- adde pec usage widget for instructor manager;
This commit is contained in:
@@ -3,7 +3,7 @@ import { __ } from '@wordpress/i18n';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
// store
|
||||
import { useStore, storeSet, storeGet } from '../../store';
|
||||
import { useStore, storeSet } from '../../store';
|
||||
|
||||
// components
|
||||
import AppSidebar from './components/AppSidebar';
|
||||
|
||||
@@ -18,10 +18,13 @@ import LatestBandiTableInstructorManager from './components/LatestBandiTableInst
|
||||
import AllDomandeTable from '../Domande/components/AllDomandeTable';
|
||||
import DraftApplicationsTable from '../Dashboard/components/DraftApplicationsTable';
|
||||
|
||||
const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
|
||||
const DashboardInstructorManager = () => {
|
||||
const navigate = useNavigate();
|
||||
const [mainStats, setMainStats] = useState({});
|
||||
const [chartStats, setChartStats] = useState({});
|
||||
const [pecUsage, setPecUsage] = useState(0);
|
||||
|
||||
const goToAllEvaluations = () => {
|
||||
navigate('/domande');
|
||||
@@ -35,6 +38,7 @@ const DashboardInstructorManager = () => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
setMainStats(data.data.widget1);
|
||||
setChartStats(data.data.widgetBars);
|
||||
setPecUsage(data.data.pecUsage/data.data.pecLimit * 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +57,20 @@ const DashboardInstructorManager = () => {
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
{REACT_APP_HUB_ID === 'p4lk3bcx1RStqTaIVVbXs' // only for GEPAFIN
|
||||
? <div className={`appPageSection__withBorder${pecUsage > 91 ? ' danger' : ''}`}>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('PEC inbox quota', 'gepafin')}</span>
|
||||
<span>{<NumberFlow
|
||||
value={pecUsage}
|
||||
format={{ notation: 'compact' }}
|
||||
suffix={'%'}
|
||||
locales="it-IT"/>}</span>
|
||||
</p>
|
||||
</div> : null}
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
<div className="appPageSection statsBigBadges">
|
||||
<h2>{__('Panoramica di Sistema', 'gepafin')}</h2>
|
||||
<div className="statsBigBadges__grid">
|
||||
|
||||
Reference in New Issue
Block a user