-
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance usergroup permission handling and display (#16469)
### What does it do? Among a number of refactoring moves, the solution submitted here provides a new and centralized method to update the “Permissions in Selected Policy” component found in the various Create and Update windows within the ACLs area. Also: 1. Created a new parent class for the 5 User Group permissions grids 2. Created a new parent class for the 5 Create windows 3. Refactors implemented trim the code overall by ~450 lines 4. Because the changes were so significant, code style issues were fixed at the same time (instead of in a separate commit) 5. Updated style of the permissions display, both in windows and in the row expander (within the grids), making them significantly more readable 6. Added a handful of Lexicons for select windows to make all window headings consistent. Additionally, a couple of descriptions were missing or needed updating. 7. Altered how the window combos are set to avoid issue where certain combos would initially show the raw value instead of the displayField value (name in most cases) #### Special Note In the editing windows, I changed the Context combo’s displayField to `name` instead of `key` (`context_key`). Even as a developer, I've always found showing the key cumbersome — to me it's much more natural to associate with the name of any object rather than its id/key. If reviewers and code owners agree, I'd also implement that in the grids (which currently still display the key). ### Why is it needed? As mentioned in #16386, permissions lists (in windows) were not updating correctly. Also: 1. Permissions were not initially showing up in the edit window (see Figure 1) 2. A number of UI display issues needed solving (items 5–7 above) (see Figures 2 & 3) 3. Lastly, this are had a large amount of duplicate/very similar code, making this area far from DRY. Figure 1 — Before fix, missing perms list <img width="450" alt="fig-1" src="https://github.com/modxcms/revolution/assets/689075/28b6fc61-8d74-46c4-ac1d-b7ebce8018fe"> Figure 2 — Window before and after, showing css update <img width="919" alt="fig-1" src="https://github.com/modxcms/revolution/assets/689075/923ada3e-4ff9-4672-8579-1a5e4068fe89"> Figure 3 — Grid before and after, showing css update <img width="1176" alt="fig-3" src="https://github.com/modxcms/revolution/assets/689075/14ef0f81-53a7-49fb-816f-d4c4591b3401"> Figure 4 — Video clip showing correct permissions display when opening and after closing and re-opening editing windows https://github.com/modxcms/revolution/assets/689075/f008cd55-97fb-432a-aa7a-d2bf8c2b28df ### How to test 1. Run grunt build to ensure css is updated. 4. Ensure you have a number of ACLs created for each of the Permissions areas in a User Group (Context, Resource Group, Category, Namespace, and Source). 5. Test creating and editing various entries to verify the editing windows always display the correct information. ### Related issue(s)/PR(s) Resolves #16386 --------- Co-authored-by: Jim Graham <info@sparkmediagroup.com> Co-authored-by: Jason Coward <jason@opengeek.com>
- Loading branch information
1 parent
69c7efb
commit 7d90842
Showing
14 changed files
with
1,198 additions
and
1,559 deletions.
There are no files selected for viewing
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.