From 31206a82cc01c2cecc5507b3b5fc63429ff6d7e4 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Thu, 23 Oct 2025 13:56:14 +0200 Subject: [PATCH] - updates; --- src/pages/DashboardDirector/index.js | 111 +++++++++++++++++++++++++++ src/routes.js | 2 + 2 files changed, 113 insertions(+) create mode 100644 src/pages/DashboardDirector/index.js diff --git a/src/pages/DashboardDirector/index.js b/src/pages/DashboardDirector/index.js new file mode 100644 index 0000000..361ec9c --- /dev/null +++ b/src/pages/DashboardDirector/index.js @@ -0,0 +1,111 @@ +import React, { useEffect, useState } from 'react'; +import { __ } from '@wordpress/i18n'; +import { useNavigate } from 'react-router-dom'; +import { pathOr } from 'ramda'; +import NumberFlow from '@number-flow/react'; + +// api +import DashboardService from '../../service/dashboard-service'; + +// components +import DomandeTablePreInstructorAsync from '../DashboardPreInstructor/components/DomandeTablePreInstructorAsync'; + +const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID; + +const DashboardDirector = () => { + const navigate = useNavigate(); + const [mainStats, setMainStats] = useState({}); + + const getStatValue = (key, fallback = '') => { + return pathOr(fallback, [key], mainStats); + } + + const getStats = (data) => { + if (data.status === 'SUCCESS') { + setMainStats(data.data.widget1); + } + } + + const errGetStats = () => { + } + + useEffect(() => { + DashboardService.getAdminStats(getStats, errGetStats); + }, []); + + return ( +
+
+

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

+
+ +
+ +
+

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

+
+
+ {__('Bandi attivi', 'gepafin')} + +
+
+ {__('Utenti registrati', 'gepafin')} + +
+
+ {__('Domande in pre-istruttoria', 'gepafin')} + +
+
+ {__('Domande in bozza', 'gepafin')} + +
+
+ {__('Aziende', 'gepafin')} + +
+
+ {__('Totale finanziamenti attivi', 'gepafin')} + +
+
+
+ +
+ +
+

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

+ +
+ +
+
+ ) +} + +export default DashboardDirector; \ No newline at end of file diff --git a/src/routes.js b/src/routes.js index 6c81711..69a35cc 100644 --- a/src/routes.js +++ b/src/routes.js @@ -55,6 +55,7 @@ import DocumentsBeneficiary from './pages/DocumentsBeneficiary'; import LoginConfidi from './pages/LoginConfidi'; import ResetPasswordAdmin from './pages/ResetPasswordAdmin'; import DashboardBeneficiarioConfidi from './pages/DashboardBeneficiarioConfidi'; +import DashboardDirector from './pages/DashboardDirector'; const routes = ({ role, chosenCompanyId }) => { @@ -62,6 +63,7 @@ const routes = ({ role, chosenCompanyId }) => { }> + {/*{'ROLE_SUPER_ADMIN' === role ? : null}*/} {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} {'ROLE_CONFIDI' === role ? : null}