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(organizations): fix data and navigation flow when member updates themselves TASK-1354 #5393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pauloamorimbr
Copy link
Contributor

@pauloamorimbr pauloamorimbr commented Dec 19, 2024

🗒️ Checklist

  1. run linter locally
  2. update all related docs (API, README, inline, etc.), if any
  3. draft PR with a title <type>(<scope>)<!>: <title> TASK-1234
  4. tag PR: at least frontend or backend unless it's global
  5. fill in the template below and delete template comments
  6. review thyself: read the diff and repro the preview as written
  7. open PR & confirm that CI passes
  8. request reviewers, if needed
  9. delete this section before merging

📣 Summary

The navigation and data flow is improved when an MMO organization admin removes itself from the organization.

📖 Description

The objective of this PR is to:

  • Minimize wrong API calls due to permissions and session data that needs to be updated
  • Present a better flow for the user, redirecting them to the correct view after the removal
    There's still a big margin for improving, mainly due to some work needed in useUsage, but it unfolds into several other files and flows, so it's better to be handled in a separated PR

👀 Preview steps

  1. ℹ️ have an account and a project
  2. Be the admin in an MMO
  3. Navigate to Account Settings > Members
  4. Remove yourself from the organization
  5. 🔴 [on main] notice that the user is not redirected and there are some failed attempts to API calls due to permissions
  6. 🟢 [on PR] notice that the user is redirected and there's only 1 failed attempt to usage API

@pauloamorimbr pauloamorimbr self-assigned this Dec 19, 2024
@pauloamorimbr pauloamorimbr marked this pull request as ready for review December 20, 2024 17:59
@@ -119,11 +119,11 @@ export const useOrganizationQuery = (params?: OrganizationQueryParams) => {
// the session data loaded. Account data is needed to fetch the organization
// data.

const query = useQuery<Organization, FailResponse, Organization, QueryKeys[]>({
const query = useQuery<Organization, FailResponse, Organization, string[]>({
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated to this PR, but note to self: do we need to specify angle brackets here, or can we get better type safety and readability by leaving this blank and fixing types upstream of it?

@p2edwards
Copy link
Contributor

Skimmed, will test soon.

@p2edwards p2edwards self-requested a review December 23, 2024 17:05
@pauloamorimbr pauloamorimbr force-pushed the pamorim/task-1354-handle-ux-flow-admin-leaving-mmo branch from 15bae53 to f0541cb Compare December 23, 2024 21:21
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.

2 participants