apps/web: close message on click

This commit is contained in:
vchikalkin 2024-03-22 13:22:23 +03:00
parent 62043e84f3
commit a679b0b6c6
3 changed files with 8 additions and 1 deletions

View File

@ -41,6 +41,7 @@ export const PolicyTable = observer(
content: 'Выбранный расчет ЭЛТ применен',
duration: 1,
key: record.key,
onClick: () => message.destroy(record.key),
});
$process.delete('ELT');
}

View File

@ -61,6 +61,8 @@ const httpLink = new HttpLink({
uri: URL_CRM_GRAPHQL,
});
const key = 'APOLLO_GRAPHQL';
const errorLink = onError(({ graphQLErrors, networkError, operation, response }) => {
const scope = getCurrentScope();
scope.setTag('operationName', operation.operationName);
@ -68,7 +70,8 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, response })
if (!isServer()) {
message.error({
content: `Ошибка во время загрузки данных из CRM`,
key: 'APOLLO_GRAPHQL',
key,
onClick: () => message.destroy(key),
});
}

View File

@ -26,6 +26,7 @@ export function common({ store, trpcClient, apolloClient }: ProcessContext) {
message.loading({
content: `Загружаем КП ${quote?.label}...`,
key,
onClick: () => message.destroy(key),
});
const eltInitialValues = await initElt();
@ -90,12 +91,14 @@ export function common({ store, trpcClient, apolloClient }: ProcessContext) {
message.success({
content: `КП ${quote.label} загружено`,
key,
onClick: () => message.destroy(key),
});
})
.catch(() => {
message.error({
content: `Ошибка во время загрузки КП ${quote.label}`,
key,
onClick: () => message.destroy(key),
});
$calculation.element('selectQuote').resetValue();
})