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(site): add an organization switcher to the user menu #13269

Merged
merged 7 commits into from
May 15, 2024
Merged

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented May 13, 2024

Screenshot 2024-05-13 at 4 05 59 PM

Base automatically changed from multi-org-state to main May 14, 2024 16:48
@aslilac aslilac changed the title feat(site/experimental): add an organization switcher to the user menu feat(site): add an organization switcher to the user menu May 14, 2024
@@ -67,7 +67,7 @@ export const RequireAuth: FC = () => {
};

type RequireKeys<T, R extends keyof T> = Omit<T, R> & {
[K in keyof Pick<T, R>]: NonNullable<T[K]>;
[K in keyof Pick<T, R>]-?: NonNullable<T[K]>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What -? does?

Copy link
Member Author

Choose a reason for hiding this comment

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

"make the mapped key non-optional". it's weird but NonNullable is not enough on it's own. 🙃

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

I downloaded the branch locally but I can't see the teams getting listed in the dropdown - or at least the default one.

Screenshot 2024-05-15 at 09 54 56

How can I test this feature?

@aslilac
Copy link
Member Author

aslilac commented May 15, 2024

You need to run with CODER_EXPERIMENTS=multi-organization and click the secret button that that enables in your user settings, and refresh your page because the localStorage change doesn't get picked up by React, but it's not worth fixing because the button is super temporary.

@aslilac
Copy link
Member Author

aslilac commented May 15, 2024

and you'll need to manually hit the backend if you want to create a new org, and it'll probably break everything if you do. Trying to hack this out one piece at a time. 😅

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

I'm going to be off tomorrow so I'm going to approve this since the code looks good and it is under experimental 👍

@aslilac aslilac merged commit fc6f18a into main May 15, 2024
33 checks passed
@aslilac aslilac deleted the org-switcher branch May 15, 2024 19:14
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants