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

upcoming: [M3-7659] - Add user_type to /profile endpoint #10080

Merged
merged 9 commits into from
Jan 19, 2024

Conversation

jaalah-akamai
Copy link
Contributor

@jaalah-akamai jaalah-akamai commented Jan 18, 2024

Description 📝

We're updating our /profile endpoint to return the user role associated with Parent/Child Accounts by adding a new user_type field. Previous we had to get this information from the /users or /users/:user endpoint. This will allow us to cut down on the amount of queries we need in order to determine the user role.

Changes 🔄

  • Add user_type to type Profile in APIv4
  • You'll see with these changes we were able to remove useAccountUser query hooks
  • For MSW, you'll have to manually change the user_type for */profile similar to how we do for */account/users/:user.

How to test 🧪

Prerequisites

  • One account with full access
  • One account with restricted access

Reproduction steps

Verification steps

  1. Log into any restricted account with parent/child feature flag disabled, observe the Edit and Add Payment Method buttons are disabled.
  2. Turn parent/child feature flag on with Mock Service Workers
    • Observe the Edit and Add Payment Method buttons are enabled (by default we're in a parent state)
    • Then change parent to child on this line
    • Observe the Edit and Add Payment Method buttons are disabled.
    • Now change MSW from child to proxy and observe the Edit and Add Payment Method buttons are enabled.

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 requested a review from a team as a code owner January 18, 2024 22:45
@jaalah-akamai jaalah-akamai requested review from dwiley-akamai and abailly-akamai and removed request for a team January 18, 2024 22:45
@jaalah-akamai jaalah-akamai self-assigned this Jan 18, 2024
@jaalah-akamai jaalah-akamai requested a review from mjac0bs January 18, 2024 22:45
Copy link

github-actions bot commented Jan 18, 2024

Coverage Report:
Base Coverage: 79.95%
Current Coverage: 79.95%

@jaalah-akamai jaalah-akamai marked this pull request as draft January 19, 2024 15:16
@jaalah-akamai
Copy link
Contributor Author

Moving with an approach to add user_type to /profile endpoint instead.

@jaalah-akamai jaalah-akamai reopened this Jan 19, 2024
@jaalah-akamai jaalah-akamai marked this pull request as ready for review January 19, 2024 17:05
@jaalah-akamai jaalah-akamai changed the title upcoming: [M3-7659] - Add account capabilities for user role upcoming: [M3-7659] - Add user_type to /profile endpoint Jan 19, 2024
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.

We'll need to upate restricted-user-billing.spec.ts for the child accounts.
Screenshot 2024-01-19 at 11 51 03 AM

Approving pending that is done; confirmed that by updating the mock profile endpoint, the user_type is returned and correctly disables the buttons for child users only. 🚢

Screenshot 2024-01-19 at 11 47 06 AM

jaalah-akamai and others added 3 commits January 19, 2024 14:32
Co-authored-by: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com>
@jaalah-akamai jaalah-akamai requested a review from a team as a code owner January 19, 2024 19:41
@jaalah-akamai jaalah-akamai requested review from cliu-akamai and removed request for a team January 19, 2024 19:41
@jaalah-akamai jaalah-akamai merged commit d938bfe into linode:develop Jan 19, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants