mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-21 15:54:22 +01:00
Merge remote-tracking branch 'origin/user_validation_required' into dev
This commit is contained in:
commit
bdf42f7b5d
@ -10,6 +10,9 @@ import { ProofOfIdentityType } from '../../models/proof-of-identity-type';
|
|||||||
import { ProofOfIdentityFile } from '../../models/proof-of-identity-file';
|
import { ProofOfIdentityFile } from '../../models/proof-of-identity-file';
|
||||||
import ProofOfIdentityTypeAPI from '../../api/proof-of-identity-type';
|
import ProofOfIdentityTypeAPI from '../../api/proof-of-identity-type';
|
||||||
import ProofOfIdentityFileAPI from '../../api/proof-of-identity-file';
|
import ProofOfIdentityFileAPI from '../../api/proof-of-identity-file';
|
||||||
|
import { IFablab } from '../../models/fablab';
|
||||||
|
|
||||||
|
declare let Fablab: IFablab;
|
||||||
|
|
||||||
declare const Application: IApplication;
|
declare const Application: IApplication;
|
||||||
|
|
||||||
@ -29,6 +32,8 @@ interface FilesType {
|
|||||||
const ProofOfIdentityFiles: React.FC<ProofOfIdentityFilesProps> = ({ currentUser, onSuccess, onError }) => {
|
const ProofOfIdentityFiles: React.FC<ProofOfIdentityFilesProps> = ({ currentUser, onSuccess, onError }) => {
|
||||||
const { t } = useTranslation('admin');
|
const { t } = useTranslation('admin');
|
||||||
|
|
||||||
|
const maxProofOfIdentityFileSizeMb = (Fablab.maxProofOfIdentityFileSize / 1024 / 1024).toFixed();
|
||||||
|
|
||||||
// list of proof of identity type
|
// list of proof of identity type
|
||||||
const [proofOfIdentityTypes, setProofOfIdentityTypes] = useState<Array<ProofOfIdentityType>>([]);
|
const [proofOfIdentityTypes, setProofOfIdentityTypes] = useState<Array<ProofOfIdentityType>>([]);
|
||||||
const [proofOfIdentityFiles, setProofOfIdentityFiles] = useState<Array<ProofOfIdentityFile>>([]);
|
const [proofOfIdentityFiles, setProofOfIdentityFiles] = useState<Array<ProofOfIdentityFile>>([]);
|
||||||
@ -64,8 +69,7 @@ const ProofOfIdentityFiles: React.FC<ProofOfIdentityFilesProps> = ({ currentUser
|
|||||||
return (event) => {
|
return (event) => {
|
||||||
const fileSize = event.target.files[0].size;
|
const fileSize = event.target.files[0].size;
|
||||||
let _errors = errors;
|
let _errors = errors;
|
||||||
// 5m max
|
if (fileSize > Fablab.maxProofOfIdentityFileSize) {
|
||||||
if (fileSize > 5242880) {
|
|
||||||
_errors = errors.concat(poitId);
|
_errors = errors.concat(poitId);
|
||||||
setErrors(_errors);
|
setErrors(_errors);
|
||||||
} else {
|
} else {
|
||||||
@ -115,7 +119,7 @@ const ProofOfIdentityFiles: React.FC<ProofOfIdentityFilesProps> = ({ currentUser
|
|||||||
<h3>{t('app.admin.members_edit.proof_of_identity_files')}</h3>
|
<h3>{t('app.admin.members_edit.proof_of_identity_files')}</h3>
|
||||||
<p className="text-black font-sbold">{t('app.admin.members_edit.my_documents_info')}</p>
|
<p className="text-black font-sbold">{t('app.admin.members_edit.my_documents_info')}</p>
|
||||||
<div className="alert alert-warning">
|
<div className="alert alert-warning">
|
||||||
<HtmlTranslate trKey="app.admin.members_edit.my_documents_alert" />
|
<HtmlTranslate trKey="app.admin.members_edit.my_documents_alert" options={{ SIZE: maxProofOfIdentityFileSizeMb }}/>
|
||||||
</div>
|
</div>
|
||||||
<div className="widget-content no-bg auto">
|
<div className="widget-content no-bg auto">
|
||||||
{proofOfIdentityTypes.map((poit: ProofOfIdentityType) => {
|
{proofOfIdentityTypes.map((poit: ProofOfIdentityType) => {
|
||||||
@ -146,7 +150,7 @@ const ProofOfIdentityFiles: React.FC<ProofOfIdentityFilesProps> = ({ currentUser
|
|||||||
required />
|
required />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{errors.includes(poit.id) && <span className="help-block">{t('app.admin.members_edit.proof_of_identity_file_size_error')}</span>}
|
{errors.includes(poit.id) && <span className="help-block">{t('app.admin.members_edit.proof_of_identity_file_size_error', { SIZE: maxProofOfIdentityFileSizeMb })}</span>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
@ -17,6 +17,7 @@ export interface IFablab {
|
|||||||
weekStartingDay: string,
|
weekStartingDay: string,
|
||||||
d3DateFormat: string,
|
d3DateFormat: string,
|
||||||
uibDateFormat: string,
|
uibDateFormat: string,
|
||||||
|
maxProofOfIdentityFileSize: number,
|
||||||
sessionTours: Array<string>,
|
sessionTours: Array<string>,
|
||||||
translations: {
|
translations: {
|
||||||
app: {
|
app: {
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
Fablab.weekStartingDay = <%= Date.parse(Rails.application.secrets.week_starting_day).strftime('%w') %>;
|
Fablab.weekStartingDay = <%= Date.parse(Rails.application.secrets.week_starting_day).strftime('%w') %>;
|
||||||
Fablab.d3DateFormat = "<%= Rails.application.secrets.d3_date_format %>";
|
Fablab.d3DateFormat = "<%= Rails.application.secrets.d3_date_format %>";
|
||||||
Fablab.uibDateFormat = "<%= Rails.application.secrets.uib_date_format %>";
|
Fablab.uibDateFormat = "<%= Rails.application.secrets.uib_date_format %>";
|
||||||
|
Fablab.maxProofOfIdentityFileSize = <%= Rails.application.secrets.max_proof_of_identity_file_size&.to_i || 5.megabytes.to_i %>;
|
||||||
|
|
||||||
// feature tour (used when feature_tour_display = session)
|
// feature tour (used when feature_tour_display = session)
|
||||||
Fablab.sessionTours = [];
|
Fablab.sessionTours = [];
|
||||||
|
@ -959,8 +959,8 @@ de:
|
|||||||
cannot_extend_own_subscription: "Sie können Ihr eigenes Abonnement nicht erweitern. Bitte fragen Sie einen anderen Manager oder einen Administrator."
|
cannot_extend_own_subscription: "Sie können Ihr eigenes Abonnement nicht erweitern. Bitte fragen Sie einen anderen Manager oder einen Administrator."
|
||||||
my_documents: "My documents"
|
my_documents: "My documents"
|
||||||
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
||||||
proof_of_identity_file_size_error: "The weight limit is 5 MB max"
|
proof_of_identity_file_size_error: "The weight limit is {SIZE} MB max"
|
||||||
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of 5 Mb max"
|
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of {SIZE} Mb max"
|
||||||
proof_of_identity_files: "Proof of identity"
|
proof_of_identity_files: "Proof of identity"
|
||||||
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
||||||
save: "Save"
|
save: "Save"
|
||||||
|
@ -994,8 +994,8 @@ en:
|
|||||||
update_success: "Member's profile successfully updated"
|
update_success: "Member's profile successfully updated"
|
||||||
my_documents: "My documents"
|
my_documents: "My documents"
|
||||||
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
||||||
proof_of_identity_file_size_error: "The weight limit is 5 MB max"
|
proof_of_identity_file_size_error: "The weight limit is {SIZE} MB max"
|
||||||
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of 5 Mb max"
|
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of {SIZE} Mb max"
|
||||||
proof_of_identity_files: "Proof of identity"
|
proof_of_identity_files: "Proof of identity"
|
||||||
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
||||||
save: "Save"
|
save: "Save"
|
||||||
|
@ -959,8 +959,8 @@ es:
|
|||||||
cannot_extend_own_subscription: "You cannot extend your own subscription. Please ask another manager or an administrator to extend your subscription."
|
cannot_extend_own_subscription: "You cannot extend your own subscription. Please ask another manager or an administrator to extend your subscription."
|
||||||
my_documents: "My documents"
|
my_documents: "My documents"
|
||||||
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
||||||
proof_of_identity_file_size_error: "The weight limit is 5 MB max"
|
proof_of_identity_file_size_error: "The weight limit is {SIZE} MB max"
|
||||||
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of 5 Mb max"
|
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of {SIZE} Mb max"
|
||||||
proof_of_identity_files: "Proof of identity"
|
proof_of_identity_files: "Proof of identity"
|
||||||
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
||||||
save: "Save"
|
save: "Save"
|
||||||
|
@ -959,8 +959,8 @@ fr:
|
|||||||
cannot_extend_own_subscription: "Vous ne pouvez pas prolonger votre propre abonnement. Veuillez demander à un autre gestionnaire ou à un administrateur de prolonger votre abonnement."
|
cannot_extend_own_subscription: "Vous ne pouvez pas prolonger votre propre abonnement. Veuillez demander à un autre gestionnaire ou à un administrateur de prolonger votre abonnement."
|
||||||
my_documents: "Mes documents"
|
my_documents: "Mes documents"
|
||||||
my_documents_info: "Suite à la déclaration de votre profil, vous devez déclarer des justificatifs. Une fois déposé, ces documents vont être vérifiés par l'administrateur."
|
my_documents_info: "Suite à la déclaration de votre profil, vous devez déclarer des justificatifs. Une fois déposé, ces documents vont être vérifiés par l'administrateur."
|
||||||
proof_of_identity_file_size_error: "La limite de poids est 5 Mo max"
|
proof_of_identity_file_size_error: "La limite de poids est {SIZE} Mo max"
|
||||||
my_documents_alert: "Attention ! </br>Vous pouvez déposer vos documents en pdf ou en image(jpg) sous une limite de poids de 5 Mo max"
|
my_documents_alert: "Attention ! </br>Vous pouvez déposer vos documents en pdf ou en image(jpg) sous une limite de poids de {SIZE} Mo max"
|
||||||
proof_of_identity_files: "Justificatifs"
|
proof_of_identity_files: "Justificatifs"
|
||||||
find_below_the_proof_of_identity_files: "Retrouvez ci-dessous, les justificatifs déposés par le membre."
|
find_below_the_proof_of_identity_files: "Retrouvez ci-dessous, les justificatifs déposés par le membre."
|
||||||
save: "Enregistrer"
|
save: "Enregistrer"
|
||||||
|
@ -959,8 +959,8 @@
|
|||||||
cannot_extend_own_subscription: "Du kan ikke utvide ditt eget medlemskap. Be en annen leder eller en administrator om å utvide abonnementet."
|
cannot_extend_own_subscription: "Du kan ikke utvide ditt eget medlemskap. Be en annen leder eller en administrator om å utvide abonnementet."
|
||||||
my_documents: "My documents"
|
my_documents: "My documents"
|
||||||
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
||||||
proof_of_identity_file_size_error: "The weight limit is 5 MB max"
|
proof_of_identity_file_size_error: "The weight limit is {SIZE} MB max"
|
||||||
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of 5 Mb max"
|
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of {SIZE} Mb max"
|
||||||
proof_of_identity_files: "Proof of identity"
|
proof_of_identity_files: "Proof of identity"
|
||||||
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
||||||
save: "Save"
|
save: "Save"
|
||||||
|
@ -959,8 +959,8 @@ pt:
|
|||||||
cannot_extend_own_subscription: "Você não pode estender sua própria assinatura. Por favor, peça a outro gerente ou administrador para estender sua assinatura."
|
cannot_extend_own_subscription: "Você não pode estender sua própria assinatura. Por favor, peça a outro gerente ou administrador para estender sua assinatura."
|
||||||
my_documents: "My documents"
|
my_documents: "My documents"
|
||||||
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
||||||
proof_of_identity_file_size_error: "The weight limit is 5 MB max"
|
proof_of_identity_file_size_error: "The weight limit is {SIZE} MB max"
|
||||||
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of 5 Mb max"
|
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of {SIZE} Mb max"
|
||||||
proof_of_identity_files: "Proof of identity"
|
proof_of_identity_files: "Proof of identity"
|
||||||
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
||||||
save: "Save"
|
save: "Save"
|
||||||
|
@ -959,8 +959,8 @@ zu:
|
|||||||
cannot_extend_own_subscription: "crwdns20346:0crwdne20346:0"
|
cannot_extend_own_subscription: "crwdns20346:0crwdne20346:0"
|
||||||
my_documents: "My documents"
|
my_documents: "My documents"
|
||||||
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
my_documents_info: "Following the declaration of your profile, you must declare the proof of identity documents. Once submitted, these documents will be verified by the administrator."
|
||||||
proof_of_identity_file_size_error: "The weight limit is 5 MB max"
|
proof_of_identity_file_size_error: "The weight limit is {SIZE} MB max"
|
||||||
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of 5 Mb max"
|
my_documents_alert: "Attention!</br>You can submit your documents in pdf or in image (jpg) under a weight limit of {SIZE} Mb max"
|
||||||
proof_of_identity_files: "Proof of identity"
|
proof_of_identity_files: "Proof of identity"
|
||||||
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
find_below_the_proof_of_identity_files: "You will find below the proof of identity documents submitted by the member."
|
||||||
save: "Save"
|
save: "Save"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user