Skip to content

Commit 298021c

Browse files
committed
improvement(settings): align access-control detail UI + nav-driven docs link
- Move permission-group Save/Discard into the detail header (matching secrets/whitelabeling) and delete the one-off sticky 'Unsaved changes' bar - Convert the Platform and Blocks config tabs to SettingsSection (drop the custom multi-column masonry + hand-rolled section labels); add an optional far-right action slot to SettingsSection for the per-section Select All - Replace the file-share auth-mode checkboxes with a multi-select ChipDropdown - Normalize per-tab spacing to gap-7, align the expand-chevron token to --text-icon, and match the list-row arrow size to the integrations precedent - Add a nav docsLink surfaced as a header 'Docs' ChipLink by SettingsPanel, wired for the six enterprise settings pages
1 parent 223def5 commit 298021c

5 files changed

Lines changed: 226 additions & 234 deletions

File tree

apps/sim/app/workspace/[workspaceId]/settings/components/settings-panel/settings-panel.tsx

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

33
import { createContext, type ReactNode, useContext } from 'react'
4-
import { ChipInput, Search } from '@/components/emcn'
4+
import { ChipInput, ChipLink, Search } from '@/components/emcn'
55
import { cn } from '@/lib/core/utils/cn'
66
import {
77
getSettingsSectionMeta,
@@ -47,6 +47,8 @@ interface SettingsPanelProps {
4747
title?: string
4848
/** Overrides the nav-driven description. */
4949
description?: string
50+
/** Overrides the nav-driven docs link (the "Docs" link rendered on the title row). */
51+
docsLink?: string
5052
/** Extra classes for the content column (layout/spacing only, e.g. a tighter `gap-*`). */
5153
contentClassName?: string
5254
/** Ref forwarded to the scroll region (e.g. for programmatic scroll-to-bottom). */
@@ -73,6 +75,7 @@ export function SettingsPanel({
7375
actions,
7476
title,
7577
description,
78+
docsLink,
7679
contentClassName,
7780
scrollContainerRef,
7881
search,
@@ -81,12 +84,20 @@ export function SettingsPanel({
8184
const meta = section ? getSettingsSectionMeta(section) : null
8285
const resolvedTitle = title ?? meta?.label
8386
const resolvedDescription = description ?? meta?.description
87+
const resolvedDocsLink = docsLink ?? meta?.docsLink
8488

8589
return (
8690
<div className='flex h-full flex-col bg-[var(--bg)]'>
8791
<div className='flex flex-shrink-0 items-center justify-between bg-[var(--bg)] px-[16px] pt-[8.5px] pb-[8.5px]'>
8892
<div />
89-
<div className='flex h-[30px] items-center gap-1'>{actions}</div>
93+
<div className='flex h-[30px] items-center gap-1'>
94+
{resolvedDocsLink && (
95+
<ChipLink href={resolvedDocsLink} target='_blank' rel='noopener noreferrer'>
96+
Docs
97+
</ChipLink>
98+
)}
99+
{actions}
100+
</div>
90101
</div>
91102
<div
92103
ref={scrollContainerRef}

apps/sim/app/workspace/[workspaceId]/settings/components/settings-section/settings-section.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,27 @@ interface SettingsSectionProps {
44
label: string
55
/** Optional node rendered immediately to the right of the label (e.g. an info tooltip). */
66
headerAccessory?: ReactNode
7+
/** Optional control pinned to the far right of the header row (e.g. a Select All chip). */
8+
action?: ReactNode
79
children: ReactNode
810
}
911

1012
/**
1113
* Labeled section primitive that matches the integrations page visual rhythm:
1214
* a muted small label, a thin divider, then the body content.
1315
*/
14-
export function SettingsSection({ label, headerAccessory, children }: SettingsSectionProps) {
16+
export function SettingsSection({
17+
label,
18+
headerAccessory,
19+
action,
20+
children,
21+
}: SettingsSectionProps) {
1522
return (
1623
<section className='flex flex-col'>
1724
<div className='flex items-center gap-1.5 pl-0.5'>
1825
<span className='text-[var(--text-muted)] text-small'>{label}</span>
1926
{headerAccessory}
27+
{action && <div className='ml-auto'>{action}</div>}
2028
</div>
2129
<div className='mt-[9px] mb-3 h-px bg-[var(--border)]' />
2230
{children}

apps/sim/app/workspace/[workspaceId]/settings/navigation.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export interface NavigationItem {
7474
/** Hide for enterprise plans, which manage billing out-of-band. */
7575
hideForEnterprise?: boolean
7676
externalUrl?: string
77+
/** Absolute docs URL surfaced as a "Docs" link in the page header. */
78+
docsLink?: string
7779
}
7880

7981
const isSSOEnabled = isTruthy(getEnv('NEXT_PUBLIC_SSO_ENABLED'))
@@ -114,6 +116,7 @@ export const allNavigationItems: NavigationItem[] = [
114116
requiresHosted: true,
115117
requiresEnterprise: true,
116118
selfHostedOverride: isAccessControlEnabled,
119+
docsLink: 'https://docs.sim.ai/platform/enterprise/access-control',
117120
},
118121
{
119122
id: 'audit-logs',
@@ -124,6 +127,7 @@ export const allNavigationItems: NavigationItem[] = [
124127
requiresHosted: true,
125128
requiresEnterprise: true,
126129
selfHostedOverride: isAuditLogsEnabled,
130+
docsLink: 'https://docs.sim.ai/platform/enterprise/audit-logs',
127131
},
128132
{
129133
id: 'billing',
@@ -239,6 +243,7 @@ export const allNavigationItems: NavigationItem[] = [
239243
requiresHosted: true,
240244
requiresEnterprise: true,
241245
selfHostedOverride: isSSOEnabled,
246+
docsLink: 'https://docs.sim.ai/platform/enterprise/sso',
242247
},
243248
{
244249
id: 'data-retention',
@@ -249,6 +254,7 @@ export const allNavigationItems: NavigationItem[] = [
249254
requiresHosted: true,
250255
requiresEnterprise: true,
251256
selfHostedOverride: isDataRetentionEnabled,
257+
docsLink: 'https://docs.sim.ai/platform/enterprise/data-retention',
252258
},
253259
{
254260
id: 'data-drains',
@@ -259,6 +265,7 @@ export const allNavigationItems: NavigationItem[] = [
259265
requiresHosted: true,
260266
requiresEnterprise: true,
261267
selfHostedOverride: isDataDrainsEnabled,
268+
docsLink: 'https://docs.sim.ai/platform/enterprise/data-drains',
262269
},
263270
{
264271
id: 'whitelabeling',
@@ -269,6 +276,7 @@ export const allNavigationItems: NavigationItem[] = [
269276
requiresHosted: true,
270277
requiresEnterprise: true,
271278
selfHostedOverride: isWhitelabelingEnabled,
279+
docsLink: 'https://docs.sim.ai/platform/enterprise/whitelabeling',
272280
},
273281
{
274282
id: 'admin',
@@ -295,7 +303,7 @@ export const allNavigationItems: NavigationItem[] = [
295303
*/
296304
export function getSettingsSectionMeta(
297305
section: SettingsSection
298-
): { label: string; description: string } | null {
306+
): { label: string; description: string; docsLink?: string } | null {
299307
const item = allNavigationItems.find((navItem) => navItem.id === section)
300-
return item ? { label: item.label, description: item.description } : null
308+
return item ? { label: item.label, description: item.description, docsLink: item.docsLink } : null
301309
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export function AccessControl() {
211211
}`}
212212
</span>
213213
</div>
214-
<ArrowRight className='size-[14px] flex-shrink-0 text-[var(--text-icon)]' />
214+
<ArrowRight className='size-4 flex-shrink-0 text-[var(--text-icon)]' />
215215
</button>
216216
))}
217217
</div>

0 commit comments

Comments
 (0)