From 294fd17445df302fd8e7fb23616981b61355a13e Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Tue, 1 Oct 2024 11:03:17 +0300 Subject: [PATCH 1/5] MSP-4160 add id in List.Item.Meta in ApplicationsPage, ApplicationsContent and ListItem --- src/components/ApplicationsContent/index.tsx | 2 +- src/pages/ApplicationsPage/index.tsx | 18 +++--------------- src/widgets/ListItem/index.tsx | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/components/ApplicationsContent/index.tsx b/src/components/ApplicationsContent/index.tsx index c061d49..a83c462 100644 --- a/src/components/ApplicationsContent/index.tsx +++ b/src/components/ApplicationsContent/index.tsx @@ -142,7 +142,7 @@ const ApplicationsContent: FC = ({ return ( - + id: {item.id}}/>
{ diff --git a/src/pages/ApplicationsPage/index.tsx b/src/pages/ApplicationsPage/index.tsx index 5b05c1a..9bcf506 100644 --- a/src/pages/ApplicationsPage/index.tsx +++ b/src/pages/ApplicationsPage/index.tsx @@ -1,4 +1,4 @@ -import { List, message, Spin, Tooltip } from 'antd' +import { message, Spin } from 'antd' import { Layout } from 'isp-ui-kit' import { ColumnItem } from 'isp-ui-kit/dist/Layout/Column/column.type' import { useEffect, useMemo, useState } from 'react' @@ -23,6 +23,7 @@ import applicationsGroupApi from '@services/applicationsGroupService.ts' import { routePaths } from '@routes/routePaths.ts' import { PermissionKeysType } from '@type/roles.type.ts' +import ListItem from '@widgets/ListItem' import './applications-page.scss' @@ -79,19 +80,6 @@ const ApplicationsPage = () => { return } - const renderColumnItems = (item: ColumnItem) => { - return ( - - - {item.description}} - /> - - - ) - } - const addApplicationModal = () => { setShowApplicationsModal({ ...showApplicationsModal, @@ -183,7 +171,7 @@ const ApplicationsPage = () => { applicationsGroup as unknown as ColumnItem[], searchValue )} - renderItems={renderColumnItems} + renderItems={(item) => } searchValue={searchValue} selectedItemId={selectedItemId} setSelectedItemId={(itemId) => { diff --git a/src/widgets/ListItem/index.tsx b/src/widgets/ListItem/index.tsx index 3fb828f..3dc0863 100644 --- a/src/widgets/ListItem/index.tsx +++ b/src/widgets/ListItem/index.tsx @@ -8,7 +8,7 @@ const ListItem: FC = ({ item }) => { return ( - + id: {item.id}} /> ) From 92706e8d992f2b054ea1396079e3fd9e4c11bd0f Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Tue, 1 Oct 2024 11:05:24 +0300 Subject: [PATCH 2/5] MSP-4160 save menu position in localStorage in LayoutComponent --- src/components/Layout/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index f5ccc8c..4b4e0c7 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -40,7 +40,7 @@ import './layout.scss'; const { Content, Sider } = Layout const LayoutComponent = () => { - const [collapsed, setCollapsed] = useState(true) + const [collapsed, setCollapsed] = useState(LocalStorage.get('menu') === null ? true : LocalStorage.get('menu')) const [selectedMenuKeys, setSelectedMenuKeys] = useState( [] ) @@ -204,7 +204,10 @@ const LayoutComponent = () => { theme="light" collapsible collapsed={collapsed} - onCollapse={(value) => setCollapsed(value)} + onCollapse={(value) => { + LocalStorage.set('menu', value) + setCollapsed(value) + }} >
Date: Tue, 1 Oct 2024 11:07:47 +0300 Subject: [PATCH 3/5] MSP-4160 update LocalStorage clear when token expires or removes --- src/services/apiService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/apiService.ts b/src/services/apiService.ts index 9124a01..e1b8b80 100644 --- a/src/services/apiService.ts +++ b/src/services/apiService.ts @@ -30,12 +30,17 @@ apiService.interceptors.request.use( (error: AxiosError) => Promise.reject(error) ) +const localClear = () => { + LocalStorage.remove(localStorageKeys.USER_TOKEN) + LocalStorage.remove(localStorageKeys.HEADER_NAME) +} + apiService.interceptors.response.use( async (response: any) => response, (error: AxiosError) => { console.error(error) if (error.response && error.response.status === 401) { - LocalStorage.clear() + localClear() message.error('Ваша сессия истекла"').then() LocalStorage.set('redirectUrl', location.pathname) window.location.href = routePaths.login From f4d561e2669d115cca69d6a62f130954b2eea234 Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Tue, 1 Oct 2024 11:08:34 +0300 Subject: [PATCH 4/5] MSP-4160 update style for submenu in Menu in LayoutComponent --- src/components/Layout/layout.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/Layout/layout.scss b/src/components/Layout/layout.scss index 242388b..19ddc9e 100644 --- a/src/components/Layout/layout.scss +++ b/src/components/Layout/layout.scss @@ -44,3 +44,9 @@ padding-top: 5px !important; } } + +.ant-menu-submenu { + .hide-item { + display: none !important; + } +} From 51118dd17e8d1c6f5c4a4b1f8d2c7cde42c55a51 Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Tue, 1 Oct 2024 11:13:19 +0300 Subject: [PATCH 5/5] MSP-4160 up version to 0.13.3 --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cce9f93..95e0802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.13.3 +- Добавлено отображение id приложения на экранах страниц 'Приложения' и 'Доступы приложений' +- Добавлено фиксирование в localStorage открытое или закрытое меню +- Исправлена очистка localStorage после протухания или удаления токена +- Исправлены стили для субменю, которые влияли на отображение разрешенных и неразрешенных пунктов меню ## 0.13.2 - Обновление пермишенов ## 0.13.1 diff --git a/package.json b/package.json index 6b8feef..da1cdab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "isp-admin-ui", "private": true, - "version": "0.13.2", + "version": "0.13.3", "type": "module", "scripts": { "start": "vite",