Skip to content

Commit

Permalink
address some feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nl0 committed Jun 18, 2024
1 parent 46d982f commit 10d4302
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
5 changes: 4 additions & 1 deletion catalog/app/containers/Admin/UsersAndRoles/RoleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const validate: FF.FieldValidator<Value> = (v) => {

export const ROLE_NAME_ASC = R.ascend((r: Role) => r.name)

Check warning on line 25 in catalog/app/containers/Admin/UsersAndRoles/RoleSelect.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/Admin/UsersAndRoles/RoleSelect.tsx#L25

Added line #L25 was not covered by tests

const ITEM_HEIGHT = 46

Check warning on line 27 in catalog/app/containers/Admin/UsersAndRoles/RoleSelect.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/Admin/UsersAndRoles/RoleSelect.tsx#L27

Added line #L27 was not covered by tests

const useRoleSelectStyles = M.makeStyles((t) => ({

Check warning on line 29 in catalog/app/containers/Admin/UsersAndRoles/RoleSelect.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/Admin/UsersAndRoles/RoleSelect.tsx#L29

Added line #L29 was not covered by tests
grid: {
alignItems: 'center',
Expand All @@ -33,7 +35,8 @@ const useRoleSelectStyles = M.makeStyles((t) => ({
marginTop: t.spacing(2),
},
list: ({ roles }: { roles: number }) => ({

Check warning on line 37 in catalog/app/containers/Admin/UsersAndRoles/RoleSelect.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/Admin/UsersAndRoles/RoleSelect.tsx#L37

Added line #L37 was not covered by tests
height: `${46 * R.clamp(3, 4.5, roles)}px`,
// show no less than 3 and no more than 4 and a half items
height: `${ITEM_HEIGHT * R.clamp(3, 4.5, roles)}px`,
overflowY: 'auto',
}),
listEmpty: {
Expand Down
2 changes: 1 addition & 1 deletion catalog/app/containers/Admin/UsersAndRoles/Users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const DIALOG_PROPS: Dialogs.ExtraDialogProps = { maxWidth: 'xs', fullWidth: true

const useDialogFormStyles = M.makeStyles((t) => ({

Check warning on line 38 in catalog/app/containers/Admin/UsersAndRoles/Users.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/Admin/UsersAndRoles/Users.tsx#L38

Added line #L38 was not covered by tests
root: {
marginTop: t.spacing(-3),
marginTop: t.spacing(-2),
},
}))

Expand Down
16 changes: 7 additions & 9 deletions catalog/app/containers/NavBar/RoleSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SWITCH_ROLE_MUTATION from './gql/SwitchRole.generated'

type Me = NonNullable<GQL.DataForDoc<typeof ME_QUERY>['me']>

const useRoleSwitcherStyles = M.makeStyles({
const useRoleSwitcherStyles = M.makeStyles((t) => ({

Check warning on line 17 in catalog/app/containers/NavBar/RoleSwitcher.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/NavBar/RoleSwitcher.tsx#L17

Added line #L17 was not covered by tests
content: {
position: 'relative',
},
Expand All @@ -41,7 +41,11 @@ const useRoleSwitcherStyles = M.makeStyles({
overflow: 'hidden',
textOverflow: 'ellipsis',
},
})
hint: {
color: t.palette.text.hint,
fontWeight: t.typography.fontWeightLight,
},
}))

interface RoleSwitcherProps {
user: Me
Expand Down Expand Up @@ -130,13 +134,7 @@ function RoleSwitcher({ user, close }: RoleSwitcherProps) {
<M.ListItemText classes={{ primary: classes.name }}>
{role.name}
{role.name === user.role.name && (
<M.Box
component="span"
color="text.hint"
fontWeight="fontWeightLight"
>
&nbsp;(current)
</M.Box>
<span className={classes.hint}>&nbsp;(current)</span>

Check warning on line 137 in catalog/app/containers/NavBar/RoleSwitcher.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/NavBar/RoleSwitcher.tsx#L137

Added line #L137 was not covered by tests
)}
</M.ListItemText>
</M.ListItem>
Expand Down

0 comments on commit 10d4302

Please sign in to comment.