From 6213fe1395fd31c966e487ac12a2e436d8c9b6d4 Mon Sep 17 00:00:00 2001 From: Nick Jakuschona Date: Thu, 23 Nov 2023 16:05:29 +0100 Subject: [PATCH 1/8] add i18n language support #1 --- .../js/bundles/dn_what3words/manifest.json | 5 ++-- .../js/bundles/dn_what3words/nls/bundle.js | 24 +++++++++++++++++++ .../js/bundles/dn_what3words/nls/de/bundle.js | 23 ++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/main/js/bundles/dn_what3words/nls/bundle.js create mode 100644 src/main/js/bundles/dn_what3words/nls/de/bundle.js diff --git a/src/main/js/bundles/dn_what3words/manifest.json b/src/main/js/bundles/dn_what3words/manifest.json index 4ab024f..d2de86a 100644 --- a/src/main/js/bundles/dn_what3words/manifest.json +++ b/src/main/js/bundles/dn_what3words/manifest.json @@ -6,6 +6,7 @@ "productName": "map.apps", "main": "", "i18n": [ + "bundle" ], "dependencies": { "esri": "^4.10.1", @@ -72,8 +73,8 @@ "propertiesConstructor": true, "properties": { "id": "popupToggleTool", - "title": "w3w Adresse in der Karte identifizieren", - "tooltip": "w3w Adresse in der Karte identifizieren", + "title": "${tool.title}", + "tooltip": "${tool.tooltip}", "toolRole": "toolset", "iconClass": "", "togglable": true, diff --git a/src/main/js/bundles/dn_what3words/nls/bundle.js b/src/main/js/bundles/dn_what3words/nls/bundle.js new file mode 100644 index 0000000..c59940e --- /dev/null +++ b/src/main/js/bundles/dn_what3words/nls/bundle.js @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2020 con terra GmbH (info@conterra.de) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +module.exports = { + root: ({ + tool: { + tooltip: "Identify w3w address in the map", + title: "Identify w3w address in the map" + } + }), + de: true +}; diff --git a/src/main/js/bundles/dn_what3words/nls/de/bundle.js b/src/main/js/bundles/dn_what3words/nls/de/bundle.js new file mode 100644 index 0000000..7cec547 --- /dev/null +++ b/src/main/js/bundles/dn_what3words/nls/de/bundle.js @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2020 con terra GmbH (info@conterra.de) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +module.exports = { + root: ({ + tool: { + tooltip: "w3w Adresse in der Karte identifizieren", + title: "w3w Adresse in der Karte identifizieren" + } + }) +}; From 104df35b55d7ffae028bbf3668c5eebf3e73b060 Mon Sep 17 00:00:00 2001 From: Nick Jakuschona Date: Thu, 23 Nov 2023 16:22:40 +0100 Subject: [PATCH 2/8] retrun words in same language as choosen locale #2 --- .../dn_what3words/MapClickPopupHandler.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/js/bundles/dn_what3words/MapClickPopupHandler.js b/src/main/js/bundles/dn_what3words/MapClickPopupHandler.js index 445e835..e25c5e2 100644 --- a/src/main/js/bundles/dn_what3words/MapClickPopupHandler.js +++ b/src/main/js/bundles/dn_what3words/MapClickPopupHandler.js @@ -14,6 +14,7 @@ * limitations under the License. */ import apprt_request from "apprt-request"; +import Locale from "apprt-core/Locale"; const coordsUrl = "https://api.what3words.com/v3/convert-to-3wa"; @@ -54,10 +55,10 @@ function MapClickPopupHandler() { return; } - let latitude = event.mapPoint.latitude; - let lat = Math.round(latitude * 1000) / 1000; - let longitude = event.mapPoint.longitude; - let lon = Math.round(longitude * 1000) / 1000; + const latitude = event.mapPoint.latitude; + const lat = Math.round(latitude * 1000) / 1000; + const longitude = event.mapPoint.longitude; + const lon = Math.round(longitude * 1000) / 1000; view.popup.open({ // Set the location of the popup to the clicked location @@ -66,7 +67,8 @@ function MapClickPopupHandler() { content: "what3words für: [" + lon + ", " + lat + "]" }); - let queryParams = {key, coordinates: `${latitude},${longitude}`, language: 'de'}; + const currentLang = Locale.getCurrent().getLocaleString(); + const queryParams = {key, coordinates: `${latitude},${longitude}`, language: currentLang}; apprt_request(coordsUrl, {query: queryParams}).then( (response) => { @@ -74,15 +76,14 @@ function MapClickPopupHandler() { } ).catch((e) => { console.warn("Geocoding failed: " + e.response.data.error.message); - }) + }); }); }, deactivateTool: cleanup, deactivate: cleanup - } + }; } export default MapClickPopupHandler; - From 32a01d29ab99ac0547d7924ced45e011e3dd2d45 Mon Sep 17 00:00:00 2001 From: Nick Jakuschona Date: Thu, 23 Nov 2023 17:05:34 +0100 Subject: [PATCH 3/8] change display marker #3 --- src/main/js/apps/sample/images/mapMarker.png | Bin 27678 -> 6937 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/js/apps/sample/images/mapMarker.png b/src/main/js/apps/sample/images/mapMarker.png index 5e86a6b9ef777e628c79b1e3a39fb0a8268aca76..672869922727fb2ff772eb20f9d6ad6408534acc 100644 GIT binary patch literal 6937 zcmeHM3pkYP+SXQ?X)PHfJ8Vp$$fPo{R1SU4OM_KZOG~U(WVBHzgmjoh+R=$+kTtDs zR8}QK&YhGTGBrd_6~<}lK$;w4{^$L^;h)vo>;Lz)Pyc^idv|?(UGskL`#kq^Klk&z z@AVez>}V@HM`ezbl$5N!oz(^@so6)+-v*_h>pgHDyu{W zMj{QJjNcE?;Ong54UQXYhPoTa^kdjilZf~{DCA4{sP!uH@}ECq1`cLL9)7z1Q5n~aS^NB%1Bq;pKU6B2 zO4ZVudRVN4gsF$3fML^*-P8hD_P?*GbMX0ar{7O2H~{-Gt>jNEEtdEJ>ypl3eA*ux zpPGioDG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w8g}{9Zs_F486QS={_k8yKz6m8(tfn_VLKrpIS7gPp^MCr#eYKwIX9{W$yHm zF!V73FXesRu{ZDWliPPg-(57To|~$ho1K@G;W4^Ob9((;!<5<}vui!N{UKAe{|;-; zS_EcppZy|HzruX??)f>gty8r>Ob+|}{)7>7v%nnn;Hhrue>-6RxTBnZtTrQYpTFBt zm)rX&%Kk9mTuivJwxxVm>v2)vf}906A{=7UW{w`JcJ#iLu9NrfJb{5MNZ9gdQcYF! zY?l|ky|y>X7J~ztqXTYRZ?rB`H_z0l#P^%QPWf8@uVQU1^e(r0>-2afG|hA3uTtN1 zPw$VrQ?={dj%G#p#ZE}maZA_9J^21kii-Idq`Y8dZg%b9J5rb2j)b4rpLp+=ylwGS zw{#P#_Ixu~ds05dT%gX*RA(ndb(UwjS??K=@;(< z>wn=hFV1GnVBkm#|0&;VtT#%`nw)pxNKeiFRbzsu<|QW-z#F|sv!VPh8N-Ts(a z-?ip+Oz!Ppp!Z~S6dWjx@2(92(5g>L&rnYwNRZSN19gCm9wf{4hKZ-8) z^S!SZh0M=Mos!q@XH2~~bK>)^fH`fYQ8g7K2J&Scx(1Y*WmNKqJ5u9i1%|e2dIfhN zm}LE4Ii{(j$Hw?WqfouPf9CPCI_8UVCZ%|ty`8+l=s;U*=m*P-2KLWsE6dum@I+7Z z{YzK4>z40K?;9-iFfPcM*%gU%Dwf%<;B%4o6+CMeZ zO^uR-^@|XO@rP>x@8XZ`NiZh-8Had;Ki`6lke|)NuYeqeF%t48z7S zYz)+JY(yjYAB&APkOzuS54y!<$mU{#0j>D4_QU)HuAt>dL9)w_)@mVi*o(D28EU7&eACAj)tih-UFR(hkdIST4im q610Kg@QG3w4xcE6|Leve*Iq5I*?9i)nr;-v(tq0j Date: Thu, 23 Nov 2023 17:25:53 +0100 Subject: [PATCH 4/8] white tooltip color on hover #4 --- src/main/js/bundles/dn_what3words/styles/styles.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/js/bundles/dn_what3words/styles/styles.css b/src/main/js/bundles/dn_what3words/styles/styles.css index 4e586ca..44261ae 100644 --- a/src/main/js/bundles/dn_what3words/styles/styles.css +++ b/src/main/js/bundles/dn_what3words/styles/styles.css @@ -37,7 +37,7 @@ .ctAppRoot .ctTool_popupToggleTool .dijitButtonNode .ctToolIcon_popupToggleTool { height: 47px; width: 47px; - background: url(./../images/w3w_logo.svg) no-repeat top left; + background: url(./../images/w3w_logo.svg) no-repeat center; background-size: contain; } @@ -47,3 +47,8 @@ color: #45474d; } +.ctAppRoot .dijitHover .ctTool_popupToggleTool .dijitButtonNode .dijitButtonText { + display: block; + font-size: 15px; + color: #fff; +} From 4926adf768b87f032d5e82086ac532825a230c03 Mon Sep 17 00:00:00 2001 From: Nick Jakuschona Date: Thu, 23 Nov 2023 17:32:57 +0100 Subject: [PATCH 5/8] improve code consistency --- .../js/bundles/dn_what3words/PopupOmnisearchHandler.js | 9 ++++----- src/main/js/bundles/dn_what3words/What3wordsModel.js | 4 ++-- src/main/js/bundles/dn_what3words/What3wordsStore.js | 2 +- .../js/bundles/dn_what3words/What3wordsStoreFactory.js | 10 +++++----- src/main/js/bundles/dn_what3words/module.js | 2 +- src/main/js/bundles/dn_what3words/nls/bundle.js | 2 +- src/main/js/bundles/dn_what3words/nls/de/bundle.js | 2 +- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/main/js/bundles/dn_what3words/PopupOmnisearchHandler.js b/src/main/js/bundles/dn_what3words/PopupOmnisearchHandler.js index aad8e0c..8e452bf 100644 --- a/src/main/js/bundles/dn_what3words/PopupOmnisearchHandler.js +++ b/src/main/js/bundles/dn_what3words/PopupOmnisearchHandler.js @@ -65,16 +65,15 @@ function PopupOmnisearchHandler(){ title: "what3words", location: item.geometry // Set the location of the popup to the clicked location }); - view.popup.content = `///${item.title} <--> [${lon}, ${lat}]` + view.popup.content = `///${item.title} <--> [${lon}, ${lat}]`; }, _clear: function () { - const view = this.model.get("view"); - view && view.popup.close(); + const view = this.model.get("view"); + view && view.popup.close(); } - } - + }; } export default PopupOmnisearchHandler; diff --git a/src/main/js/bundles/dn_what3words/What3wordsModel.js b/src/main/js/bundles/dn_what3words/What3wordsModel.js index b511a84..3c35b41 100644 --- a/src/main/js/bundles/dn_what3words/What3wordsModel.js +++ b/src/main/js/bundles/dn_what3words/What3wordsModel.js @@ -17,8 +17,8 @@ import {declare} from "apprt-core/Mutable"; const What3wordsModel = declare({ - apiKey: "", + apiKey: "" }); -export default What3wordsModel; \ No newline at end of file +export default What3wordsModel; diff --git a/src/main/js/bundles/dn_what3words/What3wordsStore.js b/src/main/js/bundles/dn_what3words/What3wordsStore.js index 2b3a1bc..3037bfd 100644 --- a/src/main/js/bundles/dn_what3words/What3wordsStore.js +++ b/src/main/js/bundles/dn_what3words/What3wordsStore.js @@ -64,7 +64,7 @@ let emptyResult = function () { class What3wordsStore { constructor(properties) { - this.key = properties.apiKey + this.key = properties.apiKey; } get(id, options) { diff --git a/src/main/js/bundles/dn_what3words/What3wordsStoreFactory.js b/src/main/js/bundles/dn_what3words/What3wordsStoreFactory.js index 7b00eb6..0edcb09 100644 --- a/src/main/js/bundles/dn_what3words/What3wordsStoreFactory.js +++ b/src/main/js/bundles/dn_what3words/What3wordsStoreFactory.js @@ -19,7 +19,7 @@ function What3wordsStoreFactory() { let _registration; function _unregisterStore() { - let reg = _registration; + const reg = _registration; _registration = undefined; if (reg) { reg.unregister(); @@ -31,10 +31,10 @@ function What3wordsStoreFactory() { this._initStore(); }, _initStore() { - let props = this._properties; + const props = this._properties; props.apiKey = this.model.get("apiKey"); - let store = new What3wordsStore(props); - _registration = this._componentContext.getBundleContext().registerService(["ct.api.Store"], store, props) + const store = new What3wordsStore(props); + _registration = this._componentContext.getBundleContext().registerService(["ct.api.Store"], store, props); }, deactivate() { _unregisterStore(); @@ -42,4 +42,4 @@ function What3wordsStoreFactory() { }; } -export default What3wordsStoreFactory; \ No newline at end of file +export default What3wordsStoreFactory; diff --git a/src/main/js/bundles/dn_what3words/module.js b/src/main/js/bundles/dn_what3words/module.js index 11dd2a0..89913c5 100644 --- a/src/main/js/bundles/dn_what3words/module.js +++ b/src/main/js/bundles/dn_what3words/module.js @@ -17,4 +17,4 @@ import "."; import "./What3wordsStoreFactory"; import "./PopupOmnisearchHandler"; import "./MapClickPopupHandler"; -import "./What3wordsModel"; \ No newline at end of file +import "./What3wordsModel"; diff --git a/src/main/js/bundles/dn_what3words/nls/bundle.js b/src/main/js/bundles/dn_what3words/nls/bundle.js index c59940e..1a0d3d9 100644 --- a/src/main/js/bundles/dn_what3words/nls/bundle.js +++ b/src/main/js/bundles/dn_what3words/nls/bundle.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 con terra GmbH (info@conterra.de) + * Copyright (C) 2022 con terra GmbH (info@conterra.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/js/bundles/dn_what3words/nls/de/bundle.js b/src/main/js/bundles/dn_what3words/nls/de/bundle.js index 7cec547..83a5a57 100644 --- a/src/main/js/bundles/dn_what3words/nls/de/bundle.js +++ b/src/main/js/bundles/dn_what3words/nls/de/bundle.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 con terra GmbH (info@conterra.de) + * Copyright (C) 2022 con terra GmbH (info@conterra.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 0001570d0e314658fbc3d71524aef84c0c3e7b12 Mon Sep 17 00:00:00 2001 From: Nick Jakuschona Date: Thu, 14 Dec 2023 16:50:49 +0100 Subject: [PATCH 6/8] add copy button #5 --- .../dn_what3words/MapClickPopupHandler.js | 48 ++++++++++++++++--- .../js/bundles/dn_what3words/images/copy.svg | 1 + .../js/bundles/dn_what3words/manifest.json | 4 +- .../js/bundles/dn_what3words/nls/bundle.js | 4 ++ .../js/bundles/dn_what3words/nls/de/bundle.js | 4 ++ .../bundles/dn_what3words/styles/styles.css | 37 ++++++++++++++ 6 files changed, 90 insertions(+), 8 deletions(-) create mode 100644 src/main/js/bundles/dn_what3words/images/copy.svg diff --git a/src/main/js/bundles/dn_what3words/MapClickPopupHandler.js b/src/main/js/bundles/dn_what3words/MapClickPopupHandler.js index e25c5e2..a29c944 100644 --- a/src/main/js/bundles/dn_what3words/MapClickPopupHandler.js +++ b/src/main/js/bundles/dn_what3words/MapClickPopupHandler.js @@ -18,11 +18,12 @@ import Locale from "apprt-core/Locale"; const coordsUrl = "https://api.what3words.com/v3/convert-to-3wa"; -function MapClickPopupHandler() { +function MapClickPopupHandler(i18n) { let _clickHandle; let mapWidgetModel; let key; + i18n = i18n._i18n.get().root; function cleanup() { _clear(); @@ -42,15 +43,46 @@ function MapClickPopupHandler() { mapWidgetModel = this.mapWidgetModel; key = this.what3wordsModel.get("apiKey"); const view = mapWidgetModel.get("view"); - if(!view){ + if (!view) { return; } + // Defines an action to zoom out from the selected feature + let copyAction = { + // This text is displayed as a tooltip + title: i18n.popup.button, + // The ID by which to reference the action in the event handler + id: "copy-result", + // Sets the icon font used to style the action button + image: "js/bundles/dn_what3words/images/copy.svg" + }; + // Adds the custom action to the popup. + view.popup.actions.push(copyAction); + + view.popup.on("trigger-action", function (event) { + // If the zoom-out action is clicked, fire the zoomOut() function + if (event.action.id === "copy-result") { + copyText(); + } + }); + + function copyText() { + const copyText = document.getElementsByClassName("popupTitle")[0]; + navigator.clipboard.writeText(copyText.textContent); + const tooltip = document.getElementsByClassName("tooltiptext")[0]; + tooltip.style.visibility = "visible"; + tooltip.style.opacity = "1"; + setTimeout(() => { + tooltip.style.visibility = "hidden"; + tooltip.style.opacity = "0"; + }, 5000); + + } view.popup.autoOpenEnabled = false; _clickHandle = view.on("click", (event) => { _clear(); - if(key === ""){ + if (key === "") { console.warn("API key for what3words is empty!"); return; } @@ -68,11 +100,15 @@ function MapClickPopupHandler() { }); const currentLang = Locale.getCurrent().getLocaleString(); - const queryParams = {key, coordinates: `${latitude},${longitude}`, language: currentLang}; + const queryParams = { key, coordinates: `${latitude},${longitude}`, language: currentLang }; + + - apprt_request(coordsUrl, {query: queryParams}).then( + apprt_request(coordsUrl, { query: queryParams }).then( (response) => { - view.popup.title = "///" + response.words; + view.popup.title = "
" + + ""+ i18n.popup.tooltip +"" + + " ///" + response.words + '
'; } ).catch((e) => { console.warn("Geocoding failed: " + e.response.data.error.message); diff --git a/src/main/js/bundles/dn_what3words/images/copy.svg b/src/main/js/bundles/dn_what3words/images/copy.svg new file mode 100644 index 0000000..be509c1 --- /dev/null +++ b/src/main/js/bundles/dn_what3words/images/copy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main/js/bundles/dn_what3words/manifest.json b/src/main/js/bundles/dn_what3words/manifest.json index d2de86a..b851239 100644 --- a/src/main/js/bundles/dn_what3words/manifest.json +++ b/src/main/js/bundles/dn_what3words/manifest.json @@ -73,8 +73,8 @@ "propertiesConstructor": true, "properties": { "id": "popupToggleTool", - "title": "${tool.title}", - "tooltip": "${tool.tooltip}", + "title": "${root.tool.title}", + "tooltip": "${root.tool.tooltip}", "toolRole": "toolset", "iconClass": "", "togglable": true, diff --git a/src/main/js/bundles/dn_what3words/nls/bundle.js b/src/main/js/bundles/dn_what3words/nls/bundle.js index 1a0d3d9..3799eee 100644 --- a/src/main/js/bundles/dn_what3words/nls/bundle.js +++ b/src/main/js/bundles/dn_what3words/nls/bundle.js @@ -18,6 +18,10 @@ module.exports = { tool: { tooltip: "Identify w3w address in the map", title: "Identify w3w address in the map" + }, + popup: { + button: "Copy Adress", + tooltip: "Copied" } }), de: true diff --git a/src/main/js/bundles/dn_what3words/nls/de/bundle.js b/src/main/js/bundles/dn_what3words/nls/de/bundle.js index 83a5a57..e099bc8 100644 --- a/src/main/js/bundles/dn_what3words/nls/de/bundle.js +++ b/src/main/js/bundles/dn_what3words/nls/de/bundle.js @@ -18,6 +18,10 @@ module.exports = { tool: { tooltip: "w3w Adresse in der Karte identifizieren", title: "w3w Adresse in der Karte identifizieren" + }, + popup: { + button: "Kopiere Adresse", + tooltip: "Kopiert" } }) }; diff --git a/src/main/js/bundles/dn_what3words/styles/styles.css b/src/main/js/bundles/dn_what3words/styles/styles.css index 44261ae..b74f7c2 100644 --- a/src/main/js/bundles/dn_what3words/styles/styles.css +++ b/src/main/js/bundles/dn_what3words/styles/styles.css @@ -52,3 +52,40 @@ font-size: 15px; color: #fff; } + +.tooltip { + position: relative; + display: inline-block; + } + + .tooltip .tooltiptext { + visibility: hidden; + width: 80px; + background-color: #555; + color: #fff; + text-align: center; + border-radius: 6px; + padding: 5px 0; + + /* Position the tooltip */ + position: absolute; + z-index: 1; + top: -5px; + left: 105%; + opacity: 0; + transition: opacity 0.3s; + + } + + .tooltip .tooltiptext::after { + content: " "; + position: absolute; + top: 50%; + right: 100%; /* To the left of the tooltip */ + margin-top: -5px; + border-width: 5px; + border-style: solid; + border-color: transparent #555 transparent transparent; + height: 10px; + } + From 2ff8dc32cd6705ed81289bbf36e9390358f80d3a Mon Sep 17 00:00:00 2001 From: Nick Jakuschona Date: Thu, 14 Dec 2023 16:58:24 +0100 Subject: [PATCH 7/8] cursor to default over popup #6 --- src/main/js/bundles/dn_what3words/styles/styles.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/js/bundles/dn_what3words/styles/styles.css b/src/main/js/bundles/dn_what3words/styles/styles.css index b74f7c2..0c7df82 100644 --- a/src/main/js/bundles/dn_what3words/styles/styles.css +++ b/src/main/js/bundles/dn_what3words/styles/styles.css @@ -89,3 +89,6 @@ height: 10px; } +.ctAppRoot .esri-popup__main-container { + cursor: default; +} From 2836f2fbc19e46575a7330c7154fb0ad602ebd93 Mon Sep 17 00:00:00 2001 From: Sebastian Holtkamp Date: Fri, 1 Mar 2024 15:12:37 +0100 Subject: [PATCH 8/8] Update to map.apps version 4.17.0 --- .gitignore | 1 + .vscode/extensions.json | 2 +- .vscode/launch.json | 2 +- .vscode/tasks.json | 8 ++++ RELEASE.md | 2 +- gulpfile.js | 9 ++-- package.json | 40 ++++++++++------ pom.xml | 66 ++++++++++++--------------- src/test/webapp/js/tests/test-init.js | 12 ++--- tsconfig.json | 6 ++- 10 files changed, 81 insertions(+), 67 deletions(-) diff --git a/.gitignore b/.gitignore index cc762e4..e41ab5f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /.vscode/settings.json /.externalToolBuilders/ /package-lock.json +/gulpfile.overrides.js diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 67efcac..cc765a8 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,4 +5,4 @@ "Esri.arcgis-jsapi-snippets", "ctjdr.vscode-apprt-bundles" ] -} \ No newline at end of file +} diff --git a/.vscode/launch.json b/.vscode/launch.json index e8ab909..29fadc6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,4 +12,4 @@ "webRoot": "${workspaceFolder}/src/main" } ] -} \ No newline at end of file +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 30fd3c8..d1643d5 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -43,6 +43,14 @@ "type": "shell", "command": "mvn clean", "group": "build" + }, + { + "label": "Watch types", + "detail": "Start TypeScript compiler in watch mode", + "type": "npm", + "script": "watch-types", + "group": "build", + "problemMatcher": [], } ] } diff --git a/RELEASE.md b/RELEASE.md index 7951b33..4820d0b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,4 @@ -✅ Tested for map.apps 4.15.1 / Linie 4 +✅ Tested for map.apps 4.17.0 / Linie 4 #### Release Notes - autogenerated SNAPSHOT-Release diff --git a/gulpfile.js b/gulpfile.js index c302438..d650c29 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -64,15 +64,13 @@ mapapps.registerTasks({ }, /* a list of themes inside this project */ - themes: [/*"sample-theme"*/], + themes: [], /* state that the custom theme will be dependant from map.apps everlasting theme that provides the base styles */ hasBaseThemes: true, /* state that we want to support vuetify components and therefore need the vuetify core styles*/ hasVuetify: true, themeChangeTargets: { - "vuetify": [ - // "sample_theme" - ] + "vuetify": [] }, /* A list oft target browser versions. This should be streamlined with Esri JS API requirements. */ transpileTargets: { @@ -139,7 +137,6 @@ gulp.task("lint", gulp.task("preview", gulp.series( "build", - "lint", gulp.parallel( "watch", "browser-sync" @@ -152,7 +149,7 @@ gulp.task("run-tests", function transportTestUrls() { // transport test url to run-browser-tests // eslint-disable-next-line max-len - const testsAt = mapappsBrowserSync.state.url + "/resources/jsregistry/root/@conterra/mapapps-mocha-runner/latest/mocha.html?boot=/js/tests/test-init.js&timeout=5000&test=dn_what3words/tests/all&reporter=tap"; + const testsAt = mapappsBrowserSync.state.url + "/resources/jsregistry/root/@conterra/mapapps-mocha-runner/latest/mocha.html?boot=/js/tests/test-init.js&timeout=5000&test=sample_helloworld/tests/all&reporter=tap"; runBrowserTests.push(testsAt); return Promise.resolve(); }, diff --git a/package.json b/package.json index 899af04..6430ec8 100644 --- a/package.json +++ b/package.json @@ -4,22 +4,32 @@ "version": "0.0.1", "license": "CC0-1.0", "scripts": { - "check-licenses": "node ./src/support/js/check-licenses.js" + "check-licenses": "tsx ./src/support/js/check-licenses.ts", + "check-types": "tsc --noEmit", + "watch-types": "tsc -w --noEmit" }, "devDependencies": { - "@conterra/ct-mapapps-typings": "4.15.1", - "@conterra/mapapps-mocha-runner": "^1.1.1", - "@types/arcgis-js-api": "4.26.0", - "chai": "^4.3.7", - "ct-mapapps-browser-sync": "0.0.30", - "ct-mapapps-gulp-js": "0.9.4", - "eslint-config-ct-prodeng": "1.3.0-next-2", - "license-checker": "^25.0.1", - "mocha": "^10.2.0", - "puppeteer": "^19.11.1", - "vue-template-compiler": "2.7.8", - "stylelint-config-ct-prodeng": "1.0.4", - "stylelint-config-recommended": "5.0.0", - "stylelint": "^13.13.1" + "@conterra/ct-mapapps-typings": "~4.17.0", + "@conterra/mapapps-mocha-runner": "1.1.1", + "@types/arcgis-js-api": "4.28.0", + "@types/chai": "4.3.10", + "@types/license-checker": "^25.0.6", + "@types/mocha": "10.0.4", + "chai": "4.3.10", + "ct-mapapps-browser-sync": "0.0.35", + "ct-mapapps-gulp-js": "0.10.2", + "eslint-config-ct-prodeng": "1.4.0", + "license-checker": "25.0.1", + "mocha": "10.2.0", + "puppeteer": "21.5.2", + "stylelint": "15.11.0", + "stylelint-config-ct-prodeng": "2.0.0", + "stylelint-config-recommended": "13.0.0", + "stylelint-config-recommended-less": "2.0.0", + "ts-node": "^10.9.1", + "tsx": "^4.6.0", + "typescript": "5.2.2", + "vue": "2.7.15", + "vue-template-compiler": "2.7.15" } } diff --git a/pom.xml b/pom.xml index 396e5e1..6d87381 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,8 @@ limitations under the License. --> - 4.0.0 de.conterra.devnet @@ -46,11 +47,6 @@ pom import - - de.conterra.mapapps - ct-mapapps-js - ${mapapps.version} - @@ -92,6 +88,11 @@ + + de.conterra.mapapps + mapapps-maven-plugin + ${mapapps.version} + de.conterra.jsregistry ct-jsregistry-maven-plugin @@ -144,10 +145,9 @@ com.github.eirslett frontend-maven-plugin - 1.12.1 + 1.14.2 - v18.13.0 - 8.19.3 + v20.9.0 @@ -173,11 +173,6 @@ setproperties-maven-plugin 1.0.2 - - de.conterra.jsrt - ct-jsrt-test-maven-plugin - ${ct.jsrt-test.version} - src/main/js @@ -215,9 +210,7 @@ - - . @@ -225,7 +218,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + 3.11.0 true @@ -233,7 +226,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.0 + 3.5.0 true @@ -241,6 +234,7 @@ org.apache.maven.plugins maven-dependency-plugin + 3.5.0 unpack-themes-src @@ -343,6 +337,9 @@ **/gulpfile.js **/pom.xml + + src/main/js/**/*.min.js + XML_STYLE @@ -409,6 +406,12 @@ de.conterra.mapapps mapapps-maven-plugin + + + true + ${js.build.outputPath}/apps + ${project.build.directory} + @@ -436,13 +439,6 @@ - - - true - false - ${js.build.outputPath}/apps - ${project.build.directory} - maven-assembly-plugin @@ -496,15 +492,16 @@ ${project.build.directory}/webapp ${root.build.outputPath}/js - 4.15.1 + 4.17.0 + 1.5.28 ${mapapps.version} - 1.5.10 + 2.0.1 2.0.2 - sample + Demo @@ -563,6 +560,11 @@ ags-js-api4 test + + com.esri + terraformer-js + test + moment-js moment-js @@ -665,12 +667,6 @@ - - maven-deploy-plugin - - true - - de.conterra.jsregistry ct-jsregistry-maven-plugin @@ -713,8 +709,6 @@ ${skip.apps.upload} true - ${project.artifactId} - ${project.artifactId}-${project.version} PUBLISHED ${mapapps.remote.base}/resources ${mapapps.user} diff --git a/src/test/webapp/js/tests/test-init.js b/src/test/webapp/js/tests/test-init.js index 6421e5a..c9df5fc 100644 --- a/src/test/webapp/js/tests/test-init.js +++ b/src/test/webapp/js/tests/test-init.js @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// eslint-disable-next-line no-undef testConfig({ jsregistry: [{ - //root: "url to registry..", - packages: [ - // register all self hosted packages - "*" - ] - } + //root: "url to registry..", + packages: [ + // register all self hosted packages + "*" + ]} //uncomment, if project runs in remote mode // ,{ // root: "@@mapapps.remote.base@@/resources/jsregistry/root", diff --git a/tsconfig.json b/tsconfig.json index f33e19d..c1df1bb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,11 @@ }, "allowJs": true, "noEmit": true, + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, "skipLibCheck": true, "esModuleInterop": true - } + }, + "include": ["src"] }