Pull request #2519: Release 1.10.2
Merge in MCB_FE/mcb-platform-monorepo from release-1.10.2 to master * commit '42368742f79ca58947c06d66148ab52031df4ccd': fix(TEAMMSBMOB-22925): убрана метрика появления модалки fix(TEAMMSBMOB-22943): Исправление преобразования даты chore(app): 1.10.2 fix(TEAMMSBMOB-22925, TEAMMSBMOB-22926): исправления метрик fix(TEAMMSBMOB-22920): check authority params fix
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@msb/ib-module",
|
||||
"version": "1.10.1",
|
||||
"version": "1.10.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@msb/ib-module",
|
||||
"version": "1.10.0",
|
||||
"version": "1.10.2",
|
||||
"workspaces": [
|
||||
"packages/*",
|
||||
"services/*"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@msb/ib-module",
|
||||
"version": "1.10.1",
|
||||
"version": "1.10.2",
|
||||
"files": [
|
||||
"msb-host",
|
||||
"msb-main-page",
|
||||
|
||||
@@ -14,10 +14,14 @@ function mapDataToCheckAuthority(org: OrganizationDto, signData: IDstForSign[])
|
||||
clientAbsId: org.absId,
|
||||
clientEskId: org.externalClientGuid,
|
||||
clientInnKio: org.innKio,
|
||||
clientKpp: org.kpp,
|
||||
clientName: org.fullName,
|
||||
clientOgrn: org.ogrnOgrip,
|
||||
certificateIds: signData.map(dst => dst.certificateId),
|
||||
...(org.kpp
|
||||
? {
|
||||
clientKpp: org.kpp,
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,9 @@ function openNotificationSignModal(
|
||||
|
||||
if (data) {
|
||||
readNotification(document);
|
||||
handleReachGoal(YM_GOALS.VIEW_ELEMENT, { [YM_GOALS.VIEW_ELEMENT]: { element_name: 'notification_signed' } });
|
||||
handleReachGoal(YM_GOALS.VIEW_ELEMENT, {
|
||||
[YM_GOALS.VIEW_ELEMENT]: { blocking_modal: { element_name: 'notification_signed' } },
|
||||
});
|
||||
}
|
||||
|
||||
return [data];
|
||||
|
||||
+7
-2
@@ -69,6 +69,8 @@ const BlockingNotification = ({ id, setSignModalOpened, markAsRead, markAsReadLo
|
||||
);
|
||||
|
||||
await queryClient.invalidateQueries([QUERY_KEY_USER_NOTIFICATION_CATEGORY_COUNT]);
|
||||
|
||||
handleReachGoal(YM_GOALS.VIEW_ELEMENT, { [YM_GOALS.VIEW_ELEMENT]: { blocking_modal: { element_name: 'notification_read' } } });
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -79,7 +81,7 @@ const BlockingNotification = ({ id, setSignModalOpened, markAsRead, markAsReadLo
|
||||
return;
|
||||
}
|
||||
|
||||
handleReachGoal(YM_GOALS.BUTTON_CLICK, { [YM_GOALS.BUTTON_CLICK]: { element_name: 'mark_as_read' } });
|
||||
handleReachGoal(YM_GOALS.BUTTON_CLICK, { [YM_GOALS.BUTTON_CLICK]: { blocking_modal: { element_name: 'mark_as_read' } } });
|
||||
|
||||
if (isSignable) {
|
||||
setSignModalOpened(true);
|
||||
@@ -97,7 +99,10 @@ const BlockingNotification = ({ id, setSignModalOpened, markAsRead, markAsReadLo
|
||||
if (error) {
|
||||
return (
|
||||
<>
|
||||
<YaMetrikaReachGoal goalType={YM_GOALS.ERROR} params={{ [YM_GOALS.ERROR]: { error_description: LOCALIZATION.DATA_IS_FAILED } }} />
|
||||
<YaMetrikaReachGoal
|
||||
goalType={YM_GOALS.ERROR}
|
||||
params={{ [YM_GOALS.ERROR]: { blocking_modal: { error_description: LOCALIZATION.DATA_IS_FAILED } } }}
|
||||
/>
|
||||
<DataIsFailedError
|
||||
onClick={() => {
|
||||
refetch();
|
||||
|
||||
+5
-7
@@ -56,7 +56,6 @@ const BlockingNotificationModal = ({ notifications }: Props): ReactElement => {
|
||||
if (shouldShow && !isModalOpen) {
|
||||
const timer = setTimeout(() => {
|
||||
setIsModalOpen(true);
|
||||
handleReachGoal(YM_GOALS.VIEW_ELEMENT, { [YM_GOALS.VIEW_ELEMENT]: { element_name: 'blocking_modal' } });
|
||||
}, DELAY_MS);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
@@ -64,11 +63,10 @@ const BlockingNotificationModal = ({ notifications }: Props): ReactElement => {
|
||||
|
||||
if (notifications.length > 0 && notifications.every(notification => notification.status === READ_STATUS.READ)) {
|
||||
const closeTimer = setTimeout(() => {
|
||||
queryClient.invalidateQueries([QUERY_KEY_REQUIRED_READ_USER_NOTIFICATION]).then(() => {
|
||||
setIsModalOpen(false);
|
||||
showSnackbarMessage({ type: 'success', icon: OkIcon, message: LOCALIZATION.ALL_NOTIFICATIONS_IS_TAKEN_INTO_ACTION });
|
||||
localStorage.removeItem(BLOCKING_NOTIFICATION_MODAL_KEY);
|
||||
});
|
||||
setIsModalOpen(false);
|
||||
showSnackbarMessage({ type: 'success', icon: OkIcon, message: LOCALIZATION.ALL_NOTIFICATIONS_IS_TAKEN_INTO_ACTION });
|
||||
queryClient.invalidateQueries([QUERY_KEY_REQUIRED_READ_USER_NOTIFICATION]);
|
||||
localStorage.removeItem(BLOCKING_NOTIFICATION_MODAL_KEY);
|
||||
}, DELAY_MS);
|
||||
|
||||
return () => clearTimeout(closeTimer);
|
||||
@@ -94,7 +92,7 @@ const BlockingNotificationModal = ({ notifications }: Props): ReactElement => {
|
||||
}, []);
|
||||
|
||||
const handleExpandCard = useCallback((id: string) => {
|
||||
handleReachGoal(YM_GOALS.BUTTON_CLICK, { [YM_GOALS.BUTTON_CLICK]: { element_name: 'opening_a_notification' } });
|
||||
handleReachGoal(YM_GOALS.BUTTON_CLICK, { [YM_GOALS.BUTTON_CLICK]: { blocking_modal: { element_name: 'opening_a_notification' } } });
|
||||
setExpandedId(prevExpandedId => (prevExpandedId === id ? null : id));
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { useCallback, useMemo, useRef, useState, type ReactElement } from 'react';
|
||||
import { useCallback, useMemo, useRef, useState, useEffect, type ReactElement } from 'react';
|
||||
import { Button, Skeleton } from '@fractal-ui/core';
|
||||
import { NotificationIcon } from '@fractal-ui/library';
|
||||
import type { ModalButtonProps } from '@fractal-ui/overlays';
|
||||
@@ -30,7 +30,7 @@ import * as S from './styles';
|
||||
|
||||
const UserNotifications = (): ReactElement => {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const timeoutIdRef = useRef<NodeJS.Timeout | null>(null);
|
||||
const [isScrollLocked, setIsScrollLocked] = useState(false);
|
||||
const containerRef = useRef(null);
|
||||
const dropdownRef = useRef(null);
|
||||
@@ -65,6 +65,17 @@ const UserNotifications = (): ReactElement => {
|
||||
[notificationsCategories]
|
||||
);
|
||||
|
||||
useEffect(
|
||||
() => () => {
|
||||
if (timeoutIdRef.current) {
|
||||
clearTimeout(timeoutIdRef.current);
|
||||
}
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
useScrollLock(isDesktop && isScrollLocked);
|
||||
|
||||
const toggleOpen = useCallback(() => {
|
||||
if (!havePermission) {
|
||||
return;
|
||||
@@ -95,17 +106,22 @@ const UserNotifications = (): ReactElement => {
|
||||
|
||||
const handleClick = useCallback(
|
||||
(id?: string) => () => {
|
||||
if (timeoutIdRef.current) {
|
||||
clearTimeout(timeoutIdRef.current);
|
||||
}
|
||||
|
||||
handleReachGoal(YM_GOALS.BUTTON_CLICK, {
|
||||
[YM_GOALS.BUTTON_CLICK]: { new_notifications: { element_name: 'go_to_the_section' } },
|
||||
});
|
||||
toggleOpen();
|
||||
push(id ? `${PATHS.NOTIFICATIONS}/${id}` : PATHS.NOTIFICATIONS);
|
||||
|
||||
timeoutIdRef.current = setTimeout(() => {
|
||||
push(id ? `${PATHS.NOTIFICATIONS}/${id}` : PATHS.NOTIFICATIONS);
|
||||
}, 500);
|
||||
},
|
||||
[push, toggleOpen]
|
||||
);
|
||||
|
||||
useScrollLock(isDesktop && isScrollLocked);
|
||||
|
||||
const actions: ModalButtonProps[] = [
|
||||
{
|
||||
text: LOCALIZATION.GO_TO_NOTIFICATION_PAGE,
|
||||
|
||||
@@ -285,6 +285,7 @@ const NotificationPageDrawer = ({ setBadge, readNotification, setNotificationExe
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
isNeedScroll={false}
|
||||
isOpen={!!id}
|
||||
width={500}
|
||||
onClose={handleClose}
|
||||
|
||||
@@ -353,6 +353,11 @@ const mapStatementRequestFormToDto = (formValues: StatementForm, creationType: C
|
||||
|
||||
const { dateInterval, period } = dateWithPeriod || {};
|
||||
|
||||
const parsedDate = (dateInterval as string[]).map(date => date.split('T')[0]);
|
||||
|
||||
// Должно быть локальное время
|
||||
const formattedDate = parsedDate.map(date => formatDateTime(date, { keepLocalTime: true, format: STATEMENT_REQUEST_DATE_FORMAT }));
|
||||
|
||||
return {
|
||||
action,
|
||||
accountsIds: accountIds,
|
||||
@@ -367,12 +372,8 @@ const mapStatementRequestFormToDto = (formValues: StatementForm, creationType: C
|
||||
: Boolean(separateDocumentsFiles),
|
||||
},
|
||||
creationType,
|
||||
dateFrom: formatDateTime(dateInterval[0] as string | undefined, {
|
||||
format: STATEMENT_REQUEST_DATE_FORMAT,
|
||||
}),
|
||||
dateTo: formatDateTime(dateInterval.length === 1 ? (dateInterval[0] as string | undefined) : (dateInterval[1] as string | undefined), {
|
||||
format: STATEMENT_REQUEST_DATE_FORMAT,
|
||||
}),
|
||||
dateFrom: formattedDate[0],
|
||||
dateTo: formattedDate[1],
|
||||
format: action === STATEMENT_REQUEST_ACTION.VIEW ? STATEMENT_REQUEST_ACTION.VIEW : fileFormats,
|
||||
hideEmptyTurnovers,
|
||||
nationalCurrency,
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import type { StatementRequestFormDto } from '@msb/http/statements';
|
||||
import { OPERATIONS, REPORT_TYPE_DTO, STATEMENT_REQUEST_FORMAT, STATEMENT_REQUEST_TYPES } from '@msb/http/statements';
|
||||
import { MEDIA, PERIOD_TYPE, useMediaQuery } from '@msb/shared';
|
||||
import { getIntervalByPeriod, MEDIA, PERIOD_TYPE, useMediaQuery } from '@msb/shared';
|
||||
import dayjs from 'dayjs';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { LOCALIZATION_ERRORS } from '../lib';
|
||||
@@ -77,7 +77,7 @@ const initialValuesSlim: StatementForm = {
|
||||
fileFormats: STATEMENT_REQUEST_FORMAT.PDF,
|
||||
dateWithPeriod: {
|
||||
period: PERIOD_TYPE.YESTERDAY,
|
||||
dateInterval: [new Date().setDate(new Date().getDate() - 1)],
|
||||
dateInterval: getIntervalByPeriod(PERIOD_TYPE.YESTERDAY)!,
|
||||
},
|
||||
reportType: REPORT_TYPE_DTO.STATEMENT_AND_DOCUMENTS,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user