From c1c5c5a33a99637030f164ea48cf12e19a65b8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 28 Aug 2024 17:22:15 +0200 Subject: [PATCH] Creates JavaScript files with the SVG icons --- package.json | 1 + src/auth/FormElement.ts | 5 +- src/auth/PanelElement.ts | 5 +- src/drawing/drawFeatureComponent.html.js | 43 ++--- src/editing/editFeatureComponent.html.js | 52 ++---- src/filter/rulecomponent.html.js | 66 ++----- src/icons/README.md | 2 +- src/icons/circle_svg.ts | 25 +++ src/icons/{spinner.ts => dot_svg.ts} | 6 +- src/icons/layers_svg.ts | 22 +++ src/icons/line_svg.ts | 25 +++ src/icons/point_svg.ts | 25 +++ src/icons/polygon_svg.ts | 25 +++ src/icons/rectangle_svg.ts | 25 +++ src/icons/search-go_svg.ts | 25 +++ src/icons/spinner_svg.ts | 46 +++++ src/icons/stack-indeterminate_svg.ts | 25 +++ src/icons/swipe_svg.ts | 35 ++++ src/icons/text_svg.ts | 25 +++ src/import/importdatasourceComponent.html.js | 103 +---------- .../wmsCapabilityLayertreeComponent.html.js | 8 +- src/layertree/component.html.js | 164 ++---------------- .../datasourceGroupTreeComponent.html.js | 8 +- src/map/swipe.html.js | 20 +-- src/permalink/shareComponent.html.js | 103 +---------- src/print/component.html.js | 103 +---------- src/profile/component.html.js | 103 +---------- src/query/gridComponent.html.js | 103 +---------- src/query/panelComponent.html.js | 10 +- src/query/windowComponent.html.js | 103 +---------- src/raster/widgetComponent.html.js | 103 +---------- 31 files changed, 403 insertions(+), 1011 deletions(-) create mode 100644 src/icons/circle_svg.ts rename src/icons/{spinner.ts => dot_svg.ts} (50%) create mode 100644 src/icons/layers_svg.ts create mode 100644 src/icons/line_svg.ts create mode 100644 src/icons/point_svg.ts create mode 100644 src/icons/polygon_svg.ts create mode 100644 src/icons/rectangle_svg.ts create mode 100644 src/icons/search-go_svg.ts create mode 100644 src/icons/spinner_svg.ts create mode 100644 src/icons/stack-indeterminate_svg.ts create mode 100644 src/icons/swipe_svg.ts create mode 100644 src/icons/text_svg.ts diff --git a/package.json b/package.json index 5721de09bfb8..1c9a9d3ee7d5 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "ngeo/test": "./test/spec", "gmf/test": "./contribs/gmf/test/spec", "ngeo": "./src", + "gmf": "./src", "api": "./api/src", "lib": "./lib", "jsts": "jsts/org/locationtech/jts", diff --git a/src/auth/FormElement.ts b/src/auth/FormElement.ts index ca5f8febd7ce..edf073b6c301 100644 --- a/src/auth/FormElement.ts +++ b/src/auth/FormElement.ts @@ -24,8 +24,7 @@ import {customElement, property, state} from 'lit/decorators.js'; import GmfBaseElement from 'gmfapi/elements/BaseElement'; import {Message, MessageType} from 'ngeo/message/Message'; import ngeoMessageNotification from 'ngeo/message/Notification'; -import {unsafeSVG} from 'lit/directives/unsafe-svg'; -import loadingSvg from 'gmf/icons/spinner'; +import {litIcon as svgSpinner} from 'gmf/icons/spinner_svg'; import {gmfBackgroundlayerStatus} from 'ngeo/backgroundlayerselector/status'; import user, {User, UserState} from 'gmfapi/store/user'; // @ts-ignore @@ -225,7 +224,7 @@ export default class GmfAuthForm extends GmfBaseElement { ${this.isLoading ? html`
- ${unsafeSVG(loadingSvg)} + ${svgSpinner()}
` : ''} diff --git a/src/auth/PanelElement.ts b/src/auth/PanelElement.ts index f9ae5ec1c61e..c7160843dfdc 100644 --- a/src/auth/PanelElement.ts +++ b/src/auth/PanelElement.ts @@ -21,8 +21,7 @@ import {html, TemplateResult, CSSResult, css, unsafeCSS} from 'lit'; import {customElement, property, state} from 'lit/decorators.js'; -import {unsafeSVG} from 'lit/directives/unsafe-svg.js'; -import loadingSvg from 'gmf/icons/spinner'; +import {litIcon as svgSpinner} from 'gmf/icons/spinner_svg'; import i18next from 'i18next'; import {PasswordValidator} from './FormElement'; import './FormElement'; @@ -62,7 +61,7 @@ export default class GmfAuthPanel extends ToolPanelElement { const spinnerTemplate = this.postLoading ? html`
- ${unsafeSVG(loadingSvg)} + ${svgSpinner()} ${i18next.t('Loading themes, please wait...')}
` diff --git a/src/drawing/drawFeatureComponent.html.js b/src/drawing/drawFeatureComponent.html.js index ede0e5dd2f92..da7cbac10010 100644 --- a/src/drawing/drawFeatureComponent.html.js +++ b/src/drawing/drawFeatureComponent.html.js @@ -19,6 +19,13 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +import svgPoint from 'gmf/icons/point_svg'; +import svgLine from 'gmf/icons/line_svg'; +import svgPolygon from 'gmf/icons/polygon_svg'; +import svgCircle from 'gmf/icons/circle_svg'; +import svgRectangle from 'gmf/icons/rectangle_svg'; +import svgText from 'gmf/icons/text_svg'; + export default ` - + >${svgPoint} - + >${svgLine} - + >${svgPolygon} - + >${svgCircle} - + >${svgRectangle} - + >${svgText}
diff --git a/src/editing/editFeatureComponent.html.js b/src/editing/editFeatureComponent.html.js index 5a74f612cb45..f3d1ad51be6a 100644 --- a/src/editing/editFeatureComponent.html.js +++ b/src/editing/editFeatureComponent.html.js @@ -19,6 +19,10 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +import svgPoint from 'gmf/icons/point_svg'; +import svgLine from 'gmf/icons/line_svg'; +import svgPolygon from 'gmf/icons/polygon_svg'; + export default `
ng-model="efCtrl.createActive" > - - - - - {{'Draw new point' | translate}} + ${svgPoint} {{'Draw new point' | translate}} - - - - - {{'Draw new point' | translate}} + ${svgPoint} {{'Draw new point' | translate}} - - - - - {{'Draw new linestring' | translate}} + ${svgLine} {{'Draw new linestring' | translate}} - - - - - {{'Draw new linestring' | translate}} + ${svgLine} {{'Draw new linestring' | translate}} - - - - - {{'Draw new polygon' | translate}} + ${svgPolygon} {{'Draw new polygon' | translate}} - - - - - {{'Draw new polygon' | translate}} + ${svgPolygon} {{'Draw new polygon' | translate}} diff --git a/src/filter/rulecomponent.html.js b/src/filter/rulecomponent.html.js index 04180f0b6bbc..369fe53eb272 100644 --- a/src/filter/rulecomponent.html.js +++ b/src/filter/rulecomponent.html.js @@ -19,6 +19,12 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +import svgPoint from 'gmf/icons/point_svg'; +import svgLine from 'gmf/icons/line_svg'; +import svgPolygon from 'gmf/icons/polygon_svg'; +import svgCircle from 'gmf/icons/circle_svg'; +import svgRectangle from 'gmf/icons/rectangle_svg'; + export default `