Skip to content

Commit 571bb6a

Browse files
committed
feat(console): draw the map settings specifier as a table of keyed rows
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUhVXEJm46XTxRs4GM
1 parent cd6618e commit 571bb6a

17 files changed

Lines changed: 1020 additions & 12 deletions

File tree

‎ui/apps/console/src/pages/settings/SettingsField.tsx‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242
import { pickLocalized, useObjectTranslation } from '@object-ui/i18n';
4343
import { AlertTriangle, ChevronRight, Info, RotateCcw } from 'lucide-react';
4444
import { EnvLockBadge } from './EnvLockBadge';
45+
import { SettingsMapField, type MapRefusalAt } from './SettingsMapField';
4546
import {
4647
resolveLabel,
4748
type Specifier,
@@ -115,6 +116,12 @@ export interface SettingsFieldProps {
115116
* sitting under a red error reads as if the field has two states at once.
116117
*/
117118
error?: string;
119+
/**
120+
* Where the last refusal points inside a `map` value (objectstack#31391):
121+
* the save door's `constraint.entry` and `constraint.column`. The row and
122+
* cell named are marked; `error` stays the sentence. Read by `map` only.
123+
*/
124+
errorAt?: MapRefusalAt;
118125
/**
119126
* A fact the PAGE knows about this row that the manifest cannot carry
120127
* (objectstack#30313: the address the server judges beside Allowed IP
@@ -586,6 +593,7 @@ export function SettingsField(props: SettingsFieldProps) {
586593
saving,
587594
labels,
588595
error,
596+
errorAt,
589597
note,
590598
writeScope,
591599
onClearSaved,
@@ -1062,6 +1070,21 @@ export function SettingsField(props: SettingsFieldProps) {
10621070
onChange={(e) => onChange(e.target.value)}
10631071
/>,
10641072
);
1073+
case 'map':
1074+
// objectstack#31391 — keyed rows over the served `options`, one cell per
1075+
// declared column. A group named by the row's label, so no `htmlFor`.
1076+
return wrapper(
1077+
<SettingsMapField
1078+
spec={spec}
1079+
value={value}
1080+
onChange={onChange}
1081+
disabled={disabled}
1082+
labelId={labelId}
1083+
optionLabel={renderOptionLabel}
1084+
errorAt={error ? errorAt : undefined}
1085+
/>,
1086+
undefined,
1087+
);
10651088
default:
10661089
return wrapper(
10671090
<div className="text-sm text-muted-foreground">

0 commit comments

Comments
 (0)