Skip to content

Commit 78ed32c

Browse files
committed
fix(access-control): merge triggers into tools section in blocks tab
1 parent d04e7f4 commit 78ed32c

File tree

1 file changed

+2
-43
lines changed

1 file changed

+2
-43
lines changed

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

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -500,19 +500,13 @@ export function AccessControl() {
500500
return allBlocks.filter((b) => b.name.toLowerCase().includes(query))
501501
}, [allBlocks, integrationSearchTerm])
502502

503-
const filteredTriggerBlocks = useMemo(() => {
504-
return filteredBlocks
505-
.filter((block) => block.category === 'triggers')
506-
.sort((a, b) => a.name.localeCompare(b.name))
507-
}, [filteredBlocks])
508-
509503
const filteredCoreBlocks = useMemo(() => {
510504
return filteredBlocks.filter((block) => block.category === 'blocks')
511505
}, [filteredBlocks])
512506

513507
const filteredToolBlocks = useMemo(() => {
514508
return filteredBlocks
515-
.filter((block) => block.category === 'tools')
509+
.filter((block) => block.category === 'tools' || block.category === 'triggers')
516510
.sort((a, b) => a.name.localeCompare(b.name))
517511
}, [filteredBlocks])
518512

@@ -1009,43 +1003,8 @@ export function AccessControl() {
10091003
</Button>
10101004
</div>
10111005
<div className='flex flex-col gap-4'>
1012-
{filteredTriggerBlocks.length > 0 && (
1013-
<div className='flex flex-col gap-1.5'>
1014-
<span className='font-medium text-[var(--text-tertiary)] text-xs uppercase tracking-wide'>
1015-
Triggers
1016-
</span>
1017-
<div className='grid grid-cols-3 gap-x-2 gap-y-0.5'>
1018-
{filteredTriggerBlocks.map((block) => {
1019-
const BlockIcon = block.icon
1020-
const checkboxId = `block-${block.type}`
1021-
return (
1022-
<label
1023-
key={block.type}
1024-
htmlFor={checkboxId}
1025-
className='flex cursor-pointer items-center gap-2 rounded-md px-2 py-[5px] transition-colors hover-hover:bg-[var(--surface-2)]'
1026-
>
1027-
<Checkbox
1028-
id={checkboxId}
1029-
checked={isIntegrationAllowed(block.type)}
1030-
onCheckedChange={() => toggleIntegration(block.type)}
1031-
/>
1032-
<div
1033-
className='relative flex h-[16px] w-[16px] flex-shrink-0 items-center justify-center overflow-hidden rounded-sm'
1034-
style={{ background: block.bgColor }}
1035-
>
1036-
{BlockIcon && (
1037-
<BlockIcon className='!h-[10px] !w-[10px] text-white' />
1038-
)}
1039-
</div>
1040-
<span className='truncate font-medium text-sm'>{block.name}</span>
1041-
</label>
1042-
)
1043-
})}
1044-
</div>
1045-
</div>
1046-
)}
10471006
{filteredCoreBlocks.length > 0 && (
1048-
<div className='flex flex-col gap-1.5 border-[var(--border)] border-t pt-4'>
1007+
<div className='flex flex-col gap-1.5'>
10491008
<span className='font-medium text-[var(--text-tertiary)] text-xs uppercase tracking-wide'>
10501009
Core Blocks
10511010
</span>

0 commit comments

Comments
 (0)