Commit 9de19699 authored by Benjamin Bouvier's avatar Benjamin Bouvier Committed by Nicolas Frandeboeuf
Browse files

Hide the access sync form when the bank isn't supported anymore

parent 6e6a5730
Pipeline #409000 passed with stage
in 4 minutes and 8 seconds
......@@ -106,46 +106,52 @@ const SyncForm = (props: { access: Access; bankDesc: Bank }) => {
<Form center={true} onSubmit={onSubmit}>
<h3>{$t('client.editaccess.sync_title')}</h3>
<p>
{$t('client.editaccess.this_access')}&nbsp;
<strong>
{access.enabled
? $t('client.editaccess.enabled')
: $t('client.editaccess.disabled')}
</strong>
.
</p>
<DisplayIf condition={!access.enabled}>
<p>{$t('client.editaccess.fill_the_fields')}</p>
<DisplayIf condition={bankDesc.deprecated}>
<p>{$t('client.editaccess.deprecated_access')}</p>
</DisplayIf>
<Form.Input id="login-text" label={$t('client.settings.login')}>
<ValidatedTextInput
placeholder="123456789"
onChange={setLogin}
initialValue={login}
/>
</Form.Input>
<Form.Input id="password-text" label={$t('client.settings.password')}>
<PasswordInput onChange={setPassword} className="block" autoFocus={true} />
</Form.Input>
<DisplayIf condition={!!bankDesc && bankDesc.customFields.length > 0}>
{bankDesc.customFields.map((field: CustomFieldDescriptor, index: number) => (
<CustomBankField
key={index}
onChange={onChangeCustomField}
field={field}
value={customFields[field.name]}
<DisplayIf condition={!bankDesc.deprecated}>
<p>
{$t('client.editaccess.this_access')}&nbsp;
<strong>
{access.enabled
? $t('client.editaccess.enabled')
: $t('client.editaccess.disabled')}
</strong>
.
</p>
<DisplayIf condition={!access.enabled}>
<p>{$t('client.editaccess.fill_the_fields')}</p>
</DisplayIf>
<Form.Input id="login-text" label={$t('client.settings.login')}>
<ValidatedTextInput
placeholder="123456789"
onChange={setLogin}
initialValue={login}
/>
))}
</Form.Input>
<Form.Input id="password-text" label={$t('client.settings.password')}>
<PasswordInput onChange={setPassword} className="block" autoFocus={true} />
</Form.Input>
<DisplayIf condition={!!bankDesc && bankDesc.customFields.length > 0}>
{bankDesc.customFields.map((field: CustomFieldDescriptor, index: number) => (
<CustomBankField
key={index}
onChange={onChangeCustomField}
field={field}
value={customFields[field.name]}
/>
))}
</DisplayIf>
<button type="submit" className="btn primary" disabled={!isFormValid}>
{$t('client.general.save')}
</button>
</DisplayIf>
<button type="submit" className="btn primary" disabled={!isFormValid}>
{$t('client.general.save')}
</button>
</Form>
);
};
......
......@@ -221,7 +221,7 @@ export async function fetchOperations(req: PreloadedRequest<Access>, res: expres
if (!access.isEnabled() || bankVendor.deprecated) {
const errcode = getErrorCode('DISABLED_ACCESS');
throw new KError('disabled access', 403, errcode);
throw new KError('disabled or deprecated access', 403, errcode);
}
const userActionFields = extractUserActionFields(req.body);
......
......@@ -1203,4 +1203,4 @@
"name": "Demo bank",
"uuid": "demo"
}
]
\ No newline at end of file
]
......@@ -120,10 +120,11 @@
"success": "Your bank access was correctly updated.",
"error": "Your bank access could not correctly be updated.",
"disable_access": "Disable the access",
"this_access":"This access is currently",
"enabled":"enabled",
"disabled":"disabled",
"fill_the_fields":"Fill the fields and click save to re-enable it.",
"this_access": "This access is currently",
"enabled": "enabled",
"disabled": "disabled",
"deprecated_access": "Kresus' bank connectors don't support this bank anymore. All associated data is kept in read-only mode.",
"fill_the_fields": "Fill the fields and click save to re-enable it.",
"danger_zone_title": "Danger zone",
"sync_title": "Synchronization",
"delete_session": "Delete session cookies",
......
......@@ -120,10 +120,11 @@
"success": "Votre accès bancaire a bien été mis à jour.",
"error": "Votre accès bancaire n'a pas pu être mis à jour.",
"disable_access": "Désactiver l'accès",
"this_access":"Cet accès est actuellement",
"enabled":"activé",
"disabled":"désactivé",
"fill_the_fields":"Remplissez les champs ci-dessous pour le réactiver.",
"this_access": "Cet accès est actuellement",
"enabled": "activé",
"disabled": "désactivé",
"deprecated_access": "Les connecteurs bancaires de Kresus ne supportent plus l'accès à cette banque. Les données sont conservées en lecture seule.",
"fill_the_fields": "Remplissez les champs ci-dessous pour le réactiver.",
"danger_zone_title": "Zone dangereuse",
"sync_title": "Synchronisation",
"delete_session": "Supprimer les cookies de session",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment