From 226aa9f109acf87c72be3a2698727aa3b1cc545e Mon Sep 17 00:00:00 2001 From: Brice Schaffner Date: Tue, 31 Oct 2023 15:23:25 +0100 Subject: [PATCH 1/2] BGDIINF_SB-3071: Moved the external-layer-providers.json in its module Move it into its module as well as its utilities, which are highly related to the import tool. Also avoid a typescript failure in vscode by adding explicitly json file in the tsconfig.json include pattern. --- README.md | 2 +- scripts/check-external-layers-providers.js | 10 ++++++++-- src/modules/infobox/components/ImportContent.vue | 5 +++-- .../infobox/utils}/external-layer-providers.json | 0 src/{ => modules/infobox}/utils/external-provider.js | 0 tsconfig.json | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) rename src/{ => modules/infobox/utils}/external-layer-providers.json (100%) rename src/{ => modules/infobox}/utils/external-provider.js (100%) diff --git a/README.md b/README.md index 5c1282637..38ec55028 100644 --- a/README.md +++ b/README.md @@ -212,7 +212,7 @@ Depending on the target (`dev|int|prod`), you will have to build and bundle/mini ## Check External Layer Provider list -In the `Import` tool we provide an hardcoded list of provider via the [src/external-layer-providers.json](./src/external-layer-providers.json) file. Because we have quite a lot of provider, we have a CLI tool in order to +In the `Import` tool we provide an hardcoded list of provider via the [src/modules/infobox/utils/external-layer-providers.json](./src/modules/infobox/utils/external-layer-providers.json) file. Because we have quite a lot of provider, we have a CLI tool in order to check their validity. The tool can also be used with a single url as input parameter to see the url would be valid for our application. diff --git a/scripts/check-external-layers-providers.js b/scripts/check-external-layers-providers.js index a847a35a5..b45e5ed4a 100755 --- a/scripts/check-external-layers-providers.js +++ b/scripts/check-external-layers-providers.js @@ -9,14 +9,20 @@ import { hideBin } from 'yargs/helpers' import ogcParser from 'ogc-parser' import { exit } from 'process' -import { transformUrl, isWmsGetCap, isWmtsGetCap, isKml, isGpx } from '@/utils/external-provider' +import { + transformUrl, + isWmsGetCap, + isWmtsGetCap, + isKml, + isGpx, +} from '@/modules/infobox/utils/external-provider' const options = yargs(hideBin(process.argv)) .usage('Usage: $0 [options]') .version('1.0.0') .epilog('Check validity of all providers') .option('input', { - default: './src/external-layer-providers.json', + default: './src/modules/infobox/utils/external-layer-providers.json', describe: 'Input JSON providers file to check', type: 'string', }) diff --git a/src/modules/infobox/components/ImportContent.vue b/src/modules/infobox/components/ImportContent.vue index 0f4bcd997..8c0f9742a 100644 --- a/src/modules/infobox/components/ImportContent.vue +++ b/src/modules/infobox/components/ImportContent.vue @@ -78,7 +78,7 @@