Commit a97f81a9 authored by Benjamin Bouvier's avatar Benjamin Bouvier
Browse files

Review comments;

parent 45056e63
Pipeline #357596 passed with stage
in 4 minutes and 14 seconds
......@@ -14,13 +14,9 @@ import AccountSelector from '../ui/account-select';
export default connect(
state => {
let accessIds = get.accessIds(state);
let accesses = accessIds.map(id => get.accessById(state, id));
return {
accessIds,
accessIds: get.accessIds(state),
isDemoMode: get.isDemoMode(state),
accesses,
};
},
dispatch => {
......@@ -30,16 +26,12 @@ export default connect(
}
)(props => {
const accesses = props.accessIds.map(id => <BankAccessItem key={id} accessId={id} />);
function handleChangeAccount(accountId) {
props.setDefault(accountId);
}
return (
<div className="bank-accesses-section">
<FormRow
label={$t('client.accesses.default_account')}
inputId="default-account-selector"
input={<AccountSelector onChange={handleChangeAccount} />}
input={<AccountSelector onChange={props.setDefault} />}
help={$t('client.accesses.default_account_helper')}
/>
<DisplayIf condition={!props.isDemoMode}>
......
......@@ -89,7 +89,6 @@ const formatIBAN = iban => {
export default connect(
(state, props) => {
return {
isDefaultAccount: get.defaultAccountId(state) === props.accountId,
account: get.accountById(state, props.accountId),
isDemoEnabled: get.isDemoMode(state),
};
......@@ -100,9 +99,6 @@ export default connect(
handleDeleteAccount: () => {
actions.deleteAccount(dispatch, props.accountId);
},
handleSetDefault: () => {
actions.setDefaultAccountId(dispatch, props.accountId);
},
updateAccount(update, previousAttributes) {
actions.updateAccount(dispatch, props.accountId, update, previousAttributes);
},
......@@ -110,7 +106,7 @@ export default connect(
},
(stateToProps, dispatchToProps, props) => {
let currentExcludeFromBalance = stateToProps.account.excludeFromBalance;
let excludeFromBalance = stateToProps.account.excludeFromBalance;
return {
...stateToProps,
...props,
......@@ -119,10 +115,10 @@ export default connect(
handleExcludeFromBalance() {
dispatchToProps.updateAccount(
{
excludeFromBalance: !currentExcludeFromBalance,
excludeFromBalance: !excludeFromBalance,
},
{
excludeFromBalance: currentExcludeFromBalance,
excludeFromBalance,
}
);
},
......
......@@ -96,8 +96,8 @@
"accesses": {
"back_to_access_list": "Go back to the accesses list",
"new_bank_form_title": "Configure a new access",
"default_account": "Choose a default bank account",
"default_account_helper": "The chosen bank account will be displayed at Kresus startup."
"default_account": "Default account",
"default_account_helper": "The chosen bank account will be displayed at startup."
},
"editaccessmodal": {
"not_empty": "Please fill the password field",
......
......@@ -96,7 +96,7 @@
"accesses": {
"back_to_access_list": "Retourner à la liste des accès",
"new_bank_form_title": "Configurer un nouvel accès",
"default_account": "Choisissez un compte bancaire par défaut",
"default_account": "Compte par défaut",
"default_account_helper": "Le compte bancaire choisi sera affiché au démarrage de Kresus."
},
"editaccessmodal": {
......
Supports Markdown
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