-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add workspace sharing page #20931
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
base: main
Are you sure you want to change the base?
Conversation
| {...props} | ||
| > | ||
| <span className="absolute right-2 flex items-center justify-center"> | ||
| <span className="absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vertically center the checkmark when the select takes up more vertical space
| htmlProps: HTMLAttributes<HTMLLIElement>; | ||
| } | ||
|
|
||
| export const UserOrGroupOption = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted from UserOrGroupAutocomplete
|
Not really happy with UserOrGroupAutocomplete.tsx and I would really prefer to replace it then add yet another variation but I think that is better saved for a separate PR. Also, stories for WorkspaceSharingPageView coming in a separate PR. |
site/src/pages/WorkspaceSettingsPage/WorkspaceSharingPage/WorkspaceSharingPage.tsx
Show resolved
Hide resolved
site/src/pages/WorkspaceSettingsPage/WorkspaceSharingPage/WorkspaceSharingPage.tsx
Show resolved
Hide resolved
site/src/pages/WorkspaceSettingsPage/WorkspaceSharingPage/WorkspaceSharingPage.tsx
Show resolved
Hide resolved
| displayError( | ||
| getErrorMessage(error, "Failed to add user to workspace"), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine it was already like this on the template sharing page, but I really dislike the ux of error toasts :\
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I seem to keep doing this just to maintain consistency and forgetting there are better ways. Github actually decided to get rid of toasts altogether.
| workspaceACL={workspaceACL} | ||
| isLoading={isAddingUser || isAddingGroup} | ||
| onSubmit={(value, role, resetAutocomplete) => | ||
| "members" in value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels typo prone 😬 but I see that this is yet another thing taken from the old page. dang.
| onAddUser: ( | ||
| user: WorkspaceUser | ({ role: WorkspaceRole } & User), | ||
| role: WorkspaceRole, | ||
| reset: () => void, | ||
| ) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| onAddUser: ( | |
| user: WorkspaceUser | ({ role: WorkspaceRole } & User), | |
| role: WorkspaceRole, | |
| reset: () => void, | |
| ) => void; | |
| onAddUser: ( | |
| user: WorkspaceUser, | |
| role: WorkspaceRole, | |
| reset: () => void, | |
| ) => void; |
what are the odds this still just works if we make this type less obnoxious? 💀
Uh oh!
There was an error while loading. Please reload this page.