fix(ar1-admin): bottoni azioni con label (pattern coerente rendicontazione)
Bug visuale: colonna Azioni appariva vuota. I Button rounded+text con solo icon=pi
pi-pencil (senza label) non renderizzavano su alcune configurazioni PrimeReact.
Pattern in rendicontazione/Bandi usa sempre label esplicita con size='small' outlined.
Ar1AdminConfig — bottoni azioni unificati:
* tplActiveActionsTpl (Tab Template):
- 'Anteprima' icon eye + severity info (apre PDF mock in nuova tab)
- 'Layout' icon pencil (apre dialog edit layout)
- 'Nuova vers.' icon plus + severity warning
* pecActionsTpl (Tab Regole):
- 'Modifica' icon pencil (outlined small)
- icon trash only + severity danger (outlined small, tooltip 'Elimina')
Allargate colonne: template 170→280px, regole 120→200px per accomodare label italiani.
Build stamp aggiornato nel commento header per forzare rebuild CRA.
This commit is contained in:
@@ -59,7 +59,7 @@ const PEC_KIND_OPTIONS = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ar1AdminConfig — configurazione AR1 per superadmin.
|
* Ar1AdminConfig — configurazione AR1 per superadmin. (build 1776949184)
|
||||||
* URL: /ar1-admin
|
* URL: /ar1-admin
|
||||||
*
|
*
|
||||||
* 5 sezioni (TabView):
|
* 5 sezioni (TabView):
|
||||||
@@ -415,8 +415,8 @@ const Ar1AdminConfig = () => {
|
|||||||
const variantTpl = (row) => VARIANT_LABEL[row.variant] || row.variant;
|
const variantTpl = (row) => VARIANT_LABEL[row.variant] || row.variant;
|
||||||
|
|
||||||
const tplActiveActionsTpl = (row) => (
|
const tplActiveActionsTpl = (row) => (
|
||||||
<div style={{ display: 'flex', gap: 4 }}>
|
<div style={{ display: 'flex', gap: 6, flexWrap: 'wrap' }}>
|
||||||
<Button icon="pi pi-eye" rounded text severity="info" tooltip="Anteprima PDF (dati di esempio)" onClick={async () => {
|
<Button icon="pi pi-eye" label="Anteprima" size="small" severity="info" outlined onClick={async () => {
|
||||||
try {
|
try {
|
||||||
if (toast.current) toast.current.show({ severity: 'info', summary: 'Generazione anteprima...', detail: 'Attendere qualche secondo', life: 3000 });
|
if (toast.current) toast.current.show({ severity: 'info', summary: 'Generazione anteprima...', detail: 'Attendere qualche secondo', life: 3000 });
|
||||||
const blob = await Ar1Service.previewTemplatePdf(row.id);
|
const blob = await Ar1Service.previewTemplatePdf(row.id);
|
||||||
@@ -427,8 +427,8 @@ const Ar1AdminConfig = () => {
|
|||||||
if (toast.current) toast.current.show({ severity: 'error', summary: 'Errore anteprima', detail: e.message || 'Generazione PDF fallita' });
|
if (toast.current) toast.current.show({ severity: 'error', summary: 'Errore anteprima', detail: e.message || 'Generazione PDF fallita' });
|
||||||
}
|
}
|
||||||
}} />
|
}} />
|
||||||
<Button icon="pi pi-pencil" rounded text tooltip="Modifica layout grafico" onClick={() => openEditLayout(row)} disabled={row.status === 'ARCHIVED'} />
|
<Button icon="pi pi-pencil" label="Layout" size="small" outlined onClick={() => openEditLayout(row)} disabled={row.status === 'ARCHIVED'} />
|
||||||
<Button icon="pi pi-plus-circle" rounded text severity="warning" tooltip="Nuova versione" onClick={() => openNewVersion(row.variant)} />
|
<Button icon="pi pi-plus" label="Nuova vers." size="small" severity="warning" outlined onClick={() => openNewVersion(row.variant)} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -451,9 +451,9 @@ const Ar1AdminConfig = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const pecActionsTpl = (row) => (
|
const pecActionsTpl = (row) => (
|
||||||
<div style={{ display: 'flex', gap: 4 }}>
|
<div style={{ display: 'flex', gap: 6 }}>
|
||||||
<Button icon="pi pi-pencil" rounded text tooltip="Modifica" onClick={() => openPecDialog(row)} />
|
<Button icon="pi pi-pencil" label="Modifica" size="small" outlined onClick={() => openPecDialog(row)} />
|
||||||
<Button icon="pi pi-trash" rounded text severity="danger" tooltip="Elimina" onClick={() => deletePecRule(row)} />
|
<Button icon="pi pi-trash" size="small" severity="danger" outlined onClick={() => deletePecRule(row)} tooltip="Elimina" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ const Ar1AdminConfig = () => {
|
|||||||
<Column field="version" header="Versione" style={{ width: 120 }} body={(r) => <strong>v{r.version}</strong>} />
|
<Column field="version" header="Versione" style={{ width: 120 }} body={(r) => <strong>v{r.version}</strong>} />
|
||||||
<Column field="status" header="Stato" body={tplStatusTpl} style={{ width: 140 }} />
|
<Column field="status" header="Stato" body={tplStatusTpl} style={{ width: 140 }} />
|
||||||
<Column field="quadri_count" header="N. quadri" style={{ width: 110 }} body={(r) => r.quadri_count ?? (r.questions_snapshot?.quadri?.length ?? '—')} />
|
<Column field="quadri_count" header="N. quadri" style={{ width: 110 }} body={(r) => r.quadri_count ?? (r.questions_snapshot?.quadri?.length ?? '—')} />
|
||||||
<Column header="Azioni" body={tplActiveActionsTpl} style={{ width: 170 }} />
|
<Column header="Azioni" body={tplActiveActionsTpl} style={{ width: 280 }} />
|
||||||
</DataTable>
|
</DataTable>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
@@ -582,7 +582,7 @@ const Ar1AdminConfig = () => {
|
|||||||
<Column field="offset_days" header="Quando parte" body={pecWhenTpl} style={{ width: 240 }} />
|
<Column field="offset_days" header="Quando parte" body={pecWhenTpl} style={{ width: 240 }} />
|
||||||
<Column field="is_recurring" header="Ricorrenza" body={pecRecurringTpl} style={{ width: 160 }} />
|
<Column field="is_recurring" header="Ricorrenza" body={pecRecurringTpl} style={{ width: 160 }} />
|
||||||
<Column field="enabled" header="Attiva" body={pecEnabledTpl} style={{ width: 90 }} />
|
<Column field="enabled" header="Attiva" body={pecEnabledTpl} style={{ width: 90 }} />
|
||||||
<Column header="Azioni" body={pecActionsTpl} style={{ width: 120 }} />
|
<Column header="Azioni" body={pecActionsTpl} style={{ width: 200 }} />
|
||||||
</DataTable>
|
</DataTable>
|
||||||
</Card>
|
</Card>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
|
|||||||
Reference in New Issue
Block a user