feat: integrate opportunity draft management with audited lifecycle
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
import { useForm } from '@inertiajs/react';
|
||||
import { Management, button } from './shared';
|
||||
export default function Install({
|
||||
installed,
|
||||
ready,
|
||||
target,
|
||||
hash,
|
||||
changes,
|
||||
migration,
|
||||
backupDate,
|
||||
rollback,
|
||||
}: {
|
||||
installed: boolean;
|
||||
ready: boolean;
|
||||
target: { database: string; port: number };
|
||||
hash: string;
|
||||
changes: string[];
|
||||
migration: string;
|
||||
backupDate: string | null;
|
||||
rollback: string;
|
||||
}) {
|
||||
const form = useForm({ hash, confirm: false });
|
||||
return (
|
||||
<Management title="Ativação da Gestão de Oportunidades">
|
||||
<p>
|
||||
Base: {target.database}:{target.port} ·{' '}
|
||||
{installed ? 'Instalado' : 'Ainda não aplicado'}
|
||||
</p>
|
||||
<ul>
|
||||
{changes.map((c) => (
|
||||
<li key={c}>{c}</li>
|
||||
))}
|
||||
</ul>
|
||||
<p>Migração: {migration}</p>
|
||||
<p>Backup/restauro: {backupDate ?? 'Prova ainda por preparar'}</p>
|
||||
<p>{rollback}</p>
|
||||
<p>
|
||||
Este plano ativa apenas o primeiro incremento; workflow
|
||||
completo, imagens e módulos especializados permanecem no
|
||||
backlog.
|
||||
</p>
|
||||
<form
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
form.post('/management/opportunity-management-install');
|
||||
}}
|
||||
>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={form.data.confirm}
|
||||
onChange={(e) =>
|
||||
form.setData('confirm', e.target.checked)
|
||||
}
|
||||
/>{' '}
|
||||
Confirmo a aplicação deste plano
|
||||
</label>
|
||||
<button
|
||||
className={button}
|
||||
disabled={
|
||||
installed ||
|
||||
!ready ||
|
||||
!form.data.confirm ||
|
||||
form.processing
|
||||
}
|
||||
>
|
||||
Aplicar plano de gestão
|
||||
</button>
|
||||
{!ready && (
|
||||
<p>
|
||||
Aplicação indisponível até comprovar QA,
|
||||
backup/restauro, compatibilidade e reversão da versão
|
||||
atual.
|
||||
</p>
|
||||
)}
|
||||
{Object.values(form.errors).map((e) => (
|
||||
<p role="alert" key={e}>
|
||||
{e}
|
||||
</p>
|
||||
))}
|
||||
</form>
|
||||
</Management>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user