feat: handle transactions locking request error.

This commit is contained in:
a.bouhuolia
2021-12-14 18:03:58 +02:00
parent ae7d37a0e0
commit eebe4c46fa
8 changed files with 47 additions and 30 deletions

View File

@@ -86,7 +86,7 @@ function MoneyInForm({
});
})
.finally(() => {
setSubmitting(true);
setSubmitting(false);
});
};

View File

@@ -86,7 +86,7 @@ function MoneyOutForm({
});
})
.finally(() => {
setSubmitting(true);
setSubmitting(false);
});
};
return (

View File

@@ -53,9 +53,11 @@ function GlobalErrors({
);
}
if (globalErrors.transactionsLocked) {
const lockedToDate =
globalErrors.transactionsLocked.formatted_locked_to_date;
AppToaster.show({
message:
'Transactions before 13 Dec 2021 has been locked. Hence action cannot be performed.',
message: `Transactions before ${lockedToDate} has been locked. Hence action cannot be performed.`,
intent: Intent.DANGER,
onDismiss: () => {
globalErrorsSet({ transactionsLocked: false });

View File

@@ -1,5 +1,4 @@
import React from 'react';
import intl from 'react-intl-universal';
import { Intent } from '@blueprintjs/core';
import styled from 'styled-components';
import * as R from 'ramda';
@@ -11,6 +10,7 @@ import {
Join,
Paragraph,
FormattedMessage as T,
AlertDesc
} from 'components';
import { TransactionsLockingProvider } from './TransactionsLockingProvider';
import {
@@ -258,4 +258,8 @@ const LockAllAlert = styled(Alert)`
margin-bottom: 0;
margin-top: 20px;
background: transparent;
${AlertDesc} {
color: #1f3255;
}
`;

View File

@@ -213,7 +213,7 @@ const TransactionLockingWrapp = styled.div`
${(props) =>
props.isEnabled &&
`
border-color: #fe9f9e;
border-color: #fc8483;
${TransLockingIcon} {
color: #ff8282;