- assegnare btn is enabled for all statuses;

This commit is contained in:
Vitalii Kiiko
2025-11-12 11:02:43 +01:00
parent 2e262e07b4
commit 65795842b5

View File

@@ -43,7 +43,10 @@ const AllDomandeTableAsync = ({ openDialogFn, updaterString = '' }) => {
status: { value: null, matchMode: 'equals' }
}
});
const statuses = ['SUBMIT', 'EVALUATION', 'SOCCORSO', 'APPOINTMENT', 'NDG', 'ADMISSIBLE', 'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION'];
const statuses = [
'SUBMIT', 'EVALUATION', 'SOCCORSO', 'APPOINTMENT', 'NDG', 'ADMISSIBLE',
'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION'
];
const getPaginationQuery = useCallback(() => getQueryParamsForPaginatedEndpoint(lazyState, statuses, 'id'), [lazyState]);
@@ -65,7 +68,8 @@ const AllDomandeTableAsync = ({ openDialogFn, updaterString = '' }) => {
const getCallback = (resp) => {
if (resp.status === 'SUCCESS') {
const { body, totalRecords,
const {
body, totalRecords,
//currentPage, totalPages, pageSize
} = resp.data;
setTotalRecordsNum(totalRecords);
@@ -89,15 +93,16 @@ const AllDomandeTableAsync = ({ openDialogFn, updaterString = '' }) => {
const actionsBodyTemplate = (rowData) => {
return <div className="appPageSection__tableActions lessGap">
{openDialogFn && ['SUBMIT', 'EVALUATION', 'SOCCORSO'].includes(rowData.status)
{openDialogFn
? <Button severity="info"
onClick={() => openDialogFn(rowData.id)}
label={__('Assegnare', 'gepafin')}
icon="pi pi-pencil" size="small" iconPos="right"/>
: location.pathname !== '/domande'
? <Link to={'/domande'}>
<Button severity="info" label={__('Gestire', 'gepafin')} size="small"/>
</Link> : null}
: null}
{location.pathname !== '/domande'
? <Link to={'/domande'}>
<Button severity="info" label={__('Gestire', 'gepafin')} size="small"/>
</Link> : null}
<Link to={`/domande/${rowData.id}/preview`}>
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
iconPos="right"/>
@@ -126,7 +131,8 @@ const AllDomandeTableAsync = ({ openDialogFn, updaterString = '' }) => {
}
setLazyState({ ...lazyState, filters, first: 0 });
}}
itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel} className="p-column-filter"/>;
itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel}
className="p-column-filter"/>;
};
const dateFilterTemplate = (options) => {
@@ -159,7 +165,8 @@ const AllDomandeTableAsync = ({ openDialogFn, updaterString = '' }) => {
const renderHeader = () => {
return (
<div className="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label={__('Pulisci', 'gepafin')} outlined onClick={clearFilter} />
<Button type="button" icon="pi pi-filter-slash" label={__('Pulisci', 'gepafin')} outlined
onClick={clearFilter}/>
</div>
);
};