Adopt shared WebUI layout primitives
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
|||||||
useRef,
|
useRef,
|
||||||
useState
|
useState
|
||||||
} from "react";
|
} from "react";
|
||||||
import {
|
import { DialogSection, ToolbarGroup, FormGrid, ActionToolbar,
|
||||||
ApiError,
|
ApiError,
|
||||||
Button,
|
Button,
|
||||||
ConfirmDialog,
|
ConfirmDialog,
|
||||||
@@ -531,7 +531,7 @@ export default function DistributionListsPage({ settings, auth }: Props) {
|
|||||||
<main className="dist-lists-page">
|
<main className="dist-lists-page">
|
||||||
<div className="dist-lists-shell">
|
<div className="dist-lists-shell">
|
||||||
<aside className="dist-lists-sidebar" aria-label="Distribution lists">
|
<aside className="dist-lists-sidebar" aria-label="Distribution lists">
|
||||||
<div className="dist-lists-sidebar-toolbar">
|
<ActionToolbar className="dist-lists-sidebar-toolbar">
|
||||||
<strong>Distribution Lists</strong>
|
<strong>Distribution Lists</strong>
|
||||||
<span>
|
<span>
|
||||||
<IconButton
|
<IconButton
|
||||||
@@ -551,7 +551,7 @@ export default function DistributionListsPage({ settings, auth }: Props) {
|
|||||||
onClick={() => requestDiscard(() => setCreateOpen(true))}
|
onClick={() => requestDiscard(() => setCreateOpen(true))}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</ActionToolbar>
|
||||||
<div className="dist-lists-search">
|
<div className="dist-lists-search">
|
||||||
<input
|
<input
|
||||||
type="search"
|
type="search"
|
||||||
@@ -583,12 +583,12 @@ export default function DistributionListsPage({ settings, auth }: Props) {
|
|||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<section className="dist-lists-workspace">
|
<section className="dist-lists-workspace">
|
||||||
<div className="dist-lists-workspace-toolbar">
|
<ActionToolbar className="dist-lists-workspace-toolbar">
|
||||||
<span className="dist-lists-current-title">
|
<span className="dist-lists-current-title">
|
||||||
<strong>{selected?.name ?? "No distribution list selected"}</strong>
|
<strong>{selected?.name ?? "No distribution list selected"}</strong>
|
||||||
{selected ? <small>Revision {selected.current_revision} · {selected.scope_type} scope</small> : null}
|
{selected ? <small>Revision {selected.current_revision} · {selected.scope_type} scope</small> : null}
|
||||||
</span>
|
</span>
|
||||||
<span className="dist-lists-toolbar-actions">
|
<ToolbarGroup align="end" className="dist-lists-toolbar-actions">
|
||||||
<DocumentationHelpLink reference={DIST_LISTS_DOCUMENTATION} />
|
<DocumentationHelpLink reference={DIST_LISTS_DOCUMENTATION} />
|
||||||
<SegmentedControl<WorkspaceView>
|
<SegmentedControl<WorkspaceView>
|
||||||
ariaLabel="Distribution-list workspace"
|
ariaLabel="Distribution-list workspace"
|
||||||
@@ -616,8 +616,8 @@ export default function DistributionListsPage({ settings, auth }: Props) {
|
|||||||
disabledReason={!canWrite ? DIST_LISTS_I18N.writeReason : !selected ? DIST_LISTS_I18N.noSelection : undefined}
|
disabledReason={!canWrite ? DIST_LISTS_I18N.writeReason : !selected ? DIST_LISTS_I18N.noSelection : undefined}
|
||||||
onClick={() => setDeleteOpen(true)}
|
onClick={() => setDeleteOpen(true)}
|
||||||
/>
|
/>
|
||||||
</span>
|
</ToolbarGroup>
|
||||||
</div>
|
</ActionToolbar>
|
||||||
|
|
||||||
<div className="dist-lists-alerts">
|
<div className="dist-lists-alerts">
|
||||||
{error ? <DismissibleAlert tone="danger" resetKey={error}>{error}</DismissibleAlert> : null}
|
{error ? <DismissibleAlert tone="danger" resetKey={error}>{error}</DismissibleAlert> : null}
|
||||||
@@ -746,7 +746,7 @@ export default function DistributionListsPage({ settings, auth }: Props) {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="dist-lists-dialog-form">
|
<DialogSection className="dist-lists-dialog-form">
|
||||||
<FormField label="Name" documentation={DIST_LISTS_FIELD_DOCUMENTATION}><input autoFocus value={createName} onChange={(event) => setCreateName(event.target.value)} /></FormField>
|
<FormField label="Name" documentation={DIST_LISTS_FIELD_DOCUMENTATION}><input autoFocus value={createName} onChange={(event) => setCreateName(event.target.value)} /></FormField>
|
||||||
<FormField label="Definition type" documentation={DIST_LISTS_FIELD_DOCUMENTATION}>
|
<FormField label="Definition type" documentation={DIST_LISTS_FIELD_DOCUMENTATION}>
|
||||||
<select value={createKind} onChange={(event) => setCreateKind(event.target.value as DefinitionKind)}>
|
<select value={createKind} onChange={(event) => setCreateKind(event.target.value as DefinitionKind)}>
|
||||||
@@ -756,7 +756,7 @@ export default function DistributionListsPage({ settings, auth }: Props) {
|
|||||||
<option value="template">Template (not runnable)</option>
|
<option value="template">Template (not runnable)</option>
|
||||||
</select>
|
</select>
|
||||||
</FormField>
|
</FormField>
|
||||||
</div>
|
</DialogSection>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
<EntryEditorDialog
|
<EntryEditorDialog
|
||||||
@@ -954,7 +954,7 @@ function EntryEditorDialog({
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="dist-lists-dialog-form">
|
<DialogSection className="dist-lists-dialog-form">
|
||||||
<FormField label="Source type">
|
<FormField label="Source type">
|
||||||
<SegmentedControl<SourceMode>
|
<SegmentedControl<SourceMode>
|
||||||
value={state.sourceMode}
|
value={state.sourceMode}
|
||||||
@@ -1001,7 +1001,7 @@ function EntryEditorDialog({
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
<div className="dist-lists-form-grid">
|
<FormGrid columns={2} gap="compact" collapseAt="narrow">
|
||||||
<FormField label="Mode" documentation={DIST_LISTS_FIELD_DOCUMENTATION}>
|
<FormField label="Mode" documentation={DIST_LISTS_FIELD_DOCUMENTATION}>
|
||||||
<select value={state.mode} onChange={(event) => onChange({ ...state, mode: event.target.value as EntryMode })}>
|
<select value={state.mode} onChange={(event) => onChange({ ...state, mode: event.target.value as EntryMode })}>
|
||||||
<option value="include">Include</option>
|
<option value="include">Include</option>
|
||||||
@@ -1071,7 +1071,7 @@ function EntryEditorDialog({
|
|||||||
</FormField>
|
</FormField>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</FormGrid>
|
||||||
<fieldset className="dist-lists-channel-fieldset">
|
<fieldset className="dist-lists-channel-fieldset">
|
||||||
<legend>Requested channels</legend>
|
<legend>Requested channels</legend>
|
||||||
{(["email", "postal", "internal_mail", "portal"] as DistributionChannel[]).map((channel) => (
|
{(["email", "postal", "internal_mail", "portal"] as DistributionChannel[]).map((channel) => (
|
||||||
@@ -1088,7 +1088,7 @@ function EntryEditorDialog({
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</DialogSection>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -394,12 +394,6 @@
|
|||||||
max-width: 780px;
|
max-width: 780px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dist-lists-form-grid {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dist-lists-provider-notices {
|
.dist-lists-provider-notices {
|
||||||
display: grid;
|
display: grid;
|
||||||
max-height: 150px;
|
max-height: 150px;
|
||||||
@@ -543,7 +537,6 @@
|
|||||||
|
|
||||||
.dist-lists-definition-fields,
|
.dist-lists-definition-fields,
|
||||||
.dist-lists-preview-inputs,
|
.dist-lists-preview-inputs,
|
||||||
.dist-lists-form-grid,
|
|
||||||
.dist-lists-metrics,
|
.dist-lists-metrics,
|
||||||
.dist-lists-channel-fieldset,
|
.dist-lists-channel-fieldset,
|
||||||
.dist-lists-parameter-row {
|
.dist-lists-parameter-row {
|
||||||
|
|||||||
Reference in New Issue
Block a user