Skip to content

Commit b818ddf

Browse files
committed
revert(people): restore Emir's directory, import and directory sync markup
His last versions (ecd02bc, directory CSS from b5a30e9) of the directory, connect modal, import modal and directory sync page. Kept logic: the toast sink import path and LOCALE number formatting.
1 parent c11f278 commit b818ddf

5 files changed

Lines changed: 45 additions & 112 deletions

File tree

‎apps/sim/app/(product)/o/[organizationId]/people/_components/directory-sync/connect-modal.tsx‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Button } from '@sim/emcn/button'
55
import { TextField } from '@sim/emcn/field'
66
import { SecretField } from '@sim/emcn/field/value-fields'
77
import { Modal } from '@sim/emcn/modal'
8-
import { FailureNotice, InlineNotice } from '@sim/emcn/status'
8+
import { InlineNotice } from '@sim/emcn/status'
99
import Link from 'next/link'
1010
import styles from '@/app/(product)/o/[organizationId]/people/_components/directory-sync/directory-sync.module.css'
1111
import { ExternalLink } from '@/app/(product)/o/[organizationId]/people/_components/external-link/external-link'
@@ -138,18 +138,15 @@ export function ConnectModal({ organizationId, source, onClose, onConnected }: C
138138
</ExternalLink>
139139
</>
140140
)}
141-
{source === 'scim' && provisioning.failed && (
142-
<FailureNotice
143-
message='Could not read the provisioning connection.'
144-
retrying={provisioning.fetching}
145-
onRetry={provisioning.refresh}
146-
/>
147-
)}
148-
{source === 'scim' && !provisioning.failed && (
141+
{source === 'scim' && (
149142
<div className={styles.provisioning} aria-live='polite'>
150143
{!provisioning.loading && (
151144
<p data-type='T060'>
152-
{provisioning.ready ? 'Active' : 'Enable provisioning before connecting this source.'}
145+
{provisioning.failed
146+
? 'Could not read the provisioning connection.'
147+
: provisioning.ready
148+
? 'Active'
149+
: 'Enable provisioning before connecting this source.'}
153150
</p>
154151
)}
155152
<div className={styles.quietActions}>

‎apps/sim/app/(product)/o/[organizationId]/people/_components/directory-sync/directory-sync-page.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { useState } from 'react'
44
import { Button } from '@sim/emcn/button'
55
import { Modal } from '@sim/emcn/modal'
6-
import { FailureNotice, InlineNotice, StatusText } from '@sim/emcn/status'
6+
import { FailureNotice, InlineNotice, StatusTag } from '@sim/emcn/status'
77
import { PageColumn } from '@sim/emcn-platform/page-column'
88
import { formatDateTime } from '@sim/utils/formatting'
99
import {
@@ -105,7 +105,7 @@ function SyncCard({ sync, syncing, running, onUpdate, onRun }: SyncCardProps) {
105105
</span>
106106
)}
107107
</span>
108-
<StatusText label={tag} intent={intent} />
108+
<StatusTag label={tag} intent={intent} live />
109109
</header>
110110
<div className={styles.summary}>
111111
<h2 data-type='T042'>{title}</h2>

‎apps/sim/app/(product)/o/[organizationId]/people/_components/directory/directory.module.css‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
3232
margin-inline-start: auto;
3333
}
3434

35-
/* A phone gives search its own row, out to the page gutter. */
36-
@media (width < 30rem) {
37-
.search {
38-
flex-basis: 100%;
39-
}
40-
}
41-
4235
.scope {
4336
flex: 1;
4437
color: var(--ui-secondary);
@@ -51,33 +44,3 @@
5144
display: none;
5245
}
5346
}
54-
55-
.personCell {
56-
display: grid;
57-
min-inline-size: 0;
58-
}
59-
60-
.summary,
61-
.summaryDepartment {
62-
display: none;
63-
}
64-
65-
.summary {
66-
gap: var(--ui-stack-gap);
67-
margin-block-start: var(--ui-stack-gap);
68-
color: var(--ui-secondary);
69-
overflow-wrap: anywhere;
70-
}
71-
72-
/* The breakpoints where the table hides its columns: what leaves the row joins the person's cell. */
73-
@container (width < 48rem) {
74-
.summary {
75-
display: grid;
76-
}
77-
}
78-
79-
@container (width < 30rem) {
80-
.summaryDepartment {
81-
display: inline;
82-
}
83-
}

‎apps/sim/app/(product)/o/[organizationId]/people/_components/directory/directory.tsx‎

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,6 @@ function DirectoryCell({ value }: DirectoryCellProps) {
2828
return <span data-type='T043'>{value || '—'}</span>
2929
}
3030

31-
interface PersonSummaryProps {
32-
department: string | null
33-
location: string | null
34-
manager: string | undefined
35-
}
36-
37-
/** What the table's hidden columns would say, under the person, so a narrow table loses nothing. */
38-
function PersonSummary({ department, location, manager }: PersonSummaryProps) {
39-
const place = [location, manager && `Reports to ${manager}`].filter(Boolean).join(' · ')
40-
return (
41-
<span className={styles.summary} data-type='T052'>
42-
{department && <span className={styles.summaryDepartment}>{department}</span>}
43-
{place && <span>{place}</span>}
44-
</span>
45-
)
46-
}
47-
4831
interface PeopleDirectoryProps {
4932
organizationId: string
5033
}
@@ -60,16 +43,7 @@ export function PeopleDirectory({ organizationId }: PeopleDirectoryProps) {
6043
id: person.memberId,
6144
values: {},
6245
cells: {
63-
person: (
64-
<span className={styles.personCell}>
65-
<PersonIdentity person={person} />
66-
<PersonSummary
67-
department={person.department}
68-
location={person.location}
69-
manager={person.manager?.name}
70-
/>
71-
</span>
72-
),
46+
person: <PersonIdentity person={person} />,
7347
department: <DirectoryCell value={person.department} />,
7448
location: <DirectoryCell value={person.location} />,
7549
manager: <DirectoryCell value={person.manager?.name} />,

‎apps/sim/app/(product)/o/[organizationId]/people/_components/import/import-modal.tsx‎

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { FileField } from '@sim/emcn/field/file-field'
88
import { SecretField } from '@sim/emcn/field/value-fields'
99
import { Modal } from '@sim/emcn/modal'
1010
import { useScrollEdges } from '@sim/emcn/scroll-area/use-scroll-edges'
11-
import { FailureNotice } from '@sim/emcn/status'
11+
import { InlineNotice } from '@sim/emcn/status'
1212
import { getErrorMessage } from '@sim/utils/errors'
1313
import Link from 'next/link'
1414
import { toast } from '@/lib/toast/sink'
@@ -156,7 +156,6 @@ export function ImportModal({ organizationId, onClose, onOpenSync }: ImportModal
156156
confirmLabel={
157157
done ? 'Done' : preview ? `Import ${plural(preview.updated, 'profile')}` : 'Preview import'
158158
}
159-
pending={pending}
160159
confirmDisabled={pending || (!preview && !ready)}
161160
onBack={preview ? () => setPreview(null) : undefined}
162161
onConfirm={
@@ -248,46 +247,45 @@ export function ImportModal({ organizationId, onClose, onOpenSync }: ImportModal
248247
</ExternalLink>
249248
</>
250249
)}
251-
{source === 'directory' && connection.failed && (
252-
<FailureNotice
253-
message='Could not load your provisioning connection.'
254-
retrying={connection.fetching}
255-
onRetry={connection.refresh}
256-
/>
257-
)}
258-
{source === 'directory' && !connection.failed && !connection.loading && (
250+
{source === 'directory' && (
259251
<>
260-
<p className={styles.secondary} data-type='T060'>
261-
{!connection.active
262-
? 'Enable SCIM provisioning and assign accounts in your provider to import their profiles.'
263-
: connection.userCount === 0
264-
? 'Your connection is active. Assign accounts to Sim in your identity provider, then refresh here.'
265-
: `Your connection has ${plural(connection.userCount, 'provisioned account')}. Preview the profile fields and reporting lines sent by your provider.`}
266-
</p>
267-
<div className={styles.links}>
268-
{canOpenProvisioningSettings && (
252+
{!connection.loading && (
253+
<p className={styles.secondary} data-type='T060'>
254+
{connection.failed
255+
? 'Could not load your provisioning connection.'
256+
: !connection.active
257+
? 'Enable SCIM provisioning and assign accounts in your provider to import their profiles.'
258+
: connection.userCount === 0
259+
? 'Your connection is active. Assign accounts to Sim in your identity provider, then refresh here.'
260+
: `Your connection has ${plural(connection.userCount, 'provisioned account')}. Preview the profile fields and reporting lines sent by your provider.`}
261+
</p>
262+
)}
263+
{!connection.loading && (
264+
<div className={styles.links}>
265+
{canOpenProvisioningSettings && !connection.failed && (
266+
<Button
267+
variant='quiet'
268+
size='compact'
269+
render={<Link href={provisioningSettingsHref} />}
270+
>
271+
{connection.active ? 'Manage provisioning' : 'Set up provisioning'}
272+
</Button>
273+
)}
274+
{!connection.active && (
275+
<ExternalLink href='https://docs.sim.ai/platform/enterprise/scim'>
276+
Provisioning guide
277+
</ExternalLink>
278+
)}
269279
<Button
270280
variant='quiet'
271281
size='compact'
272-
render={<Link href={provisioningSettingsHref} />}
282+
disabled={connection.fetching}
283+
onClick={connection.refresh}
273284
>
274-
{connection.active ? 'Manage provisioning' : 'Set up provisioning'}
285+
{connection.failed ? 'Retry connection' : 'Refresh'}
275286
</Button>
276-
)}
277-
{!connection.active && (
278-
<ExternalLink href='https://docs.sim.ai/platform/enterprise/scim'>
279-
Provisioning guide
280-
</ExternalLink>
281-
)}
282-
<Button
283-
variant='quiet'
284-
size='compact'
285-
disabled={connection.fetching}
286-
onClick={connection.refresh}
287-
>
288-
Refresh
289-
</Button>
290-
</div>
287+
</div>
288+
)}
291289
</>
292290
)}
293291
{source === 'file' && (
@@ -303,6 +301,7 @@ export function ImportModal({ organizationId, onClose, onOpenSync }: ImportModal
303301
error={fileError}
304302
hint='CSV or Excel with an email column, plus any of title, department, location, start date, and manager email.'
305303
/>
304+
{reading && <InlineNotice message='Reading…' />}
306305
<div>
307306
<Button variant='quiet' size='compact' onClick={downloadImportTemplate}>
308307
Download template

0 commit comments

Comments
 (0)