Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalog service list generator #1282

Open
wants to merge 69 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d4c59ce
Added Get services list button
ThierryNormand Apr 19, 2023
b3e3b57
Continue getCatalogList
ThierryNormand May 1, 2023
d0ad265
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
ThierryNormand May 1, 2023
eb5d0a5
Writes a CSV file
ThierryNormand May 1, 2023
d4a0700
Manage to write special characters
ThierryNormand May 1, 2023
d3338a3
Generate csv with columns
ThierryNormand May 5, 2023
2b134af
Added more informations to the csv
ThierryNormand May 8, 2023
4233f91
Added Metadata to the csv
ThierryNormand May 10, 2023
e94d0ea
Now manages all items. Handles WMTS layers.
ThierryNormand May 18, 2023
30ddcf8
made it similar to end product
ThierryNormand May 23, 2023
9664a31
From geo to integration. CatalogGroup title is ok
ThierryNormand Jun 2, 2023
9548f61
Centered the button
ThierryNormand Jun 5, 2023
5b07fa8
Corrected spacing in csv.
ThierryNormand Jun 8, 2023
ab44488
Fixes. GetDescription function
ThierryNormand Jun 9, 2023
d0ca34d
lint
ThierryNormand Jun 9, 2023
d0a8733
lint
ThierryNormand Jun 9, 2023
ed0ba96
lint
ThierryNormand Jun 9, 2023
0e4cee9
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
ThierryNormand Jun 9, 2023
ba3170b
wip
pelord Sep 11, 2023
cacd18e
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
pelord Sep 11, 2023
9d5e674
Merge remote-tracking branch 'origin/release/16.0.0' into catalog-ser…
pelord Oct 10, 2023
31cbd02
Merge tag '16.0.0-rc.4' into catalog-service_listGenerator
pelord Oct 19, 2023
a559222
wip formatting
pelord Oct 19, 2023
19368ab
formatting
pelord Oct 19, 2023
0eaff00
Merge remote-tracking branch 'origin/release/16.0.0' into catalog-ser…
pelord Oct 19, 2023
0f0ca2c
update packages/auth
ThierryNormand Nov 20, 2023
7b5823a
Merge branch 'release/16.0.0' into catalog-service_listGenerator
ThierryNormand Nov 20, 2023
e7590e8
Merge tag 'v16.0.2' into catalog-service_listGenerator
ThierryNormand Nov 24, 2023
cf1b807
Merge remote-tracking branch 'origin/release/16.1.0' into catalog-ser…
ThierryNormand Dec 6, 2023
175a664
Added correction following the pull request. Added calls to the langu…
ThierryNormand Dec 18, 2023
ec1891f
Corrected names for language service
ThierryNormand Dec 19, 2023
f875b52
Added corrections and date format for file name
ThierryNormand Jan 29, 2024
0712f49
wip
pelord Jan 29, 2024
2d6214f
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
pelord Jan 29, 2024
7340fbe
var to let or const
pelord Jan 30, 2024
1dc0243
locale
pelord Jan 30, 2024
41af724
refactor(catalog-library-tool): enhance typing
pelord Jan 30, 2024
3b66d62
review comment
pelord Feb 6, 2024
0c6aaa6
wip
pelord Feb 6, 2024
dcdff75
wip
pelord Feb 6, 2024
c0c1987
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
pelord Feb 15, 2024
1e3b1fe
review comments
pelord Feb 15, 2024
49b64c2
review comments
pelord Mar 13, 2024
a7953ed
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
pelord Mar 21, 2024
17f0a11
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
pelord May 16, 2024
6733da8
wip
pelord May 16, 2024
9043412
set exportButton default value to false
pelord May 16, 2024
c193dd5
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
pelord Nov 25, 2024
ceb4200
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
pelord Nov 27, 2024
7823919
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
pelord Nov 28, 2024
82fec96
refactor(integration): declaration from var to const or let
pelord Nov 29, 2024
8813c95
feat(integration): export catalog list as an excel file
pelord Nov 29, 2024
943756f
refactor(integration): code and variable simplification +i18n
pelord Nov 29, 2024
8727b92
feat(integration): add metadata url to exported excel file
pelord Nov 29, 2024
3bc3e11
refactor(*): simple fixes based on review comments
pelord Dec 2, 2024
ea1d368
refactor(geo): delete index export
pelord Dec 2, 2024
d23c80e
refactor(integration): resolving some comments (more complex one)
pelord Dec 4, 2024
169d7c2
feat(utils): add an util to handle excel file export
pelord Dec 4, 2024
12c33bb
refactor(geo): move from local method to shared method
pelord Dec 4, 2024
b86e4ac
refactor(integration): move from local method to shared method
pelord Dec 4, 2024
65543fa
refactor(*): renaming some function, typing fixes
pelord Dec 9, 2024
34afc11
chore(utils): creating a files directoty and move file util
pelord Dec 9, 2024
d2d6cd7
Merge branch 'feature/excel-export-util' into catalog-service_listGen…
pelord Dec 9, 2024
3e8e764
refactor(*): rename function
pelord Dec 9, 2024
dbcb4cd
Merge branch 'feature/excel-export-util' into catalog-service_listGen…
pelord Dec 9, 2024
14ea0a3
refactor(utils): enhance excel typing and f(x) naming and input
pelord Dec 9, 2024
bfc63d3
refactor(utils): enhance excel typing and f(x) naming and input
pelord Dec 9, 2024
50cab43
Merge branch 'feature/excel-export-util' into catalog-service_listGen…
pelord Dec 9, 2024
cfc2151
Merge remote-tracking branch 'origin/next' into catalog-service_listG…
pelord Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/geo/src/lib/catalog/shared/catalog.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ export interface CatalogServiceOptions {
sources?: (ICatalog | ICompositeCatalog)[];
/** @deprecated Use url instead */
sourcesUrl?: string;
exportAsListButton?: boolean;
pelord marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ export type AnyDataSourceOptions =
| TileArcGISRestDataSourceOptions
| MVTDataSourceOptions
| ClusterDataSourceOptions;

export interface InfoFromSourceOptions {
pelord marked this conversation as resolved.
Show resolved Hide resolved
id: string;
layerName: string;
url: string;
sourceOptions: AnyDataSourceOptions;
context: string;
}
pelord marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import { generateIdFromSourceOptions } from '../../../utils/id-generator';
import {
AnyDataSourceOptions,
InfoFromSourceOptions
} from './any-datasource.interface';
import { ArcGISRestDataSourceOptions } from './arcgisrest-datasource.interface';
import { CartoDataSourceOptions } from './carto-datasource.interface';
import { ClusterDataSourceOptions } from './cluster-datasource.interface';
import { FeatureDataSourceOptions } from './feature-datasource.interface';
import { MVTDataSourceOptions } from './mvt-datasource.interface';
import { OSMDataSourceOptions } from './osm-datasource.interface';
import { WFSDataSourceOptions } from './wfs-datasource.interface';
import { WMSDataSourceOptions } from './wms-datasource.interface';
import { WMTSDataSourceOptions } from './wmts-datasource.interface';
import { XYZDataSourceOptions } from './xyz-datasource.interface';

export function getInfoFromSourceOptions(
sourceOptions: AnyDataSourceOptions,
context?: string
): InfoFromSourceOptions {
const infoFromSourceOptions: InfoFromSourceOptions = {
pelord marked this conversation as resolved.
Show resolved Hide resolved
id: undefined,
layerName: undefined,
url: undefined,
sourceOptions: undefined,
context
pelord marked this conversation as resolved.
Show resolved Hide resolved
};

switch (sourceOptions.type) {
case 'imagearcgisrest':
case 'arcgisrest':
case 'tilearcgisrest':
const argisSo = sourceOptions as ArcGISRestDataSourceOptions;

Check failure on line 33 in packages/geo/src/lib/datasource/shared/datasources/any-datasource.utils.ts

View workflow job for this annotation

GitHub Actions / Analyze Pull Rrequest

Unexpected lexical declaration in case block
pelord marked this conversation as resolved.
Show resolved Hide resolved
infoFromSourceOptions.layerName = argisSo.layer;
infoFromSourceOptions.url = argisSo.url;
infoFromSourceOptions.sourceOptions = argisSo;
break;
case 'wmts':
const wmtsSo = sourceOptions as WMTSDataSourceOptions;

Check failure on line 39 in packages/geo/src/lib/datasource/shared/datasources/any-datasource.utils.ts

View workflow job for this annotation

GitHub Actions / Analyze Pull Rrequest

Unexpected lexical declaration in case block
infoFromSourceOptions.layerName = wmtsSo.layer;
infoFromSourceOptions.url = wmtsSo.url;
infoFromSourceOptions.sourceOptions = wmtsSo;
break;
case 'xyz':
const xyzSo = sourceOptions as XYZDataSourceOptions;

Check failure on line 45 in packages/geo/src/lib/datasource/shared/datasources/any-datasource.utils.ts

View workflow job for this annotation

GitHub Actions / Analyze Pull Rrequest

Unexpected lexical declaration in case block
infoFromSourceOptions.layerName = '';
infoFromSourceOptions.url = xyzSo.url;
infoFromSourceOptions.sourceOptions = xyzSo;
break;
case 'wms':
const wmsSo = sourceOptions as WMSDataSourceOptions;

Check failure on line 51 in packages/geo/src/lib/datasource/shared/datasources/any-datasource.utils.ts

View workflow job for this annotation

GitHub Actions / Analyze Pull Rrequest

Unexpected lexical declaration in case block
wmsSo.params.LAYERS = wmsSo.params.LAYERS ?? (wmsSo.params as any).layers;
infoFromSourceOptions.layerName = wmsSo.params.LAYERS;

infoFromSourceOptions.url = wmsSo.url;
infoFromSourceOptions.sourceOptions = wmsSo;
break;
case 'osm':
const osmSo = sourceOptions as OSMDataSourceOptions;

Check failure on line 59 in packages/geo/src/lib/datasource/shared/datasources/any-datasource.utils.ts

View workflow job for this annotation

GitHub Actions / Analyze Pull Rrequest

Unexpected lexical declaration in case block
infoFromSourceOptions.layerName = '';
infoFromSourceOptions.url = osmSo.url
? osmSo.url
: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png';
infoFromSourceOptions.sourceOptions = osmSo;
break;
case 'wfs':
const wfsSo = sourceOptions as WFSDataSourceOptions;

Check failure on line 67 in packages/geo/src/lib/datasource/shared/datasources/any-datasource.utils.ts

View workflow job for this annotation

GitHub Actions / Analyze Pull Rrequest

Unexpected lexical declaration in case block
infoFromSourceOptions.layerName = wfsSo.params.featureTypes;
infoFromSourceOptions.url = wfsSo.url;
infoFromSourceOptions.sourceOptions = wfsSo;
break;
case 'vector':
const featureSo = sourceOptions as FeatureDataSourceOptions;

Check failure on line 73 in packages/geo/src/lib/datasource/shared/datasources/any-datasource.utils.ts

View workflow job for this annotation

GitHub Actions / Analyze Pull Rrequest

Unexpected lexical declaration in case block
infoFromSourceOptions.layerName = '';
infoFromSourceOptions.url = featureSo.url;
infoFromSourceOptions.sourceOptions = featureSo;
break;
case 'cluster':
const clusterSo = sourceOptions as ClusterDataSourceOptions;

Check failure on line 79 in packages/geo/src/lib/datasource/shared/datasources/any-datasource.utils.ts

View workflow job for this annotation

GitHub Actions / Analyze Pull Rrequest

Unexpected lexical declaration in case block
infoFromSourceOptions.layerName = '';
infoFromSourceOptions.url = clusterSo.url;
infoFromSourceOptions.sourceOptions = clusterSo;
break;
case 'mvt':
const mvtSo = sourceOptions as MVTDataSourceOptions;

Check failure on line 85 in packages/geo/src/lib/datasource/shared/datasources/any-datasource.utils.ts

View workflow job for this annotation

GitHub Actions / Analyze Pull Rrequest

Unexpected lexical declaration in case block
infoFromSourceOptions.layerName = '';
infoFromSourceOptions.url = mvtSo.url;
infoFromSourceOptions.sourceOptions = mvtSo;
break;
case 'carto':
const cartoSo = sourceOptions as CartoDataSourceOptions;

Check failure on line 91 in packages/geo/src/lib/datasource/shared/datasources/any-datasource.utils.ts

View workflow job for this annotation

GitHub Actions / Analyze Pull Rrequest

Unexpected lexical declaration in case block
infoFromSourceOptions.layerName = cartoSo.config.layers
.map((layer) => layer.options.sql)
.join(' ');
infoFromSourceOptions.url = `https://${cartoSo.account}.carto.com/api/v1/map`;
infoFromSourceOptions.sourceOptions = cartoSo;
break;
default:
break;
}
if (infoFromSourceOptions.sourceOptions) {
infoFromSourceOptions.id = generateIdFromSourceOptions(
infoFromSourceOptions.sourceOptions
);
infoFromSourceOptions.url = infoFromSourceOptions.url?.startsWith('/')
? window.location.origin + infoFromSourceOptions.url
: infoFromSourceOptions.url;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce que le sourceOptions est toujours défini? Si oui, on pourrait même déclarer le id dans l'instanciation de l'objet de départ

Suggested change
if (infoFromSourceOptions.sourceOptions) {
infoFromSourceOptions.id = generateIdFromSourceOptions(
infoFromSourceOptions.sourceOptions
);
infoFromSourceOptions.url = infoFromSourceOptions.url?.startsWith('/')
? window.location.origin + infoFromSourceOptions.url
: infoFromSourceOptions.url;
}
infoFromSourceOptions.id = generateIdFromSourceOptions(infoFromSourceOptions.sourceOptions);
if (infoFromSourceOptions.url) {
infoFromSourceOptions.url = infoFromSourceOptions.url.startsWith('/')
? window.location.origin + infoFromSourceOptions.url
: infoFromSourceOptions.url;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On pourrait aussi faire un méthode de normalisation d'url et le connecter dans les SwitchCase

const normalizeUrl = (url: string | undefined): string | undefined => {
  if (!url) return undefined;
  return url.startsWith('/') ? window.location.origin + url : url;
};


return infoFromSourceOptions;
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ export * from './cluster-datasource';
export * from './cluster-datasource.interface';
export * from './any-datasource';
export * from './any-datasource.interface';
export * from './any-datasource.utils';
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,14 @@
(catalogSelectChange)="onCatalogSelectChange($event)"
>
</igo-catalog-library>
<div *ngIf="exportButton" class="get-catalog-list-button">
<button
mat-raised-button
[matTooltip]="'igo.integration.catalog.library.getCatalogList' | translate"
matTooltipPosition="above"
color="primary"
(click)="getCatalogList()"
>
{{ 'igo.integration.catalog.library.getCatalogList' | translate }}
</button>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.get-catalog-list-button {
display: flex;
justify-content: center;
align-items: center;
}
Loading