diff --git a/src/assets/scss/components/layout.scss b/src/assets/scss/components/layout.scss
index e350503..5b617be 100644
--- a/src/assets/scss/components/layout.scss
+++ b/src/assets/scss/components/layout.scss
@@ -116,6 +116,20 @@ img {
}
}
}
+
+ li div.nonLink {
+ display: flex;
+ padding: 10.5px 17.5px;
+ align-items: center;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 100%;
+ text-decoration: none;
+ border-bottom: 1px solid var(--menu-borderColor);
+ background-color: var(--button-secondary-borderColor);
+ color: white;
+ }
}
}
diff --git a/src/layouts/DefaultLayout/components/AppSidebar/index.js b/src/layouts/DefaultLayout/components/AppSidebar/index.js
index 30bc83e..aa25929 100644
--- a/src/layouts/DefaultLayout/components/AppSidebar/index.js
+++ b/src/layouts/DefaultLayout/components/AppSidebar/index.js
@@ -53,69 +53,97 @@ const AppSidebar = () => {
icon: 'pi pi-file',
href: '/domande',
id: 6,
- enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
+ enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS', 'ASSIGED_APPLICATION']).length
},
{
label: __('Domande da valutare', 'gepafin'),
icon: 'pi pi-calendar-clock',
href: '/domande',
id: 7,
+ enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length && !intersection(permissions, ['ASSIGED_APPLICATION']).length
+ },
+ {
+ label: __('Bandi attivi', 'gepafin'),
+ icon: 'pi pi-file',
+ href: '/bandi',
+ id: 8,
+ enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
+ },
+ {
+ label: __('Soccorso', 'gepafin'),
+ icon: ,
+ href: '/soccorso-istruttorio',
+ id: 9,
enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
},
{
label: __('Archivio domande', 'gepafin'),
icon: 'pi pi-briefcase',
href: '/domande',
- id: 8,
+ id: 10,
enable: intersection(permissions, ['APPLY_CALLS']).length
},
{
label: __('Archivio domande', 'gepafin'),
icon: 'pi pi-briefcase',
href: '/domande-archivio',
- id: 9,
+ id: 11,
enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
},
{
label: __('Archivio domande', 'gepafin'),
icon: 'pi pi-briefcase',
href: '/domande-archivio',
- id: 10,
+ id: 12,
enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
},
+ {
+ label: __('Area personale', 'gepafin'),
+ icon: 'pi pi-calendar-clock',
+ id: 17,
+ enable: intersection(permissions, ['ASSIGED_APPLICATION']).length
+ },
+ {
+ label: __('Domande da valutare', 'gepafin'),
+ icon: 'pi pi-calendar-clock',
+ href: '/mie-domande',
+ id: 18,
+ enable: intersection(permissions, ['ASSIGED_APPLICATION']).length
+ },
{
label: __('Soccorso istruttorio', 'gepafin'),
icon: ,
- href: '/soccorso-istruttorio',
- id: 11,
- enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
+ href: '/mio-soccorso-istruttorio',
+ id: 19,
+ enable: intersection(permissions, ['ASSIGED_APPLICATION']).length
},
{
label: __('Gestione utenti', 'gepafin'),
icon: 'pi pi-users',
href: '/utenti',
- id: 12,
+ id: 13,
enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
},
{
label: __('Configurazione', 'gepafin'),
icon: 'pi pi-cog',
//href: '/configurazione',
- id: 13,
+ id: 14,
enable: false
},
{
label: __('Report e Analisi', 'gepafin'),
icon: 'pi pi-chart-bar',
//href: '/stats',
- id: 14,
+ id: 15,
enable: false
},
{
label: __('Log di Sistema', 'gepafin'),
icon: 'pi pi-receipt',
- clickFn: () => {},
- id: 15,
+ clickFn: () => {
+ },
+ id: 16,
enable: false
}
]
@@ -125,20 +153,25 @@ const AppSidebar = () => {
{items
.filter(o => o.enable)
.map(o =>
- {o.href
- ?
- {is(String, o.icon)
- ?
- : o.icon}
- {o.label}
-
- : }
- )}
+ {o.href
+ ?
+ {is(String, o.icon)
+ ?
+ : o.icon}
+ {o.label}
+
+ : (o.clickFn ?
+
+ :
+ {o.label}
+
)}
+ )}
}
diff --git a/src/pages/BandiPreInstructor/components/AllBandiTable/index.js b/src/pages/BandiPreInstructor/components/AllBandiTable/index.js
new file mode 100644
index 0000000..a5dbe61
--- /dev/null
+++ b/src/pages/BandiPreInstructor/components/AllBandiTable/index.js
@@ -0,0 +1,149 @@
+import React, { useState, useEffect} from 'react';
+import { __ } from '@wordpress/i18n';
+import { is, uniq } from 'ramda';
+
+// tools
+import getBandoSeverity from '../../../../helpers/getBandoSeverity';
+import getBandoLabel from '../../../../helpers/getBandoLabel';
+import getDateFromISOstring from '../../../../helpers/getDateFromISOstring';
+
+// api
+import BandoService from '../../../../service/bando-service';
+
+// components
+import { FilterMatchMode, FilterOperator } from 'primereact/api';
+import { DataTable } from 'primereact/datatable';
+import { Column } from 'primereact/column';
+import { Dropdown } from 'primereact/dropdown';
+import { Button } from 'primereact/button';
+import { Calendar } from 'primereact/calendar';
+import { Tag } from 'primereact/tag';
+import ProperBandoLabel from '../../../../components/ProperBandoLabel';
+import { Link } from 'react-router-dom';
+import translationStrings from '../../../../translationStringsForComponents';
+
+
+const AllBandiTable = () => {
+ const [items, setItems] = useState(null);
+ const [filters, setFilters] = useState(null);
+ const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
+ const [statuses, setStatuses] = useState([]);
+
+ useEffect(() => {
+ setLocalAsyncRequest(true);
+ BandoService.getBandi(getCallback, errGetCallbacks);
+ }, []);
+
+ const getCallback = (data) => {
+ if (data.status === 'SUCCESS') {
+ setItems(getFormattedBandiData(data.data));
+ setStatuses(uniq(data.data.map(o => o.status)))
+ initFilters();
+ }
+ setLocalAsyncRequest(false);
+ }
+
+ const errGetCallbacks = (data) => {
+ setLocalAsyncRequest(false);
+ }
+
+ const getFormattedBandiData = (data) => {
+ return data.map((d) => {
+ d.dates = d.dates.map(v => is(String, v) ? new Date(v) : (v ? v : ''));
+ return d;
+ });
+ };
+
+ const clearFilter = () => {
+ initFilters();
+ };
+
+ const initFilters = () => {
+ setFilters({
+ global: { value: null, matchMode: FilterMatchMode.CONTAINS },
+ name: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }] },
+ start_date: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
+ end_date: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
+ status: { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] },
+ });
+ };
+
+ const renderHeader = () => {
+ return (
+
+
+
+ );
+ };
+
+ /*const nameBodyTemplate = (rowData) => {
+ return {rowData.name}
+ }*/
+
+ const dateStartBodyTemplate = (rowData) => {
+ return getDateFromISOstring(rowData.dates[0]);
+ };
+
+ const dateEndBodyTemplate = (rowData) => {
+ return getDateFromISOstring(rowData.dates[1]);
+ };
+
+ const dateFilterTemplate = (options) => {
+ return options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
+ };
+
+ const statusBodyTemplate = (rowData) => {
+ return ;
+ };
+
+ const statusFilterTemplate = (options) => {
+ return options.filterCallback(e.value, options.index)}
+ itemTemplate={statusItemTemplate}
+ placeholder={translationStrings.selectOneLabel}
+ className="p-column-filter"
+ showClear />;
+ };
+
+ const statusItemTemplate = (option) => {
+ return ;
+ };
+
+ const actionsBodyTemplate = (rowData) => {
+ return
+
+
+ }
+
+ const header = renderHeader();
+
+ return(
+
+ setFilters(e.filters)}>
+
+
+
+
+
+
+
+ )
+}
+
+export default AllBandiTable;
diff --git a/src/pages/BandiPreInstructor/index.js b/src/pages/BandiPreInstructor/index.js
new file mode 100644
index 0000000..8388166
--- /dev/null
+++ b/src/pages/BandiPreInstructor/index.js
@@ -0,0 +1,27 @@
+import React from 'react';
+import { __ } from '@wordpress/i18n';
+import { useNavigate } from 'react-router-dom';
+
+// components
+import AllBandiTable from './components/AllBandiTable';
+import { Button } from 'primereact/button';
+
+const BandiPreInstructor = () => {
+ const navigate = useNavigate();
+
+ return(
+
+
+
{__('Bandi attivi', 'gepafin')}
+
+
+
+
+
+
+ )
+}
+
+export default BandiPreInstructor;
\ No newline at end of file
diff --git a/src/pages/BandoViewPreInstructor/index.js b/src/pages/BandoViewPreInstructor/index.js
new file mode 100644
index 0000000..52bbe25
--- /dev/null
+++ b/src/pages/BandoViewPreInstructor/index.js
@@ -0,0 +1,274 @@
+import React, { useState, useEffect, useRef } from 'react';
+import { __ } from '@wordpress/i18n';
+import { useNavigate, useParams } from 'react-router-dom';
+import { is, isEmpty, isNil } from 'ramda';
+import 'quill/dist/quill.core.css';
+
+// store
+import { storeSet, useStore } from '../../store';
+
+// tools
+import getNumberWithCurrency from '../../helpers/getNumberWithCurrency';
+import getDateFromISOstring from '../../helpers/getDateFromISOstring';
+
+// components
+import { Skeleton } from 'primereact/skeleton';
+import { Accordion } from 'primereact/accordion';
+import { AccordionTab } from 'primereact/accordion';
+import { InputTextarea } from 'primereact/inputtextarea';
+import { Button } from 'primereact/button';
+import BandoService from '../../service/bando-service';
+import { Messages } from 'primereact/messages';
+import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
+import renderHtmlContent from '../../helpers/renderHtmlContent';
+
+const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
+
+const BandoViewPreInstructor = () => {
+ const isAsyncRequest = useStore().main.isAsyncRequest();
+ const { id } = useParams();
+ const navigate = useNavigate();
+ const [data, setData] = useState({});
+ const [newQuestion, setNewQuestion] = useState('');
+ const bandoMsgs = useRef(null);
+
+ const closePreview = () => {
+ navigate(`/bandi/${id}`);
+ }
+
+ const getCallback = (data) => {
+ if (data.status === 'SUCCESS') {
+ setData(getFormattedBandiData(data.data));
+ }
+ storeSet.main.unsetAsyncRequest();
+ }
+
+ const errGetCallback = (data) => {
+ if (bandoMsgs.current && data.message) {
+ bandoMsgs.current.show([
+ {
+ sticky: true, severity: 'error', summary: '',
+ detail: data.message,
+ closable: true
+ }
+ ]);
+ }
+ set404FromErrorResponse(data);
+ storeSet.main.unsetAsyncRequest();
+ }
+
+ const getFormattedBandiData = (data) => {
+ data.dates = data.dates.map(v => is(String, v) ? new Date(v) : (v ? v : ''));
+ return data;
+ };
+
+ useEffect(() => {
+ const parsed = parseInt(id)
+ const bandoId = !isNaN(parsed) ? parsed : 0;
+
+ BandoService.getBando(bandoId, getCallback, errGetCallback);
+ }, [id]);
+
+ return (
+
+ {!isAsyncRequest && !isEmpty(data)
+ ?
+
{data.name}
+
+ {__('Data:', 'gepafin')}
+ {getDateFromISOstring(data.createdDate)}
+
+
+ : <>
+
+
+ >}
+
+
+
+
+ {!isAsyncRequest && !isEmpty(data)
+ ?
+ {!isEmpty(data.images)
+ ?
+
+
+ : null}
+
+
+
{__('Descrizione breve', 'gepafin')}
+
+ {renderHtmlContent(data.descriptionShort)}
+
+
+
+
+
+
+ {__('Importo totale', 'gepafin')}
+ {getNumberWithCurrency(data.amount)}
+
+
+ {__('Importo minimo per progetto', 'gepafin')}
+ {getNumberWithCurrency(data.amountMin)}
+
+
+ {__('Importo massimo per progetto', 'gepafin')}
+ {getNumberWithCurrency(data.amountMax)}
+
+
+
+
+
+ {__('Data apertura', 'gepafin')}
+ {getDateFromISOstring(data.dates[0])} {data.startTime}
+
+
+ {__('Data chiusura', 'gepafin')}
+ {getDateFromISOstring(data.dates[1])} {data.endTime}
+
+
+
+
+
+
{__('Descrizione dettagliata', 'gepafin')}
+
+ {renderHtmlContent(data.descriptionLong)}
+
+
+
+
+
{__('Requisiti di Partecipazione', 'gepafin')}
+
+
+ {data.aimedTo.map((o, i) => -
+ {o.value}
+
)}
+
+
+
+
+
+
{__('Documentazione richiesta', 'gepafin')}
+
+ {renderHtmlContent(data.documentationRequested)}
+
+
+
+ {/*
+
{__('Criteri di Valutazione', 'gepafin')}
+
+
+ {data.criteria.map((o, i) => -
+ {o.value} {o.score > 0 ? sprintf(__(' (%d punti)'), o.score) : null}
+
)}
+
+
+
*/}
+
+
+
{__('Allegati', 'gepafin')}
+
+
+ {data.docs
+ .filter(o => o.source === 'CALL' && o.type === 'DOCUMENT')
+ .map((o, i) => -
+ {o.name}
+
)}
+
+
+
+
+
+
{__('FAQ', 'gepafin')}
+
+ {data.faq
+ .filter(o => o.isVisible)
+ .map((o, i) =>
+
+ {renderHtmlContent(o.response)}
+
+ )}
+
+
+
+ {REACT_APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE'
+ ? null
+ :
+
{__('Non hai trovato la risposta che cercavi?', 'gepafin')}
+
+
+ setNewQuestion(e.target.value)}
+ aria-describedby="newQuestion-help"/>
+
+ {__('Riceverai una notifica quando ti risponderemo', 'gepafin')}
+
+
+
}
+
+
+
{__('Download Documenti', 'gepafin')}
+
+
+
+
+
+
{__('Contatti per Assistenza', 'gepafin')}
+
+
Email: {data.email}
+ {!isNil(data.phoneNumber) ?
+
{__('Telefono', 'gepafin')}: +39 {data.phoneNumber}
: null}
+
+
+
+ : <>
+
+
+
+
+
+
+
+
+ >}
+
+ )
+
+}
+
+export default BandoViewPreInstructor;
\ No newline at end of file
diff --git a/src/pages/DashboardInstructorManager/components/InstructorManagerMieDomandeTable/index.js b/src/pages/DashboardInstructorManager/components/InstructorManagerMieDomandeTable/index.js
new file mode 100644
index 0000000..537aefd
--- /dev/null
+++ b/src/pages/DashboardInstructorManager/components/InstructorManagerMieDomandeTable/index.js
@@ -0,0 +1,195 @@
+import React, { useState, useEffect} from 'react';
+import { __ } from '@wordpress/i18n';
+import { is, uniq, isNil } from 'ramda';
+import { Link } from 'react-router-dom';
+
+// api
+import AssignedApplicationService from '../../../../service/assigned-application-service';
+
+// tools
+import getBandoLabel from '../../../../helpers/getBandoLabel';
+import getBandoSeverity from '../../../../helpers/getBandoSeverity';
+
+// components
+import { FilterMatchMode, FilterOperator } from 'primereact/api';
+import { DataTable } from 'primereact/datatable';
+import { Column } from 'primereact/column';
+import { Button } from 'primereact/button';
+import { Calendar } from 'primereact/calendar';
+import ProperBandoLabel from '../../../../components/ProperBandoLabel';
+import { Dropdown } from 'primereact/dropdown';
+import { Tag } from 'primereact/tag';
+
+import translationStrings from '../../../../translationStringsForComponents';
+import { useStore } from '../../../../store';
+
+const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
+
+const InstructorManagerMieDomandeTable = ({ userId = null, statuses = [] }) => {
+ const [items, setItems] = useState(null);
+ const [filters, setFilters] = useState(null);
+ const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
+ const [statusesForFilter, setStatusesForFilter] = useState([]);
+ const userData = useStore().main.userData();
+
+ useEffect(() => {
+ if (!isNil(userId)) {
+ setLocalAsyncRequest(true);
+
+ if (userId === 0) {
+ AssignedApplicationService.getAssignedApplications(getCallback, errGetCallbacks, [
+ ['statuses', statuses]
+ ]);
+ } else {
+ AssignedApplicationService.getAssignedApplications(getCallback, errGetCallbacks, [
+ ['userId', userId],
+ ['statuses', statuses]
+ ]);
+ }
+ }
+ }, [userId]);
+
+ const getCallback = (data) => {
+ if (data.status === 'SUCCESS') {
+ setItems(getFormattedData(data.data));
+ setStatusesForFilter(uniq(data.data.map(o => o.status)))
+ initFilters();
+ }
+ setLocalAsyncRequest(false);
+ }
+
+ const errGetCallbacks = (data) => {
+ setLocalAsyncRequest(false);
+ }
+
+ const getFormattedData = (data) => {
+ return data.map((d) => {
+ d.evaluationEndDate = is(String, d.evaluationEndDate) ? new Date(d.evaluationEndDate) : (d.evaluationEndDate ? d.evaluationEndDate : '');
+ d.submissionDate = is(String, d.submissionDate) ? new Date(d.submissionDate) : (d.submissionDate ? d.submissionDate : '');
+ return d;
+ });
+ };
+
+ const formatDate = (value) => {
+ return value.toLocaleDateString('it-IT', {
+ day: '2-digit',
+ month: '2-digit',
+ year: 'numeric'
+ });
+ };
+
+ const clearFilter = () => {
+ initFilters();
+ };
+
+ const initFilters = () => {
+ setFilters({
+ global: { value: null, matchMode: FilterMatchMode.CONTAINS },
+ callName: {
+ operator: FilterOperator.AND,
+ constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }]
+ },
+ companyName: {
+ operator: FilterOperator.AND,
+ constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }]
+ },
+ submissionDate: {
+ operator: FilterOperator.AND,
+ constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
+ },
+ evaluationEndDate: {
+ operator: FilterOperator.AND,
+ constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
+ }
+ });
+ };
+
+ const renderHeader = () => {
+ return (
+
+
+
+ );
+ };
+
+ const dateAppliedBodyTemplate = (rowData) => {
+ return formatDate(rowData.submissionDate);
+ };
+
+ const dateEndBodyTemplate = (rowData) => {
+ return formatDate(rowData.evaluationEndDate);
+ };
+
+ const dateFilterTemplate = (options) => {
+ return options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
+ };
+
+ const statusBodyTemplate = (rowData) => {
+ return ;
+ };
+
+ const statusFilterTemplate = (options) => {
+ return options.filterCallback(e.value, options.index)} itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel} className="p-column-filter" showClear />;
+ };
+
+ const statusItemTemplate = (option) => {
+ return ;
+ };
+
+ const actionsBodyTemplate = (rowData) => {
+ const label = ['OPEN', 'SOCCORSO'].includes(rowData.status) && userData.id === rowData.userId
+ ? __('Valuta', 'gepafin')
+ : __('Mostra', 'gepafin');
+ return
+
+
+ }
+
+ const header = renderHeader();
+
+ return(
+
+ setFilters(e.filters)}>
+
+
+ {APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
+ ? : null}
+ {APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
+ ? : null}
+
+
+
+
+
+
+
+
+ )
+}
+
+export default InstructorManagerMieDomandeTable;
\ No newline at end of file
diff --git a/src/pages/DashboardInstructorManager/index.js b/src/pages/DashboardInstructorManager/index.js
new file mode 100644
index 0000000..2ee8a13
--- /dev/null
+++ b/src/pages/DashboardInstructorManager/index.js
@@ -0,0 +1,119 @@
+import React, { useEffect, useState } from 'react';
+import { __ } from '@wordpress/i18n';
+import { useNavigate } from 'react-router-dom';
+import NumberFlow from '@number-flow/react';
+import { pathOr } from 'ramda';
+
+// service
+import DashboardService from '../../service/dashboard-service';
+
+// components
+import { Button } from 'primereact/button';
+import PreInstructorDomandeTable from '../DashboardPreInstructor/components/PreInstructorDomandeTable';
+
+const DashboardInstructorManager = () => {
+ const navigate = useNavigate();
+ const [mainStats, setMainStats] = useState({});
+
+ const goToAllEvaluations = () => {
+ navigate('/domande');
+ }
+
+ const getStats = (data) => {
+ if (data.status === 'SUCCESS') {
+ setMainStats(data.data);
+ }
+ }
+
+ const errGetStats = () => {}
+
+ const getStatValue = (key, fallback = '') => {
+ return pathOr(fallback, [key], mainStats);
+ }
+
+ useEffect(() => {
+ DashboardService.getEvaluationsStats(getStats, errGetStats);
+ }, []);
+
+ return(
+
+
+
{__('Dashboard', 'gepafin')}
+
+
+
+
+
+
{__('Riepilogo', 'gepafin')}
+
+
+ {__('Totale domande', 'gepafin')}
+
+
+
+ {__('In soccorso', 'gepafin')}
+
+
+
+ {__('In valutazione', 'gepafin')}
+
+
+
+ {__('Completate', 'gepafin')}
+
+
+
+ {__('Tempo medio di valutazione', 'gepafin')}
+
+
+
+ {__('Domande in scadenza (48h)', 'gepafin')}
+
+
+
+
+
+
+
+
+
{__('Panoramica delle domande da valutare', 'gepafin')}
+
+
+
+
+
+
+ {__('Azioni rapide', 'gepafin')}
+
+
+
+
+ )
+}
+
+export default DashboardInstructorManager;
\ No newline at end of file
diff --git a/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js b/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js
index d8c5188..43b2cf1 100644
--- a/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js
+++ b/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js
@@ -1,11 +1,8 @@
import React, { useState, useEffect} from 'react';
import { __ } from '@wordpress/i18n';
-import { is, uniq } from 'ramda';
+import { is, uniq, isNil } from 'ramda';
import { Link } from 'react-router-dom';
-// store
-import { useStore } from '../../../../store';
-
// api
import AssignedApplicationService from '../../../../service/assigned-application-service';
@@ -24,27 +21,38 @@ import { Dropdown } from 'primereact/dropdown';
import { Tag } from 'primereact/tag';
import translationStrings from '../../../../translationStringsForComponents';
+import { useStore } from '../../../../store';
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
-const PreInstructorDomandeTable = () => {
- const userData = useStore().main.userData();
+const PreInstructorDomandeTable = ({ userId = null, statuses = [] }) => {
const [items, setItems] = useState(null);
const [filters, setFilters] = useState(null);
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
- const [statuses, setStatuses] = useState([]);
+ const [statusesForFilter, setStatusesForFilter] = useState([]);
+ const userData = useStore().main.userData();
useEffect(() => {
- setLocalAsyncRequest(true);
- AssignedApplicationService.getAssignedApplications(getCallback, errGetCallbacks, [
- ['userId', userData.id]
- ]);
- }, []);
+ if (!isNil(userId)) {
+ setLocalAsyncRequest(true);
+
+ if (userId === 0) {
+ AssignedApplicationService.getAssignedApplications(getCallback, errGetCallbacks, [
+ ['statuses', statuses]
+ ]);
+ } else {
+ AssignedApplicationService.getAssignedApplications(getCallback, errGetCallbacks, [
+ ['userId', userId],
+ ['statuses', statuses]
+ ]);
+ }
+ }
+ }, [userId]);
const getCallback = (data) => {
if (data.status === 'SUCCESS') {
setItems(getFormattedData(data.data));
- setStatuses(uniq(data.data.map(o => o.status)))
+ setStatusesForFilter(uniq(data.data.map(o => o.status)))
initFilters();
}
setLocalAsyncRequest(false);
@@ -121,7 +129,7 @@ const PreInstructorDomandeTable = () => {
};
const statusFilterTemplate = (options) => {
- return options.filterCallback(e.value, options.index)} itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel} className="p-column-filter" showClear />;
+ return options.filterCallback(e.value, options.index)} itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel} className="p-column-filter" showClear />;
};
const statusItemTemplate = (option) => {
@@ -129,8 +137,11 @@ const PreInstructorDomandeTable = () => {
};
const actionsBodyTemplate = (rowData) => {
+ const label = ['OPEN', 'SOCCORSO'].includes(rowData.status) && userData.id === rowData.userId
+ ? __('Valuta', 'gepafin')
+ : __('Mostra', 'gepafin');
return
-
+
}
diff --git a/src/pages/DashboardPreInstructor/index.js b/src/pages/DashboardPreInstructor/index.js
index 6e2f59f..cbd94a5 100644
--- a/src/pages/DashboardPreInstructor/index.js
+++ b/src/pages/DashboardPreInstructor/index.js
@@ -1,58 +1,106 @@
-import React from 'react';
+import React, { useEffect, useState } from 'react';
import { __ } from '@wordpress/i18n';
import { useNavigate } from 'react-router-dom';
+import NumberFlow from '@number-flow/react';
+import { pathOr } from 'ramda';
// store
-//import { useStore } from '../../store';
+import { useStore } from '../../store';
-// api
-//import DashboardService from '../../service/dashboard-service';
+// service
+import DashboardService from '../../service/dashboard-service';
// components
-//import LatestBandiTable from './components/LatestBandiTable';
-//import MyLatestSubmissionsTable from './components/MyLatestSubmissionsTable';
import { Button } from 'primereact/button';
import PreInstructorDomandeTable from './components/PreInstructorDomandeTable';
const DashboardPreInstructor = () => {
const navigate = useNavigate();
- //const [mainStats, setMainStats] = useState({});
+ const [mainStats, setMainStats] = useState({});
+ const userData = useStore().main.userData();
const goToAllEvaluations = () => {
navigate('/domande');
}
+ const getStats = (data) => {
+ if (data.status === 'SUCCESS') {
+ setMainStats(data.data);
+ }
+ }
+
+ const errGetStats = () => {}
+
+ const getStatValue = (key, fallback = '') => {
+ return pathOr(fallback, [key], mainStats);
+ }
+
+ useEffect(() => {
+ DashboardService.getEvaluationsStats(getStats, errGetStats);
+ }, []);
+
return(
{__('Dashboard', 'gepafin')}
- {/*
+
-
{__('Panoramica di Sistema', 'gepafin')}
-
+
{__('Riepilogo', 'gepafin')}
+
- {__('Domande attive', 'gepafin')}
- {getStatValue('numberOfApplications', 0)}
+ {__('Totale domande', 'gepafin')}
+
- {__('Bandi osservati', 'gepafin')}
- {getStatValue('numberOfCalls', 0)}
+ {__('In soccorso', 'gepafin')}
+
- {__('Documenti da integrare', 'gepafin')}
- {getStatValue('numberOfIntegratedDocuments', 0)}
+ {__('In valutazione', 'gepafin')}
+
+
+
+ {__('Completate', 'gepafin')}
+
+
+
+ {__('Tempo medio di valutazione', 'gepafin')}
+
+
+
+ {__('Domande in scadenza (48h)', 'gepafin')}
+
-
*/}
+
{__('Coda di lavoro', 'gepafin')}
-
+
diff --git a/src/pages/DomandaEditInstructorManager/index.js b/src/pages/DomandaEditInstructorManager/index.js
index 137e8de..1a4d37f 100644
--- a/src/pages/DomandaEditInstructorManager/index.js
+++ b/src/pages/DomandaEditInstructorManager/index.js
@@ -68,7 +68,7 @@ const DomandaEditPreInstructor = () => {
});
const goToEvaluationsPage = () => {
- navigate('/domande');
+ navigate('/mie-domande');
}
const updateFlagsForSoccorso = (data) => {
@@ -101,9 +101,9 @@ const DomandaEditPreInstructor = () => {
const doNewSoccorso = () => {
if (connectedSoccorsoId !== 0) {
- navigate(`/domande/${id}/soccorso/${connectedSoccorsoId}`);
+ navigate(`/mie-domande/${id}/soccorso/${connectedSoccorsoId}`);
} else {
- doSaveDraft(`/domande/${id}/aggiungi-soccorso/`)
+ doSaveDraft(`/mie-domande/${id}/aggiungi-soccorso/`)
}
}
@@ -506,7 +506,7 @@ const DomandaEditPreInstructor = () => {
}
const evaluationShouldBeBlocked = (data = {}) => {
- const userData = storeGet.main.userData()
+ const userData = storeGet.main.userData();
return isAsyncRequest || userData.id !== data.assignedUserId;
}
@@ -592,6 +592,10 @@ const DomandaEditPreInstructor = () => {
{__('Data assegnazione', 'gepafin')}
{getDateTimeFromISOstring(data.assignedAt)}
+
+ {__('Aassegnato a', 'gepafin')}
+ {data.assignedUserName}
+
{__('Scadenza Valutazione', 'gepafin')}
{getDateFromISOstring(data.evaluationEndDate)}
@@ -605,7 +609,7 @@ const DomandaEditPreInstructor = () => {
{__('Scarica documenti della domanda', 'gepafin')}
-
+
diff --git a/src/pages/DomandaEditPreInstructor/index.js b/src/pages/DomandaEditPreInstructor/index.js
index 6d61af8..b516229 100644
--- a/src/pages/DomandaEditPreInstructor/index.js
+++ b/src/pages/DomandaEditPreInstructor/index.js
@@ -594,6 +594,10 @@ const DomandaEditPreInstructor = () => {
{__('Data assegnazione', 'gepafin')}
{getDateTimeFromISOstring(data.assignedAt)}
+
+ {__('Aassegnato a', 'gepafin')}
+ {data.assignedUserName}
+
{__('Scadenza Valutazione', 'gepafin')}
{getDateFromISOstring(data.evaluationEndDate)}
diff --git a/src/pages/DomandeArchive/index.js b/src/pages/DomandeArchive/index.js
index c6e7885..2a629eb 100644
--- a/src/pages/DomandeArchive/index.js
+++ b/src/pages/DomandeArchive/index.js
@@ -2,10 +2,10 @@ import React from 'react';
import { __ } from '@wordpress/i18n';
// components
-import AllDomandeArchiveTable from './components/AllDomandeArchiveTable';
-
-const Domande = () => {
+//import AllDomandeArchiveTable from './components/AllDomandeArchiveTable';
+import PreInstructorDomandeTable from '../DashboardPreInstructor/components/PreInstructorDomandeTable';
+const DomandeArchive = () => {
return (
@@ -15,11 +15,11 @@ const Domande = () => {
-
{__('Domande pubblicate', 'gepafin')}
-
+
{__('Domande completate', 'gepafin')}
+
)
}
-export default Domande;
\ No newline at end of file
+export default DomandeArchive;
\ No newline at end of file
diff --git a/src/pages/DomandeArchivePreInstructor/index.js b/src/pages/DomandeArchivePreInstructor/index.js
new file mode 100644
index 0000000..81b9a78
--- /dev/null
+++ b/src/pages/DomandeArchivePreInstructor/index.js
@@ -0,0 +1,29 @@
+import React from 'react';
+import { __ } from '@wordpress/i18n';
+
+// store
+import { useStore } from '../../store';
+
+// components
+import PreInstructorDomandeTable from '../DashboardPreInstructor/components/PreInstructorDomandeTable';
+
+const DomandeArchivePreInstructor = () => {
+ const userData = useStore().main.userData();
+
+ return (
+
+
+
{__('Archivio domande', 'gepafin')}
+
+
+
+
+
+
{__('Domande completate', 'gepafin')}
+
+
+
+ )
+}
+
+export default DomandeArchivePreInstructor;
\ No newline at end of file
diff --git a/src/pages/DomandeInstructorManager/index.js b/src/pages/DomandeInstructorManager/index.js
index fc68cec..fbe1232 100644
--- a/src/pages/DomandeInstructorManager/index.js
+++ b/src/pages/DomandeInstructorManager/index.js
@@ -159,17 +159,25 @@ const DomandeInstructorManager = () => {
return(
-
{__('Domande da valutare', 'gepafin')}
+ {__('Gestione domande', 'gepafin')}
-
+
{__('Da assegnare', 'gepafin')}
+
+
+
{__('In lavorazione', 'gepafin')}
+
+
+
+ {/*
+
{__('Riepilogo', 'gepafin')}
@@ -217,14 +225,7 @@ const DomandeInstructorManager = () => {
locales="en-US"/>
-
-
-
-
-
-
{__('Domande pubblicate', 'gepafin')}
-
-
+
*/}
+
+
+
+
)
}
diff --git a/src/routes.js b/src/routes.js
index c8c0302..e72c0c2 100644
--- a/src/routes.js
+++ b/src/routes.js
@@ -41,6 +41,13 @@ import DomandeInstructorManager from './pages/DomandeInstructorManager';
import DomandaEditInstructorManager from './pages/DomandaEditInstructorManager';
import UserActivity from './pages/UserActivity';
import DomandeArchive from './pages/DomandeArchive';
+import BandiPreInstructor from './pages/BandiPreInstructor';
+import BandoViewPreInstructor from './pages/BandoViewPreInstructor';
+import DomandeArchivePreInstructor from './pages/DomandeArchivePreInstructor';
+import DashboardInstructorManager from './pages/DashboardInstructorManager';
+import DomandeMieInstructorManager from './pages/DomandeMieInstructorManager';
+import SoccorsoAddInstructorManager from './pages/SoccorsoAddInstructorManager';
+import SoccorsoEditInstructorManager from './pages/SoccorsoEditInstructorManager';
const routes = ({ role, chosenCompanyId }) => {
@@ -51,19 +58,19 @@ const routes = ({ role, chosenCompanyId }) => {
{'ROLE_SUPER_ADMIN' === role ? : null}
{'ROLE_BENEFICIARY' === role ? : null}
{'ROLE_PRE_INSTRUCTOR' === role ? : null}
- {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
+ {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
}/>
{'ROLE_SUPER_ADMIN' === role ? : null}
{'ROLE_BENEFICIARY' === role ? : null}
- {'ROLE_PRE_INSTRUCTOR' === role ? : null}
- {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
+ {'ROLE_PRE_INSTRUCTOR' === role ? : null}
+ {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
}/>
{'ROLE_SUPER_ADMIN' === role ? : null}
{'ROLE_BENEFICIARY' === role ? : null}
- {'ROLE_PRE_INSTRUCTOR' === role ? : null}
- {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
+ {'ROLE_PRE_INSTRUCTOR' === role ? : null}
+ {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
}/>
{'ROLE_SUPER_ADMIN' === role ? : null}
@@ -117,7 +124,7 @@ const routes = ({ role, chosenCompanyId }) => {
{'ROLE_SUPER_ADMIN' === role ? : null}
{'ROLE_BENEFICIARY' === role ? : null}
{'ROLE_PRE_INSTRUCTOR' === role ? : null}
- {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
+ {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
}/>
{'ROLE_SUPER_ADMIN' === role ? : null}
@@ -128,7 +135,7 @@ const routes = ({ role, chosenCompanyId }) => {
{'ROLE_SUPER_ADMIN' === role ? : null}
{'ROLE_BENEFICIARY' === role ? : null}
- {'ROLE_PRE_INSTRUCTOR' === role ? : null}
+ {'ROLE_PRE_INSTRUCTOR' === role ? : null}
{'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
}/>
@@ -141,7 +148,7 @@ const routes = ({ role, chosenCompanyId }) => {
{'ROLE_SUPER_ADMIN' === role ? : null}
{'ROLE_BENEFICIARY' === role ? : null}
{'ROLE_PRE_INSTRUCTOR' === role ? : null}
- {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
+ {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
}/>
{'ROLE_SUPER_ADMIN' === role ? : null}
@@ -155,6 +162,36 @@ const routes = ({ role, chosenCompanyId }) => {
{'ROLE_PRE_INSTRUCTOR' === role ? : null}
{'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
}/>
+
+ {'ROLE_SUPER_ADMIN' === role ? : null}
+ {'ROLE_BENEFICIARY' === role ? : null}
+ {'ROLE_PRE_INSTRUCTOR' === role ? : null}
+ {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
+ }/>
+
+ {'ROLE_SUPER_ADMIN' === role ? : null}
+ {'ROLE_BENEFICIARY' === role ? : null}
+ {'ROLE_PRE_INSTRUCTOR' === role ? : null}
+ {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
+ }/>
+
+ {'ROLE_SUPER_ADMIN' === role ? : null}
+ {'ROLE_BENEFICIARY' === role ? : null}
+ {'ROLE_PRE_INSTRUCTOR' === role ? : null}
+ {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
+ }/>
+
+ {'ROLE_SUPER_ADMIN' === role ? : null}
+ {'ROLE_BENEFICIARY' === role ? : null}
+ {'ROLE_PRE_INSTRUCTOR' === role ? : null}
+ {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
+ }/>
+
+ {'ROLE_SUPER_ADMIN' === role ? : null}
+ {'ROLE_BENEFICIARY' === role ? : null}
+ {'ROLE_PRE_INSTRUCTOR' === role ? : null}
+ {'ROLE_INSTRUCTOR_MANAGER' === role ? : null}
+ }/>
{'ROLE_SUPER_ADMIN' === role ? : null}
{'ROLE_BENEFICIARY' === role ? : null}