Complete grouped collaborative editorial queues and native review coverage
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -12,6 +12,7 @@ import type { ChainLink, Gap } from './value-network';
|
||||
|
||||
function ChainForm({ clusterId, chain }: { clusterId: string; chain?: Chain }) {
|
||||
const form = useForm({
|
||||
editorial_version: chain?.editorial_version ?? null,
|
||||
code: chain?.code ?? '',
|
||||
name: chain?.name ?? '',
|
||||
stage: chain?.stage ?? 'input',
|
||||
@@ -34,6 +35,11 @@ function ChainForm({ clusterId, chain }: { clusterId: string; chain?: Chain }) {
|
||||
<h3 className="font-semibold">
|
||||
{chain ? chain.name : 'Nova etapa'}
|
||||
</h3>
|
||||
{chain?.editorial_url && (
|
||||
<Link className="underline" href={chain.editorial_url}>
|
||||
Conferir proposta e publicação
|
||||
</Link>
|
||||
)}
|
||||
<Field label="Código da etapa" error={form.errors.code}>
|
||||
<input
|
||||
className={control}
|
||||
@@ -79,8 +85,12 @@ export default function Editor({
|
||||
gaps,
|
||||
competitiveness,
|
||||
editorialDossier,
|
||||
editorialSubject,
|
||||
structuralEditorial = false,
|
||||
}: {
|
||||
editorialDossier?: string | null;
|
||||
editorialSubject?: string | null;
|
||||
structuralEditorial?: boolean;
|
||||
structure: Structure;
|
||||
record: StructureRecord | null;
|
||||
projects: { id: string; name: string; code: string }[];
|
||||
@@ -101,6 +111,8 @@ export default function Editor({
|
||||
valid_until: string | null;
|
||||
validation_status: string;
|
||||
version_no: number;
|
||||
editorial_version?: number;
|
||||
editorial_url?: string;
|
||||
editor_id: number | null;
|
||||
}[];
|
||||
}) {
|
||||
@@ -133,6 +145,7 @@ export default function Editor({
|
||||
const association = useForm({
|
||||
project_id: '',
|
||||
version_no: 0,
|
||||
editorial_version: 0,
|
||||
role: 'complementary',
|
||||
association_type: 'potential',
|
||||
source_reference: '',
|
||||
@@ -142,6 +155,23 @@ export default function Editor({
|
||||
});
|
||||
return (
|
||||
<Management title={`${record ? 'Editar' : 'Criar'} ${singular}`}>
|
||||
{editorialSubject && (
|
||||
<p>
|
||||
As alterações ficam numa proposta privada.{' '}
|
||||
<Link className="underline" href={editorialSubject}>
|
||||
Conferir edição e publicar
|
||||
</Link>
|
||||
.
|
||||
</p>
|
||||
)}
|
||||
{structuralEditorial && (
|
||||
<Link
|
||||
className="underline"
|
||||
href="/management/editorial/subjects"
|
||||
>
|
||||
Propostas de estruturas, relações e cadeias de valor
|
||||
</Link>
|
||||
)}
|
||||
<Link className="underline" href={`/management/${structure}`}>
|
||||
Voltar a {titles[structure].toLowerCase()}
|
||||
</Link>
|
||||
@@ -351,7 +381,16 @@ export default function Editor({
|
||||
{member.evidence_reference ?? 'Sem evidencia'} -{' '}
|
||||
{member.valid_from ?? 'Sem inicio'} -{' '}
|
||||
{member.valid_until ?? 'Sem termo'}
|
||||
{member.validation_status === 'pending' &&
|
||||
{member.editorial_url && (
|
||||
<Link
|
||||
className="underline"
|
||||
href={member.editorial_url}
|
||||
>
|
||||
Rever proposta e publicação
|
||||
</Link>
|
||||
)}
|
||||
{!structuralEditorial &&
|
||||
member.validation_status === 'pending' &&
|
||||
member.editor_id !== viewerId && (
|
||||
<button
|
||||
className={button}
|
||||
@@ -404,6 +443,59 @@ export default function Editor({
|
||||
member.project_id ===
|
||||
e.target.value,
|
||||
)?.version_no ?? 0,
|
||||
editorial_version:
|
||||
memberships.find(
|
||||
(member) =>
|
||||
member.project_id ===
|
||||
e.target.value,
|
||||
)?.editorial_version ?? 0,
|
||||
role:
|
||||
memberships.find(
|
||||
(member) =>
|
||||
member.project_id ===
|
||||
e.target.value,
|
||||
)?.role ?? 'complementary',
|
||||
association_type:
|
||||
memberships.find(
|
||||
(member) =>
|
||||
member.project_id ===
|
||||
e.target.value,
|
||||
)?.association_type ??
|
||||
'potential',
|
||||
source_reference:
|
||||
memberships.find(
|
||||
(member) =>
|
||||
member.project_id ===
|
||||
e.target.value,
|
||||
)?.source_reference ?? '',
|
||||
evidence_reference:
|
||||
memberships.find(
|
||||
(member) =>
|
||||
member.project_id ===
|
||||
e.target.value,
|
||||
)?.evidence_reference ?? '',
|
||||
valid_from:
|
||||
memberships
|
||||
.find(
|
||||
(member) =>
|
||||
member.project_id ===
|
||||
e.target.value,
|
||||
)
|
||||
?.valid_from?.slice(
|
||||
0,
|
||||
10,
|
||||
) ?? '',
|
||||
valid_until:
|
||||
memberships
|
||||
.find(
|
||||
(member) =>
|
||||
member.project_id ===
|
||||
e.target.value,
|
||||
)
|
||||
?.valid_until?.slice(
|
||||
0,
|
||||
10,
|
||||
) ?? '',
|
||||
}))
|
||||
}
|
||||
>
|
||||
|
||||
@@ -41,4 +41,11 @@ export const roles: Record<string, string> = {
|
||||
complementary: 'Complementar',
|
||||
supporting: 'Apoio',
|
||||
};
|
||||
export type Chain = { id: string; code: string; name: string; stage: string };
|
||||
export type Chain = {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
stage: string;
|
||||
editorial_version?: number;
|
||||
editorial_url?: string;
|
||||
};
|
||||
|
||||
@@ -17,6 +17,8 @@ export type Gap = {
|
||||
rationale: string;
|
||||
status: string;
|
||||
call_to_action: string;
|
||||
editorial_version?: number;
|
||||
editorial_url?: string;
|
||||
};
|
||||
const linkTypes: Record<string, string> = {
|
||||
supplies: 'Fornece a',
|
||||
@@ -72,6 +74,7 @@ function GapForm({
|
||||
gap?: Gap;
|
||||
}) {
|
||||
const form = useForm({
|
||||
editorial_version: gap?.editorial_version ?? null,
|
||||
value_chain_id: gap?.value_chain_id ?? '',
|
||||
title: gap?.title ?? '',
|
||||
location: gap?.location ?? '',
|
||||
|
||||
Reference in New Issue
Block a user