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:
@@ -106,7 +106,6 @@ const Ar1Home = () => {
|
||||
|
||||
const renderStatusCard = () => {
|
||||
if (!status) return null;
|
||||
const isUrgent = ['MISSING', 'EXPIRED'].includes(status.status);
|
||||
const canCompile = ['MISSING', 'EXPIRED', 'APPROACHING', 'VALID'].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>
|
||||
</span>
|
||||
)}
|
||||
{status.days_to_expiry !== null && status.days_to_expiry !== undefined && (
|
||||
<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>
|
||||
)}
|
||||
{/* "Scade tra X giorni" / "Scaduta da X giorni" rimosso su richiesta Leonardo 6/7/2026 */}
|
||||
</div>
|
||||
|
||||
{status.must_recompile_reason && (
|
||||
|
||||
@@ -303,7 +303,7 @@ const Ar1Wizard = () => {
|
||||
return (
|
||||
<div key={key} style={{ marginBottom: 14 }}>
|
||||
{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>
|
||||
);
|
||||
case 'checkbox':
|
||||
|
||||
Reference in New Issue
Block a user