feat(ar1): accorgimenti Leonardo 6/7 — datepicker no-passato + rimozione Scade tra X giorni

- #1 Calendar: minDate=oggi sui campi date con min_today (scadenza documento
  non selezionabile nel passato)
- #6 Ar1Home: rimossa la dicitura Scade tra X giorni / Scaduta da X giorni
This commit is contained in:
Kitzanos
2026-07-06 17:04:49 +02:00
parent 05cf15cad7
commit abf415487d
2 changed files with 2 additions and 9 deletions

View File

@@ -106,7 +106,6 @@ const Ar1Home = () => {
const renderStatusCard = () => { const renderStatusCard = () => {
if (!status) return null; if (!status) return null;
const isUrgent = ['MISSING', 'EXPIRED'].includes(status.status);
const canCompile = ['MISSING', 'EXPIRED', 'APPROACHING', 'VALID'].includes(status.status); const canCompile = ['MISSING', 'EXPIRED', 'APPROACHING', 'VALID'].includes(status.status);
const hasActive = status.form_id && ['DRAFT', 'AWAITING_SIGNATURE'].includes(status.status); const hasActive = status.form_id && ['DRAFT', 'AWAITING_SIGNATURE'].includes(status.status);
@@ -119,13 +118,7 @@ const Ar1Home = () => {
{__('Variante:', 'gepafin')} <strong>{status.variant}</strong> {__('Variante:', 'gepafin')} <strong>{status.variant}</strong>
</span> </span>
)} )}
{status.days_to_expiry !== null && status.days_to_expiry !== undefined && ( {/* "Scade tra X giorni" / "Scaduta da X giorni" rimosso su richiesta Leonardo 6/7/2026 */}
<span style={{ color: isUrgent ? '#b71c1c' : '#444', fontWeight: 600 }}>
{status.days_to_expiry < 0
? __(`Scaduta da ${Math.abs(status.days_to_expiry)} giorni`, 'gepafin')
: __(`Scade tra ${status.days_to_expiry} giorni`, 'gepafin')}
</span>
)}
</div> </div>
{status.must_recompile_reason && ( {status.must_recompile_reason && (

View File

@@ -303,7 +303,7 @@ const Ar1Wizard = () => {
return ( return (
<div key={key} style={{ marginBottom: 14 }}> <div key={key} style={{ marginBottom: 14 }}>
{commonLabel} {commonLabel}
<Calendar id={key} value={value ? new Date(value + 'T00:00:00') : null} onChange={(e) => onChange(field.id, e.value ? `${e.value.getFullYear()}-${String(e.value.getMonth() + 1).padStart(2, '0')}-${String(e.value.getDate()).padStart(2, '0')}` : null)} disabled={disabled} dateFormat="dd/mm/yy" showIcon style={{ width: '100%' }} /> <Calendar id={key} value={value ? new Date(value + 'T00:00:00') : null} onChange={(e) => onChange(field.id, e.value ? `${e.value.getFullYear()}-${String(e.value.getMonth() + 1).padStart(2, '0')}-${String(e.value.getDate()).padStart(2, '0')}` : null)} disabled={disabled} minDate={field.min_today ? (() => { const t = new Date(); t.setHours(0,0,0,0); return t; })() : undefined} dateFormat="dd/mm/yy" showIcon style={{ width: '100%' }} />
</div> </div>
); );
case 'checkbox': case 'checkbox':