feat(editorial): preserve public editions and add QA review workflow

This commit is contained in:
2026-11-13 22:56:44 +02:00
parent 2f1ef2fdfc
commit b3849d850e
25 changed files with 1963 additions and 55 deletions
+56 -40
View File
@@ -166,7 +166,9 @@ export default function Manage({
editorialScopeOnly = false,
managementFilters = {},
associationOptions = {},
editorialWorkflowEnabled = false,
}: {
editorialWorkflowEnabled?: boolean;
managementFilters?: { q?: string; state?: string; intent?: string };
associationOptions?: Record<
string,
@@ -984,20 +986,24 @@ export default function Manage({
/>
Destacar como essencial na página inicial
</label>
<label className="flex gap-2">
<input
type="checkbox"
checked={form.data.independent_review}
onChange={(e) =>
form.setData(
'independent_review',
e.target.checked,
)
}
/>
Foi realizada revisão independente por outro
gestor
</label>
{!editorialWorkflowEnabled && (
<label className="flex gap-2">
<input
type="checkbox"
checked={
form.data.independent_review
}
onChange={(e) =>
form.setData(
'independent_review',
e.target.checked,
)
}
/>
Foi realizada revisão independente por
outro gestor
</label>
)}
<fieldset className="space-y-3 rounded border p-4">
<legend className="font-semibold">
Relações com etapas, módulos e
@@ -1401,7 +1407,7 @@ export default function Manage({
</div>
</form>
{disclosureAuthorization && (
{disclosureAuthorization && !editorialWorkflowEnabled && (
<section
className="space-y-3 rounded border border-emerald-700 bg-emerald-50 p-5"
aria-labelledby="disclosure-authorization-title"
@@ -1684,31 +1690,41 @@ export default function Manage({
>
Ler / pré-visualizar artigo
</a>
<button
type="button"
className={button}
onClick={() => {
setActionError('');
router.post(
`/management/portal-services/resources/${r.id}`,
{ published: !r.published },
{
preserveScroll: true,
onError: (errors) =>
setActionError(
Object.values(
errors,
)[0] ??
'A transição foi recusada; confirme o estado do ficheiro, fonte e direitos.',
),
},
);
}}
>
{r.published
? 'Retirar da publicação'
: 'Publicar'}
</button>
{editorialWorkflowEnabled && (
<a
className={button}
href={`/management/editorial/resources/${r.id}`}
>
Revisão, aprovação e publicação
</a>
)}
{(!editorialWorkflowEnabled || r.published) && (
<button
type="button"
className={button}
onClick={() => {
setActionError('');
router.post(
`/management/portal-services/resources/${r.id}`,
{ published: !r.published },
{
preserveScroll: true,
onError: (errors) =>
setActionError(
Object.values(
errors,
)[0] ??
'A transição foi recusada; confirme o estado do ficheiro, fonte e direitos.',
),
},
);
}}
>
{r.published
? 'Retirar da publicação'
: 'Publicar'}
</button>
)}
</div>
{actionError && <p role="alert">{actionError}</p>}
</article>