mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 15:18:11 +00:00
increase JSON body size limit, update awaiting shipment endpoint handling, and enhance contract document editor UI
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
Group,
|
||||
Loader,
|
||||
Modal,
|
||||
ScrollArea,
|
||||
// Select, // ponytail: unused now the validity dropdown below is commented out
|
||||
Stack,
|
||||
Text,
|
||||
@@ -274,17 +275,63 @@ export function ContractDocumentEditorModal({
|
||||
? draft?.nextApproverRole
|
||||
? `Only the current approver (${draft.nextApproverRole}) can edit this document right now.`
|
||||
: "This document can no longer be edited — the contract has advanced beyond approval."
|
||||
: "Articles come from this contract's template. Set the validity dates, then accept."}
|
||||
: "This document is read-only — it is accepted exactly as the template produced it. Set the validity dates, then accept."}
|
||||
</Alert>
|
||||
|
||||
<TextInput
|
||||
label="Document title"
|
||||
placeholder="e.g. Bulk Cargo Transportation and Customs Clearance Services"
|
||||
value={documentTitle}
|
||||
onChange={(e) => setDocumentTitle(e.currentTarget.value)}
|
||||
disabled={locked}
|
||||
/>
|
||||
{/* Accept is a REVIEW step: the document is shown exactly as the
|
||||
template produced it, with nothing editable. Any wording change
|
||||
belongs to the template or to the separate edit action. */}
|
||||
{mode === "accept" ? (
|
||||
<ScrollArea.Autosize mah={340} type="auto">
|
||||
<Stack gap="sm" pr="sm">
|
||||
<Text fw={700} fz={15}>
|
||||
{documentTitle || "Contract document"}
|
||||
</Text>
|
||||
|
||||
{whereasClauses.length > 0 && (
|
||||
<Stack gap={4}>
|
||||
{whereasClauses.map((clause, i) => (
|
||||
<Text key={i} fz={13} c="dimmed">
|
||||
WHEREAS {clause}
|
||||
</Text>
|
||||
))}
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
{articles.length === 0 ? (
|
||||
<Text fz={13} c="dimmed">
|
||||
This template carries no articles.
|
||||
</Text>
|
||||
) : (
|
||||
articles.map((article, index) => (
|
||||
<Box key={article.id}>
|
||||
<Text fz={13} fw={700}>
|
||||
Article {index + 1}
|
||||
{article.title ? ` — ${article.title}` : ""}
|
||||
</Text>
|
||||
<Text
|
||||
fz={12.5}
|
||||
c="dimmed"
|
||||
style={{ whiteSpace: "pre-wrap" }}
|
||||
>
|
||||
{article.body}
|
||||
</Text>
|
||||
</Box>
|
||||
))
|
||||
)}
|
||||
</Stack>
|
||||
</ScrollArea.Autosize>
|
||||
) : (
|
||||
<TextInput
|
||||
label="Document title"
|
||||
placeholder="e.g. Bulk Cargo Transportation and Customs Clearance Services"
|
||||
value={documentTitle}
|
||||
onChange={(e) => setDocumentTitle(e.currentTarget.value)}
|
||||
disabled={locked}
|
||||
/>
|
||||
)}
|
||||
|
||||
{mode !== "accept" && (
|
||||
<Box>
|
||||
<Group justify="space-between" mb={6}>
|
||||
<Text size="sm" fw={600}>
|
||||
@@ -340,6 +387,7 @@ export function ContractDocumentEditorModal({
|
||||
</Stack>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{/* Article editing is hidden for now (frontend only) — staff accept the
|
||||
contract on the template's articles as-is. The articles themselves
|
||||
|
||||
Reference in New Issue
Block a user