Merge branch 'develop' into feature/30-better-tables
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
REACT_APP_TAB_TITLE=Gepafin
|
REACT_APP_TAB_TITLE=Gepafin
|
||||||
REACT_APP_API_EXECUTION_ADDRESS=https://bandi-api.gepafin.it/v1
|
REACT_APP_API_EXECUTION_ADDRESS=https://bandi-api.gepafin.it/v1
|
||||||
REACT_APP_API_ADDRESS=https://bandi-api.gepafin.it
|
REACT_APP_API_ADDRESS=https://bandi-api.gepafin.it
|
||||||
|
REACT_APP_API_ADDRESS_WS=https://bandi-api.gepafin.it/wss
|
||||||
REACT_APP_LOGO_FILENAME=gepafin-logo.svg
|
REACT_APP_LOGO_FILENAME=gepafin-logo.svg
|
||||||
REACT_APP_FAVICON_FILENAME=gepafin-favicon.ico
|
REACT_APP_FAVICON_FILENAME=gepafin-favicon.ico
|
||||||
REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
|
REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
|
||||||
|
|||||||
@@ -25,8 +25,8 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
border: 1px solid var(--yellow-500);
|
border: 1px solid #858585;
|
||||||
background: var(--card-full-background-color-2);
|
background: #cecece;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 48px;
|
gap: 48px;
|
||||||
|
|
||||||
@@ -41,29 +41,76 @@
|
|||||||
span:nth-last-of-type(1) {
|
span:nth-last-of-type(1) {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.statsBigBadges__grid {
|
||||||
|
.statsBigBadges__gridItem {
|
||||||
|
&:nth-of-type(1) {
|
||||||
|
border: 1px solid var(--yellow-500);
|
||||||
|
background: var(--card-full-background-color-2);
|
||||||
|
}
|
||||||
|
|
||||||
&:nth-of-type(2) {
|
&:nth-of-type(2) {
|
||||||
border: 1px solid var(--yellow-500);
|
border: 1px solid var(--yellow-500);
|
||||||
background: var(--card-full-background-color-3);
|
background: var(--card-full-background-color-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-of-type(3) {
|
&:nth-of-type(3) {
|
||||||
border: 1px solid var(--yellow-500);
|
border: 1px solid var(--yellow-500);
|
||||||
background: var(--card-full-background-color-4);
|
background: var(--card-full-background-color-4);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-of-type(4) {
|
&:nth-of-type(4) {
|
||||||
border: 1px solid var(--yellow-500);
|
border: 1px solid var(--yellow-500);
|
||||||
background: var(--card-full-background-color-1);
|
background: var(--card-full-background-color-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-of-type(5) {
|
&:nth-of-type(5) {
|
||||||
border: 1px solid var(--yellow-500);
|
border: 1px solid var(--yellow-500);
|
||||||
background: var(--card-full-background-color-5);
|
background: var(--card-full-background-color-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-of-type(6) {
|
&:nth-of-type(6) {
|
||||||
border: 1px solid var(--yellow-500);
|
border: 1px solid var(--yellow-500);
|
||||||
background: var(--card-full-background-color-6);
|
background: var(--card-full-background-color-6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.applStats {
|
||||||
|
.statsBigBadges__gridItem {
|
||||||
|
&:nth-of-type(1) {
|
||||||
|
border: 1px solid var(--yellow-500);
|
||||||
|
background: var(--card-full-background-color-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-of-type(2) {
|
||||||
|
border: 1px solid var(--yellow-500);
|
||||||
|
background: var(--card-full-background-color-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-of-type(3) {
|
||||||
|
border: 1px solid var(--yellow-500);
|
||||||
|
background: var(--card-full-background-color-4);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-of-type(4) {
|
||||||
|
border: 1px solid var(--yellow-500);
|
||||||
|
background: var(--card-full-background-color-7);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-of-type(5) {
|
||||||
|
border: 1px solid var(--yellow-500);
|
||||||
|
background: var(--card-full-background-color-8);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-of-type(6) {
|
||||||
|
border: 1px solid var(--yellow-500);
|
||||||
|
background: var(--card-full-background-color-9);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 820px) {
|
@media (max-width: 820px) {
|
||||||
.statsBigBadges__grid {
|
.statsBigBadges__grid {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
--card-full-background-color-1: #54965b;
|
--card-full-background-color-1: #54965b;
|
||||||
--card-full-background-color-5: #4ba190;
|
--card-full-background-color-5: #4ba190;
|
||||||
--card-full-background-color-6: #6d68c0;
|
--card-full-background-color-6: #6d68c0;
|
||||||
|
--card-full-background-color-7: #06B6D4;
|
||||||
|
--card-full-background-color-8: #FF3D32;
|
||||||
|
--card-full-background-color-9: #F97316;
|
||||||
}
|
}
|
||||||
|
|
||||||
@import "./components/layout.scss";
|
@import "./components/layout.scss";
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ const ElementSetting = ({ setting, changeFn, updateDataFn, bandoStatus }) => {
|
|||||||
placeholder: __('Segnaposto', 'gepafin'),
|
placeholder: __('Segnaposto', 'gepafin'),
|
||||||
step: __('Numero Decimali', 'gepafin'),
|
step: __('Numero Decimali', 'gepafin'),
|
||||||
isRequestedAmount: __('Importo richiesto', 'gepafin'),
|
isRequestedAmount: __('Importo richiesto', 'gepafin'),
|
||||||
|
isDelegation: __('Delega', 'gepafin'),
|
||||||
options: __('Opzioni', 'gepafin'),
|
options: __('Opzioni', 'gepafin'),
|
||||||
mime: __('Tipo di file', 'gepafin'),
|
mime: __('Tipo di file', 'gepafin'),
|
||||||
text: __('Testo formattato', 'gepafin'),
|
text: __('Testo formattato', 'gepafin'),
|
||||||
@@ -80,7 +81,7 @@ const ElementSetting = ({ setting, changeFn, updateDataFn, bandoStatus }) => {
|
|||||||
name={setting.name}
|
name={setting.name}
|
||||||
bandoStatus={bandoStatus}
|
bandoStatus={bandoStatus}
|
||||||
setDataFn={updateDataFn}/>
|
setDataFn={updateDataFn}/>
|
||||||
} else if (setting.name === 'isRequestedAmount') {
|
} else if (['isRequestedAmount', 'isDelegation'].includes(setting.name)) {
|
||||||
return <InputSwitch
|
return <InputSwitch
|
||||||
checked={setting.value}
|
checked={setting.value}
|
||||||
onChange={(e) => changeFn(e.value, setting.name)}/>
|
onChange={(e) => changeFn(e.value, setting.name)}/>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { isEmpty } from 'ramda';
|
import { isEmpty, pathOr } from 'ramda';
|
||||||
|
|
||||||
// api
|
// api
|
||||||
import UserService from '../../service/user-service';
|
import UserService from '../../service/user-service';
|
||||||
@@ -20,6 +20,8 @@ import { Button } from 'primereact/button';
|
|||||||
import { classNames } from 'primereact/utils';
|
import { classNames } from 'primereact/utils';
|
||||||
import { Dropdown } from 'primereact/dropdown';
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
import DraftApplicationsTable from '../Dashboard/components/DraftApplicationsTable';
|
import DraftApplicationsTable from '../Dashboard/components/DraftApplicationsTable';
|
||||||
|
import NumberFlow from '@number-flow/react';
|
||||||
|
import DashboardService from '../../service/dashboard-service';
|
||||||
|
|
||||||
const Domande = () => {
|
const Domande = () => {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@@ -29,6 +31,7 @@ const Domande = () => {
|
|||||||
const [chosenUser, setChosenUser] = useState(0);
|
const [chosenUser, setChosenUser] = useState(0);
|
||||||
const [chosenApplication, setChosenApplication] = useState(0);
|
const [chosenApplication, setChosenApplication] = useState(0);
|
||||||
const [updaterString, setUpdaterString] = useState('');
|
const [updaterString, setUpdaterString] = useState('');
|
||||||
|
const [mainStats, setMainStats] = useState({});
|
||||||
const toast = useRef(null);
|
const toast = useRef(null);
|
||||||
|
|
||||||
const getRolesCallback = (data) => {
|
const getRolesCallback = (data) => {
|
||||||
@@ -123,6 +126,18 @@ const Domande = () => {
|
|||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getStatValue = (key, fallback = '') => {
|
||||||
|
return pathOr(fallback, [key], mainStats);
|
||||||
|
}
|
||||||
|
|
||||||
|
const getStats = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
setMainStats(data.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetStats = () => {}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (roleIds.length > 0) {
|
if (roleIds.length > 0) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -137,6 +152,10 @@ const Domande = () => {
|
|||||||
}
|
}
|
||||||
}, [isVisibleEditDialog]);
|
}, [isVisibleEditDialog]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
DashboardService.getApplicationsStats(getStats, errGetStats);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="appPage">
|
<div className="appPage">
|
||||||
<div className="appPage__pageHeader">
|
<div className="appPage__pageHeader">
|
||||||
@@ -152,6 +171,57 @@ const Domande = () => {
|
|||||||
|
|
||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection statsBigBadges">
|
||||||
|
<h2>{__('Riepilogo', 'gepafin')}</h2>
|
||||||
|
<div className="statsBigBadges__grid applStats">
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Totale domande', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfApplication', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT"/></span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Assegnate', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfAssignedApplication', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT"/></span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Completate', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfAcceptedApplication', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT"/></span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Tempo medio di valutazione', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('evaluationAverageTime', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
suffix={` ${__('minuti', 'gepafin')}`}
|
||||||
|
locales="it-IT"/></span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('In soccorso istruttorio', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfApplicationInAmendmentState', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT"/></span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Domande in scadenza (48h)', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfDueApplication', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="en-US"/></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
<h2>{__('Domande in bozza', 'gepafin')}</h2>
|
<h2>{__('Domande in bozza', 'gepafin')}</h2>
|
||||||
<DraftApplicationsTable/>
|
<DraftApplicationsTable/>
|
||||||
|
|||||||
@@ -517,7 +517,7 @@ const ProfileCompany = () => {
|
|||||||
? <div className="appForm__delegaForm">
|
? <div className="appForm__delegaForm">
|
||||||
<div className="appForm__delegaFormHeader">
|
<div className="appForm__delegaFormHeader">
|
||||||
<legend>{__('Compilazione Delega', 'gepafin')}</legend>
|
<legend>{__('Compilazione Delega', 'gepafin')}</legend>
|
||||||
<p className="appForm__delegaFormText">{__('Per procedere come delegato, compila il form seguente, scarica il documento della delega, fallo firmare dal rappresentante legale.', 'gepafin')}</p>
|
<p className="appForm__delegaFormText">{__('Per procedere come delegato, compila il form seguente, scarica il documento della delega, fallo firmare dal rappresentante legale e ricaricalo nel form di domanda.', 'gepafin')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="appForm__cols">
|
<div className="appForm__cols">
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ const Registration = () => {
|
|||||||
const newFormData = {
|
const newFormData = {
|
||||||
...formData,
|
...formData,
|
||||||
dateOfBirth: originalDateOfBirth,
|
dateOfBirth: originalDateOfBirth,
|
||||||
hubUuid: APP_HUB_ID
|
hubUuid: APP_HUB_ID,
|
||||||
|
roleId: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
AuthenticationService.registerUser(newFormData, regCallback, regError, [
|
AuthenticationService.registerUser(newFormData, regCallback, regError, [
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ export default class DashboardService {
|
|||||||
NetworkService.get(`${API_BASE_URL}/dashboard`, callback, errCallback);
|
NetworkService.get(`${API_BASE_URL}/dashboard`, callback, errCallback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static getApplicationsStats = (callback, errCallback) => {
|
||||||
|
NetworkService.get(`${API_BASE_URL}/dashboard/application`, callback, errCallback);
|
||||||
|
};
|
||||||
|
|
||||||
static getBeneficiaryStatsForCompany = (id, callback, errCallback) => {
|
static getBeneficiaryStatsForCompany = (id, callback, errCallback) => {
|
||||||
NetworkService.get(`${API_BASE_URL}/dashboard/beneficiary/company/${id}`, callback, errCallback);
|
NetworkService.get(`${API_BASE_URL}/dashboard/beneficiary/company/${id}`, callback, errCallback);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -214,6 +214,10 @@ export const elementItems = [
|
|||||||
{
|
{
|
||||||
name: "mime",
|
name: "mime",
|
||||||
value: []
|
value: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "isDelegation",
|
||||||
|
value: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
validators: {
|
validators: {
|
||||||
|
|||||||
Reference in New Issue
Block a user