-
Notifications
You must be signed in to change notification settings - Fork 32
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
2259 osdp geocore #2535
2259 osdp geocore #2535
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 13 of 14 files at r1, all commit messages.
Reviewable status: 13 of 14 files reviewed, 3 unresolved discussions (waiting on @Alex-NRCan and @DamonU2)
packages/geoview-core/src/api/config/uuid-config-reader.ts
line 147 at r1 (raw file):
return mergedConfig; // return toJsonObject({
DEad code, add comment if we need to keep. Fix the esri dynamic as well
packages/geoview-core/src/api/plugin/plugin.ts
line 45 at r1 (raw file):
script.src = `${scriptPath}/corePackages/geoview-${pluginId}.js`; script.id = pluginId; script.setAttribute('data-name', `geoview-${pluginId}`);
This may not be needed as we are only using id with query selector
packages/geoview-geochart/src/index.tsx
line 65 at r1 (raw file):
*/ override onAdd(): void { // Initialize the store with geochart provided configuration in there is one
Typo if instead of in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 10 of 14 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @DamonU2 and @jolevesq)
packages/geoview-core/src/api/config/uuid-config-reader.ts
line 62 at r2 (raw file):
// Get Geocore custom config layer entries values // TODO: The prrof of concept is done only for WMS layers. We need to implement other layer types after the refactor
typo 'proof'
packages/geoview-core/src/core/utils/config/reader/uuid-config-reader.ts
line 124 at r2 (raw file):
customGeocoreLayerConfig as unknown as TypeJsonObject ); const esriDynamicLayerEntryConfig = new EsriDynamicLayerEntryConfig(mergedConfig as unknown as EsriDynamicLayerEntryConfig);
This type of self-construct using another copy of the class has been causing many issues when we started privatizing methods with '#'. We realized that the variable sent in the constructor were NOT in fact a class, but a simple JS object casted as a class.
If it's still working, I guess we can keep for now, but this should be revised here and other places in this section.
For example, here, mergedConfig is not an EsriDynamicLayerEntryConfig. The constructor of EsriDynamicLayerEntryConfig shouldn't expect a EsriDynamicLayerEntryConfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 4 files at r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @DamonU2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 4 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Alex-NRCan and @DamonU2)
packages/geoview-core/src/core/utils/config/reader/uuid-config-reader.ts
line 124 at r2 (raw file):
Previously, Alex-NRCan (Alex) wrote…
This type of self-construct using another copy of the class has been causing many issues when we started privatizing methods with '#'. We realized that the variable sent in the constructor were NOT in fact a class, but a simple JS object casted as a class.
If it's still working, I guess we can keep for now, but this should be revised here and other places in this section.
For example, here, mergedConfig is not an EsriDynamicLayerEntryConfig. The constructor of EsriDynamicLayerEntryConfig shouldn't expect a EsriDynamicLayerEntryConfig.
Is it the same way it is done in new config API? I don't think so, looks like it uses TypeJSON
else if (layerType === CV_CONST_LAYER_TYPES.WMS) {
const geoviewLayerConfig = toJsonObject({
geoviewLayerId: `${id}`,
geoviewLayerName: createLocalizedString(name),
metadataAccessPath: createLocalizedString(url),
geoviewLayerType: CV_CONST_LAYER_TYPES.WMS,
isGeocore: true,
isTimeAware,
});
(geoviewLayerConfig.listOfLayerEntryConfig as TypeJsonObject[]) = (layerEntries as TypeJsonArray).map(
(item): TypeJsonObject => {
const originalConfig = {
layerId: `${item.id}`,
source: {
serverType: serverType === undefined ? 'mapserver' : serverType,
},
};
// Overwrite default from geocore custom config
const mergedConfig = deepMergeObjects(
originalConfig as unknown as TypeJsonObject,
customGeocoreLayerConfig as unknown as TypeJsonObject
);
return mergedConfig;
}
);
listOfGeoviewLayerConfig.push(geoviewLayerConfig);
This whole file will be deleted once refactor is done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @DamonU2 and @jolevesq)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @DamonU2 and @jolevesq)
packages/geoview-core/src/core/utils/config/reader/uuid-config-reader.ts
line 124 at r2 (raw file):
Previously, jolevesq (Johann Levesque) wrote…
Is it the same way it is done in new config API? I don't think so, looks like it uses TypeJSON
else if (layerType === CV_CONST_LAYER_TYPES.WMS) { const geoviewLayerConfig = toJsonObject({ geoviewLayerId: `${id}`, geoviewLayerName: createLocalizedString(name), metadataAccessPath: createLocalizedString(url), geoviewLayerType: CV_CONST_LAYER_TYPES.WMS, isGeocore: true, isTimeAware, }); (geoviewLayerConfig.listOfLayerEntryConfig as TypeJsonObject[]) = (layerEntries as TypeJsonArray).map( (item): TypeJsonObject => { const originalConfig = { layerId: `${item.id}`, source: { serverType: serverType === undefined ? 'mapserver' : serverType, }, }; // Overwrite default from geocore custom config const mergedConfig = deepMergeObjects( originalConfig as unknown as TypeJsonObject, customGeocoreLayerConfig as unknown as TypeJsonObject ); return mergedConfig; } ); listOfGeoviewLayerConfig.push(geoviewLayerConfig);
This whole file will be deleted once refactor is done
I believe it's more in nodeFactory
that it's now done and it looks better yes.
Here layerConfig
is of right type, no 'as' is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @DamonU2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 10 of 14 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jolevesq)
packages/geoview-core/src/core/utils/utilities.ts
line 62 at r2 (raw file):
* Check if an object is empty * @param {object} obj - The object to test * @returns true is object is empty, false otherwise
true is > true if
e6f3573
to
545e2af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3, 10 of 11 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @jolevesq)
packages/geoview-core/src/geo/layer/layer-sets/abstract-layer-set.ts
line 452 at r5 (raw file):
* Align records with informatiom provided by OutFields from layer config. * This will update fields in and delete unwanted fields from the arrayOfRecords * @param {TypeLayerEntryConfig} layerPath - Path of the layerto get config from.
layerto > layer to
packages/geoview-core/src/geo/layer/layer-sets/abstract-layer-set.ts
line 457 at r5 (raw file):
* @static */ protected static alingRecordsWithOutFields(layerEntryConfig: TypeLayerEntryConfig, arrayOfRecords: TypeFeatureInfoEntry[]): void {
alingRecordsWithOutFields > align...
packages/geoview-core/src/geo/layer/layer-sets/all-feature-info-layer-set.ts
line 131 at r5 (raw file):
// Use the response to align arrayOfRecords fields with layerConfig fields if (arrayOfRecords?.length) AbstractLayerSet.alingRecordsWithOutFields(this.layerApi.getLayerEntryConfig(layerPath) as TypeLayerEntryConfig, arrayOfRecords);
alingRecordsWithOutFields > align...
packages/geoview-core/src/geo/layer/layer-sets/feature-info-layer-set.ts
line 159 at r5 (raw file):
// Use the response to align arrayOfRecords fields with layerConfig fields if (arrayOfRecords?.length) AbstractLayerSet.alingRecordsWithOutFields(
alingRecordsWithOutFields > align...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3, 10 of 11 files at r4, 2 of 3 files at r6, all commit messages.
Reviewable status: 20 of 21 files reviewed, 5 unresolved discussions (waiting on @DamonU2)
packages/geoview-core/src/core/utils/utilities.ts
line 62 at r2 (raw file):
Previously, DamonU2 (Damon Ulmi) wrote…
true is > true if
Done.
packages/geoview-core/src/geo/layer/layer-sets/abstract-layer-set.ts
line 452 at r5 (raw file):
Previously, DamonU2 (Damon Ulmi) wrote…
layerto > layer to
Done.
packages/geoview-core/src/geo/layer/layer-sets/abstract-layer-set.ts
line 457 at r5 (raw file):
Previously, DamonU2 (Damon Ulmi) wrote…
alingRecordsWithOutFields > align...
Done.
packages/geoview-core/src/geo/layer/layer-sets/all-feature-info-layer-set.ts
line 131 at r5 (raw file):
Previously, DamonU2 (Damon Ulmi) wrote…
alingRecordsWithOutFields > align...
Done.
packages/geoview-core/src/geo/layer/layer-sets/feature-info-layer-set.ts
line 159 at r5 (raw file):
Previously, DamonU2 (Damon Ulmi) wrote…
alingRecordsWithOutFields > align...
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @jolevesq)
8f4d8b5
into
Canadian-Geospatial-Platform:develop
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #2259, #2531
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Hosted, October 3rd, 7:30AM
https://jolevesq.github.io/geoview/add-layers.html
https://jolevesq.github.io/geoview/demos-navigator.html?config=./configs/navigator/27-geocore-custom.json
https://jolevesq.github.io/geoview/config-sandbox.html
Checklist:
I have made corresponding changes to the documentationI have added tests that prove my fix is effective or that my feature worksNew and existing unit tests pass locally with my changesThis change is