Skip to content

Commit 8d35586

Browse files
emir-karabegwaleedlatif1
authored andcommitted
Clarify credentials, permissions and setup on integration details
1 parent 9a30f34 commit 8d35586

11 files changed

Lines changed: 81 additions & 106 deletions

File tree

‎apps/sim/platform/app/(shell)/integrations/_components/connected-credential/connected-credential.module.css‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
.section {
2+
display: grid;
3+
gap: var(--ui-row-gap);
4+
}
15
.identity {
26
display: grid;
37
min-inline-size: 0;
48
gap: var(--ui-stack-gap);
9+
overflow-wrap: anywhere;
510
}
6-
.credential {
11+
.row {
712
display: flex;
813
align-items: center;
914
justify-content: space-between;

‎apps/sim/platform/app/(shell)/integrations/_components/connected-credential/connected-credential.tsx‎

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,44 +22,44 @@ export function ConnectedCredential({
2222
}: ConnectedCredentialProps) {
2323
const [confirming, setConfirming] = useState(false)
2424
return (
25-
<section aria-label='Connected credential' className={styles.credential}>
26-
<div className={styles.identity}>
27-
<h2 className={styles.muted} data-type='T050'>
28-
Connected credential
29-
</h2>
30-
<p data-type='T059'>{account.label}</p>
31-
{status && (
32-
<p className={styles.muted} data-type='T050'>
33-
{status}
34-
</p>
35-
)}
25+
<section aria-label='Connected credential' className={styles.section}>
26+
<h2 data-type='T042'>Connected credential</h2>
27+
<div className={styles.row}>
28+
<div className={styles.identity}>
29+
<p data-type='T059'>{account.label}</p>
30+
{status && (
31+
<p className={styles.muted} data-type='T050'>
32+
{status}
33+
</p>
34+
)}
35+
</div>
36+
<ActionMenu
37+
label={`Manage ${account.label}`}
38+
icon='I108'
39+
triggerSize='row'
40+
align='end'
41+
tooltip={false}
42+
actions={[
43+
...(account.canReconnect
44+
? [
45+
{
46+
id: 'reconnect',
47+
label: 'Reconnect account',
48+
disabled: !canAuthorize,
49+
onSelect: onReconnect,
50+
},
51+
]
52+
: []),
53+
{
54+
id: 'disconnect',
55+
label: 'Disconnect account',
56+
destructive: true,
57+
separatorBefore: account.canReconnect,
58+
onSelect: () => setConfirming(true),
59+
},
60+
]}
61+
/>
3662
</div>
37-
<ActionMenu
38-
label={`Manage ${account.label}`}
39-
icon='I108'
40-
triggerSize='row'
41-
align='end'
42-
tooltip={false}
43-
actions={[
44-
...(account.canReconnect
45-
? [
46-
{
47-
id: 'reconnect',
48-
label: 'Reconnect account',
49-
disabled: !canAuthorize,
50-
onSelect: onReconnect,
51-
},
52-
]
53-
: []),
54-
{
55-
id: 'disconnect',
56-
label: 'Disconnect account',
57-
destructive: true,
58-
separatorBefore: account.canReconnect,
59-
onSelect: () => setConfirming(true),
60-
},
61-
]}
62-
/>
6363
{confirming && (
6464
<Modal
6565
open

‎apps/sim/platform/app/(shell)/integrations/_components/connection-access/connection-access.module.css‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
}
1717
.items {
1818
gap: var(--ui-list-gap);
19+
list-style: disc outside;
20+
padding-inline-start: var(--spacing-16);
1921
overflow-wrap: anywhere;
2022
}
21-
.items,
23+
.items li::marker,
2224
.heading p {
2325
color: var(--ui-secondary);
2426
}

‎apps/sim/platform/app/(shell)/integrations/_components/integration-details/integration-details.tsx‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,19 @@ export function IntegrationDetails({ integration, onChange }: IntegrationDetails
8484
titleRef={titleRef}
8585
description={integration.description}
8686
providerId={providerId}
87-
>
88-
{account && !staleCredential && (
89-
<ConnectedCredential
90-
account={account}
91-
status={memberStatus(integration)}
92-
canAuthorize={canAuthorize}
93-
onReconnect={() => {
94-
if (canAuthorize && account.canReconnect)
95-
onChange({ ...integration, account: { ...account, status: 'active' } })
96-
}}
97-
onDisconnect={disconnect}
98-
/>
99-
)}
100-
</ProviderHeading>
87+
/>
88+
{account && !staleCredential && (
89+
<ConnectedCredential
90+
account={account}
91+
status={memberStatus(integration)}
92+
canAuthorize={canAuthorize}
93+
onReconnect={() => {
94+
if (canAuthorize && account.canReconnect)
95+
onChange({ ...integration, account: { ...account, status: 'active' } })
96+
}}
97+
onDisconnect={disconnect}
98+
/>
99+
)}
101100
{staleCredential ? (
102101
<EmptyState
103102
title='This credential is no longer connected'

‎apps/sim/platform/app/(shell)/integrations/_components/provider-heading/provider-heading.module.css‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@
99
place-items: center;
1010
block-size: var(--leading-32);
1111
}
12-
.content,
1312
.copy {
1413
display: grid;
1514
min-inline-size: 0;
1615
overflow-wrap: anywhere;
17-
}
18-
.content {
19-
gap: var(--ui-section-gap);
20-
}
21-
.copy {
2216
gap: var(--ui-stack-gap);
2317
}
2418
.copy p {

‎apps/sim/platform/app/(shell)/integrations/_components/provider-heading/provider-heading.tsx‎

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,25 @@
1-
import type { ReactNode, Ref } from 'react'
1+
import type { Ref } from 'react'
22
import styles from '@/platform/app/(shell)/integrations/_components/provider-heading/provider-heading.module.css'
33
import { Icon } from '@/platform/design-system/components'
44

55
interface ProviderHeadingProps {
66
name: string
77
description: string
88
providerId?: string
9-
children?: ReactNode
109
titleRef?: Ref<HTMLHeadingElement>
1110
}
1211

13-
export function ProviderHeading({
14-
name,
15-
description,
16-
providerId,
17-
children,
18-
titleRef,
19-
}: ProviderHeadingProps) {
12+
export function ProviderHeading({ name, description, providerId, titleRef }: ProviderHeadingProps) {
2013
return (
2114
<header className={styles.header}>
2215
<span className={styles.mark}>
2316
{providerId ? <Icon providerId={providerId} /> : <Icon name='I070' />}
2417
</span>
25-
<div className={styles.content}>
26-
<div className={styles.copy}>
27-
<h1 ref={titleRef} tabIndex={titleRef ? -1 : undefined} data-type='T076'>
28-
{name}
29-
</h1>
30-
<p data-type='T048'>{description}</p>
31-
</div>
32-
{children}
18+
<div className={styles.copy}>
19+
<h1 ref={titleRef} tabIndex={titleRef ? -1 : undefined} data-type='T076'>
20+
{name}
21+
</h1>
22+
<p data-type='T048'>{description}</p>
3323
</div>
3424
</header>
3525
)

‎apps/sim/platform/app/(shell)/integrations/_components/tool-permissions/tool-permissions.module.css‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,15 @@
1818
color: var(--ui-secondary);
1919
}
2020
.group {
21-
gap: var(--ui-list-gap);
22-
}
23-
.group + .group {
24-
margin-block-start: var(--ui-section-gap);
21+
gap: var(--ui-stack-gap);
2522
}
26-
.groupTitle,
2723
.tool {
2824
display: flex;
2925
align-items: center;
3026
justify-content: space-between;
3127
gap: var(--ui-row-gap);
3228
min-inline-size: 0;
3329
}
34-
.groupTitle {
35-
min-block-size: var(--spacing-app-chip);
36-
}
3730
.list {
3831
gap: var(--ui-list-gap);
3932
}

‎apps/sim/platform/app/(shell)/integrations/_components/tool-permissions/tool-permissions.tsx‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ export function ToolPermissions({ account, permissions, onChange }: ToolPermissi
6767
ACTIONS.find((action) => action.value === defaultValue)?.label ?? defaultValue
6868
return (
6969
<section key={kind} className={styles.group} aria-label={label}>
70-
<div className={styles.groupTitle}>
71-
<h3 data-type='T059'>
72-
<CountedLabel label={label} count={tools.length} />
73-
</h3>
74-
</div>
70+
<h3 data-type='T059'>
71+
<CountedLabel label={label} count={tools.length} />
72+
</h3>
7573
<ul className={styles.list}>
7674
{matching.map((tool) => (
7775
<li className={styles.tool} key={tool.id}>

‎apps/sim/platform/checks/integrations.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test('an approved app can connect and disconnect a sample account during the sam
99
const list = page.getByRole('main')
1010
await list.getByRole('searchbox', { name: 'Search integrations' }).fill('Linear issues')
1111
await list.getByRole('link', { name: /^Linear / }).click()
12-
const guide = list.getByRole('link', { name: /Setup guide/ })
12+
const guide = list.getByRole('link', { name: 'Docs (opens in a new tab)', exact: true })
1313
await expect(guide).toHaveAttribute('href', 'https://docs.sim.ai/search/linear')
1414
await expect(guide).toHaveAttribute('target', '_blank')
1515
await list.getByRole('button', { name: 'Linear', exact: true }).click()

‎apps/sim/platform/design-system/components/connection-prompt/connection-prompt.tsx‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,19 @@ export function ConnectionPrompt({ title, options, setupGuideUrl }: ConnectionPr
1919
<div className={styles.prompt} data-material='shell'>
2020
<p data-type='T060'>{title}</p>
2121
<div className={styles.providers}>
22+
{setupGuideUrl && (
23+
<ControlRow
24+
render={<Link href={setupGuideUrl} target='_blank' rel='noopener noreferrer' />}
25+
icon='I079'
26+
label='Docs'
27+
accessibleLabel='Docs (opens in a new tab)'
28+
/>
29+
)}
2230
{options.map(({ label, icon, onConnect }) => (
2331
<Button key={label} icon={icon} onClick={onConnect} disabled={!onConnect}>
2432
{label}
2533
</Button>
2634
))}
27-
{setupGuideUrl && (
28-
<ControlRow
29-
render={
30-
<Link
31-
href={setupGuideUrl}
32-
target='_blank'
33-
rel='noopener noreferrer'
34-
aria-label='Setup guide (opens in a new tab)'
35-
/>
36-
}
37-
label='Setup guide'
38-
trailingIcon='I030'
39-
/>
40-
)}
4135
</div>
4236
</div>
4337
)

0 commit comments

Comments
 (0)