- updated tables and fixed some bugs;

This commit is contained in:
Vitalii Kiiko
2024-10-24 17:33:13 +02:00
parent 255af71365
commit 36b9ebb165
9 changed files with 40 additions and 21 deletions

View File

@@ -14,6 +14,9 @@ const getBandoLabel = (status) => {
case 'READY_TO_PUBLISH': case 'READY_TO_PUBLISH':
return __('Pronto', 'gepafin'); return __('Pronto', 'gepafin');
case 'READY':
return __('Pronto', 'gepafin');
case 'DRAFT': case 'DRAFT':
return __('Bozza', 'gepafin'); return __('Bozza', 'gepafin');
@@ -23,6 +26,12 @@ const getBandoLabel = (status) => {
case 'AWAIT': case 'AWAIT':
return __('In attesa', 'gepafin'); return __('In attesa', 'gepafin');
case 'ASSIGNED':
return __('Assegnato', 'gepafin');
case 'EVALUATION':
return __('Valutazione', 'gepafin');
case 'EXPIRED': case 'EXPIRED':
return __('Scaduto', 'gepafin'); return __('Scaduto', 'gepafin');

View File

@@ -12,6 +12,9 @@ const getBandoSeverity = (status) => {
case 'READY_TO_PUBLISH': case 'READY_TO_PUBLISH':
return 'info'; return 'info';
case 'READY':
return 'info';
case 'DRAFT': case 'DRAFT':
return 'warning'; return 'warning';
@@ -21,6 +24,12 @@ const getBandoSeverity = (status) => {
case 'AWAIT': case 'AWAIT':
return 'warning'; return 'warning';
case 'ASSIGNED':
return 'warning';
case 'EVALUATION':
return 'info';
case 'EXPIRED': case 'EXPIRED':
return 'closed'; return 'closed';

View File

@@ -604,7 +604,7 @@ const BandoApplication = () => {
iconPos="right"/> iconPos="right"/>
</div> : null} </div> : null}
{['AWAIT', 'READY', 'SUBMIT', 'EVALUATION'].includes(applicationStatus) {'DRAFT' !== applicationStatus
? <div className="appPageSection"> ? <div className="appPageSection">
<div className="appForm__field"> <div className="appForm__field">
<label htmlFor="signedPdfFile"> <label htmlFor="signedPdfFile">
@@ -615,7 +615,7 @@ const BandoApplication = () => {
<FileuploadApplicationSignedPdf <FileuploadApplicationSignedPdf
setDataFn={handleSetSignedDocumentFromFileupload} setDataFn={handleSetSignedDocumentFromFileupload}
fieldName="signedPdfFile" fieldName="signedPdfFile"
disabled={['READY', 'SUBMIT', 'EVALUATION'].includes(applicationStatus)} disabled={'AWAIT' !== applicationStatus}
defaultValue={is(Array, signedPdfFile) ? signedPdfFile : []} defaultValue={is(Array, signedPdfFile) ? signedPdfFile : []}
accept={['.p7m,application/pkcs7-mime,application/x-pkcs7-mime,.zip']} accept={['.p7m,application/pkcs7-mime,application/x-pkcs7-mime,.zip']}
chooseLabel={__('Aggiungi documento', 'gepafin')} chooseLabel={__('Aggiungi documento', 'gepafin')}

View File

@@ -14,7 +14,7 @@ import DashboardService from '../../service/dashboard-service';
import LatestBandiTable from './components/LatestBandiTable'; import LatestBandiTable from './components/LatestBandiTable';
//import LatestUsersActivityTable from './components/LatestUsersActivityTable'; //import LatestUsersActivityTable from './components/LatestUsersActivityTable';
import { Button } from 'primereact/button'; import { Button } from 'primereact/button';
import MyEvaluationsTable from '../DashboardInstructor/components/MyEvaluationsTable'; import MyEvaluationsTable from '../DashboardPreInstructor/components/PreInstructorDomandeTable';
import AllDomandeTable from '../Domande/components/AllDomandeTable'; import AllDomandeTable from '../Domande/components/AllDomandeTable';
const Dashboard = () => { const Dashboard = () => {

View File

@@ -22,7 +22,7 @@ import AssignedApplicationService from '../../../../service/assigned-application
import { useStore } from '../../../../store'; import { useStore } from '../../../../store';
const MyEvaluationsTable = () => { const PreInstructorDomandeTable = () => {
const userData = useStore().main.userData(); const userData = useStore().main.userData();
const [items, setItems] = useState(null); const [items, setItems] = useState(null);
const [filters, setFilters] = useState(null); const [filters, setFilters] = useState(null);
@@ -51,7 +51,7 @@ const MyEvaluationsTable = () => {
const getFormattedData = (data) => { const getFormattedData = (data) => {
return data.map((d) => { return data.map((d) => {
d.callEndDate = is(String, d.callEndDate) ? new Date(d.callEndDate) : (d.callEndDate ? d.callEndDate : ''); d.callEndDate = is(String, d.callEndDate) ? new Date(d.callEndDate) : (d.callEndDate ? d.callEndDate : '');
d.modifiedDate = is(String, d.modifiedDate) ? new Date(d.modifiedDate) : (d.modifiedDate ? d.modifiedDate : ''); d.updatedDate = is(String, d.updatedDate) ? new Date(d.updatedDate) : (d.updatedDate ? d.updatedDate : '');
d.submissionDate = is(String, d.submissionDate) ? new Date(d.submissionDate) : (d.submissionDate ? d.submissionDate : ''); d.submissionDate = is(String, d.submissionDate) ? new Date(d.submissionDate) : (d.submissionDate ? d.submissionDate : '');
return d; return d;
}); });
@@ -82,15 +82,15 @@ const MyEvaluationsTable = () => {
const initFilters = () => { const initFilters = () => {
setFilters({ setFilters({
global: { value: null, matchMode: FilterMatchMode.CONTAINS }, global: { value: null, matchMode: FilterMatchMode.CONTAINS },
callTitle: { callName: {
operator: FilterOperator.AND, operator: FilterOperator.AND,
constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }] constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }]
}, },
appliedDate: { submissionDate: {
operator: FilterOperator.AND, operator: FilterOperator.AND,
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
}, },
callEndDate: { updatedDate : {
operator: FilterOperator.AND, operator: FilterOperator.AND,
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
} }
@@ -115,7 +115,8 @@ const MyEvaluationsTable = () => {
}; };
const dateEndBodyTemplate = (rowData) => { const dateEndBodyTemplate = (rowData) => {
return formatDate(rowData.callEndDate); //return formatDate(rowData.callEndDate);
return '';
}; };
const dateFilterTemplate = (options) => { const dateFilterTemplate = (options) => {
@@ -150,7 +151,7 @@ const MyEvaluationsTable = () => {
<Column field="id" header={__('ID domanda', 'gepafin')} <Column field="id" header={__('ID domanda', 'gepafin')}
filter filterPlaceholder={__('Cerca', 'gepafin')} filter filterPlaceholder={__('Cerca', 'gepafin')}
style={{ minWidth: '12rem' }}/> style={{ minWidth: '12rem' }}/>
<Column field="callTitle" header={__('Bando', 'gepafin')} <Column field="callName" header={__('Bando', 'gepafin')}
filter filterPlaceholder={__('Cerca', 'gepafin')} filter filterPlaceholder={__('Cerca', 'gepafin')}
style={{ minWidth: '12rem' }}/> style={{ minWidth: '12rem' }}/>
<Column header={__('Data Ricezione', 'gepafin')} filterField="modifiedDate" dataType="date" <Column header={__('Data Ricezione', 'gepafin')} filterField="modifiedDate" dataType="date"
@@ -168,4 +169,4 @@ const MyEvaluationsTable = () => {
) )
} }
export default MyEvaluationsTable; export default PreInstructorDomandeTable;

View File

@@ -13,9 +13,9 @@ import { useStore } from '../../store';
//import LatestBandiTable from './components/LatestBandiTable'; //import LatestBandiTable from './components/LatestBandiTable';
//import MyLatestSubmissionsTable from './components/MyLatestSubmissionsTable'; //import MyLatestSubmissionsTable from './components/MyLatestSubmissionsTable';
import { Button } from 'primereact/button'; import { Button } from 'primereact/button';
import MyEvaluationsTable from './components/MyEvaluationsTable'; import PreInstructorDomandeTable from './components/PreInstructorDomandeTable';
const DashboardInstructor = () => { const DashboardPreInstructor = () => {
const navigate = useNavigate(); const navigate = useNavigate();
//const [mainStats, setMainStats] = useState({}); //const [mainStats, setMainStats] = useState({});
@@ -53,7 +53,7 @@ const DashboardInstructor = () => {
<div className="appPageSection"> <div className="appPageSection">
<h2>{__('Coda di lavoro', 'gepafin')}</h2> <h2>{__('Coda di lavoro', 'gepafin')}</h2>
<MyEvaluationsTable/> <PreInstructorDomandeTable/>
</div> </div>
<div className="appPage__spacer"></div> <div className="appPage__spacer"></div>
@@ -66,11 +66,11 @@ const DashboardInstructor = () => {
<div className="appPageSection__actions"> <div className="appPageSection__actions">
<Button <Button
onClick={goToAllEvaluations} onClick={goToAllEvaluations}
label={__('Tutti valutazioni', 'gepafin')} icon="pi pi-arrow-right" iconPos="right"/> label={__('Tutte le domande', 'gepafin')} icon="pi pi-arrow-right" iconPos="right"/>
</div> </div>
</div> </div>
</div> </div>
) )
} }
export default DashboardInstructor; export default DashboardPreInstructor;

View File

@@ -2,7 +2,7 @@ import React from 'react';
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
// components // components
import MyEvaluationsTable from '../DashboardInstructor/components/MyEvaluationsTable'; import PreInstructorDomandeTable from '../DashboardPreInstructor/components/PreInstructorDomandeTable';
const Bandi = () => { const Bandi = () => {
return( return(
@@ -14,7 +14,7 @@ const Bandi = () => {
<div className="appPage__spacer"></div> <div className="appPage__spacer"></div>
<div className="appPageSection"> <div className="appPageSection">
<MyEvaluationsTable/> <PreInstructorDomandeTable/>
</div> </div>
</div> </div>
) )

View File

@@ -25,7 +25,7 @@ import ProfileCompany from './pages/ProfileCompany';
import Users from './pages/Users'; import Users from './pages/Users';
import AddCompany from './pages/AddCompany'; import AddCompany from './pages/AddCompany';
import ResetPassword from './pages/ResetPassword'; import ResetPassword from './pages/ResetPassword';
import DashboardInstructor from './pages/DashboardInstructor'; import DashboardPreInstructor from './pages/DashboardPreInstructor';
import ProfileBeneficiario from './pages/ProfileBeneficiario'; import ProfileBeneficiario from './pages/ProfileBeneficiario';
import Evaluations from './pages/Evaluations'; import Evaluations from './pages/Evaluations';
import EvaluationEdit from './pages/EvaluationEdit'; import EvaluationEdit from './pages/EvaluationEdit';
@@ -39,7 +39,7 @@ const routes = ({ role, chosenCompanyId }) => {
<Route path="/" element={<DefaultLayout> <Route path="/" element={<DefaultLayout>
{'ROLE_SUPER_ADMIN' === role ? <Dashboard/> : null} {'ROLE_SUPER_ADMIN' === role ? <Dashboard/> : null}
{'ROLE_BENEFICIARY' === role ? <DashboardBeneficiario/> : null} {'ROLE_BENEFICIARY' === role ? <DashboardBeneficiario/> : null}
{'ROLE_PRE_INSTRUCTOR' === role ? <DashboardInstructor/> : null} {'ROLE_PRE_INSTRUCTOR' === role ? <DashboardPreInstructor/> : null}
</DefaultLayout>}/> </DefaultLayout>}/>
<Route path="/bandi" element={<DefaultLayout> <Route path="/bandi" element={<DefaultLayout>
{'ROLE_SUPER_ADMIN' === role ? <Bandi/> : null} {'ROLE_SUPER_ADMIN' === role ? <Bandi/> : null}

View File

@@ -4,7 +4,7 @@ const API_BASE_URL = process.env.REACT_APP_API_EXECUTION_ADDRESS;
export default class AssignedApplicationService { export default class AssignedApplicationService {
static getAssignedApplications = (id, callback, errCallback, queryParams) => { static getAssignedApplications = (callback, errCallback, queryParams) => {
NetworkService.get(`${API_BASE_URL}/assignedApplication`, callback, errCallback, queryParams); NetworkService.get(`${API_BASE_URL}/assignedApplication`, callback, errCallback, queryParams);
}; };