- fixed login for confidi users;
- restyled fileselect UI;
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect} from 'react';
|
||||
import { __, sprintf } from '@wordpress/i18n';
|
||||
import { is, uniq, isNil, isEmpty } from 'ramda';
|
||||
import { is, uniq, isNil, isEmpty, head } from 'ramda';
|
||||
import { wrap } from 'object-path-immutable';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
@@ -37,6 +37,7 @@ const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
|
||||
const AllBandiAccordion = ({ showOnlyPreferred = false }) => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const companies = useStore().main.companies();
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const [items, setItems] = useState(null);
|
||||
const [filters, setFilters] = useState(null);
|
||||
@@ -45,11 +46,15 @@ const AllBandiAccordion = ({ showOnlyPreferred = false }) => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
storeSet.main.setAsyncRequest();
|
||||
BandoService.getBandi(getCallback, errGetCallbacks, [
|
||||
['companyId', chosenCompanyId],
|
||||
['onlyPreferredCall', showOnlyPreferred]
|
||||
]);
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (existingCompany && !isAsyncRequest) {
|
||||
storeSet.main.setAsyncRequest();
|
||||
BandoService.getBandi(getCallback, errGetCallbacks, [
|
||||
['companyId', chosenCompanyId],
|
||||
['onlyPreferredCall', showOnlyPreferred]
|
||||
]);
|
||||
}
|
||||
}, [chosenCompanyId]);
|
||||
|
||||
const getCallback = (data) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect} from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { is, uniq, isNil, isEmpty } from 'ramda';
|
||||
import { is, uniq, isNil, isEmpty, head } from 'ramda';
|
||||
import { wrap } from 'object-path-immutable';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
@@ -30,6 +30,7 @@ import translationStrings from '../../../../translationStringsForComponents';
|
||||
|
||||
const AllBandiPreferredAccordion = () => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const companies = useStore().main.companies();
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const [items, setItems] = useState(null);
|
||||
const [filters, setFilters] = useState(null);
|
||||
@@ -38,12 +39,16 @@ const AllBandiPreferredAccordion = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
storeSet.main.setAsyncRequest();
|
||||
const userData = storeGet.main.userData();
|
||||
PreferredBandoService.getPreferredCalls(getCallback, errGetCallbacks, [
|
||||
['companyId', chosenCompanyId],
|
||||
['userId', userData.id]
|
||||
]);
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (existingCompany) {
|
||||
storeSet.main.setAsyncRequest();
|
||||
const userData = storeGet.main.userData();
|
||||
PreferredBandoService.getPreferredCalls(getCallback, errGetCallbacks, [
|
||||
['companyId', chosenCompanyId],
|
||||
['userId', userData.id]
|
||||
]);
|
||||
}
|
||||
}, [chosenCompanyId]);
|
||||
|
||||
const getCallback = (data) => {
|
||||
|
||||
@@ -328,7 +328,7 @@ const BandoApplicationPreview = () => {
|
||||
|
||||
if (applId) {
|
||||
storeSet.main.setAsyncRequest();
|
||||
const queryParams = 'ROLE_BENEFICIARY' === role
|
||||
const queryParams = ['ROLE_BENEFICIARY', 'ROLE_CONFIDI'].includes(role)
|
||||
? [
|
||||
['companyId', chosenCompanyId]
|
||||
]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { uniq, is, isEmpty } from 'ramda';
|
||||
import { uniq, is, head } from 'ramda';
|
||||
|
||||
// tools
|
||||
import getBandoLabel from '../../../../helpers/getBandoLabel';
|
||||
@@ -28,13 +28,16 @@ import { ConfirmPopup, confirmPopup } from 'primereact/confirmpopup';
|
||||
|
||||
const MyLatestSubmissionsTable = () => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const companies = useStore().main.companies();
|
||||
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||
const [items, setItems] = useState(null);
|
||||
const [filters, setFilters] = useState(null);
|
||||
const [statuses, setStatuses] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isEmpty(chosenCompanyId) && chosenCompanyId !== 0) {
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (existingCompany) {
|
||||
setLocalAsyncRequest(true);
|
||||
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
||||
['companyId', chosenCompanyId],
|
||||
|
||||
@@ -5,7 +5,7 @@ import { head, isEmpty, pathOr } from 'ramda';
|
||||
import NumberFlow from '@number-flow/react';
|
||||
|
||||
// store
|
||||
import { useStore } from '../../store';
|
||||
import { storeSet, useStore } from '../../store';
|
||||
|
||||
// api
|
||||
import DashboardService from '../../service/dashboard-service';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { is, uniq } from 'ramda';
|
||||
import { head, is, uniq } from 'ramda';
|
||||
|
||||
// store
|
||||
import { useStore } from '../../../../store';
|
||||
@@ -26,13 +26,16 @@ import { confirmPopup, ConfirmPopup } from 'primereact/confirmpopup';
|
||||
|
||||
const DocumentsTable = ({ type, reload = 0 }) => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const companies = useStore().main.companies();
|
||||
const [docs, setDocs] = useState([]);
|
||||
const [filters, setFilters] = useState(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [statuses, setStatuses] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!loading && chosenCompanyId && chosenCompanyId !== 0 && reload !== 0) {
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (!loading && existingCompany && reload !== 0) {
|
||||
setLoading(true);
|
||||
CompanyDocumentsService.getCompanyDocuments(chosenCompanyId, getCallback, errGetCallbacks, [
|
||||
['documentType', type]
|
||||
@@ -41,10 +44,14 @@ const DocumentsTable = ({ type, reload = 0 }) => {
|
||||
}, [chosenCompanyId, reload]);
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
CompanyDocumentsService.getCompanyDocuments(chosenCompanyId, getCallback, errGetCallbacks, [
|
||||
['documentType', type]
|
||||
]);
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (existingCompany) {
|
||||
setLoading(true);
|
||||
CompanyDocumentsService.getCompanyDocuments(chosenCompanyId, getCallback, errGetCallbacks, [
|
||||
['documentType', type]
|
||||
]);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const getCallback = (resp) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { is, isEmpty, uniq } from 'ramda';
|
||||
import { head, is, uniq } from 'ramda';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
// store
|
||||
@@ -27,13 +27,16 @@ import translationStrings from '../../../../translationStringsForComponents';
|
||||
|
||||
const BeneficiarioDomandeTable = () => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const companies = useStore().main.companies();
|
||||
const [items, setItems] = useState(null);
|
||||
const [filters, setFilters] = useState(null);
|
||||
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||
const [statuses, setStatuses] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && !localAsyncRequest) {
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (existingCompany && !localAsyncRequest) {
|
||||
setLocalAsyncRequest(true);
|
||||
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
||||
['companyId', chosenCompanyId],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { is, isEmpty, uniq } from 'ramda';
|
||||
import { head, is, uniq } from 'ramda';
|
||||
|
||||
// store
|
||||
import { useStore } from '../../../../store';
|
||||
@@ -21,6 +21,7 @@ import translationStrings from '../../../../translationStringsForComponents';
|
||||
|
||||
const BeneficiarioUltimeDomandeTable = () => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const companies = useStore().main.companies();
|
||||
const [items, setItems] = useState(null);
|
||||
// eslint-disable-next-line
|
||||
const [filters, setFilters] = useState(null);
|
||||
@@ -43,7 +44,9 @@ const BeneficiarioUltimeDomandeTable = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && !localAsyncRequest) {
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (existingCompany && !localAsyncRequest) {
|
||||
const bodyParams = getPaginationQuery(
|
||||
['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION', 'SUBMIT'],
|
||||
1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { isEmpty, pathOr } from 'ramda';
|
||||
import { head, isEmpty, pathOr } from 'ramda';
|
||||
import NumberFlow from '@number-flow/react';
|
||||
|
||||
// store
|
||||
@@ -16,6 +16,7 @@ const StatsBeneficiary = () => {
|
||||
const [mainStats, setMainStats] = useState({});
|
||||
const [chartStats, setChartStats] = useState({});
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const companies = useStore().main.companies();
|
||||
|
||||
const getStats = (resp) => {
|
||||
if (resp.status === 'SUCCESS') {
|
||||
@@ -31,7 +32,11 @@ const StatsBeneficiary = () => {
|
||||
}, [mainStats]);
|
||||
|
||||
useEffect(() => {
|
||||
DashboardService.getBeneficiaryStatsPage(chosenCompanyId, getStats, errGetStats);
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (existingCompany) {
|
||||
DashboardService.getBeneficiaryStatsPage(chosenCompanyId, getStats, errGetStats);
|
||||
}
|
||||
}, [chosenCompanyId]);
|
||||
|
||||
return(
|
||||
|
||||
Reference in New Issue
Block a user