Skip to content

Commit 8614a4b

Browse files
committed
update ui
1 parent 0c9853d commit 8614a4b

1 file changed

Lines changed: 47 additions & 20 deletions

File tree

apps/sim/ee/access-control/components/access-control.tsx

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,11 @@ export function AccessControl() {
703703
]
704704

705705
const assignedCategories = new Set(categoryGroups.flat())
706-
const unassigned = Object.keys(platformCategories).filter((c) => !assignedCategories.has(c))
706+
// Files has its own section below (with the file-sharing auth modes), so it
707+
// stays out of the feature-toggle grid.
708+
const unassigned = Object.keys(platformCategories).filter(
709+
(c) => c !== 'Files' && !assignedCategories.has(c)
710+
)
707711
const groups = unassigned.length > 0 ? [...categoryGroups, unassigned] : categoryGroups
708712

709713
return groups
@@ -1689,26 +1693,49 @@ export function AccessControl() {
16891693
</div>
16901694
<div className='mt-8 flex flex-col gap-1.5'>
16911695
<span className='font-medium text-[var(--text-tertiary)] text-xs uppercase tracking-wide'>
1692-
File Sharing Methods
1696+
Files
16931697
</span>
1694-
<p className='text-[var(--text-secondary)] text-xs'>
1695-
Auth modes that public file-share links may use.
1696-
</p>
1697-
<div className='flex max-w-md flex-col gap-0.5 pt-1'>
1698-
{FILE_SHARE_AUTH_TYPE_OPTIONS.map(({ value, label }) => (
1699-
<label
1700-
key={value}
1701-
htmlFor={`fsauth-${value}`}
1702-
className='flex cursor-pointer items-center gap-2 rounded-md px-2 py-[5px] transition-colors hover-hover:bg-[var(--surface-active)]'
1703-
>
1704-
<Checkbox
1705-
id={`fsauth-${value}`}
1706-
checked={isFileShareAuthAllowed(value)}
1707-
onCheckedChange={() => toggleFileShareAuthType(value)}
1708-
/>
1709-
<span className='font-normal text-sm'>{label}</span>
1710-
</label>
1711-
))}
1698+
<label
1699+
htmlFor='disable-public-file-sharing'
1700+
className='flex cursor-pointer items-center gap-2 rounded-md px-2 py-[5px] transition-colors hover-hover:bg-[var(--surface-active)]'
1701+
>
1702+
<Checkbox
1703+
id='disable-public-file-sharing'
1704+
checked={!editingConfig?.disablePublicFileSharing}
1705+
onCheckedChange={(checked) =>
1706+
setEditingConfig((prev) =>
1707+
prev ? { ...prev, disablePublicFileSharing: checked !== true } : prev
1708+
)
1709+
}
1710+
/>
1711+
<span className='font-normal text-sm'>Public Sharing</span>
1712+
</label>
1713+
<div
1714+
className={cn(
1715+
'flex flex-col gap-1 pt-1',
1716+
editingConfig?.disablePublicFileSharing && 'opacity-50'
1717+
)}
1718+
>
1719+
<span className='px-2 text-[var(--text-secondary)] text-xs'>
1720+
Auth modes public file-share links may use
1721+
</span>
1722+
<div className='flex flex-wrap gap-x-4'>
1723+
{FILE_SHARE_AUTH_TYPE_OPTIONS.map(({ value, label }) => (
1724+
<label
1725+
key={value}
1726+
htmlFor={`fsauth-${value}`}
1727+
className='flex cursor-pointer items-center gap-2 rounded-md px-2 py-[5px] transition-colors hover-hover:bg-[var(--surface-active)]'
1728+
>
1729+
<Checkbox
1730+
id={`fsauth-${value}`}
1731+
checked={isFileShareAuthAllowed(value)}
1732+
onCheckedChange={() => toggleFileShareAuthType(value)}
1733+
disabled={editingConfig?.disablePublicFileSharing}
1734+
/>
1735+
<span className='font-normal text-sm'>{label}</span>
1736+
</label>
1737+
))}
1738+
</div>
17121739
</div>
17131740
</div>
17141741
</div>

0 commit comments

Comments
 (0)