Skip to content

Commit ffd12e1

Browse files
authored
fix(subblocks): update guardrails pii selector component to use emcn (#2164)
1 parent 84c2335 commit ffd12e1

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/grouped-checkbox-list/grouped-checkbox-list.tsx

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useMemo, useState } from 'react'
44
import { Settings2 } from 'lucide-react'
5-
import { Button } from '@/components/ui/button'
5+
import { Button } from '@/components/emcn/components'
66
import { Checkbox } from '@/components/ui/checkbox'
77
import {
88
Dialog,
@@ -11,6 +11,7 @@ import {
1111
DialogTitle,
1212
DialogTrigger,
1313
} from '@/components/ui/dialog'
14+
import { cn } from '@/lib/core/utils/cn'
1415
import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value'
1516

1617
interface GroupedCheckboxListProps {
@@ -81,25 +82,38 @@ export function GroupedCheckboxList({
8182

8283
const SelectedCountDisplay = () => {
8384
if (noneSelected) {
84-
return <span className='text-muted-foreground text-sm'>None selected</span>
85+
return (
86+
<span className='truncate font-medium text-[var(--text-muted)] text-sm'>None selected</span>
87+
)
8588
}
8689
if (allSelected) {
87-
return <span className='text-sm'>All selected</span>
90+
return (
91+
<span className='truncate font-medium text-[var(--text-primary)] text-sm'>
92+
All selected
93+
</span>
94+
)
8895
}
89-
return <span className='text-sm'>{selectedValues.length} selected</span>
96+
return (
97+
<span className='truncate font-medium text-[var(--text-primary)] text-sm'>
98+
{selectedValues.length} selected
99+
</span>
100+
)
90101
}
91102

92103
return (
93104
<Dialog open={open} onOpenChange={setOpen}>
94105
<DialogTrigger asChild>
95106
<Button
96-
variant='outline'
97-
className='h-10 w-full justify-between border-input bg-background px-3 font-normal text-sm hover:bg-accent hover:text-accent-foreground'
107+
variant='ghost'
98108
disabled={disabled}
109+
className={cn(
110+
'flex w-full cursor-pointer items-center justify-between rounded-[4px] border border-[var(--surface-11)] bg-[var(--surface-6)] px-[8px] py-[6px] font-medium font-sans text-[var(--text-primary)] text-sm outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-[var(--surface-9)]',
111+
'hover:border-[var(--surface-14)] hover:bg-[var(--surface-9)] dark:hover:border-[var(--surface-13)] dark:hover:bg-[var(--surface-11)]'
112+
)}
99113
>
100-
<span className='flex items-center gap-2 text-muted-foreground'>
101-
<Settings2 className='h-4 w-4' />
102-
<span>Configure PII Types</span>
114+
<span className='flex flex-1 items-center gap-2 truncate text-[var(--text-muted)]'>
115+
<Settings2 className='h-4 w-4 flex-shrink-0 opacity-50' />
116+
<span className='truncate'>Configure PII Types</span>
103117
</span>
104118
<SelectedCountDisplay />
105119
</Button>
@@ -137,13 +151,7 @@ export function GroupedCheckboxList({
137151
Select all entities
138152
</label>
139153
</div>
140-
<Button
141-
variant='ghost'
142-
size='sm'
143-
onClick={handleClear}
144-
disabled={disabled || noneSelected}
145-
className='w-[85px]'
146-
>
154+
<Button variant='ghost' onClick={handleClear} disabled={disabled || noneSelected}>
147155
<span className='flex items-center gap-1'>
148156
Clear{!noneSelected && <span>({selectedValues.length})</span>}
149157
</span>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,11 @@ export function ToolInput({
19981998
value={tool.params.credential || ''}
19991999
onChange={(value) => handleParamChange(toolIndex, 'credential', value)}
20002000
provider={oauthConfig.provider as OAuthProvider}
2001-
requiredScopes={getCanonicalScopesForProvider(oauthConfig.provider)}
2001+
requiredScopes={
2002+
toolBlock?.subBlocks?.find((sb) => sb.id === 'credential')
2003+
?.requiredScopes ||
2004+
getCanonicalScopesForProvider(oauthConfig.provider)
2005+
}
20022006
label={`Select ${oauthConfig.provider} account`}
20032007
serviceId={oauthConfig.provider}
20042008
disabled={disabled}

0 commit comments

Comments
 (0)