diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a316a8..2e6d902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.11.1 +- Проверка на пермишены заменена на компонент CanEdit ## 0.11.0 - Добавлена страница Конфигураций - Добавлена страница сравнения версий diff --git a/package-lock.json b/package-lock.json index 3fdaf73..e021fdb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "isp-admin-ui", - "version": "0.11.0", + "version": "0.11.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "isp-admin-ui", - "version": "0.11.0", + "version": "0.11.1", "dependencies": { "@codemirror/lang-json": "^6.0.1", "@reduxjs/toolkit": "^2.2.3", diff --git a/package.json b/package.json index bec0e8e..ed31dd9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "isp-admin-ui", "private": true, - "version": "0.11.0", + "version": "0.11.1", "type": "module", "scripts": { "start": "vite", diff --git a/src/components/AppAccessContent/app-access-content.scss b/src/components/AppAccessContent/app-access-content.scss index 72cc6f7..86ded25 100644 --- a/src/components/AppAccessContent/app-access-content.scss +++ b/src/components/AppAccessContent/app-access-content.scss @@ -5,7 +5,7 @@ width: 100%; min-width: 760px; - padding: $basic-padding * 2; + padding: $basic-padding * 1.8; border: 1px solid $border-color; &__header { diff --git a/src/components/AppAccessContent/index.tsx b/src/components/AppAccessContent/index.tsx index c4f09a1..4efc947 100644 --- a/src/components/AppAccessContent/index.tsx +++ b/src/components/AppAccessContent/index.tsx @@ -22,7 +22,6 @@ import { PermissionKeysType } from '@type/roles.type.ts' import './app-access-content.scss' - const unknownMethodKey = 'неизвестные методы' const AppAccessContent: FC = ({ @@ -31,7 +30,7 @@ const AppAccessContent: FC = ({ }) => { const [messageApi, contextHolder] = message.useMessage() const { hasPermission } = useRole() - + const canWrite = hasPermission(PermissionKeysType.write) const { @@ -171,7 +170,8 @@ const AppAccessContent: FC = ({ onChange={onChange} />
- - - - record.createdAt} - pagination={false} - columns={columns} - dataSource={data} - /> - - setShowApplicationsModal(false)} - > -
- +
+ + + +
+
+
record.createdAt} + pagination={false} + columns={columns} + dataSource={data} /> - - + + setShowApplicationsModal(false)} + > +
+ + +
+ ) } diff --git a/src/components/TokenContent/tokens.scss b/src/components/TokenContent/tokens.scss index 8b5bca4..9c6ee9d 100644 --- a/src/components/TokenContent/tokens.scss +++ b/src/components/TokenContent/tokens.scss @@ -1,7 +1,20 @@ @import "src/constants/style/styleConst"; + .token-content { - padding: $basic-padding *2 $basic-padding; + overflow-x: scroll; + width: 100%; + + &__wrap { + padding: $basic-padding*2 $basic-padding*3; + min-width: 700px; + } + + &__header { + display: flex; + justify-content: space-between; + } + .copy-btn { cursor: pointer; } -} \ No newline at end of file +} diff --git a/src/constants/style/styleConst.scss b/src/constants/style/styleConst.scss index a7e5d94..74a35cc 100644 --- a/src/constants/style/styleConst.scss +++ b/src/constants/style/styleConst.scss @@ -11,8 +11,6 @@ $grey: #606060; $border-color: #d9d9d9; $error-red: #cf1322; -$border-color: #F0F0F0; - $blue-color: #40A9FF; $blue-light: #E6F7FF; $text-color-blue: #1890FF; diff --git a/src/pages/ApplicationsPage/applications-page.scss b/src/pages/ApplicationsPage/applications-page.scss index ea0a86e..9365a2b 100644 --- a/src/pages/ApplicationsPage/applications-page.scss +++ b/src/pages/ApplicationsPage/applications-page.scss @@ -1,16 +1,31 @@ @import "src/constants/style/styleConst"; .applications-page { - height: 100vh; + height: 100%; + display: flex; + background: #fff; + + &__list { + .ant-list-item { + flex-direction: column; + align-items: self-start; + + .applications-page__list__desc { + width: auto !important; + font-size: 12px; + } + } + } + .column-content { max-height: 100vh; } + .three-columns { display: flex; background: #fff; box-shadow: inset -1px 0px 0px $border-color; - height: 100%; .column__header { padding: $basic-padding * 2 $basic-padding; diff --git a/src/pages/ApplicationsPage/index.tsx b/src/pages/ApplicationsPage/index.tsx index 9d5e5d4..fe1904c 100644 --- a/src/pages/ApplicationsPage/index.tsx +++ b/src/pages/ApplicationsPage/index.tsx @@ -1,4 +1,4 @@ -import { message, Spin } from 'antd' +import { List, message, Spin } from 'antd' import { Layout, FormComponents } from 'isp-ui-kit' import { ColumnItem } from 'isp-ui-kit/dist/Layout/Column/column.type' import { useEffect, useState } from 'react' @@ -7,7 +7,6 @@ import { useNavigate, useParams, useSearchParams } from 'react-router-dom' import { ValidationRules } from '@constants/form/validationRules.ts' -import ListItem from '@widgets/ListItem' import Modal from '@widgets/Modal' import ApplicationsContent from '@components/ApplicationsContent' @@ -31,7 +30,7 @@ import { PermissionKeysType } from '@type/roles.type.ts' import './applications-page.scss' -const { Column, ContentColumn, EmptyData } = Layout +const { Column, EmptyData } = Layout const { FormInput } = FormComponents const ApplicationsPage = () => { @@ -81,7 +80,18 @@ const ApplicationsPage = () => { return } - const renderColumnItems = (item: ColumnItem) => + const renderColumnItems = (item: ColumnItem) => { + return ( +
+ + {item.name} + + {item.description} + + +
+ ) + } const addApplicationModal = () => { setShowApplicationsModal({ @@ -152,8 +162,7 @@ const ApplicationsPage = () => { } return ( -
-
+
{ setSearchValue(value, setSearchParams) } /> - - {renderMainContent()} + {renderMainContent()} { -
) } diff --git a/src/pages/ConfigurationsPage/configurations.scss b/src/pages/ConfigurationsPage/configurations.scss index 891b674..6204ac5 100644 --- a/src/pages/ConfigurationsPage/configurations.scss +++ b/src/pages/ConfigurationsPage/configurations.scss @@ -4,6 +4,7 @@ height: calc(100vh - 150px); width: 100%; overflow-y: auto; + min-width: 700px; &__buttons { display: flex; diff --git a/src/pages/ConnectionsPage/connections.scss b/src/pages/ConnectionsPage/connections.scss index e06b390..1bf3056 100644 --- a/src/pages/ConnectionsPage/connections.scss +++ b/src/pages/ConnectionsPage/connections.scss @@ -2,12 +2,11 @@ .connection-page { &__content { - padding: 2 * $basic-padding 3 * $basic-padding 2 * $basic-padding 0; width: 100%; &__wrap-table { overflow-x: scroll; - height: calc(100vh - 100px); + height: calc(100vh - 150px); } } diff --git a/src/pages/LoginPage/index.tsx b/src/pages/LoginPage/index.tsx index f4826df..d6aa488 100644 --- a/src/pages/LoginPage/index.tsx +++ b/src/pages/LoginPage/index.tsx @@ -61,7 +61,7 @@ const LoginPage = () => { navigate(redirectUrl, { replace: true }) localStorage.removeItem('redirectUrl') }) - .catch((err: any) => handleError(err)) + .catch((err: AxiosError) => handleError(err)) } const renderInternalAuthForm = () => { diff --git a/src/pages/ModulesPage/modules-page.scss b/src/pages/ModulesPage/modules-page.scss index 74f2412..25b6d56 100644 --- a/src/pages/ModulesPage/modules-page.scss +++ b/src/pages/ModulesPage/modules-page.scss @@ -4,14 +4,13 @@ height: 100%; &__tabs { - padding: $basic-padding*3 $basic-padding*2; + padding: 0 $basic-padding*2 $basic-padding*2; width: 100%; overflow-x: scroll; } .ant-list-item { padding-bottom: 20px; - } .ant-tag { @@ -57,11 +56,14 @@ } } - &__content { overflow-x: scroll; width: 100%; } + + .column .column__items__item span { + width: fit-content; + } } .three-columns { @@ -122,7 +124,3 @@ } } } - -.column .column__items__item span { - width: fit-content; -} diff --git a/src/pages/RolesPage/index.tsx b/src/pages/RolesPage/index.tsx index 689c02b..a735511 100644 --- a/src/pages/RolesPage/index.tsx +++ b/src/pages/RolesPage/index.tsx @@ -111,7 +111,7 @@ const RolesPage = () => { }) } - const handleRemoveRole = (id: any) => { + const handleRemoveRole = (id: string) => { const idAsNumber = parseInt(id, 10) removeRole(idAsNumber) .unwrap() @@ -170,6 +170,7 @@ const RolesPage = () => { return (
{ const isLoading = isUsersLoading || isLoadingSession const isPageAvailable = hasPermission(PermissionKeysType.read) - const hasRevokePermission = hasPermission(PermissionKeysType.write) useEffect(() => { if (!isPageAvailable) { @@ -115,7 +116,7 @@ const SessionsPage = () => { } return ( <> - {hasRevokePermission && ( + handleRevokeSessions(record.id)} @@ -127,7 +128,7 @@ const SessionsPage = () => { icon={} /> - )} + ) } diff --git a/src/pages/SessionsPage/sessions-page.scss b/src/pages/SessionsPage/sessions-page.scss index 3978107..865e179 100644 --- a/src/pages/SessionsPage/sessions-page.scss +++ b/src/pages/SessionsPage/sessions-page.scss @@ -23,7 +23,7 @@ &__wrap-table { overflow-x: scroll; - height: calc(100vh - 200px); + height: calc(100vh - 250px); } &__table { diff --git a/src/pages/UsersPage/index.tsx b/src/pages/UsersPage/index.tsx index 3aa2508..811a740 100644 --- a/src/pages/UsersPage/index.tsx +++ b/src/pages/UsersPage/index.tsx @@ -10,6 +10,8 @@ import { ColumnsType } from 'antd/es/table' import { useEffect } from 'react' import { useNavigate } from 'react-router-dom' +import CanEdit from '@components/CanEdit' + import { getUserFullName } from '@utils/userUtils/getFullNameUtil.ts' import useRole from '@hooks/useRole.tsx' @@ -37,9 +39,6 @@ const UsersPage = () => { const isLoading = isRolesLoading || isUsersLoading const isPageAvailable = hasPermission(PermissionKeysType.read) - const hasBlockUserPermission = hasPermission(PermissionKeysType.write) - const hasDeleteUserPermission = hasPermission(PermissionKeysType.write) - const hasUpdateUserPermission = hasPermission(PermissionKeysType.write) const hasCreateUserPermission = hasPermission(PermissionKeysType.write) useEffect(() => { @@ -106,7 +105,7 @@ const UsersPage = () => { dataIndex: 'roles', key: 'roles', render: (values: number[]) => { - const labels: any[] = [] + const labels: string[] = [] values.forEach((value: number) => { const roleLabel = roles?.find((el) => el.id === value) if (roleLabel) { @@ -136,7 +135,7 @@ const UsersPage = () => { : 'Вы действительно хотите заблокировать этого пользователя?' return (
- {hasBlockUserPermission && ( + handleBlockUser(record.id)} @@ -149,8 +148,6 @@ const UsersPage = () => { icon={record.blocked ? : } /> - )} - {hasUpdateUserPermission && (
{ >
- )} - - {hasDeleteUserPermission && ( handleDeleteUser(record.id)} @@ -176,7 +170,7 @@ const UsersPage = () => { icon={} /> - )} +
) }