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

@@ -1,90 +1,91 @@
{ {
"name": "bflows-gepafin", "name": "bflows-gepafin",
"version": "1.0.0", "version": "1.0.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@babel/plugin-proposal-private-property-in-object": "7.21.11", "@babel/plugin-proposal-private-property-in-object": "7.21.11",
"@babel/preset-react": "7.26.3", "@babel/preset-react": "7.26.3",
"@date-fns/tz": "1.2.0", "@date-fns/tz": "1.2.0",
"@emailjs/browser": "4.4.1", "@emailjs/browser": "4.4.1",
"@number-flow/react": "0.5.9", "@number-flow/react": "0.5.9",
"@sentry/browser": "9.11.0", "@sentry/browser": "9.11.0",
"@stomp/stompjs": "7.1.1", "@stomp/stompjs": "7.1.1",
"@tanstack/react-table": "8.21.2", "@tanstack/react-table": "8.21.2",
"@wordpress/i18n": "5.21.0", "@wordpress/i18n": "5.21.0",
"@wordpress/react-i18n": "4.21.0", "@wordpress/react-i18n": "4.21.0",
"codice-fiscale-js": "2.3.22", "codice-fiscale-js": "2.3.22",
"copy-to-clipboard": "3.3.3", "copy-to-clipboard": "3.3.3",
"deep-object-diff": "1.1.9", "deep-object-diff": "1.1.9",
"dompurify": "3.2.5", "dompurify": "3.2.5",
"expression-language": "1.2.0", "expression-language": "1.2.0",
"fast-deep-equal": "3.1.3", "fast-deep-equal": "3.1.3",
"hotkeys-js": "3.13.9", "hotkeys-js": "3.13.9",
"html-react-parser": "5.2.3", "html-react-parser": "5.2.3",
"jwt-decode": "4.0.0", "jwt-decode": "4.0.0",
"klona": "2.0.6", "klona": "2.0.6",
"leader-line-new": "1.1.9", "leader-line-new": "1.1.9",
"luxon": "3.6.1", "luxon": "3.6.1",
"mathjs": "14.4.0", "mathjs": "14.4.0",
"mustache": "4.2.0", "mustache": "4.2.0",
"object-path-immutable": "4.1.2", "object-path-immutable": "4.1.2",
"primeicons": "7.0.0", "primeicons": "7.0.0",
"primereact": "10.9.4", "primereact": "10.9.4",
"quill": "2.0.3", "quill": "2.0.3",
"ramda": "0.30.1", "ramda": "0.30.1",
"react": "19.1.0", "react": "19.1.0",
"react-dnd": "16.0.1", "react-dnd": "16.0.1",
"react-dnd-html5-backend": "16.0.1", "react-dnd-html5-backend": "16.0.1",
"react-dom": "19.1.0", "react-dom": "19.1.0",
"react-hook-form": "7.55.0", "react-hook-form": "7.55.0",
"react-router-dom": "7.5.0", "react-router-dom": "7.5.0",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"recharts": "2.15.2", "recharts": "2.15.2",
"sockjs-client": "1.6.1", "sockjs-client": "1.6.1",
"validate.js": "0.13.1", "validate.js": "0.13.1",
"zustand": "5.0.3", "zustand": "5.0.3",
"zustand-x": "6.1.0" "zustand-x": "6.1.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "7.27.0", "@babel/cli": "7.27.0",
"@babel/core": "7.26.10", "@babel/core": "7.26.10",
"@babel/plugin-syntax-jsx": "7.25.9", "@babel/plugin-syntax-jsx": "7.25.9",
"@wordpress/babel-plugin-makepot": "6.21.0", "@wordpress/babel-plugin-makepot": "6.21.0",
"babel-plugin-macros": "3.1.0", "babel-plugin-macros": "3.1.0",
"node-wp-i18n": "1.2.7", "node-wp-i18n": "1.2.7",
"sass": "1.86.3", "sass": "1.86.3",
"sass-loader": "16.0.5" "sass-loader": "16.0.5"
}, },
"scripts": { "scripts": {
"start": "GENERATE_SOURCEMAP=false react-scripts start", "start": "GENERATE_SOURCEMAP=false 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", "start2": "react-scripts start",
"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: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",
"build": "react-scripts build", "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:dev": "cp environments/dev/* public/loaded-files && rm public/loaded-files/dev.env && cp environments/dev/dev.env .env && react-scripts build --mode development", "build": "react-scripts build",
"build:prod": "cp environments/prod/* public/loaded-files && rm public/loaded-files/prod.env && cp environments/prod/prod.env .env && react-scripts build --mode production", "build:dev": "cp environments/dev/* public/loaded-files && rm public/loaded-files/dev.env && cp environments/dev/dev.env .env && react-scripts build --mode development",
"test": "react-scripts test", "build:prod": "cp environments/prod/* public/loaded-files && rm public/loaded-files/prod.env && cp environments/prod/prod.env .env && react-scripts build --mode production",
"eject": "react-scripts eject", "test": "react-scripts test",
"make-pot": "wpi18n makepot --domain-path=languages --domain=gepafin" "eject": "react-scripts eject",
}, "make-pot": "wpi18n makepot --domain-path=languages --domain=gepafin"
"eslintConfig": { },
"extends": [ "eslintConfig": {
"react-app", "extends": [
"react-app/jest" "react-app",
], "react-app/jest"
"rules": { ],
"react-hooks/exhaustive-deps": "off" "rules": {
"react-hooks/exhaustive-deps": "off"
}
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
} }
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
} }

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 (
<Button severity="info" label={label} icon="pi pi-eye" size="small" iconPos="right"/> <>
</Link> <Link to={`/domande/${rowData.applicationId}`}>
<Button severity="info" label={label} icon="pi pi-eye" size="small" iconPos="right"/>
</Link>
{rowData.applicationStatus === 'REJECTED' && (
<Button
severity='success'
label={__('Riammetti', 'gepafin')}
icon='pi pi-arrow-circle-up'
size="small"
iconPos="right"
style={{marginTop:'1rem'}}
/>
)}
</>
)
} }
} }