Compare commits
6 Commits
dev
...
fix/ui-ux-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50701b19b7 | ||
|
|
ec32c0dea6 | ||
|
|
56fcb384f3 | ||
|
|
df4cce0ebf | ||
|
|
a679b0b6c6 | ||
|
|
62043e84f3 |
@ -7,16 +7,16 @@ import { Table } from 'ui/elements';
|
|||||||
|
|
||||||
export const PolicyTable = observer(
|
export const PolicyTable = observer(
|
||||||
({
|
({
|
||||||
storeSelector,
|
|
||||||
onSelectRow,
|
onSelectRow,
|
||||||
|
storeSelector,
|
||||||
...props
|
...props
|
||||||
}: {
|
}: {
|
||||||
columns: typeof columns;
|
columns: typeof columns;
|
||||||
onSelectRow: (row: Row) => void;
|
onSelectRow: (row: Row) => void;
|
||||||
storeSelector: StoreSelector;
|
storeSelector: StoreSelector;
|
||||||
}) => {
|
}) => {
|
||||||
const { $tables, $process } = useStore();
|
const { $process, $tables } = useStore();
|
||||||
const { getRows, setSelectedKey, getSelectedRow } = storeSelector($tables.elt);
|
const { getRows, getSelectedRow, setSelectedKey } = storeSelector($tables.elt);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table
|
<Table
|
||||||
@ -37,7 +37,12 @@ export const PolicyTable = observer(
|
|||||||
$process.add('ELT');
|
$process.add('ELT');
|
||||||
setSelectedKey(record.key);
|
setSelectedKey(record.key);
|
||||||
onSelectRow(record);
|
onSelectRow(record);
|
||||||
message.success({ content: 'Выбранный расчет ЭЛТ применен', key: record.key });
|
message.success({
|
||||||
|
content: 'Выбранный расчет ЭЛТ применен',
|
||||||
|
duration: 1,
|
||||||
|
key: record.key,
|
||||||
|
onClick: () => message.destroy(record.key),
|
||||||
|
});
|
||||||
$process.delete('ELT');
|
$process.delete('ELT');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -50,7 +50,7 @@ function Form({ prune }) {
|
|||||||
<Tabs type="card" tabBarGutter="5px">
|
<Tabs type="card" tabBarGutter="5px">
|
||||||
{formTabs
|
{formTabs
|
||||||
.filter((tab) => !prune?.includes(tab.id))
|
.filter((tab) => !prune?.includes(tab.id))
|
||||||
.map(({ id, title, Component }) => (
|
.map(({ Component, id, title }) => (
|
||||||
<Tabs.TabPane tab={title} key={id}>
|
<Tabs.TabPane tab={title} key={id}>
|
||||||
<ComponentWrapper>
|
<ComponentWrapper>
|
||||||
<Component />
|
<Component />
|
||||||
|
|||||||
@ -7,14 +7,17 @@ import { message as antdMessage, notification as antdNotification } from 'ui/ele
|
|||||||
export let message: Readonly<MessageInstance>;
|
export let message: Readonly<MessageInstance>;
|
||||||
export let notification: Readonly<NotificationInstance>;
|
export let notification: Readonly<NotificationInstance>;
|
||||||
|
|
||||||
export function Notification({ children }: { children: ReactNode }) {
|
export function Notification({ children }: { readonly children: ReactNode }) {
|
||||||
const [messageApi, messageContextHolder] = antdMessage.useMessage({
|
const [messageApi, messageContextHolder] = antdMessage.useMessage({
|
||||||
|
duration: 1.2,
|
||||||
maxCount: 3,
|
maxCount: 3,
|
||||||
top: 70,
|
top: 70,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [notificationApi, notificationContextHolder] = antdNotification.useNotification({
|
const [notificationApi, notificationContextHolder] = antdNotification.useNotification({
|
||||||
|
maxCount: 3,
|
||||||
placement: 'bottomRight',
|
placement: 'bottomRight',
|
||||||
|
stack: { threshold: 1 },
|
||||||
});
|
});
|
||||||
|
|
||||||
message = messageApi;
|
message = messageApi;
|
||||||
|
|||||||
@ -61,6 +61,8 @@ const httpLink = new HttpLink({
|
|||||||
uri: URL_CRM_GRAPHQL,
|
uri: URL_CRM_GRAPHQL,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const key = 'APOLLO_GRAPHQL';
|
||||||
|
|
||||||
const errorLink = onError(({ graphQLErrors, networkError, operation, response }) => {
|
const errorLink = onError(({ graphQLErrors, networkError, operation, response }) => {
|
||||||
const scope = getCurrentScope();
|
const scope = getCurrentScope();
|
||||||
scope.setTag('operationName', operation.operationName);
|
scope.setTag('operationName', operation.operationName);
|
||||||
@ -68,7 +70,8 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, response })
|
|||||||
if (!isServer()) {
|
if (!isServer()) {
|
||||||
message.error({
|
message.error({
|
||||||
content: `Ошибка во время загрузки данных из CRM`,
|
content: `Ошибка во время загрузки данных из CRM`,
|
||||||
key: 'APOLLO_GRAPHQL',
|
key,
|
||||||
|
onClick: () => message.destroy(key),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,7 @@ export function common({ store, trpcClient, apolloClient }: ProcessContext) {
|
|||||||
message.loading({
|
message.loading({
|
||||||
content: `Загружаем КП ${quote?.label}...`,
|
content: `Загружаем КП ${quote?.label}...`,
|
||||||
key,
|
key,
|
||||||
|
onClick: () => message.destroy(key),
|
||||||
});
|
});
|
||||||
|
|
||||||
const eltInitialValues = await initElt();
|
const eltInitialValues = await initElt();
|
||||||
@ -90,12 +91,14 @@ export function common({ store, trpcClient, apolloClient }: ProcessContext) {
|
|||||||
message.success({
|
message.success({
|
||||||
content: `КП ${quote.label} загружено`,
|
content: `КП ${quote.label} загружено`,
|
||||||
key,
|
key,
|
||||||
|
onClick: () => message.destroy(key),
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
message.error({
|
message.error({
|
||||||
content: `Ошибка во время загрузки КП ${quote.label}`,
|
content: `Ошибка во время загрузки КП ${quote.label}`,
|
||||||
key,
|
key,
|
||||||
|
onClick: () => message.destroy(key),
|
||||||
});
|
});
|
||||||
$calculation.element('selectQuote').resetValue();
|
$calculation.element('selectQuote').resetValue();
|
||||||
})
|
})
|
||||||
|
|||||||
@ -4,5 +4,5 @@ export function min(breakpoint: keyof typeof screens) {
|
|||||||
return `@media (min-width: calc(${screens[breakpoint]}px + ${threshold}px))`;
|
return `@media (min-width: calc(${screens[breakpoint]}px + ${threshold}px))`;
|
||||||
}
|
}
|
||||||
export function max(breakpoint: keyof typeof screens) {
|
export function max(breakpoint: keyof typeof screens) {
|
||||||
return `@media (max-width: calc(${screens[breakpoint]}px))`;
|
return `@media (max-width: calc(${screens[breakpoint]}px - ${threshold}px))`;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user