-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Metadata editor / Fix javascript error in the add thumbnail option when the metadata has 1 WMS layer #7646
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
josegar74
force-pushed
the
editor-wms-addthumbnail-fix
branch
from
January 22, 2024 11:05
1d8a547
to
9a08468
Compare
…en the metadata has 1 WMS layer: Error: [orderBy:notarray] http://errors.angularjs.org/1.8.2/orderBy/notarray\?p0\=%7B%22resource%22%3A%7B%22ref%22%3A%22172%22%2C%22refParent%22%3A%22171%22%2C%22name%22%3A%222%22%2C%22url%22%3A%22https%3A%2F%2Fmaps-cartes.ec.gc.ca%2Farcgis%2Fservices%2FDMS%2FStressCumulatifLittorales%2FMapServer%2FWMSServer%3Frequest%3DGetCapabilities%26service%3DWMS%22%2C%22title%22%3A%22Metadata%20WMS%20layer%22%2C%22abstract%22%3A%22The%20ISO19115%20metadata%20standard%20is%20the%20preferred%20metadata%20standard%20to%20use.%20If%20unsure%20what%20templates%20to%20start%20with%2C%20use%20this%20one.%22%2C%22protocol%22%3A%22OGC%3AWMS%22%7D%7D at lib.js?v=65b94734a63ca8491dba95d7439baf1be02c2450:21:168
josegar74
force-pushed
the
editor-wms-addthumbnail-fix
branch
from
January 22, 2024 12:37
9a08468
to
10137eb
Compare
fxprunayre
added a commit
to fxprunayre/core-geonetwork
that referenced
this pull request
Feb 1, 2024
10 tasks
* Metadata editor / Improve layer configuration init. Related to geonetwork#7646. * Metadata editor / Improve layer configuration init. * Metadata editor / Remove log.
fxprunayre
approved these changes
Feb 1, 2024
geonetworkbuild
pushed a commit
that referenced
this pull request
Feb 1, 2024
* Metadata editor / Improve layer configuration init. Related to #7646. * Metadata editor / Improve layer configuration init. * Metadata editor / Remove log.
josegar74
added a commit
that referenced
this pull request
Feb 1, 2024
…umbnail option when the metadata has 1 WMS layer (#7684) * Metadata editor / Fix javascript error in the add thumbnail option when the metadata has 1 WMS layer: Error: [orderBy:notarray] http://errors.angularjs.org/1.8.2/orderBy/notarray\?p0\=%7B%22resource%22%3A%7B%22ref%22%3A%22172%22%2C%22refParent%22%3A%22171%22%2C%22name%22%3A%222%22%2C%22url%22%3A%22https%3A%2F%2Fmaps-cartes.ec.gc.ca%2Farcgis%2Fservices%2FDMS%2FStressCumulatifLittorales%2FMapServer%2FWMSServer%3Frequest%3DGetCapabilities%26service%3DWMS%22%2C%22title%22%3A%22Metadata%20WMS%20layer%22%2C%22abstract%22%3A%22The%20ISO19115%20metadata%20standard%20is%20the%20preferred%20metadata%20standard%20to%20use.%20If%20unsure%20what%20templates%20to%20start%20with%2C%20use%20this%20one.%22%2C%22protocol%22%3A%22OGC%3AWMS%22%7D%7D at lib.js?v=65b94734a63ca8491dba95d7439baf1be02c2450:21:168 * Metadata editor / Improve layer configuration init. (#96) * Metadata editor / Improve layer configuration init. Related to #7646. * Metadata editor / Improve layer configuration init. * Metadata editor / Remove log. --------- Co-authored-by: Jose García <[email protected]> Co-authored-by: François Prunayre <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Test case:
Add a thumbnail
in the dialog. Check the Javascript console:@fxprunayre not really related to this change, but to the Add thumbnails from map feature. Is this to hide the add thumbnails from map panel if the metadata doesn't have any WMS layer?
core-geonetwork/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html
Lines 542 to 549 in 65b9473
This doesn't really work, independently of the value of
scope.layers
incore-geonetwork/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js
Line 681 in 65b9473
undefined
or has a value), if you print that value in the HTML it is always prints[]
.Debugging the code,
scope.layers
are reset incore-geonetwork/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js
Line 1123 in 65b9473
core-geonetwork/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js
Line 681 in 65b9473
I don't know that much this code, but seems like an unwanted side-effect?
Should not be this set to
undefined
to be consistent with the HTML check?core-geonetwork/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js
Line 617 in 65b9473
If the purpose is to hide the panel if no WMS layers, I think we should unify the check either to
undefined
or empty array and check the side effect for reset protocol.Doing some additional research, it seems
scope.layers
are used both in the WMS directive to select a WMS layer and also in the Add Thumbnail from map feature, that doesn't look good. I've changedcore-geonetwork/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html
Lines 542 to 549 in 65b9473
To
And looks working fine like this:
If the metadata has WMS layers, are loaded in the map viewer to create the thumbnail
If the metadata has no WMS layers, a message
No layer defined in record to generate thumbnail from
is displayed (although needs some styling).I think the assignment changed in this PR can be also completely removed,
scope.layers
should be used only to select layers from a WMS service.Checklist
main
branch, backports managed with labelREADME.md
filespom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentation