mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
(wip) lint for scoped-translation
This commit is contained in:
parent
2033329342
commit
4a8d8796a3
@ -56,7 +56,8 @@
|
||||
"fabmanager/component-documentation": "error",
|
||||
"fabmanager/component-methods-documentation": "error",
|
||||
"fabmanager/no-bootstrap": "error",
|
||||
"fabmanager/no-utilities": "error"
|
||||
"fabmanager/no-utilities": "error",
|
||||
"fabmanager/scoped-translation": ["error", { "ignoreAbstractKeyword": true }]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -77,10 +77,10 @@ export const EventThemes: React.FC<EventThemesProps> = ({ event, onChange }) =>
|
||||
return (
|
||||
<div className="event-themes">
|
||||
{hasThemes() && <div className="event-themes--panel">
|
||||
<h3>{ t('app.shared.event.event_themes') }</h3>
|
||||
<h3>{ t('app.shared.event_themes.title') }</h3>
|
||||
<div className="content">
|
||||
<Select defaultValue={defaultValues()}
|
||||
placeholder={t('app.shared.event.select_theme')}
|
||||
placeholder={t('app.shared.event_themes.select_theme')}
|
||||
onChange={handleChange}
|
||||
options={buildOptions()}
|
||||
isMulti />
|
||||
|
@ -43,9 +43,9 @@ export const ProfileCustomFieldsList: React.FC<ProfileCustomFieldsListProps> = (
|
||||
if (profileCustomFieldToEdit) {
|
||||
setProfileCustomFieldToEdit(null);
|
||||
}
|
||||
onSuccess(t('app.admin.settings.compte.organization_profile_custom_field_successfully_updated'));
|
||||
onSuccess(t('app.admin.settings.account.organization_profile_custom_field_successfully_updated'));
|
||||
}).catch(err => {
|
||||
onError(t('app.admin.settings.compte.organization_profile_custom_field_unable_to_update') + err);
|
||||
onError(t('app.admin.settings.account.organization_profile_custom_field_unable_to_update') + err);
|
||||
});
|
||||
};
|
||||
|
||||
@ -120,11 +120,11 @@ export const ProfileCustomFieldsList: React.FC<ProfileCustomFieldsListProps> = (
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
<label htmlFor="profile-custom-field-actived" className="control-label m-r">{t('app.admin.settings.compte.organization_profile_custom_field.actived')}</label>
|
||||
<label htmlFor="profile-custom-field-actived" className="control-label m-r">{t('app.admin.settings.account.organization_profile_custom_field.actived')}</label>
|
||||
<Switch checked={field.actived} id="profile-custom-field-actived" onChange={handleSwitchChanged(field, 'actived')} className="v-middle"></Switch>
|
||||
</td>
|
||||
<td>
|
||||
<label htmlFor="profile-custom-field-required" className="control-label m-r">{t('app.admin.settings.compte.organization_profile_custom_field.required')}</label>
|
||||
<label htmlFor="profile-custom-field-required" className="control-label m-r">{t('app.admin.settings.account.organization_profile_custom_field.required')}</label>
|
||||
<Switch checked={field.required} disabled={!field.actived} id="profile-custom-field-required" onChange={handleSwitchChanged(field, 'required')} className="v-middle"></Switch>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -17,21 +17,21 @@ export const DeleteProofOfIdentityTypeModal: React.FC<DeleteProofOfIdentityTypeM
|
||||
const handleDeleteProofOfIdentityType = async (): Promise<void> => {
|
||||
try {
|
||||
await ProofOfIdentityTypeAPI.destroy(proofOfIdentityTypeId);
|
||||
onSuccess(t('app.admin.settings.compte.proof_of_identity_type_deleted'));
|
||||
onSuccess(t('app.admin.settings.account.proof_of_identity_type_deleted'));
|
||||
} catch (e) {
|
||||
onError(t('app.admin.settings.compte.proof_of_identity_type_unable_to_delete') + e);
|
||||
onError(t('app.admin.settings.account.proof_of_identity_type_unable_to_delete') + e);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<FabModal title={t('app.admin.settings.compte.confirmation_required')}
|
||||
<FabModal title={t('app.admin.settings.account.confirmation_required')}
|
||||
isOpen={isOpen}
|
||||
toggleModal={toggleModal}
|
||||
closeButton={true}
|
||||
confirmButton={t('app.admin.settings.compte.confirm')}
|
||||
confirmButton={t('app.admin.settings.account.confirm')}
|
||||
onConfirm={handleDeleteProofOfIdentityType}
|
||||
className="delete-proof-of-identity-type-modal">
|
||||
<p>{t('app.admin.settings.compte.do_you_really_want_to_delete_this_proof_of_identity_type')}</p>
|
||||
<p>{t('app.admin.settings.account.do_you_really_want_to_delete_this_proof_of_identity_type')}</p>
|
||||
</FabModal>
|
||||
);
|
||||
};
|
||||
|
@ -65,12 +65,12 @@ export const ProofOfIdentityTypeForm: React.FC<ProofOfIdentityTypeFormProps> = (
|
||||
return (
|
||||
<div className="proof-of-identity-type-form">
|
||||
<div className="proof-of-identity-type-form-info">
|
||||
{t('app.admin.settings.compte.proof_of_identity_type_form_info')}
|
||||
{t('app.admin.settings.account.proof_of_identity_type_form_info')}
|
||||
</div>
|
||||
<form name="proofOfIdentityTypeForm">
|
||||
<div className="proof-of-identity-type-select m-t">
|
||||
<Select defaultValue={groupsValues()}
|
||||
placeholder={t('app.admin.settings.compte.proof_of_identity_type_select_group')}
|
||||
placeholder={t('app.admin.settings.account.proof_of_identity_type_select_group')}
|
||||
onChange={handleGroupsChange}
|
||||
options={buildOptions()}
|
||||
isMulti />
|
||||
@ -79,7 +79,7 @@ export const ProofOfIdentityTypeForm: React.FC<ProofOfIdentityTypeFormProps> = (
|
||||
<FabInput id="proof_of_identity_type_name"
|
||||
icon={<i className="fa fa-edit" />}
|
||||
defaultValue={proofOfIdentityType?.name || ''}
|
||||
placeholder={t('app.admin.settings.compte.proof_of_identity_type_input_name')}
|
||||
placeholder={t('app.admin.settings.account.proof_of_identity_type_input_name')}
|
||||
onChange={handleNameChange}
|
||||
debounce={200}
|
||||
required/>
|
||||
|
@ -35,16 +35,16 @@ export const ProofOfIdentityTypeModal: React.FC<ProofOfIdentityTypeModalProps> =
|
||||
try {
|
||||
if (proofOfIdentityType?.id) {
|
||||
await ProofOfIdentityTypeAPI.update(data);
|
||||
onSuccess(t('app.admin.settings.compte.proof_of_identity_type_successfully_updated'));
|
||||
onSuccess(t('app.admin.settings.account.proof_of_identity_type_successfully_updated'));
|
||||
} else {
|
||||
await ProofOfIdentityTypeAPI.create(data);
|
||||
onSuccess(t('app.admin.settings.compte.proof_of_identity_type_successfully_created'));
|
||||
onSuccess(t('app.admin.settings.account.proof_of_identity_type_successfully_created'));
|
||||
}
|
||||
} catch (e) {
|
||||
if (proofOfIdentityType?.id) {
|
||||
onError(t('app.admin.settings.compte.proof_of_identity_type_unable_to_update') + e);
|
||||
onError(t('app.admin.settings.account.proof_of_identity_type_unable_to_update') + e);
|
||||
} else {
|
||||
onError(t('app.admin.settings.compte.proof_of_identity_type_unable_to_create') + e);
|
||||
onError(t('app.admin.settings.account.proof_of_identity_type_unable_to_create') + e);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -54,11 +54,11 @@ export const ProofOfIdentityTypeModal: React.FC<ProofOfIdentityTypeModalProps> =
|
||||
};
|
||||
|
||||
return (
|
||||
<FabModal title={t(`app.admin.settings.compte.${proofOfIdentityType ? 'edit' : 'new'}_proof_of_identity_type`)}
|
||||
<FabModal title={t(`app.admin.settings.account.${proofOfIdentityType ? 'edit' : 'new'}_proof_of_identity_type`)}
|
||||
isOpen={isOpen}
|
||||
toggleModal={toggleModal}
|
||||
closeButton={false}
|
||||
confirmButton={t(`app.admin.settings.compte.${proofOfIdentityType ? 'edit' : 'create'}`)}
|
||||
confirmButton={t(`app.admin.settings.account.${proofOfIdentityType ? 'edit' : 'create'}`)}
|
||||
onConfirm={handleSaveProofOfIdentityType}
|
||||
preventConfirm={isPreventSaveProofOfIdentityType()}
|
||||
className="proof-of-identity-type-modal">
|
||||
|
@ -134,7 +134,7 @@ const ProofOfIdentityTypesList: React.FC<ProofOfIdentityTypesListProps> = ({ onS
|
||||
|
||||
const getGroupName = (groupIds: Array<number>): string => {
|
||||
if (groupIds.length === groups.length && groupIds.length > 0) {
|
||||
return t('app.admin.settings.compte.all_groups');
|
||||
return t('app.admin.settings.account.all_groups');
|
||||
}
|
||||
const _groups = _.filter(groups, (g: Group) => { return groupIds.includes(g.id); });
|
||||
return _groups.map((g: Group) => g.name).join(', ');
|
||||
@ -143,22 +143,22 @@ const ProofOfIdentityTypesList: React.FC<ProofOfIdentityTypesListProps> = ({ onS
|
||||
return (
|
||||
<div className="panel panel-default m-t-md">
|
||||
<div className="panel-heading">
|
||||
<span className="font-sbold">{t('app.admin.settings.compte.add_proof_of_identity_types')}</span>
|
||||
<span className="font-sbold">{t('app.admin.settings.account.add_proof_of_identity_types')}</span>
|
||||
</div>
|
||||
<div className="panel-body">
|
||||
<div className="row">
|
||||
<p className="m-h">{t('app.admin.settings.compte.proof_of_identity_type_info')}</p>
|
||||
<p className="m-h">{t('app.admin.settings.account.proof_of_identity_type_info')}</p>
|
||||
<div className="alert alert-warning m-h-md row">
|
||||
<div className="col-md-8">
|
||||
<HtmlTranslate trKey="app.admin.settings.compte.proof_of_identity_type_no_group_info" />
|
||||
<HtmlTranslate trKey="app.admin.settings.account.proof_of_identity_type_no_group_info" />
|
||||
</div>
|
||||
<a href="/#!/admin/members?tabs=1" className="btn btn-warning pull-right m-t m-r-md col-md-3" style={{ color: '#000', maxWidth: '200px' }}>{t('app.admin.settings.compte.create_groups')}</a>
|
||||
<a href="/#!/admin/members?tabs=1" className="btn btn-warning pull-right m-t m-r-md col-md-3" style={{ color: '#000', maxWidth: '200px' }}>{t('app.admin.settings.account.create_groups')}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="row">
|
||||
<h3 className="m-l inline">{t('app.admin.settings.compte.proof_of_identity_type_title')}</h3>
|
||||
<button name="button" className="btn btn-warning pull-right m-t m-r-md" onClick={addProofOfIdentityType}>{t('app.admin.settings.compte.add_proof_of_identity_type_button')}</button>
|
||||
<h3 className="m-l inline">{t('app.admin.settings.account.proof_of_identity_type_title')}</h3>
|
||||
<button name="button" className="btn btn-warning pull-right m-t m-r-md" onClick={addProofOfIdentityType}>{t('app.admin.settings.account.add_proof_of_identity_type_button')}</button>
|
||||
</div>
|
||||
|
||||
<ProofOfIdentityTypeModal isOpen={modalIsOpen} groups={groups} proofOfIdentityType={proofOfIdentityType} toggleModal={toggleCreateAndEditModal} onSuccess={saveProofOfIdentityTypeOnSuccess} onError={onError} />
|
||||
@ -167,8 +167,8 @@ const ProofOfIdentityTypesList: React.FC<ProofOfIdentityTypesListProps> = ({ onS
|
||||
<table className="table proof-of-identity-type-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style={{ width: '40%' }}><a onClick={setOrderProofOfIdentityType('group_name')}>{t('app.admin.settings.compte.proof_of_identity_type.group_name')} <i className={orderClassName('group_name')}></i></a></th>
|
||||
<th style={{ width: '40%' }}><a onClick={setOrderProofOfIdentityType('name')}>{t('app.admin.settings.compte.proof_of_identity_type.name')} <i className={orderClassName('name')}></i></a></th>
|
||||
<th style={{ width: '40%' }}><a onClick={setOrderProofOfIdentityType('group_name')}>{t('app.admin.settings.account.proof_of_identity_type.group_name')} <i className={orderClassName('group_name')}></i></a></th>
|
||||
<th style={{ width: '40%' }}><a onClick={setOrderProofOfIdentityType('name')}>{t('app.admin.settings.account.proof_of_identity_type.name')} <i className={orderClassName('name')}></i></a></th>
|
||||
<th style={{ width: '20%' }} className="buttons-col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -195,7 +195,7 @@ const ProofOfIdentityTypesList: React.FC<ProofOfIdentityTypesListProps> = ({ onS
|
||||
</table>
|
||||
{!hasProofOfIdentityTypes() && (
|
||||
<p className="text-center">
|
||||
<HtmlTranslate trKey="app.admin.settings.compte.no_proof_of_identity_types" />
|
||||
<HtmlTranslate trKey="app.admin.settings.account.no_proof_of_identity_types" />
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
@ -26,6 +26,9 @@ interface SelectGatewayModalModalProps {
|
||||
onSuccess: (results: Map<SettingName, SettingBulkResult>) => void,
|
||||
}
|
||||
|
||||
/**
|
||||
* Modal dialog that enable an admin to configure the active payment gateway
|
||||
*/
|
||||
export const SelectGatewayModal: React.FC<SelectGatewayModalModalProps> = ({ isOpen, toggleModal, onError, onSuccess }) => {
|
||||
const { t } = useTranslation('admin');
|
||||
|
||||
@ -113,22 +116,22 @@ export const SelectGatewayModal: React.FC<SelectGatewayModalModalProps> = ({ isO
|
||||
};
|
||||
|
||||
return (
|
||||
<FabModal title={t('app.admin.invoices.payment.gateway_modal.select_gateway_title')}
|
||||
<FabModal title={t('app.admin.invoices.payment.select_gateway_modal.select_gateway_title')}
|
||||
isOpen={isOpen}
|
||||
toggleModal={toggleModal}
|
||||
width={ModalSize.medium}
|
||||
className="select-gateway-modal"
|
||||
confirmButton={t('app.admin.invoices.payment.gateway_modal.confirm_button')}
|
||||
confirmButton={t('app.admin.invoices.payment.select_gateway_modal.confirm_button')}
|
||||
onConfirm={onGatewayConfirmed}
|
||||
preventConfirm={preventConfirmGateway}>
|
||||
{!hasSelectedGateway() && <p className="info-gateway">
|
||||
{t('app.admin.invoices.payment.gateway_modal.gateway_info')}
|
||||
{t('app.admin.invoices.payment.select_gateway_modal.gateway_info')}
|
||||
</p>}
|
||||
<label htmlFor="gateway">{t('app.admin.invoices.payment.gateway_modal.select_gateway')}</label>
|
||||
<label htmlFor="gateway">{t('app.admin.invoices.payment.select_gateway_modal.select_gateway')}</label>
|
||||
<select id="gateway" className="select-gateway" onChange={setGateway} value={selectedGateway}>
|
||||
<option />
|
||||
<option value={Gateway.Stripe}>{t('app.admin.invoices.payment.gateway_modal.stripe')}</option>
|
||||
<option value={Gateway.PayZen}>{t('app.admin.invoices.payment.gateway_modal.payzen')}</option>
|
||||
<option value={Gateway.Stripe}>{t('app.admin.invoices.payment.select_gateway_modal.stripe')}</option>
|
||||
<option value={Gateway.PayZen}>{t('app.admin.invoices.payment.select_gateway_modal.payzen')}</option>
|
||||
</select>
|
||||
{selectedGateway === Gateway.Stripe && <StripeKeysForm onValidKeys={handleValidStripeKeys} onInvalidKeys={handleInvalidKeys} />}
|
||||
{selectedGateway === Gateway.PayZen && <PayzenKeysForm onValidKeys={handleValidPayZenKeys} onInvalidKeys={handleInvalidKeys} />}
|
||||
|
@ -48,17 +48,21 @@ export const BooleanSetting: React.FC<BooleanSettingProps> = ({ name, label, cla
|
||||
*/
|
||||
const updateSetting = () => {
|
||||
SettingAPI.update(name, value ? 'true' : 'false')
|
||||
.then(() => onSuccess(t('app.admin.settings.customization_of_SETTING_successfully_saved', { SETTING: t(`app.admin.settings.${name}`) })))
|
||||
.then(() => onSuccess(t('app.admin.boolean_setting.customization_of_SETTING_successfully_saved', {
|
||||
SETTING: t(`app.admin.settings.${name}`) // eslint-disable-line fabmanager/scoped-translation
|
||||
})))
|
||||
.catch(err => {
|
||||
if (err.status === 304) return;
|
||||
|
||||
if (err.status === 423) {
|
||||
onError(t('app.admin.settings.error_SETTING_locked', { SETTING: t(`app.admin.settings.${name}`) }));
|
||||
onError(t('app.admin.boolean_setting.error_SETTING_locked', {
|
||||
SETTING: t(`app.admin.settings.${name}`) // eslint-disable-line fabmanager/scoped-translation
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(err);
|
||||
onError(t('app.admin.settings.an_error_occurred_saving_the_setting'));
|
||||
onError(t('app.admin.boolean_setting.an_error_occurred_saving_the_setting'));
|
||||
});
|
||||
};
|
||||
|
||||
@ -100,7 +104,7 @@ export const BooleanSetting: React.FC<BooleanSettingProps> = ({ name, label, cla
|
||||
<div className={`boolean-setting ${className || ''}`}>
|
||||
<label htmlFor={`setting-${name}`}>{label}</label>
|
||||
<Switch checked={value} id={`setting-${name}}`} onChange={handleChanged} className="switch"></Switch>
|
||||
{!hideSave && <FabButton className="save-btn" onClick={handleSave}>{t('app.admin.check_list_setting.save')}</FabButton> }
|
||||
{!hideSave && <FabButton className="save-btn" onClick={handleSave}>{t('app.admin.boolean_setting.save')}</FabButton> }
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
@ -75,7 +75,9 @@ export const CheckListSetting: React.FC<CheckListSettingProps> = ({ name, label,
|
||||
*/
|
||||
const handleSave = () => {
|
||||
SettingAPI.update(name, value)
|
||||
.then(() => onSuccess(t('app.admin.check_list_setting.customization_of_SETTING_successfully_saved', { SETTING: t(`app.admin.settings.${name}`) })))
|
||||
.then(() => onSuccess(t('app.admin.check_list_setting.customization_of_SETTING_successfully_saved', {
|
||||
SETTING: t(`app.admin.settings.${name}`) // eslint-disable-line fabmanager/scoped-translation
|
||||
})))
|
||||
.catch(err => onError(err));
|
||||
};
|
||||
|
||||
|
@ -18,7 +18,7 @@ interface UserValidationSettingProps {
|
||||
}
|
||||
|
||||
/**
|
||||
* This component allows to configure user validation required setting.
|
||||
* This component allows an admin to configure the settings related to the user account validation.
|
||||
*/
|
||||
export const UserValidationSetting: React.FC<UserValidationSettingProps> = ({ onSuccess, onError }) => {
|
||||
const { t } = useTranslation('admin');
|
||||
@ -27,7 +27,7 @@ export const UserValidationSetting: React.FC<UserValidationSettingProps> = ({ on
|
||||
const userValidationRequiredListDefault = ['subscription', 'machine', 'event', 'space', 'training', 'pack'];
|
||||
const [userValidationRequiredList, setUserValidationRequiredList] = useState<string>(null);
|
||||
const userValidationRequiredOptions = userValidationRequiredListDefault.map(l => {
|
||||
return [l, t(`app.admin.settings.compte.user_validation_required_list.${l}`)];
|
||||
return [l, t(`app.admin.settings.account.user_validation_setting.user_validation_required_list.${l}`)];
|
||||
});
|
||||
|
||||
/**
|
||||
@ -37,20 +37,24 @@ export const UserValidationSetting: React.FC<UserValidationSettingProps> = ({ on
|
||||
SettingAPI.update(name, value)
|
||||
.then(() => {
|
||||
if (name === SettingName.UserValidationRequired) {
|
||||
onSuccess(t('app.admin.settings.customization_of_SETTING_successfully_saved', { SETTING: t(`app.admin.settings.compte.${name}`) }));
|
||||
onSuccess(t('app.admin.settings.account.user_validation_setting.customization_of_SETTING_successfully_saved', {
|
||||
SETTING: t(`app.admin.settings.account.${name}`) // eslint-disable-line fabmanager/scoped-translation
|
||||
}));
|
||||
}
|
||||
}).catch(err => {
|
||||
if (err.status === 304) return;
|
||||
|
||||
if (err.status === 423) {
|
||||
if (name === SettingName.UserValidationRequired) {
|
||||
onError(t('app.admin.settings.error_SETTING_locked', { SETTING: t(`app.admin.settings.compte.${name}`) }));
|
||||
onError(t('app.admin.settings.account.user_validation_setting.error_SETTING_locked', {
|
||||
SETTING: t(`app.admin.settings.account.${name}`) // eslint-disable-line fabmanager/scoped-translation
|
||||
}));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(err);
|
||||
onError(t('app.admin.settings.an_error_occurred_saving_the_setting'));
|
||||
onError(t('app.admin.settings.account.user_validation_setting.an_error_occurred_saving_the_setting'));
|
||||
});
|
||||
};
|
||||
|
||||
@ -71,7 +75,7 @@ export const UserValidationSetting: React.FC<UserValidationSettingProps> = ({ on
|
||||
return (
|
||||
<div className="user-validation-setting">
|
||||
<BooleanSetting name={SettingName.UserValidationRequired}
|
||||
label={t('app.admin.settings.compte.user_validation_required_option_label')}
|
||||
label={t('app.admin.settings.user_validation_setting.user_validation_required_option_label')}
|
||||
hideSave={true}
|
||||
onChange={setUserValidationRequired}
|
||||
onSuccess={onSuccess}
|
||||
@ -79,12 +83,12 @@ export const UserValidationSetting: React.FC<UserValidationSettingProps> = ({ on
|
||||
</BooleanSetting>
|
||||
{userValidationRequired === 'true' &&
|
||||
<div>
|
||||
<h4>{t('app.admin.settings.compte.user_validation_required_list_title')}</h4>
|
||||
<h4>{t('app.admin.settings.user_validation_setting.user_validation_required_list_title')}</h4>
|
||||
<p>
|
||||
{t('app.admin.settings.compte.user_validation_required_list_info')}
|
||||
{t('app.admin.settings.user_validation_setting.user_validation_required_list_info')}
|
||||
</p>
|
||||
<FabAlert level="warning">
|
||||
{t('app.admin.settings.compte.user_validation_required_list_other_info')}
|
||||
{t('app.admin.settings.user_validation_setting.user_validation_required_list_other_info')}
|
||||
</FabAlert>
|
||||
<CheckListSetting name={SettingName.UserValidationRequiredList}
|
||||
label=""
|
||||
@ -97,7 +101,7 @@ export const UserValidationSetting: React.FC<UserValidationSettingProps> = ({ on
|
||||
</CheckListSetting>
|
||||
</div>
|
||||
}
|
||||
<FabButton className="save-btn" onClick={handleSave}>{t('app.admin.check_list_setting.save')}</FabButton>
|
||||
<FabButton className="save-btn" onClick={handleSave}>{t('app.admin.user_validation_setting.save')}</FabButton>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
@ -71,14 +71,14 @@ export const EditSocials = <TFieldValues extends FieldValues>({ register, setVal
|
||||
rules= {{
|
||||
pattern: {
|
||||
value: urlRegex,
|
||||
message: t('app.shared.user_profile_form.website_invalid')
|
||||
message: t('app.shared.edit_socials.website_invalid')
|
||||
}
|
||||
}}
|
||||
formState={formState}
|
||||
defaultValue={network.url}
|
||||
label={network.name}
|
||||
disabled={disabled}
|
||||
placeholder={t('app.shared.text_editor.url_placeholder')}
|
||||
placeholder={t('app.shared.edit_socials.url_placeholder')}
|
||||
icon={<img src={`${Icons}#${network.name}`}></img>}
|
||||
addOn={<Trash size={16} />}
|
||||
addOnAction={() => dispatch({ type: 'delete', payload: { network, field: `profile_attributes.${network.name}` } })} />
|
||||
|
@ -107,7 +107,7 @@ export const FabSocials: React.FC<FabSocialsProps> = ({ show = false, onError, o
|
||||
rules={{
|
||||
pattern: {
|
||||
value: urlRegex,
|
||||
message: t('app.shared.user_profile_form.website_invalid')
|
||||
message: t('app.shared.fab_socials.website_invalid')
|
||||
}
|
||||
}}
|
||||
formState={formState}
|
||||
@ -121,7 +121,7 @@ export const FabSocials: React.FC<FabSocialsProps> = ({ show = false, onError, o
|
||||
</div>}
|
||||
<FabButton type='submit'
|
||||
className='save-btn'>
|
||||
{t('app.shared.buttons.save')}
|
||||
{t('app.shared.fab_socials.save')}
|
||||
</FabButton>
|
||||
</form>
|
||||
}</div>
|
||||
|
@ -85,14 +85,14 @@ export const RenewModal: React.FC<RenewModalProps> = ({ isOpen, toggleModal, sub
|
||||
* Return the formatted localized date for the given date
|
||||
*/
|
||||
const formatDateTime = (date: Date|TDateISO): string => {
|
||||
return t('app.admin.free_extend_modal.DATE_TIME', { DATE: FormatLib.date(date), TIME: FormatLib.time(date) });
|
||||
return t('app.admin.renew_modal.DATE_TIME', { DATE: FormatLib.date(date), TIME: FormatLib.time(date) });
|
||||
};
|
||||
|
||||
/**
|
||||
* Callback triggered when the payment of the subscription renewal was successful
|
||||
*/
|
||||
const onPaymentSuccess = (): void => {
|
||||
onSuccess(t('app.admin.renew_subscription_modal.renew_success'), expirationDate);
|
||||
onSuccess(t('app.admin.renew_modal.renew_success'), expirationDate);
|
||||
toggleModal();
|
||||
};
|
||||
|
||||
@ -108,25 +108,25 @@ export const RenewModal: React.FC<RenewModalProps> = ({ isOpen, toggleModal, sub
|
||||
toggleModal={toggleModal}
|
||||
width={ModalSize.large}
|
||||
className="renew-modal"
|
||||
title={t('app.admin.renew_subscription_modal.renew_subscription')}
|
||||
confirmButton={t('app.admin.renew_subscription_modal.renew')}
|
||||
title={t('app.admin.renew_modal.renew_subscription')}
|
||||
confirmButton={t('app.admin.renew_modal.renew')}
|
||||
onConfirm={toggleLocalPaymentModal}
|
||||
closeButton>
|
||||
<FabAlert level="danger" className="conditions">
|
||||
<p>{t('app.admin.renew_subscription_modal.renew_subscription_info')}</p>
|
||||
<p>{t('app.admin.renew_subscription_modal.credits_will_be_reset')}</p>
|
||||
<p>{t('app.admin.renew_modal.renew_subscription_info')}</p>
|
||||
<p>{t('app.admin.renew_modal.credits_will_be_reset')}</p>
|
||||
</FabAlert>
|
||||
<div className="form-and-payment">
|
||||
<form className="configuration-form">
|
||||
<label htmlFor="current_expiration">{t('app.admin.renew_subscription_modal.current_expiration')}</label>
|
||||
<label htmlFor="current_expiration">{t('app.admin.renew_modal.current_expiration')}</label>
|
||||
<FabInput id="current_expiration"
|
||||
defaultValue={formatDateTime(subscription.expired_at)}
|
||||
readOnly />
|
||||
<label htmlFor="new_start">{t('app.admin.renew_subscription_modal.new_start')}</label>
|
||||
<label htmlFor="new_start">{t('app.admin.renew_modal.new_start')}</label>
|
||||
<FabInput id="new_start"
|
||||
defaultValue={formatDateTime(subscription.expired_at)}
|
||||
readOnly />
|
||||
<label htmlFor="new_expiration">{t('app.admin.renew_subscription_modal.new_expiration_date')}</label>
|
||||
<label htmlFor="new_expiration">{t('app.admin.renew_modal.new_expiration_date')}</label>
|
||||
<FabInput id="new_expiration"
|
||||
defaultValue={formatDateTime(expirationDate)}
|
||||
readOnly/>
|
||||
@ -135,7 +135,7 @@ export const RenewModal: React.FC<RenewModalProps> = ({ isOpen, toggleModal, sub
|
||||
{subscription.plan.monthly_payment && <SelectSchedule show selected={scheduleRequired} onChange={setScheduleRequired} />}
|
||||
{price?.schedule && <PaymentScheduleSummary schedule={price.schedule as PaymentSchedule} />}
|
||||
{price && !price?.schedule && <div className="one-go-payment">
|
||||
<h4>{t('app.admin.renew_subscription_modal.pay_in_one_go')}</h4>
|
||||
<h4>{t('app.admin.renew_modal.pay_in_one_go')}</h4>
|
||||
<span>{FormatLib.price(price.price)}</span>
|
||||
</div>}
|
||||
</div>
|
||||
|
@ -41,16 +41,16 @@ export const UserValidation: React.FC<UserValidationProps> = ({ member, onSucces
|
||||
}
|
||||
MemberAPI.validate(_member)
|
||||
.then((user: User) => {
|
||||
onSuccess(user, t(`app.admin.members_edit.${_value ? 'validate' : 'invalidate'}_member_success`));
|
||||
onSuccess(user, t(`app.admin.user_validation.${_value ? 'validate' : 'invalidate'}_member_success`));
|
||||
}).catch(err => {
|
||||
setValue(!_value);
|
||||
onError(t(`app.admin.members_edit.${_value ? 'validate' : 'invalidate'}_member_error`) + err);
|
||||
onError(t(`app.admin.user_validation.${_value ? 'validate' : 'invalidate'}_member_error`) + err);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="user-validation">
|
||||
<label htmlFor="user-validation-switch">{t('app.admin.members_edit.validate_account')}</label>
|
||||
<label htmlFor="user-validation-switch">{t('app.admin.user_validation.validate_account')}</label>
|
||||
<Switch checked={value} id="user-validation-switch" onChange={handleChanged} className="switch"></Switch>
|
||||
</div>
|
||||
);
|
||||
|
@ -44,9 +44,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<h3 class="m-l" translate>{{ 'app.admin.settings.compte.user_validation_required_title' }}</h3>
|
||||
<h3 class="m-l" translate>{{ 'app.admin.settings.account.user_validation_required_title' }}</h3>
|
||||
<p class="alert alert-warning m-h-md" translate>
|
||||
{{ 'app.admin.settings.compte.user_validation_required_info' }}
|
||||
{{ 'app.admin.settings.account.user_validation_required_info' }}
|
||||
<div class="col-md-10 col-md-offset-1">
|
||||
<user-validation-setting on-success="onSuccess" on-error="onError" />
|
||||
</div>
|
||||
@ -76,7 +76,7 @@
|
||||
|
||||
<div class="panel panel-default m-t-md">
|
||||
<div class="panel-heading">
|
||||
<span class="font-sbold" translate>{{ 'app.admin.settings.compte.customize_account_settings' }}</span>
|
||||
<span class="font-sbold" translate>{{ 'app.admin.settings.account.customize_account_settings' }}</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
@ -107,12 +107,12 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<h3 class="m-l" translate>{{ 'app.admin.settings.compte.organization' }}</h3>
|
||||
<h3 class="m-l" translate>{{ 'app.admin.settings.account.organization' }}</h3>
|
||||
<p class="alert alert-warning m-h-md m-b" translate>
|
||||
{{ 'app.admin.settings.compte.organization_profile_custom_fields_info' }}
|
||||
{{ 'app.admin.settings.account.organization_profile_custom_fields_info' }}
|
||||
</p>
|
||||
<p class="alert alert-danger m-h-md" translate>
|
||||
{{ 'app.admin.settings.compte.organization_profile_custom_fields_alert' }}
|
||||
{{ 'app.admin.settings.account.organization_profile_custom_fields_alert' }}
|
||||
</p>
|
||||
<div class="col-md-12">
|
||||
<profile-custom-fields-list on-success="onSuccess" on-error="onError" />
|
||||
|
@ -30,7 +30,7 @@
|
||||
<ng-include src="'/admin/settings/general.html'"></ng-include>
|
||||
</uib-tab>
|
||||
|
||||
<uib-tab heading="{{ 'app.admin.settings.compte.account' | translate }}" index="1">
|
||||
<uib-tab heading="{{ 'app.admin.settings.account.account' | translate }}" index="1">
|
||||
<ng-include src="'/admin/settings/compte.html'"></ng-include>
|
||||
</uib-tab>
|
||||
|
||||
|
@ -784,7 +784,7 @@ en:
|
||||
error_while_saving: "An error occurred while saving the currency: "
|
||||
currency_updated: "The PayZen currency was successfully updated to {CURRENCY}."
|
||||
# select a payment gateway
|
||||
gateway_modal:
|
||||
select_gateway_modal:
|
||||
select_gateway_title: "Select a payment gateway"
|
||||
gateway_info: "To securely collect and process payments online, Fab-manager needs to use an third-party service authorized by the financial institutions, called a payment gateway."
|
||||
select_gateway: "Please select an available gateway"
|
||||
@ -944,6 +944,12 @@ en:
|
||||
success: "Success"
|
||||
failed: "Failed"
|
||||
error_details: "Error's details:"
|
||||
user_validation:
|
||||
validate_member_success: "Member successfully validated"
|
||||
invalidate_member_success: "Member successfully invalidated"
|
||||
validate_member_error: "An unexpected error occurred: unable to validate this member."
|
||||
invalidate_member_error: "An unexpected error occurred: unable to invalidate this member."
|
||||
validate_account: "Validate the account"
|
||||
#edit a member
|
||||
members_edit:
|
||||
change_role: "Change role"
|
||||
@ -1028,7 +1034,7 @@ en:
|
||||
extend: "Extend"
|
||||
extend_success: "The subscription was successfully extended for free"
|
||||
# renew a subscription
|
||||
renew_subscription_modal:
|
||||
renew_modal:
|
||||
renew_subscription: "Renew the subscription"
|
||||
renew_subscription_info: "You are about to renew the user's subscription by charging him again for his current subscription."
|
||||
credits_will_be_reset: "The balance of free credits (training / machines / spaces) of the user will be reset, unused credits will be lost."
|
||||
@ -1038,6 +1044,7 @@ en:
|
||||
pay_in_one_go: "Pay in one go"
|
||||
renew: "Renew"
|
||||
renew_success: "The subscription was successfully renewed"
|
||||
DATE_TIME: "{DATE} {TIME}"
|
||||
# take a new subscription
|
||||
subscribe_modal:
|
||||
subscribe_USER: "Subscribe {USER}"
|
||||
@ -1244,6 +1251,11 @@ en:
|
||||
week_of_START_to_END: "Week of {START} to {END}"
|
||||
no_data_for_this_period: "No data for this period"
|
||||
date: "Date"
|
||||
boolean_setting:
|
||||
customization_of_SETTING_successfully_saved: "Customization of the {SETTING} successfully saved."
|
||||
error_SETTING_locked: "Unable to update the setting: {SETTING} is locked. Please contact your system administrator."
|
||||
an_error_occurred_saving_the_setting: "An error occurred while saving the setting. Please try again later."
|
||||
save: "save"
|
||||
#global application parameters and customization
|
||||
settings:
|
||||
customize_the_application: "Customize the application"
|
||||
@ -1498,23 +1510,27 @@ en:
|
||||
statistics: "Statistics"
|
||||
statistics_info_html: "<p>Enable or disable the statistics module.</p><p>If enabled, every nights, the data of the day just passed will be consolidated in the database of a powerful analysis engine. Then, every administrators will be able to browse statistical charts and tables in the corresponding section.</p>"
|
||||
enable_statistics: "Enable statistics"
|
||||
compte:
|
||||
account:
|
||||
account: "Account"
|
||||
customize_account_settings: "Customize account settings"
|
||||
user_validation_required: "validation of accounts"
|
||||
user_validation_required_title: "Validation of accounts"
|
||||
user_validation_required_info: "By activating this option, only members whose account is validated by an administrator or a manager will be able to make reservations."
|
||||
user_validation_required_option_label: "Activate the account validation option"
|
||||
user_validation_required_list_title: "Member account validation information message"
|
||||
user_validation_required_list_info: "Your administrator must validate your account. You will then be able to access all the booking features."
|
||||
user_validation_required_list_other_info: "The resources selected below will be subject to member account validation."
|
||||
user_validation_required_list:
|
||||
subscription: "Subscriptions"
|
||||
machine: "Machines"
|
||||
event: "Events"
|
||||
space: "Spaces"
|
||||
training: "Trainings"
|
||||
pack: "Prepaid pack"
|
||||
user_validation_setting:
|
||||
customization_of_SETTING_successfully_saved: "Customization of the {SETTING} successfully saved."
|
||||
error_SETTING_locked: "Unable to update the setting: {SETTING} is locked. Please contact your system administrator."
|
||||
an_error_occurred_saving_the_setting: "An error occurred while saving the setting. Please try again later."
|
||||
user_validation_required_option_label: "Activate the account validation option"
|
||||
user_validation_required_list_title: "Member account validation information message"
|
||||
user_validation_required_list_info: "Your administrator must validate your account. Then, you will be able to access all the booking features."
|
||||
user_validation_required_list_other_info: "The resources selected below will be subject to member account validation."
|
||||
user_validation_required_list:
|
||||
subscription: "Subscriptions"
|
||||
machine: "Machines"
|
||||
event: "Events"
|
||||
space: "Spaces"
|
||||
training: "Trainings"
|
||||
pack: "Prepaid pack"
|
||||
create_groups: "Create groups"
|
||||
add_proof_of_identity_types: "Add proof of identity"
|
||||
proof_of_identity_type_info: "You can add proof of identity according to the user groups created in order to ask your members to deposit them in their space. Each member will be informed of the proof of identity to be provided in their personal space (My proof of identity tab). On your side, you can check the proof of identity and validate their account (provided that the Account Validation option is activated)."
|
||||
|
@ -43,6 +43,11 @@ en:
|
||||
networks_update_success: "Social networks update successful"
|
||||
networks_update_error: "Problem trying to update social networks"
|
||||
url_placeholder: "Paste url…"
|
||||
save: "Save"
|
||||
website_invalid: "The website address is not a valid URL"
|
||||
edit_socials:
|
||||
url_placeholder: "Paste url…"
|
||||
website_invalid: "The website address is not a valid URL"
|
||||
#user edition form
|
||||
user_profile_form:
|
||||
add_an_avatar: "Add an avatar"
|
||||
@ -174,6 +179,9 @@ en:
|
||||
method_check: "By check"
|
||||
card_collection_info: "By validating, you'll be prompted for the member's card number. This card will be automatically charged at the deadlines."
|
||||
check_collection_info: "By validating, you confirm that you have {DEADLINES} checks, allowing you to collect all the monthly payments."
|
||||
event_themes:
|
||||
title: "Event themes"
|
||||
select_theme: "Pick up a theme…"
|
||||
#event edition form
|
||||
event:
|
||||
title: "Title"
|
||||
@ -528,4 +536,4 @@ en:
|
||||
update_card: "Update the card"
|
||||
validate_button: "Validate the new card"
|
||||
form_multi_select:
|
||||
create_label: "Add {VALUE}"
|
||||
create_label: "Add {VALUE}"
|
||||
|
@ -25,7 +25,7 @@
|
||||
"@typescript-eslint/parser": "^5.17.0",
|
||||
"eslint": "~8.12.0",
|
||||
"eslint-config-standard": "~17.0.0-1",
|
||||
"eslint-plugin-fabmanager": "^0.4.8",
|
||||
"eslint-plugin-fabmanager": "^0.5.3",
|
||||
"eslint-plugin-html-erb": "^1.0.1",
|
||||
"eslint-plugin-import": "~2.25.4",
|
||||
"eslint-plugin-n": "^15.1.0",
|
||||
|
@ -4082,10 +4082,10 @@ eslint-plugin-es@^4.1.0:
|
||||
eslint-utils "^2.0.0"
|
||||
regexpp "^3.0.0"
|
||||
|
||||
eslint-plugin-fabmanager@^0.4.8:
|
||||
version "0.4.8"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-fabmanager/-/eslint-plugin-fabmanager-0.4.8.tgz#2104feddee06fa0245e64a3b8491412b17dcd16e"
|
||||
integrity sha512-Heey9vsr2WmRjY4JOskwWK8H2qgfR9nVX0osQyOb5bc+r6gQPci0Q0eECcN3pT9tXjLl2oL0oxWA5DFhleBi2A==
|
||||
eslint-plugin-fabmanager@^0.5.3:
|
||||
version "0.5.3"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-fabmanager/-/eslint-plugin-fabmanager-0.5.3.tgz#28576314182943c999c4a42d4d9ff8a1a9eefa82"
|
||||
integrity sha512-lubHoF0oSiCn1MaByyB3N7YS1QU0t+mxirDILlkPA/9m/puSF32AvMGd2ztKzYdYfPIOQlgHIO+dUEYBTRTc0A==
|
||||
dependencies:
|
||||
requireindex "^1.2.0"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user