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-7685] - Show empty Kubernetes landing page with disabled create button for restricted users #10756

Conversation

zaenab-akamai
Copy link
Contributor

@zaenab-akamai zaenab-akamai commented Aug 6, 2024

feat: [M3-7685] - Show empty Kubernetes landing page with disabled create button for restricted users

Description 📝

To prevent unauthorized access to specific flows and provide clearer guidance, we aim to introduce notifications on landing pages, restricting entry to users without the required permissions.

The existing "Unauthorized" view for restricted users on https://cloud.linode.com/kubernetes/clusters has been replaced with the empty Kubernetes landing page, with the "Create Cluster" button disabled.

Changes 🔄

  • Displaying the empty Kubernetes landing page instead of the existing "Unauthorized" message

Target release date 🗓️

NA

Preview 📷

Include a screenshot or screen recording of the change

💡 Use <video src="" /> tag when including recordings in table.

Before After
Screenshot 2024-08-07 at 2 18 30 PM Screenshot 2024-08-07 at 2 22 21 PM

Verification steps

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

@zaenab-akamai zaenab-akamai marked this pull request as ready for review August 7, 2024 13:51
@zaenab-akamai zaenab-akamai requested a review from a team as a code owner August 7, 2024 13:51
@zaenab-akamai zaenab-akamai requested review from jaalah-akamai and coliu-akamai and removed request for a team August 7, 2024 13:51
@@ -9,6 +9,7 @@ export const grantTypeMap = {
firewall: 'Firewalls',
image: 'Images',
linode: 'Linodes',
lkeCluster: 'Clusters',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this code comment will bring some clarity that it's mainly used to improve UX

Suggested change
lkeCluster: 'Clusters',
lkeCluster: 'Clusters', // Note: Not included in the user's grants returned from the API.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can we also rename this to lke: LKE Clusters?

it('should have the "Create Cluster" button disabled for restricted users', () => {
queryMocks.useProfile.mockReturnValue({ data: { restricted: true } });

const { container } = render(wrapWithTheme(<KubernetesLanding />));
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be able to use renderWithTheme in these tests instead of render(wrapWithTheme())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @jaalah-akamai, I've updated the PR as you suggested

Copy link
Contributor

@coliu-akamai coliu-akamai left a comment

Choose a reason for hiding this comment

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

✅ confirmed create kubernetes button disabled for restricted user
✅ confirmed button not disabled for non restricted user
✅ confirmed new landing page tests pass on local

Approving pending comments addressed

@coliu-akamai coliu-akamai added the Approved Multiple approvals and ready to merge! label Aug 7, 2024
Copy link

github-actions bot commented Aug 8, 2024

Coverage Report:
Base Coverage: 82.43%
Current Coverage: 82.43%

@jaalah-akamai jaalah-akamai merged commit 3030be8 into linode:develop Aug 8, 2024
18 of 19 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!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants