diff --git a/src/assets/scss/components/appPage.scss b/src/assets/scss/components/appPage.scss index 4ed00a3..a07df79 100644 --- a/src/assets/scss/components/appPage.scss +++ b/src/assets/scss/components/appPage.scss @@ -159,6 +159,11 @@ opacity: 0.8; } + &.danger { + border-color: var(--message-error-color); + background-color: #ffd0d0; + } + h2 { color: var(--global-textColor); font-size: 21px; @@ -168,6 +173,12 @@ margin: 0; } + &.danger { + p, span { + color: var(--message-error-color); + } + } + .row { display: flex; gap: 1rem; diff --git a/src/components/FormField/components/CriteriaTable/RenderTable/components/NumericFormulaCell/index.js b/src/components/FormField/components/CriteriaTable/RenderTable/components/NumericFormulaCell/index.js index 75f3b3a..7ededbe 100644 --- a/src/components/FormField/components/CriteriaTable/RenderTable/components/NumericFormulaCell/index.js +++ b/src/components/FormField/components/CriteriaTable/RenderTable/components/NumericFormulaCell/index.js @@ -15,7 +15,7 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table }) return ( onChange(e.value)} onFocus={onFocus} minFractionDigits={0} diff --git a/src/components/FormField/components/CriteriaTable/index.js b/src/components/FormField/components/CriteriaTable/index.js index f965321..0b34a78 100644 --- a/src/components/FormField/components/CriteriaTable/index.js +++ b/src/components/FormField/components/CriteriaTable/index.js @@ -120,12 +120,14 @@ const Table = ({ ? * : null} {tableValue - ? : null} + ?
+ +
: null} ) } diff --git a/src/components/FormField/components/Table/RenderTable/components/NumericFormulaCell/index.js b/src/components/FormField/components/Table/RenderTable/components/NumericFormulaCell/index.js index 75f3b3a..7ededbe 100644 --- a/src/components/FormField/components/Table/RenderTable/components/NumericFormulaCell/index.js +++ b/src/components/FormField/components/Table/RenderTable/components/NumericFormulaCell/index.js @@ -15,7 +15,7 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table }) return ( onChange(e.value)} onFocus={onFocus} minFractionDigits={0} diff --git a/src/components/FormField/components/Table/index.js b/src/components/FormField/components/Table/index.js index 62d71de..8edd2d7 100644 --- a/src/components/FormField/components/Table/index.js +++ b/src/components/FormField/components/Table/index.js @@ -170,12 +170,15 @@ const Table = ({ ? * : null} {rows - ? : null} + ?
+ +
+ : null} {!isEmpty(columns) && !shouldDisableNewRows ?
{__('Aggiungi una riga', 'gepafin')} diff --git a/src/components/FormField/components/Wysiwyg/index.js b/src/components/FormField/components/Wysiwyg/index.js index dcb793e..8c33a69 100644 --- a/src/components/FormField/components/Wysiwyg/index.js +++ b/src/components/FormField/components/Wysiwyg/index.js @@ -1,11 +1,19 @@ -import React from 'react'; +import React, { useRef } from 'react'; import { classNames } from 'primereact/utils'; import { Controller } from 'react-hook-form'; +import Quill from 'quill'; +import { __ } from '@wordpress/i18n'; + +// components import { Editor } from 'primereact/editor'; import BlockingOverlay from '../../../BlockingOverlay'; +import { Button } from 'primereact/button'; + +const Delta = Quill.import('delta'); const Wysiwyg = ({ fieldName, + setDataFn, label, control, rows = 3, @@ -16,6 +24,11 @@ const Wysiwyg = ({ placeholder = '', disabled = false }) => { + const editorRef = useRef(null); + + const handleCleanValue = () => { + setDataFn(fieldName, '', { shouldValidate: true }); + }; const renderHeader = () => { return ( @@ -42,6 +55,13 @@ const Wysiwyg = ({ +
+ ); + }; + + const dateStartBodyTemplate = (rowData) => { + const startTimeObj = getTimeParsedFromString(rowData.startTime); + return formatDate(rowData.start_date) + ' ' + getTimeFromISOstring(startTimeObj); + }; + + const dateEndBodyTemplate = (rowData) => { + const endTimeObg = getTimeParsedFromString(rowData.endTime); + return formatDate(rowData.end_date) + ' ' + getTimeFromISOstring(endTimeObg); + }; + + 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 header = renderHeader(); + + return( +
+ setFilters(e.filters)}> + + + + + +
+ ) +} + +export default LatestBandiTable; \ No newline at end of file diff --git a/src/pages/DashboardInstructorManager/index.js b/src/pages/DashboardInstructorManager/index.js index 2ee8a13..3cb597f 100644 --- a/src/pages/DashboardInstructorManager/index.js +++ b/src/pages/DashboardInstructorManager/index.js @@ -9,30 +9,37 @@ import DashboardService from '../../service/dashboard-service'; // components import { Button } from 'primereact/button'; -import PreInstructorDomandeTable from '../DashboardPreInstructor/components/PreInstructorDomandeTable'; +import LatestBandiTableInstructorManager from './components/LatestBandiTableInstructorManager'; +import AllDomandeTable from '../Domande/components/AllDomandeTable'; +import DraftApplicationsTable from '../Dashboard/components/DraftApplicationsTable'; +import ChartDomandePerBando from '../../components/ChartDomandePerBando'; +import ChartStatoDomande from '../../components/ChartStatoDomande'; const DashboardInstructorManager = () => { const navigate = useNavigate(); const [mainStats, setMainStats] = useState({}); + const [chartStats, setChartStats] = 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); } + const getStats = (data) => { + if (data.status === 'SUCCESS') { + setMainStats(data.data.widget1); + setChartStats(data.data.widgetBars); + } + } + + const errGetStats = () => { + } + useEffect(() => { - DashboardService.getEvaluationsStats(getStats, errGetStats); + DashboardService.getAdminStats(getStats, errGetStats); }, []); return( @@ -44,63 +51,102 @@ const DashboardInstructorManager = () => {
-

{__('Riepilogo', 'gepafin')}

-
+

{__('Panoramica di Sistema', 'gepafin')}

+
- {__('Totale domande', 'gepafin')} + {__('Bandi attivi', 'gepafin')}
- {__('In soccorso', 'gepafin')} + {__('Utenti registrati', 'gepafin')}
- {__('In valutazione', 'gepafin')} + {__('Domande in pre-istruttoria', 'gepafin')}
- {__('Completate', 'gepafin')} + {__('Domande in bozza', 'gepafin')}
- {__('Tempo medio di valutazione', 'gepafin')} + {__('Aziende', 'gepafin')}
- {__('Domande in scadenza (48h)', 'gepafin')} + {__('Totale finanziamenti attivi', 'gepafin')} + value={getStatValue('totalActiveFinancing', 0)} + format={{ + notation: 'compact', + compactDisplay: 'short', + roundingMode: 'trunc', + style: 'currency', + currency: 'EUR', + currencyDisplay: 'symbol' + }} + locales="it-IT"/>
-
+ {/*

{__('Panoramica delle domande da valutare', 'gepafin')}

+
*/} +
+

{__('Ultimi bandi pubblicati', 'gepafin')}

+
+
+

{__('Ultime domande pubblicate', 'gepafin')}

+ +
+ +
+ +
+

{__('Domande in bozza', 'gepafin')}

+ +
+ +
+ + {chartStats.applicationPerCall + ?
+

{__('Statistiche di sistema', 'gepafin')}

+
+ + +
+
: null} + +
+
{__('Azioni rapide', 'gepafin')}
diff --git a/src/service/notification-service.js b/src/service/notification-service.js index 75c22a7..e946893 100644 --- a/src/service/notification-service.js +++ b/src/service/notification-service.js @@ -4,12 +4,8 @@ const API_BASE_URL = process.env.REACT_APP_API_EXECUTION_ADDRESS; export default class NotificationService { - /*static getNotifications = (id, callback, errCallback, queryParams) => { - NetworkService.get(`${API_BASE_URL}/notification/user/${id}`, callback, errCallback, queryParams); - };*/ - - static getNotificationsByCompanyId = (id, companyId, callback, errCallback, queryParams) => { - NetworkService.get(`${API_BASE_URL}/notification/user/${id}/company/${companyId}/notifications`, callback, errCallback, queryParams); + static getNotificationsByCompanyIdPagination = (id, companyId, body, callback, errCallback, queryParams) => { + NetworkService.post(`${API_BASE_URL}/notification/user/${id}/company/${companyId}/pagination`, body, callback, errCallback, queryParams); }; static getNotificationsPagination = (id, body, callback, errCallback, queryParams) => { @@ -22,9 +18,9 @@ export default class NotificationService { ]); }; - static notificationMakeUnread = (id, callback, errCallback) => { + /*static notificationMakeUnread = (id, callback, errCallback) => { NetworkService.put(`${API_BASE_URL}/notification/${id}`, {}, callback, errCallback, [ ['status', 'UNREAD'] ]); - }; + };*/ }