add button

This commit is contained in:
Noemi Pusceddu
2025-05-07 11:08:15 +02:00
parent 535bc8d46e
commit ec9db083ad
2 changed files with 107 additions and 91 deletions

View File

@@ -57,6 +57,7 @@
}, },
"scripts": { "scripts": {
"start": "GENERATE_SOURCEMAP=false react-scripts start", "start": "GENERATE_SOURCEMAP=false react-scripts start",
"start2": "react-scripts start",
"start:dev": "cp environments/dev/* public/loaded-files && rm public/loaded-files/dev.env && cp environments/dev/dev.env .env && PORT=8000 react-scripts start --mode development", "start:dev": "cp environments/dev/* public/loaded-files && rm public/loaded-files/dev.env && cp environments/dev/dev.env .env && PORT=8000 react-scripts start --mode development",
"start:prod": "cp environments/prod/* public/loaded-files && rm public/loaded-files/prod.env && cp environments/prod/prod.env .env && react-scripts start --mode production", "start:prod": "cp environments/prod/* public/loaded-files && rm public/loaded-files/prod.env && cp environments/prod/prod.env .env && react-scripts start --mode production",
"build": "react-scripts build", "build": "react-scripts build",

View File

@@ -131,6 +131,7 @@ const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [] }) => {
}; };
const actionsBodyTemplate = (rowData) => { const actionsBodyTemplate = (rowData) => {
console.log('status', rowData.status)
if (rowData.status === 'AWAITING') { if (rowData.status === 'AWAITING') {
return <Button return <Button
severity="info" severity="info"
@@ -143,9 +144,23 @@ const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [] }) => {
const label = ['OPEN', 'SOCCORSO'].includes(rowData.status) && userData.id === rowData.userId const label = ['OPEN', 'SOCCORSO'].includes(rowData.status) && userData.id === rowData.userId
? __('Valuta', 'gepafin') ? __('Valuta', 'gepafin')
: __('Mostra', 'gepafin'); : __('Mostra', 'gepafin');
return <Link to={`/domande/${rowData.applicationId}`}> return (
<>
<Link to={`/domande/${rowData.applicationId}`}>
<Button severity="info" label={label} icon="pi pi-eye" size="small" iconPos="right"/> <Button severity="info" label={label} icon="pi pi-eye" size="small" iconPos="right"/>
</Link> </Link>
{rowData.applicationStatus === 'REJECTED' && (
<Button
severity='success'
label={__('Riammetti', 'gepafin')}
icon='pi pi-arrow-circle-up'
size="small"
iconPos="right"
style={{marginTop:'1rem'}}
/>
)}
</>
)
} }
} }