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

[PM-2102] Fix broken access selector component #5433

Conversation

shane-melton
Copy link
Member

@shane-melton shane-melton commented May 11, 2023

Type of change

- [X] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Implement logic to keep row control enable/disable status in sync with the access item properties whenever the parent form group in the access selector is enabled/disabled.

Angular 15 introduced a breaking change that calls setDisabledState() whenever a CVA is added. While not a problem on its own, it did reveal a flaw in how the access selector component would enable/disable its internal form group. When the setDisabledState() is called it calls enable() on the internal form group, which cascades to all of the child controls; effectively re-enabling all the internal form group rows (even those that should have remained disabled due to their read only status).

Fixes #5328

Code changes

  • apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.ts: Add the logic explained above
  • libs/angular/src/utils/form-selection-list.ts: Add helper method to easily iterate over a FormSelectionLists controls and values

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
  • Ensure that all UI additions follow WCAG AA requirements

…n sync with the access item properties whenever the parent control is enabled/disabled

Angular 15 introduced a breaking change that calls setDisabledState() whenever a CVA is added. This was re-enabling all the internal form group rows (even those that should have remained disabled).
@shane-melton shane-melton requested a review from a team as a code owner May 11, 2023 19:47
@github-actions github-actions bot added the needs-qa Marks a PR as requiring QA approval label May 11, 2023
…cannot-be-modified-via-the-edit-member-modal-if-the-organizational-member-is-assigned-to-a-group
…cannot-be-modified-via-the-edit-member-modal-if-the-organizational-member-is-assigned-to-a-group
@shane-melton shane-melton removed the needs-qa Marks a PR as requiring QA approval label May 18, 2023
@shane-melton shane-melton merged commit 3f7a63b into master May 18, 2023
@shane-melton shane-melton deleted the PM-2102-the-collection-access-permissions-cannot-be-modified-via-the-edit-member-modal-if-the-organizational-member-is-assigned-to-a-group branch May 18, 2023 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants