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

UX - Display an error message if the layer is not found in the CFG file, if admin #5304

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Gustry
Copy link
Member

@Gustry Gustry commented Jan 30, 2025

I'm keen to have some feedbacks here.

For now, globally in Lizmap, if an error occurs, there is nothing displayed in the user interface. The only way is to open the developer tools, which is not a good advice, our admin end-users shouldn't open the web developer tools.

It would be nice, at the end of loading a map, a UI box is displayed if there were any "error" during loading the map ?

Just to keen to have ideas

Copy link
Collaborator

@mdouchin mdouchin left a comment

Choose a reason for hiding this comment

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

Nice catch. Minor rephrasing needed IMHO

assets/src/modules/config/LayerTree.js Outdated Show resolved Hide resolved
@Gustry Gustry added the run end2end If the PR must run end2end tests or not label Jan 30, 2025
@Gustry Gustry removed the run end2end If the PR must run end2end tests or not label Jan 30, 2025
@Gustry Gustry force-pushed the admin-layer-cfg branch 2 times, most recently from 3e5e035 to e706c65 Compare January 31, 2025 12:56
@Gustry Gustry added the run end2end If the PR must run end2end tests or not label Jan 31, 2025
@Gustry
Copy link
Member Author

Gustry commented Jan 31, 2025

I'm keen to have feedbacks about this document variable @nboisteault and @rldhont
https://www.geeksforgeeks.org/how-to-fix-referenceerror-document-is-not-defined-in-javascript/

I didn't look too much

@nboisteault
Copy link
Member

I'm keen to have feedbacks about this document variable @nboisteault and @rldhont https://www.geeksforgeeks.org/how-to-fix-referenceerror-document-is-not-defined-in-javascript/

I didn't look too much

Where is the issue?

@Gustry
Copy link
Member Author

Gustry commented Jan 31, 2025

Where is the issue?

document is not defined, as described in the code, just check what I have done

Comment on lines +418 to +423
try {
// document is not defined in JUnit
if (document.body.dataset.lizmapAdminUser === 1) {
lizMap.addMessage(errorMessage, 'warning', true).attr('id', 'lizmap-warning-message');
}
}catch(error) {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
try {
// document is not defined in JUnit
if (document.body.dataset.lizmapAdminUser === 1) {
lizMap.addMessage(errorMessage, 'warning', true).attr('id', 'lizmap-warning-message');
}
}catch(error) {}

Do not use LizMap or do some UX here.

@Gustry Gustry marked this pull request as draft January 31, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
administration pages backport release_3_8 backport release_3_9 javascript Pull requests that update Javascript code run end2end If the PR must run end2end tests or not
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants