Skip to content

chore(site): Upgrade to MUI v5 #7437

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

Merged
merged 36 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
73c3c17
Initial changes
BrunoQuaresma May 5, 2023
047c10b
Apply codemod
BrunoQuaresma May 5, 2023
0b26a9b
Apply variant mod
BrunoQuaresma May 5, 2023
d0b064a
Migrate theme options
BrunoQuaresma May 5, 2023
9a5203d
Merge branch 'main' into bq/migrate-to-muiv5
BrunoQuaresma May 8, 2023
1f078ce
Fix all TS problems
BrunoQuaresma May 8, 2023
fc683c8
Merge branch 'main' into bq/migrate-to-muiv5
BrunoQuaresma May 8, 2023
77777fb
Remove unusable test
BrunoQuaresma May 8, 2023
479ce07
Button and input text
BrunoQuaresma May 8, 2023
9dfec8f
Set typography
BrunoQuaresma May 8, 2023
50e9f22
Remove default outlined
BrunoQuaresma May 8, 2023
34d9d8d
Improve theme
BrunoQuaresma May 8, 2023
9a62dcc
Setup links
BrunoQuaresma May 8, 2023
756277e
Fix link
BrunoQuaresma May 8, 2023
5c45cf6
Fix button outlined neutral
BrunoQuaresma May 8, 2023
5ae26fa
Fix
BrunoQuaresma May 8, 2023
a1cbc12
Update workspace header
BrunoQuaresma May 8, 2023
55c0751
Merge branch 'main' into bq/migrate-to-muiv5
BrunoQuaresma May 9, 2023
168814c
Fix format
BrunoQuaresma May 9, 2023
a591559
Adjust buttons
BrunoQuaresma May 9, 2023
a4bba50
Fix table loaders
BrunoQuaresma May 9, 2023
a24edee
Few tweaks on deployment settings
BrunoQuaresma May 9, 2023
4abb23d
Fix typo
BrunoQuaresma May 9, 2023
a0bbf8f
Fix filter size
BrunoQuaresma May 9, 2023
029e658
Fix skeleton path
BrunoQuaresma May 9, 2023
367c445
Fix storybook
BrunoQuaresma May 9, 2023
9682b7b
Many storybook fixes
BrunoQuaresma May 9, 2023
82d2e53
Fix table min
BrunoQuaresma May 9, 2023
a38eb9a
Fix colors and input sizes
BrunoQuaresma May 9, 2023
9a0e553
Previous design issue
BrunoQuaresma May 9, 2023
1145725
Better workspace build state error
BrunoQuaresma May 9, 2023
7251da2
Fix type
BrunoQuaresma May 9, 2023
a3a807a
Merge branch 'main' into bq/migrate-to-muiv5
BrunoQuaresma May 10, 2023
e18c0c1
Apply Kira PR comments
BrunoQuaresma May 10, 2023
47ab467
Fix fmt
BrunoQuaresma May 10, 2023
6bb6f5b
Fix
BrunoQuaresma May 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply Kira PR comments
  • Loading branch information
BrunoQuaresma committed May 10, 2023
commit e18c0c1b69fa1a9de3375682f72624cf57572c7e
4 changes: 2 additions & 2 deletions site/src/components/AvatarData/AvatarData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export const AvatarData: FC<PropsWithChildren<AvatarDataProps>> = ({

const useStyles = makeStyles((theme) => ({
root: {
...theme.typography.body2,
minHeight: theme.spacing(5), // Make it predictable for the skeleton
width: "100%",
lineHeight: "150%",
},

info: {
Expand All @@ -58,7 +58,7 @@ const useStyles = makeStyles((theme) => ({
subtitle: {
fontSize: 12,
color: theme.palette.text.secondary,
lineHeight: "140%",
lineHeight: "150%",
maxWidth: 540,
},
}))
1 change: 1 addition & 0 deletions site/src/components/CodeExample/CodeExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const useStyles = makeStyles<Theme, styleProps>((theme) => ({
fontSize: 14,
borderRadius: theme.shape.borderRadius,
padding: theme.spacing(1),
lineHeight: "150%",
}),
code: {
padding: theme.spacing(0, 1),
Expand Down
1 change: 0 additions & 1 deletion site/src/components/EditRolesButton/EditRolesButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const Option: React.FC<{
<Checkbox
id={name}
size="small"
color="primary"
className={styles.checkbox}
value={value}
checked={isChecked}
Expand Down
10 changes: 3 additions & 7 deletions site/src/components/LicenseCard/LicenseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ export const LicenseCard = ({
>(undefined)

return (
<Paper
variant="outlined"
key={license.id}
elevation={2}
className={styles.licenseCard}
>
<Paper key={license.id} elevation={2} className={styles.licenseCard}>
<ConfirmDialog
type="info"
hideCancel={false}
Expand Down Expand Up @@ -119,6 +114,7 @@ const useStyles = makeStyles((theme) => ({
fontWeight: 600,
},
licenseCard: {
...theme.typography.body2,
padding: theme.spacing(2),
},
cardContent: {
Expand All @@ -130,7 +126,7 @@ const useStyles = makeStyles((theme) => ({
},
accountType: {
fontWeight: 600,
fontSize: theme.typography.h4.fontSize,
fontSize: 24,
justifyContent: "center",
alignItems: "center",
textTransform: "capitalize",
Expand Down
1 change: 1 addition & 0 deletions site/src/components/PageHeader/FullWidthPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const useStyles = makeStyles((theme) => ({
fontSize: 18,
fontWeight: 500,
margin: 0,
lineHeight: "24px",
},
subtitle: {
fontSize: 14,
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/ParameterInput/ParameterInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ const ParameterField: React.FC<ParameterInputProps> = ({
<FormControlLabel
disabled={disabled}
value="true"
control={<Radio color="primary" disableRipple />}
control={<Radio />}
label="True"
/>
<FormControlLabel
disabled={disabled}
value="false"
control={<Radio color="primary" disableRipple />}
control={<Radio />}
label="False"
/>
</RadioGroup>
Expand Down
3 changes: 2 additions & 1 deletion site/src/components/PortForwardButton/PortForwardButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const TooltipView: React.FC<PortForwardButtonProps> = (props) => {
<TextField
label="Port"
type="number"
size="small"
value={port}
className={styles.portField}
onChange={(e) => {
Expand Down Expand Up @@ -204,6 +205,6 @@ const useStyles = makeStyles((theme) => ({
},

form: {
margin: theme.spacing(1.5, 0, 0),
margin: theme.spacing(2, 0),
},
}))
4 changes: 2 additions & 2 deletions site/src/components/Resources/AgentRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ const useStyles = makeStyles((theme) => ({
fontSize: 16,
borderLeft: `2px solid ${theme.palette.text.secondary}`,

"&:not(:first-child)": {
"&:not(:first-of-type)": {
borderTop: `2px solid ${theme.palette.divider}`,
},
},
Expand Down Expand Up @@ -538,7 +538,7 @@ const useStyles = makeStyles((theme) => ({
flexDirection: "column",
fontSize: 12,

"& > *:first-child": {
"& > *:first-of-type": {
fontWeight: 500,
color: theme.palette.text.secondary,
},
Expand Down
3 changes: 2 additions & 1 deletion site/src/components/Resources/ResourceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const useStyles = makeStyles((theme) => ({
borderRadius: theme.shape.borderRadius,
border: `1px solid ${theme.palette.divider}`,

"&:not(:first-child)": {
"&:not(:first-of-type)": {
borderTop: 0,
borderTopLeftRadius: 0,
borderTopRightRadius: 0,
Expand Down Expand Up @@ -150,6 +150,7 @@ const useStyles = makeStyles((theme) => ({

metadata: {
...theme.typography.body2,
lineHeight: "120%",
},

metadataLabel: {
Expand Down
6 changes: 3 additions & 3 deletions site/src/components/RichParameterInput/RichParameterInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ const RichParameterField: React.FC<RichParameterInputProps> = ({
<FormControlLabel
disabled={disabled}
value="true"
control={<Radio color="primary" size="small" disableRipple />}
control={<Radio size="small" />}
label="True"
/>
<FormControlLabel
disabled={disabled}
value="false"
control={<Radio color="primary" size="small" disableRipple />}
control={<Radio size="small" />}
label="False"
/>
</RadioGroup>
Expand All @@ -136,7 +136,7 @@ const RichParameterField: React.FC<RichParameterInputProps> = ({
disabled={disabled}
key={option.name}
value={option.value}
control={<Radio color="primary" size="small" disableRipple />}
control={<Radio size="small" />}
label={
<span className={styles.radioOption}>
{option.icon && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ export const TemplateVariableField: FC<TemplateVariableFieldProps> = ({
<FormControlLabel
disabled={disabled}
value="true"
control={<Radio color="primary" size="small" disableRipple />}
control={<Radio size="small" />}
label="True"
/>
<FormControlLabel
disabled={disabled}
value="false"
control={<Radio color="primary" size="small" disableRipple />}
control={<Radio size="small" />}
label="False"
/>
</RadioGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export const PublishTemplateVersionDialog: FC<
)
}}
name="isActiveVersion"
color="primary"
/>
}
/>
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Timeline/TimelineDateRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const useStyles = makeStyles((theme) => ({
dateRow: {
background: theme.palette.background.paper,

"&:not(:first-child) td": {
"&:not(:first-of-type) td": {
borderTop: `1px solid ${theme.palette.divider}`,
},
},
Expand Down
4 changes: 4 additions & 0 deletions site/src/components/Tooltips/HelpTooltip/HelpTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,20 @@ const useStyles = makeStyles((theme) => ({
marginTop: 0,
marginBottom: theme.spacing(1),
color: theme.palette.text.primary,
fontSize: 14,
fontWeight: 600,
},

text: {
marginTop: theme.spacing(0.5),
marginBottom: theme.spacing(0.5),
...theme.typography.body2,
},

link: {
display: "flex",
alignItems: "center",
...theme.typography.body2,
},

linkIcon: {
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/UserAutocomplete/UserAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export const UserAutocomplete: FC<UserAutocompleteProps> = ({
root: styles.inputRoot,
},
}}
InputLabelProps={{
shrink: true,
}}
/>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const useStyles = makeStyles<
alignItems: "center",
fontFamily: "Inter",

"&:first-child": {
"&:first-of-type": {
borderTopLeftRadius: theme.shape.borderRadius,
borderTopRightRadius: theme.shape.borderRadius,
borderTop: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ export const WorkspaceScheduleForm: FC<
name="autostartEnabled"
checked={form.values.autostartEnabled}
onChange={handleToggleAutostart}
color="primary"
/>
}
label={Language.startSwitch}
Expand Down Expand Up @@ -334,9 +333,7 @@ export const WorkspaceScheduleForm: FC<
disabled={isLoading || !form.values.autostartEnabled}
onChange={form.handleChange}
name={checkbox.name}
color="primary"
size="small"
disableRipple
/>
}
key={checkbox.name}
Expand All @@ -363,7 +360,6 @@ export const WorkspaceScheduleForm: FC<
name="autostopEnabled"
checked={form.values.autostopEnabled}
onChange={handleToggleAutostop}
color="primary"
/>
}
label={Language.stopSwitch}
Expand Down
4 changes: 3 additions & 1 deletion site/src/components/WorkspaceStats/WorkspaceStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const useStyles = makeStyles((theme) => ({
gap: 0,
padding: 0,

"& > span:first-child": {
"& > span:first-of-type": {
fontSize: 12,
fontWeight: 500,
},
Expand All @@ -346,6 +346,8 @@ const useStyles = makeStyles((theme) => ({
scheduleButton: {
border: `1px solid ${theme.palette.divider}`,
borderRadius: 4,
width: 20,
height: 20,

"& svg.MuiSvgIcon-root": {
width: theme.spacing(1.5),
Expand Down
3 changes: 0 additions & 3 deletions site/src/pages/CreateTemplatePage/CreateTemplateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ export const CreateTemplateForm: FC<CreateTemplateFormProps> = ({
<Checkbox
id="allow_user_autostart"
size="small"
color="primary"
disabled={isSubmitting || !allowAdvancedScheduling}
onChange={async () => {
await form.setFieldValue(
Expand All @@ -363,7 +362,6 @@ export const CreateTemplateForm: FC<CreateTemplateFormProps> = ({
<Checkbox
id="allow-user-autostop"
size="small"
color="primary"
disabled={isSubmitting || !allowAdvancedScheduling}
onChange={async () => {
await form.setFieldValue(
Expand Down Expand Up @@ -398,7 +396,6 @@ export const CreateTemplateForm: FC<CreateTemplateFormProps> = ({
<label htmlFor="allow_user_cancel_workspace_jobs">
<Stack direction="row" spacing={1}>
<Checkbox
color="primary"
id="allow_user_cancel_workspace_jobs"
name="allow_user_cancel_workspace_jobs"
disabled={isSubmitting}
Expand Down
4 changes: 2 additions & 2 deletions site/src/pages/CreateTemplatePage/VariableInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ const VariableField: React.FC<VariableInputProps> = ({
<FormControlLabel
disabled={disabled}
value="true"
control={<Radio color="primary" size="small" disableRipple />}
control={<Radio size="small" />}
label="True"
/>
<FormControlLabel
disabled={disabled}
value="false"
control={<Radio color="primary" size="small" disableRipple />}
control={<Radio size="small" />}
label="False"
/>
</RadioGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export const AppearanceSettingsPageView = ({
<FormControlLabel
control={
<Switch
color="primary"
checked={serviceBannerForm.values.enabled}
onChange={async () => {
const newState = !serviceBannerForm.values.enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
<label htmlFor="allow_user_cancel_workspace_jobs">
<Stack direction="row" spacing={1}>
<Checkbox
color="primary"
id="allow_user_cancel_workspace_jobs"
name="allow_user_cancel_workspace_jobs"
disabled={isSubmitting}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
<Checkbox
id="allow_user_autostart"
size="small"
color="primary"
disabled={isSubmitting || !allowAdvancedScheduling}
onChange={async () => {
await form.setFieldValue(
Expand All @@ -295,7 +294,6 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
<Checkbox
id="allow-user-autostop"
size="small"
color="primary"
disabled={isSubmitting || !allowAdvancedScheduling}
onChange={async () => {
await form.setFieldValue(
Expand Down Expand Up @@ -332,7 +330,6 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
name="failureCleanupEnabled"
checked={form.values.failure_cleanup_enabled}
onChange={handleToggleFailureCleanup}
color="primary"
/>
}
label="Enable Failure Cleanup"
Expand Down Expand Up @@ -365,7 +362,6 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
name="inactivityCleanupEnabled"
checked={form.values.inactivity_cleanup_enabled}
onChange={handleToggleInactivityCleanup}
color="primary"
/>
}
label="Enable Inactivity Cleanup"
Expand Down
Loading