Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: expose all organization ids from AuthContext#13268

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aslilac merged 6 commits intomainfrommulti-org-state
May 14, 2024

Conversation

aslilac
Copy link
Member

@aslilacaslilac commentedMay 13, 2024
edited
Loading

The important bit of this change is in AuthContext.tsx and DashboardProvider.tsx:

  • AuthContext now exposes anorganizationIds property, which is a list, rather than theorganizationId property, which was a single ID.
  • DashboardContext is now responsible for managing the state around which organization should be "active" in the app.

The rest is just "to whom it may concern" updates to accommodate those changes.

Also, some of these usages oforganizationId are almost certainly incorrect, but I'd rather audit all of that in a separate PR.

Comment on lines +46 to +50
const[activeOrganizationId,setActiveOrganizationId]=useState(()=>
lastUsedOrganizationId&&organizationIds.includes(lastUsedOrganizationId)
?lastUsedOrganizationId
:organizationIds[0],
);
Copy link
Member

Choose a reason for hiding this comment

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

Talked to@aslilac, we are not going to introduce the concept of "Default Org" to the FE. It is a stop gap on the backend to accommodate features like group sync, role sync, SCIM, etc. Those features need to be upgraded to not rely on default org.

If a deployment exists with more than 1 org, this is no morebroken than it currently is today.

if(!organizationIds.includes(id)){
thrownewReferenceError("Invalid organization ID");
}
localStorage.setItem(`user:${user.id}.lastUsedOrganizationId`,id);
Copy link
Member

Choose a reason for hiding this comment

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

Smart assigning to a user!

Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a comment

Choose a reason for hiding this comment

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

Good changes 🙏

@aslilacaslilac merged commita8a0be9 intomainMay 14, 2024
@aslilacaslilac deleted the multi-org-state branchMay 14, 2024 16:48
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 14, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@EmyrkEmyrkEmyrk left review comments

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

Assignees

@aslilacaslilac

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@aslilac@BrunoQuaresma@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp