feat: integrate files and portal surfaces
This commit is contained in:
@@ -112,6 +112,7 @@ const templateDefaults = (): TemplateDraft => ({
|
||||
address_pattern: "{template_slug}.{unit_slug}.{function_slug}",
|
||||
classification: "internal",
|
||||
allow_vacant_delivery: true,
|
||||
portal_visible: false,
|
||||
routing_policy: routingDefaults()
|
||||
});
|
||||
|
||||
@@ -121,7 +122,8 @@ const exactDefaults = (): ExactDraft => ({
|
||||
organization_unit_id: "",
|
||||
function_id: "",
|
||||
address_key: "",
|
||||
classification: "internal"
|
||||
classification: "internal",
|
||||
portal_visible: false
|
||||
});
|
||||
|
||||
export default function PostboxAdminPanel({
|
||||
@@ -270,6 +272,7 @@ export default function PostboxAdminPanel({
|
||||
address_pattern: revision.address_pattern,
|
||||
classification: revision.classification,
|
||||
allow_vacant_delivery: revision.allow_vacant_delivery,
|
||||
portal_visible: revision.portal_visible,
|
||||
routing_policy: revision.routing_policy ?? routingDefaults()
|
||||
};
|
||||
setTemplatePreview(null);
|
||||
@@ -1126,6 +1129,14 @@ function TemplateDialog({
|
||||
onChange={(checked) => onChange({ ...draft, allow_vacant_delivery: checked })}
|
||||
/>
|
||||
</div>
|
||||
<div className="postbox-toggle-field">
|
||||
<ToggleSwitch
|
||||
label="Show in Portal"
|
||||
help="Portal lists this Postbox only for users whose current function assignment already grants Postbox access."
|
||||
checked={draft.portal_visible}
|
||||
onChange={(checked) => onChange({ ...draft, portal_visible: checked })}
|
||||
/>
|
||||
</div>
|
||||
<div className="postbox-routing-section">
|
||||
<div className="postbox-routing-heading">
|
||||
<div>
|
||||
@@ -1472,6 +1483,14 @@ function ExactPostboxDialog({
|
||||
<FormField label="Description" documentation={POSTBOX_FIELD_DOCUMENTATION}>
|
||||
<input value={draft.description || ""} onChange={(event) => onChange({ ...draft, description: event.target.value })} />
|
||||
</FormField>
|
||||
<div className="postbox-toggle-field">
|
||||
<ToggleSwitch
|
||||
label="Show in Portal"
|
||||
help="Portal lists this Postbox only when the current user's function assignment grants access."
|
||||
checked={draft.portal_visible}
|
||||
onChange={(checked) => onChange({ ...draft, portal_visible: checked })}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Dialog>
|
||||
);
|
||||
@@ -1578,6 +1597,7 @@ function revisionPayload(draft: TemplateDraft): PostboxTemplateRevisionPayload {
|
||||
address_pattern: draft.address_pattern,
|
||||
classification: draft.classification,
|
||||
allow_vacant_delivery: draft.allow_vacant_delivery,
|
||||
portal_visible: draft.portal_visible,
|
||||
routing_policy: draft.routing_policy
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user