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

Header - Add authenticated user organization in hidden fields #5288

Merged

Conversation

mdouchin
Copy link
Collaborator

@mdouchin mdouchin commented Jan 29, 2025

This allows a JavaScript script to get the current user organization and use it in the editing form.

Ticket : #

Funded by Ville d'Avignon https://cartes.mairie-avignon.com

@mdouchin
Copy link
Collaborator Author

cc @sigavignon

@Gustry Gustry added sponsored development This development has been funded run end2end If the PR must run end2end tests or not labels Jan 29, 2025
@Gustry
Copy link
Member

Gustry commented Jan 29, 2025

Tests added ;-)

Linked to #3963 and #3960

@mdouchin
Copy link
Collaborator Author

@Gustry thanks a lot for the tests. Do you think we should also add other fields (city, postcode, etc.) ?

@Gustry
Copy link
Member

Gustry commented Jan 29, 2025

If more are added, I would prefer something cleaner (and revert your change in the first commit), using data attributes ?

I'm curious what other websites do ? Do they expose all "sensible" data into the frontend ? (with extensions, plugins ...)

@rldhont
Copy link
Collaborator

rldhont commented Jan 29, 2025

@mdouchin this data could be exposed through jsvars, like dataviz, action, filter, isn't it ?

@Gustry
Copy link
Member

Gustry commented Jan 29, 2025

Way more comfortable to use

@Gustry Gustry force-pushed the mdouchin-headermenu-add-organization-in-hidden-fields branch from 8fc5cfe to 0513e4e Compare February 4, 2025 12:29
mdouchin and others added 2 commits February 5, 2025 12:24
This allows a JavaScript script to get the current user organization and use it in the editing form.
@Gustry Gustry force-pushed the mdouchin-headermenu-add-organization-in-hidden-fields branch from 0513e4e to 9c444a5 Compare February 5, 2025 11:24
Copy link

github-actions bot commented Feb 5, 2025

Read only

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
24 24 0 0 0 0 1 38.8s

Flaky Tests

Flaky Tests 🍂 Retries
🍂 Axis Orientation NEU for EPSG:3044 1

Github Test Reporter

🔄 This comment has been updated

@Gustry
Copy link
Member

Gustry commented Mar 3, 2025

Is there still something to do ?

I think let's merge but other fields should go in a kind of API, like, like a global function currentUserLogin() ...

@mdouchin
Copy link
Collaborator Author

mdouchin commented Mar 4, 2025

ok for merging, and agree with you regarding API

@Gustry Gustry merged commit a9e1ea2 into master Mar 5, 2025
16 of 18 checks passed
@Gustry Gustry deleted the mdouchin-headermenu-add-organization-in-hidden-fields branch March 5, 2025 14:59
@3liz-bot
Copy link
Contributor

3liz-bot commented Mar 5, 2025

The backport to release_3_8 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 00fa45a30... Header - Add authenticated user organization in hidden fields
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

stdout
Auto-merging lizmap/modules/lizmap/templates/user_menu.tpl
CONFLICT (content): Merge conflict in lizmap/modules/lizmap/templates/user_menu.tpl

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release_3_8 release_3_8
# Navigate to the new working tree
cd .worktrees/backport-release_3_8
# Create a new branch
git switch --create backport-5288-to-release_3_8
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 00fa45a30d995e447b139c8306d1d9c7d5988352,9c444a592d70b978deab382e250c8d25197e2f33
# Push it to GitHub
git push --set-upstream origin backport-5288-to-release_3_8
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release_3_8

Then, create a pull request where the base branch is release_3_8 and the compare/head branch is backport-5288-to-release_3_8.

@3liz-bot
Copy link
Contributor

3liz-bot commented Mar 5, 2025

The backport to release_3_9 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 00fa45a30... Header - Add authenticated user organization in hidden fields
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

stdout
Auto-merging lizmap/modules/lizmap/templates/user_menu.tpl
CONFLICT (content): Merge conflict in lizmap/modules/lizmap/templates/user_menu.tpl

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release_3_9 release_3_9
# Navigate to the new working tree
cd .worktrees/backport-release_3_9
# Create a new branch
git switch --create backport-5288-to-release_3_9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 00fa45a30d995e447b139c8306d1d9c7d5988352,9c444a592d70b978deab382e250c8d25197e2f33
# Push it to GitHub
git push --set-upstream origin backport-5288-to-release_3_9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release_3_9

Then, create a pull request where the base branch is release_3_9 and the compare/head branch is backport-5288-to-release_3_9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release_3_8 backport release_3_9 failed backport run end2end If the PR must run end2end tests or not sponsored development This development has been funded
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants