Skip to content

Commit f15777d

Browse files
author
Vikhyath Mondreti
committed
Merge remote-tracking branch 'origin/feat/connector-service-account-auth' into feat/connector-service-account-auth
2 parents 8f687a3 + 9a1821a commit f15777d

46 files changed

Lines changed: 2493 additions & 771 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/special-tags.tsx‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
'use client'
22

33
import { lazy, Suspense, useCallback, useEffect, useMemo, useState } from 'react'
4-
import {
5-
ArrowRight,
6-
Check,
7-
ChevronDown,
8-
cn,
9-
Expandable,
10-
ExpandableContent,
11-
SecretReveal,
12-
SquareArrowUpRight,
13-
Tooltip,
14-
toast,
15-
} from '@sim/emcn'
16-
import { TerminalWindow } from '@sim/emcn/icons'
4+
import { cn, Expandable, ExpandableContent, SecretReveal, Tooltip, toast } from '@sim/emcn'
5+
import { ArrowRight, Check, ChevronDown, SquareArrowUpRight, TerminalWindow } from '@sim/emcn/icons'
176
import { isRecordLike } from '@sim/utils/object'
187
import { useParams } from 'next/navigation'
198
import { ThinkingLoader } from '@/components/ui'

‎apps/sim/app/workspace/[workspaceId]/home/components/search-sources/search-sources.test.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const mocks = vi.hoisted(() => ({
1111
connect: vi.fn(),
1212
}))
1313
vi.mock('@/app/workspace/[workspaceId]/providers/workspace-host-provider', () => ({
14-
useWorkspaceHostContext: () => ({ features: { knowledgeMemberAccess: mocks.enabled() } }),
1514
useOptionalWorkspaceHostContext: () => ({ features: { knowledgeMemberAccess: mocks.enabled() } }),
1615
}))
1716
vi.mock('@/hooks/queries/workspace', () => ({

‎apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx‎

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {
1010
useRef,
1111
useState,
1212
} from 'react'
13-
import { Button, cn, Paperclip, Plus, Slash, Tooltip, toast } from '@sim/emcn'
13+
import { Chip, cn, Tooltip, toast } from '@sim/emcn'
14+
import { Paperclip, Plus, Slash } from '@sim/emcn/icons'
1415
import { createLogger } from '@sim/logger'
1516
import { useParams } from 'next/navigation'
1617
import { getMothershipAttachmentPreviewUrl } from '@/lib/copilot/chat/attachment-preview'
@@ -711,43 +712,34 @@ const UserInputImpl = forwardRef<UserInputHandle, UserInputProps>(function UserI
711712
<>
712713
<Tooltip.Root>
713714
<Tooltip.Trigger asChild>
714-
<Button
715-
type='button'
716-
variant='ghost'
715+
<Chip
716+
shape='round'
717+
leftIcon={Plus}
717718
onClick={handlePlusClick}
718719
aria-label='Add resources'
719-
className='size-[28px] rounded-full p-0 hover-hover:bg-[var(--surface-hover)]'
720-
>
721-
<Plus className='size-[16px] text-[var(--text-icon)]' />
722-
</Button>
720+
/>
723721
</Tooltip.Trigger>
724722
<Tooltip.Content side='top'>Add resources</Tooltip.Content>
725723
</Tooltip.Root>
726724
<Tooltip.Root>
727725
<Tooltip.Trigger asChild>
728-
<Button
729-
type='button'
730-
variant='ghost'
726+
<Chip
727+
shape='round'
728+
leftIcon={Paperclip}
731729
onClick={handleFileSelectStable}
732730
aria-label='Attach file'
733-
className='size-[28px] rounded-full p-0 hover-hover:bg-[var(--surface-hover)]'
734-
>
735-
<Paperclip className='size-[16px] text-[var(--text-icon)]' />
736-
</Button>
731+
/>
737732
</Tooltip.Trigger>
738733
<Tooltip.Content side='top'>Attach file</Tooltip.Content>
739734
</Tooltip.Root>
740735
<Tooltip.Root>
741736
<Tooltip.Trigger asChild>
742-
<Button
743-
type='button'
744-
variant='ghost'
737+
<Chip
738+
shape='round'
739+
leftIcon={Slash}
745740
onClick={handleSlashTriggerClick}
746741
aria-label='Skills'
747-
className='size-[28px] rounded-full p-0 hover-hover:bg-[var(--surface-hover)]'
748-
>
749-
<Slash className='size-[16px] text-[var(--text-icon)]' />
750-
</Button>
742+
/>
751743
</Tooltip.Trigger>
752744
<Tooltip.Content side='top'>Skills</Tooltip.Content>
753745
</Tooltip.Root>

‎apps/sim/app/workspace/[workspaceId]/integrations/components/connect-slack-bot-modal/connect-slack-bot-modal.tsx‎

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { type ReactNode, useCallback, useEffect, useMemo, useState } from 'react'
3+
import { type ReactNode, useEffect, useMemo, useState } from 'react'
44
import {
55
Button,
66
Chip,
@@ -10,7 +10,6 @@ import {
1010
ChipModalField,
1111
Code,
1212
CopyCodeButton,
13-
Label,
1413
SecretInput,
1514
Wizard,
1615
} from '@sim/emcn'
@@ -167,7 +166,7 @@ export function ConnectSlackBotModal({
167166

168167
// Shared server-side derivation: uses the app public base (not
169168
// window.location.origin) so Slack's servers can reach it.
170-
const requestUrl = useMemo(() => buildSlackCustomBotRequestUrl(credentialId), [credentialId])
169+
const requestUrl = buildSlackCustomBotRequestUrl(credentialId)
171170

172171
const descriptionError = getAgentDescriptionError(appDescription)
173172
const slashCommandsError = getSlashCommandsError(slashCommands)
@@ -204,7 +203,7 @@ export function ConnectSlackBotModal({
204203
])
205204

206205
const capabilityIds = useMemo(() => [...selected], [selected])
207-
const setCapabilityIds = useCallback((next: string[]) => setSelected(new Set(next)), [])
206+
const setCapabilityIds = (next: string[]) => setSelected(new Set(next))
208207

209208
const isPending = createCredential.isPending || updateCredential.isPending
210209

@@ -495,10 +494,7 @@ function StepCreate({ manifestJson }: StepCreateProps) {
495494
<div className='mt-2 overflow-hidden rounded-md border border-[var(--border-1)]'>
496495
<div className='flex items-center justify-between border-[var(--border-1)] border-b bg-[var(--surface-4)] px-3 py-1'>
497496
<span className='font-sans text-[var(--text-tertiary)] text-xs'>manifest.json</span>
498-
<CopyCodeButton
499-
code={manifestJson}
500-
className='text-[var(--text-tertiary)] hover-hover:bg-[var(--surface-5)] hover-hover:text-[var(--text-secondary)]'
501-
/>
497+
<CopyCodeButton code={manifestJson} />
502498
</div>
503499
<Code.Viewer code={manifestJson} language='json' wrapText className='max-h-[180px]' />
504500
</div>
@@ -579,10 +575,9 @@ interface SecretFieldProps {
579575
}
580576
function SecretField({ label, value, onChange, placeholder }: SecretFieldProps) {
581577
return (
582-
<div className='flex flex-col gap-[9px]'>
583-
<Label className='text-[var(--text-muted)] text-small'>{label}</Label>
578+
<ChipModalField type='custom' title={label}>
584579
<SecretInput value={value} onChange={onChange} placeholder={placeholder} />
585-
</div>
580+
</ChipModalField>
586581
)
587582
}
588583

@@ -605,9 +600,7 @@ function StepDone({ pending, created, error, onRetry }: StepDoneProps) {
605600
return (
606601
<div className='flex flex-col items-center gap-3 py-10 text-center'>
607602
<p className='max-w-sm text-[var(--text-error)] text-sm leading-relaxed'>{error}</p>
608-
<Button variant='default' onClick={onRetry}>
609-
Try again
610-
</Button>
603+
<Chip onClick={onRetry}>Try again</Chip>
611604
</div>
612605
)
613606
}
Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
import type { ReactNode } from 'react'
2-
import { RESOURCE_LIST_GRID } from '@/app/workspace/[workspaceId]/settings/components/settings-resource-row'
2+
import {
3+
RESOURCE_LIST_GRID,
4+
RESOURCE_LIST_STACK,
5+
} from '@/app/workspace/[workspaceId]/settings/components/settings-resource-row'
36
import { SettingsSection } from '@/app/workspace/[workspaceId]/settings/components/settings-section/settings-section'
47

58
interface IntegrationSectionProps {
69
label: string
10+
description?: string
11+
layout?: 'grid' | 'list'
712
children: ReactNode
813
}
914

1015
/**
1116
* Labeled section used throughout the integrations surface: the shared
1217
* {@link SettingsSection} label/divider chrome wrapped around the shared
13-
* responsive card grid, so the integrations list, the connected credentials
18+
* resource grid or list, so the integrations list, the connected credentials
1419
* list, and the integration detail templates cannot drift from settings.
1520
*/
16-
export function IntegrationSection({ label, children }: IntegrationSectionProps) {
21+
export function IntegrationSection({
22+
label,
23+
description,
24+
layout = 'grid',
25+
children,
26+
}: IntegrationSectionProps) {
1727
return (
1828
<SettingsSection label={label}>
19-
<div className={RESOURCE_LIST_GRID}>{children}</div>
29+
{description && (
30+
<p className='mb-3 text-[var(--text-muted)] text-caption leading-relaxed'>{description}</p>
31+
)}
32+
<div className={layout === 'list' ? RESOURCE_LIST_STACK : RESOURCE_LIST_GRID}>{children}</div>
2033
</SettingsSection>
2134
)
2235
}

‎apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/document.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import {
5656
documentParsers,
5757
documentUrlKeys,
5858
} from '@/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/search-params'
59-
import { ActionBar } from '@/app/workspace/[workspaceId]/knowledge/[id]/components'
59+
import { ActionBar } from '@/app/workspace/[workspaceId]/knowledge/[id]/components/action-bar'
6060
import { getDocumentIcon } from '@/app/workspace/[workspaceId]/knowledge/components'
6161
import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
6262
import { CONNECTOR_META_REGISTRY } from '@/connectors/registry'

‎apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx‎

Lines changed: 39 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'
44
import {
55
Badge,
6-
Button,
6+
Chip,
77
ChipConfirmModal,
88
type ChipConfirmTextSegment,
99
ChipDatePicker,
@@ -16,7 +16,6 @@ import {
1616
cellIconNodeClass,
1717
chipContentGap,
1818
chipContentLabelClass,
19-
chipVariants,
2019
cn,
2120
FloatingTooltip,
2221
isTextClipped,
@@ -1067,20 +1066,18 @@ export function KnowledgeBase({
10671066
() => (
10681067
<AutoWidthPanel>
10691068
<div className='flex flex-col gap-2'>
1070-
<div className='flex h-5 items-center justify-between'>
1069+
<div className='flex items-center justify-between'>
10711070
<span className={FILTER_SECTION_LABEL_CLASS}>Status</span>
10721071
{enabledFilter !== 'all' && (
1073-
<Button
1074-
variant='ghost'
1072+
<Chip
10751073
onClick={() => {
10761074
setEnabledFilter('all')
10771075
setSelectedDocuments(new Set())
10781076
setIsSelectAllMode(false)
10791077
}}
1080-
className='-mr-1 h-auto px-1 py-0.5 text-[var(--text-muted)] text-caption hover-hover:text-[var(--text-secondary)]'
10811078
>
10821079
Clear
1083-
</Button>
1080+
</Chip>
10841081
)}
10851082
</div>
10861083
<ChipDropdown
@@ -1119,35 +1116,34 @@ export function KnowledgeBase({
11191116
const ConnectorIcon = def?.icon
11201117
const syncInFlight = isConnectorSyncingOrPending(connector)
11211118
return (
1122-
<button
1119+
<Chip
11231120
key={connector.id}
1124-
type='button'
11251121
onClick={() => setShowConnectorsModal(true)}
1126-
className={cn(chipVariants({ variant: 'filled' }), 'max-w-[180px]')}
1122+
className='max-w-[180px]'
1123+
leftAdornment={
1124+
<span className='relative flex size-[14px] shrink-0 items-center justify-center'>
1125+
{syncInFlight ? (
1126+
<Loader className='size-[14px]' animate />
1127+
) : (
1128+
ConnectorIcon && <BrandIcon icon={ConnectorIcon} className='size-[14px]' />
1129+
)}
1130+
{connector.status !== 'active' && !syncInFlight && (
1131+
<span
1132+
className={cn(
1133+
'-right-0.5 -top-0.5 absolute size-1.5 rounded-xs border border-[var(--surface-2)]',
1134+
connector.status === 'error'
1135+
? 'bg-[var(--text-error)]'
1136+
: connector.status === 'disabled'
1137+
? 'bg-[var(--caution)]'
1138+
: 'bg-[var(--text-muted)]'
1139+
)}
1140+
/>
1141+
)}
1142+
</span>
1143+
}
11271144
>
1128-
<span className='relative flex size-[14px] shrink-0 items-center justify-center'>
1129-
{syncInFlight ? (
1130-
<Loader className='size-[14px]' animate />
1131-
) : (
1132-
ConnectorIcon && <BrandIcon icon={ConnectorIcon} className='size-[14px]' />
1133-
)}
1134-
{connector.status !== 'active' && !syncInFlight && (
1135-
<span
1136-
className={cn(
1137-
'-right-0.5 -top-0.5 absolute size-1.5 rounded-xs border border-[var(--surface-2)]',
1138-
connector.status === 'error'
1139-
? 'bg-[var(--text-error)]'
1140-
: connector.status === 'disabled'
1141-
? 'bg-[var(--caution)]'
1142-
: 'bg-[var(--text-muted)]'
1143-
)}
1144-
/>
1145-
)}
1146-
</span>
1147-
<span className='truncate text-[var(--text-body)]'>
1148-
{def?.name || connector.connectorType}
1149-
</span>
1150-
</button>
1145+
{def?.name || connector.connectorType}
1146+
</Chip>
11511147
)
11521148
})}
11531149
</>
@@ -1770,17 +1766,9 @@ function TagFilterSection({ tagDefinitions, entries, onChange }: TagFilterSectio
17701766

17711767
return (
17721768
<div className='mt-3 border-[var(--border-1)] border-t pt-3'>
1773-
<div className='flex h-5 items-center justify-between'>
1769+
<div className='flex items-center justify-between'>
17741770
<span className={FILTER_SECTION_LABEL_CLASS}>Filter by tags</span>
1775-
{activeCount > 0 && (
1776-
<Button
1777-
variant='ghost'
1778-
className='-mr-1 h-auto px-1 py-0.5 text-[var(--text-muted)] text-caption hover-hover:text-[var(--text-secondary)]'
1779-
onClick={() => onChange([])}
1780-
>
1781-
Clear all
1782-
</Button>
1783-
)}
1771+
{activeCount > 0 && <Chip onClick={() => onChange([])}>Clear all</Chip>}
17841772
</div>
17851773

17861774
<div
@@ -1827,14 +1815,11 @@ function TagFilterSection({ tagDefinitions, entries, onChange }: TagFilterSectio
18271815
/>
18281816
)}
18291817
</div>
1830-
<Button
1831-
variant='ghost'
1832-
className='relative size-[30px] shrink-0 p-0 text-[var(--text-muted)] before:absolute before:inset-[-5px] before:content-[""] hover-hover:bg-[var(--surface-active)] hover-hover:text-[var(--text-error)]'
1818+
<Chip
18331819
onClick={() => removeFilter(entry.id)}
18341820
aria-label='Remove tag filter'
1835-
>
1836-
<X className='size-[14px]' />
1837-
</Button>
1821+
leftIcon={X}
1822+
/>
18381823
</div>
18391824
{entry.tagSlot && (
18401825
<TagFilterValueControl
@@ -1847,14 +1832,11 @@ function TagFilterSection({ tagDefinitions, entries, onChange }: TagFilterSectio
18471832
})}
18481833
</div>
18491834

1850-
<Button
1851-
variant='ghost'
1852-
onClick={addFilter}
1853-
className='mt-2 h-[30px] w-full justify-start gap-2 px-2 text-[var(--text-secondary)] text-caption hover-hover:text-[var(--text-primary)]'
1854-
>
1855-
<Plus className='size-[14px]' />
1856-
Add filter
1857-
</Button>
1835+
<div className='mt-2'>
1836+
<Chip fullWidth leftIcon={Plus} onClick={addFilter}>
1837+
Add filter
1838+
</Chip>
1839+
</div>
18581840
</div>
18591841
)
18601842
}

0 commit comments

Comments
 (0)