- Notifications
You must be signed in to change notification settings - Fork928
feat: allow admins to create workspaces for other users in UI#4247
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
12 commits Select commitHold shift + click to select a range
ce92b27
added permission for creating a workspace on behalf of a user
Kira-Pilot335bf93
committing stashed files
Kira-Pilote1a30e0
Merge remote-tracking branch 'origin/main' into admin-create-workspac…
Kira-Pilot4441f20
hooked up autocomplete for users
Kira-Pilot959b7ea
added label
Kira-Pilot44540df
added translations
Kira-Pilotce46918
wrote test
Kira-Pilot76534f2
added inputMargin prop
Kira-Pilot191e7c4
fixed permissions
Kira-Pilot4dea296
added inputSTyle prop
Kira-Pilot2242332
ran prettier
Kira-Pilot7961f52
fix lint
Kira-PilotFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
19 changes: 15 additions & 4 deletionssite/src/components/UserAutocomplete/UserAutocomplete.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -10,11 +10,20 @@ import { ChangeEvent, useEffect, useState } from "react" | ||
import { searchUserMachine } from "xServices/users/searchUserXService" | ||
export type UserAutocompleteProps = { | ||
value: User | null | ||
onChange: (user: User | null) => void | ||
label?: string | ||
inputMargin?: "none" | "dense" | "normal" | ||
inputStyles?: string | ||
} | ||
export const UserAutocomplete: React.FC<UserAutocompleteProps> = ({ | ||
value, | ||
onChange, | ||
label, | ||
inputMargin, | ||
inputStyles, | ||
}) => { | ||
const styles = useStyles() | ||
const [isAutocompleteOpen, setIsAutocompleteOpen] = useState(false) | ||
const [searchState, sendSearch] = useMachine(searchUserMachine) | ||
@@ -77,9 +86,11 @@ export const UserAutocomplete: React.FC<UserAutocompleteProps> = ({ value, onCha | ||
renderInput={(params) => ( | ||
<TextField | ||
{...params} | ||
Kira-Pilot marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
variant="outlined" | ||
margin={inputMargin ?? "normal"} | ||
label={label ?? undefined} | ||
placeholder="User email or username" | ||
className={inputStyles} | ||
InputProps={{ | ||
...params.InputProps, | ||
onChange: handleFilterChange, | ||
@@ -111,7 +122,7 @@ export const useStyles = makeStyles((theme) => { | ||
}, | ||
"& input": { | ||
Kira-Pilot marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
fontSize:16, | ||
padding: `${theme.spacing(0, 0.5, 0, 0.5)} !important`, | ||
}, | ||
}, | ||
5 changes: 5 additions & 0 deletionssite/src/i18n/en/createWorkspacePage.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"templateLabel": "Template", | ||
"nameLabel": "Name", | ||
"ownerLabel": "Workspace Owner" | ||
} |
2 changes: 2 additions & 0 deletionssite/src/i18n/en/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
32 changes: 24 additions & 8 deletionssite/src/pages/CreateWorkspacePage/CreateWorkspacePage.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
23 changes: 18 additions & 5 deletionssite/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
80 changes: 30 additions & 50 deletionssite/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletionssite/src/testHelpers/entities.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.