1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

rename proof-of-identity to supporting-documents

This commit is contained in:
Sylvain 2022-06-21 14:39:26 +02:00
parent 18aba05f25
commit 21ee80ab19
8 changed files with 20 additions and 14 deletions

View File

@ -11,27 +11,33 @@ interface DeleteProofOfIdentityTypeModalProps {
onError: (message: string) => void,
}
/**
* Modal dialog to remove a requested type of supporting documents
*/
export const DeleteProofOfIdentityTypeModal: React.FC<DeleteProofOfIdentityTypeModalProps> = ({ isOpen, toggleModal, onSuccess, proofOfIdentityTypeId, onError }) => {
const { t } = useTranslation('admin');
/**
* The user has confirmed the deletion of the requested type of supporting documents
*/
const handleDeleteProofOfIdentityType = async (): Promise<void> => {
try {
await ProofOfIdentityTypeAPI.destroy(proofOfIdentityTypeId);
onSuccess(t('app.admin.settings.account.proof_of_identity_type_deleted'));
onSuccess(t('app.admin.settings.account.delete_proof_of_identity_type_modal.deleted'));
} catch (e) {
onError(t('app.admin.settings.account.proof_of_identity_type_unable_to_delete') + e);
onError(t('app.admin.settings.account.delete_proof_of_identity_type_modal.unable_to_delete') + e);
}
};
return (
<FabModal title={t('app.admin.settings.account.confirmation_required')}
<FabModal title={t('app.admin.settings.account.delete_proof_of_identity_type_modal.confirmation_required')}
isOpen={isOpen}
toggleModal={toggleModal}
closeButton={true}
confirmButton={t('app.admin.settings.account.confirm')}
confirmButton={t('app.admin.settings.account.delete_proof_of_identity_type_modal.confirm')}
onConfirm={handleDeleteProofOfIdentityType}
className="delete-proof-of-identity-type-modal">
<p>{t('app.admin.settings.account.do_you_really_want_to_delete_this_proof_of_identity_type')}</p>
<p>{t('app.admin.settings.account.delete_proof_of_identity_type_modal.confirm_delete_proof_of_identity')}</p>
</FabModal>
);
};

View File

@ -27,20 +27,20 @@ interface FilesType {
}
/**
* This component upload the proof of identity file of member
* This component upload the supporting documents file of the member
*/
export const ProofOfIdentityFiles: React.FC<ProofOfIdentityFilesProps> = ({ currentUser, onSuccess, onError }) => {
const { t } = useTranslation('admin');
const maxProofOfIdentityFileSizeMb = (Fablab.maxProofOfIdentityFileSize / 1024 / 1024).toFixed();
// list of proof of identity type
// list of supporting documents type
const [proofOfIdentityTypes, setProofOfIdentityTypes] = useState<Array<ProofOfIdentityType>>([]);
const [proofOfIdentityFiles, setProofOfIdentityFiles] = useState<Array<ProofOfIdentityFile>>([]);
const [files, setFiles] = useState<FilesType>({});
const [errors, setErrors] = useState<Array<number>>([]);
// get proof of identity type and files
// get supporting documents type and files
useEffect(() => {
ProofOfIdentityTypeAPI.index({ group_id: currentUser.group_id }).then(tData => {
setProofOfIdentityTypes(tData);
@ -59,7 +59,7 @@ export const ProofOfIdentityFiles: React.FC<ProofOfIdentityFilesProps> = ({ curr
};
/**
* Check if the current collection of proof of identity types is empty or not.
* Check if the current collection of supporting documents types is empty or not.
*/
const hasProofOfIdentityTypes = (): boolean => {
return proofOfIdentityTypes.length > 0;

View File

@ -25,7 +25,7 @@ interface ProofOfIdentityTypesListProps {
const ProofOfIdentityTypesList: React.FC<ProofOfIdentityTypesListProps> = ({ onSuccess, onError }) => {
const { t } = useTranslation('admin');
// list of displayed proof of identity type
// list of displayed supporting documents type
const [proofOfIdentityTypes, setProofOfIdentityTypes] = useState<Array<ProofOfIdentityType>>([]);
const [proofOfIdentityType, setProofOfIdentityType] = useState<ProofOfIdentityType>(null);
const [proofOfIdentityTypeOrder, setProofOfIdentityTypeOrder] = useState<string>(null);
@ -45,7 +45,7 @@ const ProofOfIdentityTypesList: React.FC<ProofOfIdentityTypesListProps> = ({ onS
}, []);
/**
* Check if the current collection of proof of identity types is empty or not.
* Check if the current collection of supporting documents types is empty or not.
*/
const hasProofOfIdentityTypes = (): boolean => {
return proofOfIdentityTypes.length > 0;

View File

@ -21,12 +21,12 @@ interface ProofOfIdentityValidationProps {
}
/**
* This component shows a list of proof of identity file of member, admin can download and valid
* This component shows a list of supporting documents file of member, admin can download and valid
**/
const ProofOfIdentityValidation: React.FC<ProofOfIdentityValidationProps> = ({ operator, member, onSuccess, onError }) => {
const { t } = useTranslation('admin');
// list of proof of identity type
// list of supporting documents type
const [proofOfIdentityTypes, setProofOfIdentityTypes] = useState<Array<ProofOfIdentityType>>([]);
const [proofOfIdentityFiles, setProofOfIdentityFiles] = useState<Array<ProofOfIdentityFile>>([]);
const [modalIsOpen, setModalIsOpen] = useState<boolean>(false);
@ -46,7 +46,7 @@ const ProofOfIdentityValidation: React.FC<ProofOfIdentityValidationProps> = ({ o
};
/**
* Check if the current collection of proof of identity types is empty or not.
* Check if the current collection of supporting documents types is empty or not.
*/
const hasProofOfIdentityTypes = (): boolean => {
return proofOfIdentityTypes.length > 0;