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

feat: [M3-7687] - Refactor & Improve LinodeActionMenu Restricted User Experience #10199

Merged
merged 10 commits into from
Feb 20, 2024

Conversation

jaalah-akamai
Copy link
Contributor

@jaalah-akamai jaalah-akamai commented Feb 15, 2024

Note

There's more work to do for Linodes to improve the user experience for restricted users, but I've decided to breakup the work in separate PRs

Description πŸ“

This refactors the LinodeActionMenu while providing disabled tooltips for action items.

Tooltips specifically designed for disabled buttons will persist within action menus. These tooltips prove valuable in scenarios where a restricted user has permission to delete their personal resources but lacks the permission to delete those belonging to the admin user. In such cases, we refrain from displaying notices on the page.

Changes πŸ”„

List any change relevant to the reviewer.

  • Created LinodeActionMenu directory for compartmentalizing files
  • Added more options to our type ActionType
  • Updated getRestrictedResourceText for instances where we don't want to be so verbose
  • Moved buildQueryStringForLinodeClone into a util file

Target release date πŸ—“οΈ

March 4, 2024

Preview πŸ“·

Desc After
Read Only Screenshot 2024-02-15 at 2 10 31 PM
Host Maintenance Screenshot 2024-02-15 at 2 09 25 PM
Powered Off Linode Screenshot 2024-02-15 at 2 09 05 PM

How to test πŸ§ͺ

Prerequisites

(How to setup test environment)

  • Log into two accounts side by side:
    • An unrestricted admin user account: full access
    • A restricted user account (use Incognito for this)
      • Start with Read Only for everything

Reproduction steps

(How to reproduce the issue, if applicable)

  • Before changes, observe that all tooltips are same: You don't have permission to modify this Linode

Verification steps

(How to verify changes)

  • After changes, observe tooltips are tailored to the action.
  • Verify maintenance and reboot tooltips by enabling read_write of Linodes for restricted user:
    • For maintenance, change this value to true
    • For reboot, if Linode is powered off we should see This action is unavailable while your Linode is offline.

As an Author I have considered πŸ€”

Check all that apply

  • πŸ‘€ 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

@jaalah-akamai jaalah-akamai self-assigned this Feb 15, 2024
@jaalah-akamai jaalah-akamai added the Restricted User Access Improve UX surrounding restricted access to features label Feb 15, 2024
onClick: handlePowerAction,
title: linodeStatus === 'running' ? 'Power Off' : 'Power On',
tooltipAction: 'modify',
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Overall, I went with this config approach to remove some of the redundancies in the original. Open for discussion.

@jaalah-akamai jaalah-akamai changed the title feat: [M3-7687] - Refactor & Improve Linode Action Menu Restricted User Experience feat: [M3-7687] - Refactor & Improve LinodeActionMenu Restricted User Experience Feb 15, 2024
@jaalah-akamai jaalah-akamai marked this pull request as ready for review February 15, 2024 20:28
@jaalah-akamai jaalah-akamai requested a review from a team as a code owner February 15, 2024 20:28
@jaalah-akamai jaalah-akamai requested review from cpathipa and hkhalil-akamai and removed request for a team February 15, 2024 20:29
Copy link

github-actions bot commented Feb 15, 2024

Coverage Report: βœ…
Base Coverage: 81.24%
Current Coverage: 81.31%

Copy link
Contributor

@hkhalil-akamai hkhalil-akamai left a comment

Choose a reason for hiding this comment

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

Nice work, tested and looks good. Left some minor feedback and discussion.

jaalah-akamai and others added 4 commits February 16, 2024 13:58
…ionMenu/LinodeActionMenu.test.tsx

Co-authored-by: Hussain Khalil <122488130+hkhalil-akamai@users.noreply.github.com>
…ionMenu/LinodeActionMenu.test.tsx

Co-authored-by: Hussain Khalil <122488130+hkhalil-akamai@users.noreply.github.com>
@jaalah-akamai jaalah-akamai added the Add'tl Approval Needed Waiting on another approval! label Feb 16, 2024
@jaalah-akamai
Copy link
Contributor Author

Thanks @bnussman-akamai

@bnussman-akamai bnussman-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Feb 20, 2024
@jaalah-akamai jaalah-akamai merged commit a4bbe2a into linode:develop Feb 20, 2024
18 checks passed
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! Restricted User Access Improve UX surrounding restricted access to features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants