@@ -11,6 +11,8 @@ export default function Install({
|
||||
rollback,
|
||||
actionUrl = '/management/opportunity-management-install',
|
||||
imageProcessingAvailable,
|
||||
extension = false,
|
||||
operationKey,
|
||||
}: {
|
||||
installed: boolean;
|
||||
ready: boolean;
|
||||
@@ -22,10 +24,23 @@ export default function Install({
|
||||
rollback: string;
|
||||
actionUrl?: string;
|
||||
imageProcessingAvailable?: boolean;
|
||||
extension?: boolean;
|
||||
operationKey?: string;
|
||||
}) {
|
||||
const form = useForm({ hash, confirm: false });
|
||||
const form = useForm({
|
||||
hash,
|
||||
confirm: false,
|
||||
idempotency_key: operationKey ?? '',
|
||||
reason: '',
|
||||
});
|
||||
return (
|
||||
<Management title="Ativação da Gestão de Oportunidades">
|
||||
<Management
|
||||
title={
|
||||
migration.endsWith('extend_organization_country')
|
||||
? 'Instalação do país de constituição'
|
||||
: 'Ativação da Gestão de Oportunidades'
|
||||
}
|
||||
>
|
||||
<p>
|
||||
Base: {target.database}:{target.port} ·{' '}
|
||||
{installed ? 'Instalado' : 'Ainda não aplicado'}
|
||||
@@ -77,17 +92,40 @@ export default function Install({
|
||||
/>{' '}
|
||||
Confirmo a aplicação deste plano
|
||||
</label>
|
||||
{extension && (
|
||||
<div>
|
||||
<label htmlFor="installation-reason" className="block">
|
||||
Fundamentação da instalação
|
||||
</label>
|
||||
<textarea
|
||||
id="installation-reason"
|
||||
value={form.data.reason}
|
||||
minLength={20}
|
||||
maxLength={1000}
|
||||
required
|
||||
onChange={(event) =>
|
||||
form.setData('reason', event.target.value)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<button
|
||||
className={button}
|
||||
disabled={
|
||||
installed ||
|
||||
!ready ||
|
||||
!form.data.confirm ||
|
||||
(extension && !operationKey) ||
|
||||
form.processing
|
||||
}
|
||||
>
|
||||
Aplicar plano de gestão
|
||||
{migration.endsWith('extend_organization_country')
|
||||
? 'Aplicar extensão do país'
|
||||
: 'Aplicar plano de gestão'}
|
||||
</button>
|
||||
{extension && !operationKey && (
|
||||
<p role="alert">Atualize a prévia para obter a chave desta operação.</p>
|
||||
)}
|
||||
{!ready && (
|
||||
<p>
|
||||
Aplicação indisponível até comprovar QA,
|
||||
|
||||
Reference in New Issue
Block a user