Skip to content

Commit c9823b1

Browse files
committed
fix(settings): align field rhythm and report access load failures
1 parent b890e24 commit c9823b1

4 files changed

Lines changed: 24 additions & 5 deletions

File tree

apps/sim/ee/components/setting-row.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function SettingRow({
2828
children,
2929
}: SettingRowProps) {
3030
return (
31-
<div className='flex flex-col gap-1.5'>
31+
<div className='flex flex-col gap-[9px]'>
3232
<div className='flex items-center gap-1.5'>
3333
<Label htmlFor={htmlFor}>
3434
{label}

apps/sim/ee/credential-groups/components/credential-group-access.test.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,4 +374,18 @@ describe('CredentialGroupAccess', () => {
374374
const failed = renderAccess({ loadError: new Error('Access request failed') })
375375
expect(failed.container.textContent).toContain('Access request failed')
376376
})
377+
378+
/**
379+
* These three are `null` until the access query resolves, so a settled read that
380+
* still lacks them is a load failure to report — not a throw that blanks the panel
381+
* the surrounding tabs render into.
382+
*/
383+
it.each([
384+
['workflows', { workflows: null }],
385+
['allowedWorkflowIds', { allowedWorkflowIds: null }],
386+
['revision', { revision: null }],
387+
] as const)('reports a failed load when %s is missing', (_field, overrides) => {
388+
const missing = renderAccess(overrides)
389+
expect(missing.container.textContent).toContain("Couldn't load workflow access")
390+
})
377391
})

apps/sim/ee/credential-groups/components/credential-group-access.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,15 @@ export function CredentialGroupAccess({
182182
)
183183
}
184184
if (isPending) return null
185-
if (!workflows) throw new Error('Credential Group workflow catalog is unavailable')
186-
if (!allowedWorkflowIds) throw new Error('Credential Group workflow access is unavailable')
187-
if (revision === null) throw new Error('Credential Group access revision is unavailable')
185+
/**
186+
* These three arrive `null` until the access query resolves, so a settled-but-empty
187+
* read is a server state the caller can hand us — not a programming fault. It reports
188+
* as a failed load rather than throwing, which would blank the whole panel. The
189+
* integrity checks below stay throws: those mean the payload itself is corrupt.
190+
*/
191+
if (!workflows || !allowedWorkflowIds || revision === null) {
192+
return <SettingsEmptyState tone='error'>Couldn't load workflow access</SettingsEmptyState>
193+
}
188194

189195
const allowedWorkflowIdSet = new Set(allowedWorkflowIds)
190196
if (allowedWorkflowIdSet.size !== allowedWorkflowIds.length) {

apps/sim/ee/credential-groups/components/credential-group-detail.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ export function CredentialGroupDetail({
305305
onSelect: () => guard.guardBack(onBack),
306306
}}
307307
title={credentialGroup?.name ?? 'Credential group'}
308-
description={credentialGroup?.description ?? undefined}
309308
actions={actions}
310309
search={
311310
activeTab === 'details'

0 commit comments

Comments
 (0)