From 21ee80ab1962382ffd8d46b32f12891842a66d3a Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 21 Jun 2022 14:39:26 +0200 Subject: [PATCH] rename proof-of-identity to supporting-documents --- .../delete-proof-of-identity-type-modal.tsx | 16 +++++++++++----- .../proof-of-identity-files.tsx | 8 ++++---- .../proof-of-identity-refusal-form.tsx | 0 .../proof-of-identity-refusal-modal.tsx | 0 .../proof-of-identity-type-form.tsx | 0 .../proof-of-identity-type-modal.tsx | 0 .../proof-of-identity-types-list.tsx | 4 ++-- .../proof-of-identity-validation.tsx | 6 +++--- 8 files changed, 20 insertions(+), 14 deletions(-) rename app/frontend/src/javascript/components/{proof-of-identity => supporting-documents}/delete-proof-of-identity-type-modal.tsx (59%) rename app/frontend/src/javascript/components/{proof-of-identity => supporting-documents}/proof-of-identity-files.tsx (96%) rename app/frontend/src/javascript/components/{proof-of-identity => supporting-documents}/proof-of-identity-refusal-form.tsx (100%) rename app/frontend/src/javascript/components/{proof-of-identity => supporting-documents}/proof-of-identity-refusal-modal.tsx (100%) rename app/frontend/src/javascript/components/{proof-of-identity => supporting-documents}/proof-of-identity-type-form.tsx (100%) rename app/frontend/src/javascript/components/{proof-of-identity => supporting-documents}/proof-of-identity-type-modal.tsx (100%) rename app/frontend/src/javascript/components/{proof-of-identity => supporting-documents}/proof-of-identity-types-list.tsx (98%) rename app/frontend/src/javascript/components/{proof-of-identity => supporting-documents}/proof-of-identity-validation.tsx (95%) diff --git a/app/frontend/src/javascript/components/proof-of-identity/delete-proof-of-identity-type-modal.tsx b/app/frontend/src/javascript/components/supporting-documents/delete-proof-of-identity-type-modal.tsx similarity index 59% rename from app/frontend/src/javascript/components/proof-of-identity/delete-proof-of-identity-type-modal.tsx rename to app/frontend/src/javascript/components/supporting-documents/delete-proof-of-identity-type-modal.tsx index 50bb40110..8c8e9117d 100644 --- a/app/frontend/src/javascript/components/proof-of-identity/delete-proof-of-identity-type-modal.tsx +++ b/app/frontend/src/javascript/components/supporting-documents/delete-proof-of-identity-type-modal.tsx @@ -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 = ({ 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 => { 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 ( - -

{t('app.admin.settings.account.do_you_really_want_to_delete_this_proof_of_identity_type')}

+

{t('app.admin.settings.account.delete_proof_of_identity_type_modal.confirm_delete_proof_of_identity')}

); }; diff --git a/app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-files.tsx b/app/frontend/src/javascript/components/supporting-documents/proof-of-identity-files.tsx similarity index 96% rename from app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-files.tsx rename to app/frontend/src/javascript/components/supporting-documents/proof-of-identity-files.tsx index 92590710b..e1a030f71 100644 --- a/app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-files.tsx +++ b/app/frontend/src/javascript/components/supporting-documents/proof-of-identity-files.tsx @@ -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 = ({ 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>([]); const [proofOfIdentityFiles, setProofOfIdentityFiles] = useState>([]); const [files, setFiles] = useState({}); const [errors, setErrors] = useState>([]); - // 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 = ({ 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; diff --git a/app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-refusal-form.tsx b/app/frontend/src/javascript/components/supporting-documents/proof-of-identity-refusal-form.tsx similarity index 100% rename from app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-refusal-form.tsx rename to app/frontend/src/javascript/components/supporting-documents/proof-of-identity-refusal-form.tsx diff --git a/app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-refusal-modal.tsx b/app/frontend/src/javascript/components/supporting-documents/proof-of-identity-refusal-modal.tsx similarity index 100% rename from app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-refusal-modal.tsx rename to app/frontend/src/javascript/components/supporting-documents/proof-of-identity-refusal-modal.tsx diff --git a/app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-type-form.tsx b/app/frontend/src/javascript/components/supporting-documents/proof-of-identity-type-form.tsx similarity index 100% rename from app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-type-form.tsx rename to app/frontend/src/javascript/components/supporting-documents/proof-of-identity-type-form.tsx diff --git a/app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-type-modal.tsx b/app/frontend/src/javascript/components/supporting-documents/proof-of-identity-type-modal.tsx similarity index 100% rename from app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-type-modal.tsx rename to app/frontend/src/javascript/components/supporting-documents/proof-of-identity-type-modal.tsx diff --git a/app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-types-list.tsx b/app/frontend/src/javascript/components/supporting-documents/proof-of-identity-types-list.tsx similarity index 98% rename from app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-types-list.tsx rename to app/frontend/src/javascript/components/supporting-documents/proof-of-identity-types-list.tsx index 493c3d26f..9f83b75b4 100644 --- a/app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-types-list.tsx +++ b/app/frontend/src/javascript/components/supporting-documents/proof-of-identity-types-list.tsx @@ -25,7 +25,7 @@ interface ProofOfIdentityTypesListProps { const ProofOfIdentityTypesList: React.FC = ({ onSuccess, onError }) => { const { t } = useTranslation('admin'); - // list of displayed proof of identity type + // list of displayed supporting documents type const [proofOfIdentityTypes, setProofOfIdentityTypes] = useState>([]); const [proofOfIdentityType, setProofOfIdentityType] = useState(null); const [proofOfIdentityTypeOrder, setProofOfIdentityTypeOrder] = useState(null); @@ -45,7 +45,7 @@ const ProofOfIdentityTypesList: React.FC = ({ 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; diff --git a/app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-validation.tsx b/app/frontend/src/javascript/components/supporting-documents/proof-of-identity-validation.tsx similarity index 95% rename from app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-validation.tsx rename to app/frontend/src/javascript/components/supporting-documents/proof-of-identity-validation.tsx index de26ee14d..8fe7a6047 100644 --- a/app/frontend/src/javascript/components/proof-of-identity/proof-of-identity-validation.tsx +++ b/app/frontend/src/javascript/components/supporting-documents/proof-of-identity-validation.tsx @@ -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 = ({ operator, member, onSuccess, onError }) => { const { t } = useTranslation('admin'); - // list of proof of identity type + // list of supporting documents type const [proofOfIdentityTypes, setProofOfIdentityTypes] = useState>([]); const [proofOfIdentityFiles, setProofOfIdentityFiles] = useState>([]); const [modalIsOpen, setModalIsOpen] = useState(false); @@ -46,7 +46,7 @@ const ProofOfIdentityValidation: React.FC = ({ 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;