Skip to content

Commit

Permalink
LIMITED > GRANTED_FOR_TAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg committed Nov 19, 2024
1 parent 8482f89 commit 29051be
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions frontend/web/components/EditPermissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const SingleValue = (props: SingleValueProps<any>) => {
{props.data.value === 'GRANTED' && (
<Icon width={18} name='checkmark' fill='#27AB95' />
)}
{props.data.value === 'LIMITED' && (
{props.data.value === 'GRANTED_FOR_TAGS' && (
<Icon width={18} name='shield' fill='#ff9f43' />
)}
{props.children}
Expand Down Expand Up @@ -126,7 +126,7 @@ type EntityPermissions = Omit<
}
const permissionOptions = [
{ label: 'Granted', value: 'GRANTED' },
{ label: 'Granted for tags', value: 'LIMITED' },
{ label: 'Granted for tags', value: 'GRANTED_FOR_TAGS' },
{ label: 'None', value: 'NONE' },
]
const withAdminPermissions = (InnerComponent: any) => {
Expand Down Expand Up @@ -481,7 +481,7 @@ const _EditPermissionsModal: FC<EditPermissionModalType> = withAdminPermissions(
if (!permission) return 'NONE'

if (permission.tags?.length || limitedPermissions.includes(key)) {
return 'LIMITED'
return 'GRANTED_FOR_TAGS'
}

return 'GRANTED'
Expand Down Expand Up @@ -588,7 +588,7 @@ const _EditPermissionsModal: FC<EditPermissionModalType> = withAdminPermissions(

const selectPermissions = (
key: string,
value: 'GRANTED' | 'LIMITED' | 'NONE',
value: 'GRANTED' | 'GRANTED_FOR_TAGS' | 'NONE',
tags: number[] = [],
) => {
const updatedPermissions = [
Expand All @@ -615,7 +615,7 @@ const _EditPermissionsModal: FC<EditPermissionModalType> = withAdminPermissions(
]),
})
}
if (value === 'LIMITED') {
if (value === 'GRANTED_FOR_TAGS') {
setLimitedPermissions(updatedLimitedPermissions.concat([key]))
} else {
setLimitedPermissions(updatedLimitedPermissions)
Expand Down Expand Up @@ -855,13 +855,13 @@ const _EditPermissionsModal: FC<EditPermissionModalType> = withAdminPermissions(
<div className='list-item-subtitle'>
{p.description}
</div>
{permissionType === 'LIMITED' && (
{permissionType === 'GRANTED_FOR_TAGS' && (
<AddEditTags
projectId={`${projectId}`}
value={permission?.tags || []}
onChange={(v) => {
setValueChanged(true)
selectPermissions(p.key, 'LIMITED', v)
selectPermissions(p.key, 'GRANTED_FOR_TAGS', v)
}}
/>
)}
Expand Down

0 comments on commit 29051be

Please sign in to comment.