File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
site/src/pages/ManagementSettingsPage/CustomRolesPage Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { type Interpolation , type Theme , useTheme } from "@emotion/react" ;
2
2
import Stack from "@mui/material/Stack" ;
3
- import type { Permission , Role } from "api/typesGenerated" ;
3
+ import type { Permission } from "api/typesGenerated" ;
4
4
import { Pill } from "components/Pill/Pill" ;
5
5
import {
6
6
Popover ,
@@ -21,7 +21,7 @@ interface PermissionPillsListProps {
21
21
export const PermissionPillsList : FC < PermissionPillsListProps > = ( {
22
22
permissions,
23
23
} ) => {
24
- const resourceTypes : string [ ] = getUniqueResourceTypes ( permissions ) ;
24
+ const resourceTypes = getUniqueResourceTypes ( permissions ) ;
25
25
26
26
return (
27
27
< Stack direction = "row" spacing = { 1 } >
@@ -53,11 +53,9 @@ const PermissionsPill: FC<PermissionPillProps> = ({
53
53
resource,
54
54
permissions,
55
55
} ) => {
56
- const actions = permissions . filter ( ( p ) => {
57
- if ( resource === p . resource_type ) {
58
- return p . action ;
59
- }
60
- } ) ;
56
+ const actions = permissions . filter (
57
+ ( p ) => resource === p . resource_type && p . action ,
58
+ ) ;
61
59
62
60
return (
63
61
< Pill css = { styles . permissionPill } >
You can’t perform that action at this time.
0 commit comments