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

fix: [PDI-3099] - Enable Create Token button if all visible permissions selected #11453

Merged

Conversation

ChihweiLHBird
Copy link
Contributor

@ChihweiLHBird ChihweiLHBird commented Dec 21, 2024

Description 📝

This is to fix the issue where the Create Token button becomes disabled when the child-account is hidden and all permissions are individually selected, without using select all options.

Feel free to add a Jira ticket to my PR title if you would like to.

Changes 🔄

List any change(s) relevant to the reviewer.

  • Fix the issue described above.
  • Slightly refactor the initialization of excludedScopesFromSelectAll with constant values from the map.

Preview 📷

Before After
image image

How to test 🧪

Reproduction and verification steps

  • Select all permissions individually without using select all on an account without child account enabled.
  • The Create Token button is still disabled (prod version).
  • The Create Token button is enabled (the version in this branch).
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@ChihweiLHBird ChihweiLHBird force-pushed the zhiwei/fix-token-button-disabled branch from 8cb54f6 to c9364d3 Compare December 21, 2024 07:18
@ChihweiLHBird ChihweiLHBird marked this pull request as ready for review December 21, 2024 07:35
@ChihweiLHBird ChihweiLHBird requested a review from a team as a code owner December 21, 2024 07:35
@ChihweiLHBird ChihweiLHBird requested review from hkhalil-akamai and pmakode-akamai and removed request for a team December 21, 2024 07:35
@ChihweiLHBird ChihweiLHBird changed the title fix: Enable Create Token button if all visible permissions selected fix: [PDI-3099] - Enable Create Token button if all visible permissions selected Dec 21, 2024
@mjac0bs mjac0bs added the Bug Fixes for regressions or bugs label Jan 2, 2025
@mjac0bs mjac0bs self-requested a review January 2, 2025 21:11
@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🎉 472 passing tests on test run #4 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing472 Passing2 Skipped98m 59s

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Thanks for finding and submitting this fix, Zhiwei! The PAT utils are... not a pretty section of code.

Confirmed the fix for accounts where the child account access perm is not visible and confirmed that there are no regressions to unrestricted parent accounts with the child account access perm.

Prod This Branch
PATSelectBug.mov
PATSelectFix.mov

Approving this PR since the original PDI is fixed. While testing I might have discovered another existing issue in prod. When the user individually selects R/W for all perms when child account is hidden, rather than submit a * as the scope, it lists all the perms individually as rw. We had a similar issue with the 'Select All' button in the past.

Potential existing bug 📷

Screenshot 2025-01-02 at 3 14 03 PM
Screenshot 2025-01-02 at 3 14 23 PM

cc @jaalah-akamai (or others) - Can you sanity check me on this? For ALL accounts, whether all R/W radio buttons are selected individually or the 'Select All' R/W is used, the scope should be a *, correct? Will make a follow up ticket, if so.

@mjac0bs mjac0bs added the Add'tl Approval Needed Waiting on another approval! label Jan 2, 2025
@hkhalil-akamai
Copy link
Contributor

cc @jaalah-akamai (or others) - Can you sanity check me on this? For ALL accounts, whether all R/W radio buttons are selected individually or the 'Select All' R/W is used, the scope should be a *, correct? Will make a follow up ticket, if so.

Confirm that I'm seeing this too only with a restricted parent account.

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Jan 7, 2025
@mjac0bs
Copy link
Contributor

mjac0bs commented Jan 7, 2025

Created M3-9070 for the issue mentioned above. I'm going to merge this PR as is. Thanks again @ChihweiLHBird!

@mjac0bs mjac0bs merged commit f818d0b into linode:develop Jan 7, 2025
23 checks passed
Copy link

cypress bot commented Jan 7, 2025

Cloud Manager E2E    Run #7047

Run Properties:  status check passed Passed #7047  •  git commit f818d0be31: fix: [PDI-3099] - Enable `Create Token` button if all visible permissions select...
Project Cloud Manager E2E
Branch Review develop
Run status status check passed Passed #7047
Run duration 27m 52s
Commit git commit f818d0be31: fix: [PDI-3099] - Enable `Create Token` button if all visible permissions select...
Committer Zhiwei
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 478
View all changes introduced in this branch ↗︎

@ChihweiLHBird ChihweiLHBird deleted the zhiwei/fix-token-button-disabled branch January 9, 2025 09:51
dmcintyr-akamai pushed a commit to dmcintyr-akamai/manager that referenced this pull request Jan 9, 2025
…ions selected (linode#11453)

* fix: Enable `Create Token` button if all visible perms selected

* Added changeset: `Create Token` button becomes disabled when all permissions are selected individually (without using 'select all') and child-account is hidden

* Update the in-line doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Bug Fixes for regressions or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants