Merge branch 'develop' into master-sync/07-12-2024

This commit is contained in:
Vitalii Kiiko
2025-01-07 08:28:11 +01:00
31 changed files with 776 additions and 80 deletions

View File

@@ -4,7 +4,7 @@ import { isEmpty, pathOr, head } from 'ramda';
import { klona } from 'klona';
import { wrap } from 'object-path-immutable';
import { useForm } from 'react-hook-form';
import emailjs from '@emailjs/browser';
//import emailjs from '@emailjs/browser';
//import { useNavigate } from 'react-router-dom';
// store
@@ -27,7 +27,7 @@ import { InputText } from 'primereact/inputtext';
import { Toast } from 'primereact/toast';
//import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText';
//import { defaultMaxFileSize } from '../../configData';
import { Dialog } from 'primereact/dialog';
//import { Dialog } from 'primereact/dialog';
import { confirmPopup, ConfirmPopup } from 'primereact/confirmpopup';
const ProfileCompany = () => {
@@ -38,7 +38,7 @@ const ProfileCompany = () => {
const [formInitialData, setFormInitialData] = useState({});
const [delegaData, setDelegaData] = useState({});
//const [delega, setDelega] = useState([]);
const [isVisibleRemoveDialog, setIsVisibleRemoveDialog] = useState(false);
//const [isVisibleRemoveDialog, setIsVisibleRemoveDialog] = useState(false);
const { delegaFirstName = '', delegaLastName = '', delegaCodiceFiscale = '' } = delegaData;
const toast = useRef(null);
//const navigate = useNavigate();
@@ -212,22 +212,22 @@ const ProfileCompany = () => {
defaultFocus: 'reject',
acceptClassName: 'p-button-danger',
accept: () => {
doRemoveCompany();
doRemoveCompanyAPI();
},
reject: () => {
}
});
};
const headerRemoveDialog = () => {
/*const headerRemoveDialog = () => {
return <span>{__('Rimuovi azienda', 'gepafin')}</span>
}
const hideRemoveDialog = () => {
setIsVisibleRemoveDialog(false);
}
}*/
const doRemoveCompany = () => {
/*const doRemoveCompany = () => {
const userData = storeGet.main.userData();
let chosenCompany = {};
@@ -251,13 +251,13 @@ const ProfileCompany = () => {
publicKey: 'TPWwaPLM2dDuEIa10'
}
).then(() => {
/*if (toast.current) {
/!*if (toast.current) {
toast.current.show({
severity: 'success',
summary: '',
detail: __('La richiesta è stata inviata!', 'gepafin')
});
}*/
}*!/
setIsVisibleRemoveDialog(true);
})
.catch((err) => {
@@ -270,10 +270,9 @@ const ProfileCompany = () => {
});
}
});
}
}*/
// TODO delete company functionality by API, ready to be shipped
/*const doRemoveCompanyAPI = () => {
const doRemoveCompanyAPI = () => {
storeSet.main.setAsyncRequest();
CompanyService.deleteCompany(formInitialData.id, deleteCompanyCallback, errDeleteCompanyCallback)
}
@@ -289,6 +288,8 @@ const ProfileCompany = () => {
if (!isEmpty(newCompanies)) {
const newChosenCompanyId = newCompanies[0].id;
storeSet.main.chosenCompanyId(newChosenCompanyId);
} else {
storeSet.main.chosenCompanyId(0);
}
}
storeSet.main.unsetAsyncRequest();
@@ -297,7 +298,7 @@ const ProfileCompany = () => {
const errDeleteCompanyCallback = (data) => {
set404FromErrorResponse(data);
storeSet.main.unsetAsyncRequest();
}*/
}
useEffect(() => {
const newFormData = klona(formInitialData);
@@ -622,15 +623,15 @@ const ProfileCompany = () => {
</div>
</div>
<Dialog
{/*<Dialog
visible={isVisibleRemoveDialog}
modal
header={headerRemoveDialog}
/*footer={footerRemoveDialog}*/
footer={footerRemoveDialog}
style={{ maxWidth: '600px', width: '100%' }}
onHide={hideRemoveDialog}>
<p>Abbiamo preso in carica la tua richiesta a breve l'azienda sarà rimossa dal tuo profilo</p>
</Dialog>
</Dialog>*/}
</div>
)