feat: add poa to the changes approval

This commit is contained in:
Nathnael
2026-07-10 08:45:39 +00:00
parent ea0f264d72
commit e5fce529fe
13 changed files with 1046 additions and 121 deletions

View File

@@ -153,6 +153,7 @@ export function ChangeRequestReview({ company }: { company: Company }) {
: ([] as string[]);
const docCount = pending?.documentFileIds?.length ?? 0;
const licenseChanges = pending?.licenseChanges ?? [];
const documentChanges = pending?.documentChanges ?? [];
const confirmReject = () => {
if (!rejectId) return;
@@ -210,11 +211,75 @@ export function ChangeRequestReview({ company }: { company: Company }) {
</Text>
)}
{documentChanges.length > 0 && (
<Stack gap={8}>
<Text size="sm" fw={600} c="edr-text">
Document changes
</Text>
{documentChanges.map((c, i) => (
<Group key={`${c.fileId}-${i}`} gap={8} wrap="nowrap">
{c.op === "add" ? (
<FilePlus2 size={15} className="text-edr-muted" />
) : (
<FileX2 size={15} className="text-edr-muted" />
)}
<Badge
size="sm"
radius="sm"
variant="light"
color={c.op === "add" ? "green" : "red"}
>
{c.op === "add" ? "Add" : "Remove"}
</Badge>
<Anchor
component="button"
type="button"
size="sm"
onClick={() =>
view({
name: c.fileName ?? humanize(c.code),
url: fileViewUrl(c.fileId),
})
}
style={{
textDecoration:
c.op === "remove" ? "line-through" : undefined,
}}
>
{c.fileName ?? humanize(c.code)}
</Anchor>
<Text size="xs" c="dimmed">
{humanize(c.code)}
</Text>
</Group>
))}
</Stack>
)}
{docCount > 0 && (
<Text size="sm" c="dimmed">
{docCount} document{docCount === 1 ? "" : "s"} uploaded with this
request review them in the Documents tab.
</Text>
<Stack gap={8}>
<Text size="sm" fw={600} c="edr-text">
Documents uploaded with this request
</Text>
{pending!.documentFileIds.map((fileId, i) => (
<Group key={fileId} gap={8} wrap="nowrap">
<FilePlus2 size={15} className="text-edr-muted" />
<Anchor
component="button"
type="button"
size="sm"
onClick={() =>
view({
name: `Document ${i + 1}`,
url: fileViewUrl(fileId),
})
}
>
Document {i + 1}
</Anchor>
</Group>
))}
</Stack>
)}
{licenseChanges.length > 0 && (