2024-05-29 14:30:20: merge [main:6331fc77b72f888c5557a0672ede2191df74f336];
This commit is contained in:
1 parent
36c13e159d
commit
e8dfc2e552
24 files changed
+124
-75
No files matched your search
@@ -1,3 +1,5 @@
|
||||
## 0.11.4
|
||||
- Правки для прода
|
||||
## 0.11.3
|
||||
- Обновлена версия библиотеки isp-ui-kit
|
||||
## 0.11.2
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "isp-admin-ui",
|
||||
"version": "0.11.2",
|
||||
"version": "0.11.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "isp-admin-ui",
|
||||
"version": "0.11.2",
|
||||
"version": "0.11.3",
|
||||
"dependencies": {
|
||||
"@apidevtools/json-schema-ref-parser": "^9.0.6",
|
||||
"@codemirror/lang-json": "^6.0.1",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "isp-admin-ui",
|
||||
"private": true,
|
||||
"version": "0.11.3",
|
||||
"version": "0.11.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
|
||||
@@ -41,4 +41,9 @@
|
||||
background: $blue-color-2 !important;
|
||||
}
|
||||
}
|
||||
|
||||
&__buttons {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ const ActiveConfigurationsTable: FC<ActiveConfigurationsTablePropsType> =
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: 'Статус конфигурации',
|
||||
title: 'Статус',
|
||||
dataIndex: 'valid',
|
||||
key: 'version',
|
||||
align: 'center',
|
||||
@@ -191,9 +191,21 @@ const ActiveConfigurationsTable: FC<ActiveConfigurationsTablePropsType> =
|
||||
const className = `active-configurations-table__table ${isActiveTable ? 'active-config' : ''}`
|
||||
return (
|
||||
<div className="active-configurations-table">
|
||||
<h2 className="active-configurations-table__title">
|
||||
{isActiveTable ? 'Активная конфигурация' : 'Другие конфигурации'}
|
||||
</h2>
|
||||
<div className="active-configurations-table__buttons">
|
||||
<h2 className="active-configurations-table__title">
|
||||
{isActiveTable ? 'Активная' : 'Остальные'}
|
||||
</h2>
|
||||
{!isActiveTable && <CanEdit>
|
||||
<Button
|
||||
className="configurations__buttons__new-config-brn"
|
||||
onClick={() => {
|
||||
// TODO создание новой конфигурации
|
||||
}}
|
||||
>
|
||||
Создать
|
||||
</Button>
|
||||
</CanEdit>}
|
||||
</div>
|
||||
<Table
|
||||
className={className}
|
||||
rowKey={(record) => record.id}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
.applications-content {
|
||||
height: 100%;
|
||||
display: grid;
|
||||
grid-template-columns:300px 1fr;
|
||||
grid-template-columns:min-content 1fr;
|
||||
width: 100%;
|
||||
|
||||
.column-content {
|
||||
|
||||
@@ -120,17 +120,20 @@ const ApplicationsContent: FC<ApplicationsContentPropTypes> = ({
|
||||
|
||||
createApplicationService(newApplicationApp)
|
||||
.unwrap()
|
||||
.then(message.success('Элемент сохранен'))
|
||||
.catch((e) => message.error(e))
|
||||
setShowApplicationsModal({
|
||||
.then(() => message.success('Элемент сохранен'))
|
||||
.catch(() => message.error('Ошибка добавления элемента')).finally(()=> setShowApplicationsModal({
|
||||
...showApplicationsModal,
|
||||
addModal: false
|
||||
})
|
||||
}))
|
||||
|
||||
}
|
||||
const handleRemoveApplicationApp = (id: number) =>
|
||||
removeApplicationsService([id])
|
||||
.unwrap()
|
||||
.then(() => message.success('Элемент удален'))
|
||||
.then(() => {
|
||||
message.success('Элемент удален')
|
||||
navigate(`${routePaths.applicationsGroup}/${selectedItemId}/${routePaths.application}`)
|
||||
})
|
||||
.catch(() => message.error('Ошибка удаления элемента'))
|
||||
|
||||
const renderColumnItems = (item: ColumnItem<any>) => {
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
|
||||
&__row {
|
||||
cursor: pointer;
|
||||
&.ant-table-row {
|
||||
&:hover td {
|
||||
background-color: white !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ const CompareVersionModal: FC<CompareVersionModalPropsType> = ({
|
||||
const columns: ColumnsType<VersionType> = [
|
||||
{
|
||||
key: 'configVersion',
|
||||
title: 'Версия конфигурации',
|
||||
title: 'Версия',
|
||||
dataIndex: 'configVersion'
|
||||
},
|
||||
{
|
||||
@@ -71,13 +71,13 @@ const CompareVersionModal: FC<CompareVersionModalPropsType> = ({
|
||||
]
|
||||
return (
|
||||
<div className="compare-version-modal">
|
||||
<Modal title="Сравнение версий" open={open} onClose={onClose}>
|
||||
<Modal title="Выберите версию для сравнения" open={open} onClose={onClose}>
|
||||
{selectedItem ? (
|
||||
<div className="compare-version-modal__content">
|
||||
<Button onClick={() => setSelectedItem(undefined)}>Назад</Button>
|
||||
<div className="compare-version-modal__header">
|
||||
<span> Версия: {selectedItem.configVersion}</span>
|
||||
<span>Текущая версия : {config?.version || config?.configVersion}</span>
|
||||
<span>{config?.version ? `Текущая версия : ${config?.version}` : `Версия: ${config?.configVersion}`}</span>
|
||||
</div>
|
||||
<CodeMirrorMerge orientation="a-b">
|
||||
<Original
|
||||
|
||||
@@ -15,7 +15,7 @@ const ConfigSchemaModal: FC<ConfigSchemaModalPropsType> = ({
|
||||
}) => {
|
||||
return (
|
||||
<div className="config-schema-modal">
|
||||
<Modal title="Текущая схема конфигурации" open={open} onClose={onClose}>
|
||||
<Modal title="Текущая схема" open={open} onClose={onClose}>
|
||||
<JsonSchemaViewer schema={schema} />
|
||||
</Modal>
|
||||
</div>
|
||||
|
||||
@@ -72,7 +72,7 @@ const LayoutComponent = () => {
|
||||
icon: <DefaultUser />
|
||||
},
|
||||
{
|
||||
label: 'Группы приложений',
|
||||
label: 'Приложения',
|
||||
key: 'applications_group',
|
||||
className: hideItem([PermissionKeysType.read]),
|
||||
icon: <AppstoreAddOutlined />
|
||||
|
||||
@@ -93,7 +93,7 @@ const RolesContent = ({
|
||||
dataSource={permissions}
|
||||
pagination={{ pageSize: 10 }}
|
||||
scroll={{
|
||||
y: 'calc(100vh - 450px)'
|
||||
y: 'calc(100vh - 270px)'
|
||||
}}
|
||||
rowSelection={{
|
||||
selectedRowKeys: value,
|
||||
@@ -140,20 +140,22 @@ const RolesContent = ({
|
||||
/>
|
||||
</div>
|
||||
<Divider />
|
||||
<FormInput
|
||||
data-cy="roles-content__input__name"
|
||||
rules={{ required: ValidationRules.required }}
|
||||
label="Наименование роли"
|
||||
name="name"
|
||||
control={control}
|
||||
/>
|
||||
<FormInput
|
||||
data-cy="roles-content__input__external-group"
|
||||
disabled={!isExternalGroup}
|
||||
label="Группы ЕСК"
|
||||
name="externalGroup"
|
||||
control={control}
|
||||
/>
|
||||
<div className="roles-content__wrap-input">
|
||||
<FormInput
|
||||
data-cy="roles-content__input__name"
|
||||
rules={{ required: ValidationRules.required }}
|
||||
label="Наименование роли"
|
||||
name="name"
|
||||
control={control}
|
||||
/>
|
||||
<FormInput
|
||||
data-cy="roles-content__input__external-group"
|
||||
disabled={!isExternalGroup}
|
||||
label="Группы ЕСК"
|
||||
name="externalGroup"
|
||||
control={control}
|
||||
/>
|
||||
</div>
|
||||
{renderFormTable()}
|
||||
</form>
|
||||
</>
|
||||
|
||||
@@ -1,11 +1,30 @@
|
||||
@import "../../constants/style/styleConst";
|
||||
|
||||
.roles-content {
|
||||
padding: $basic-padding*2 $basic-padding*3;
|
||||
padding: $basic-padding*2 $basic-padding*3 0;
|
||||
min-width: 400px;
|
||||
height: 100%;
|
||||
|
||||
&__header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
&__wrap-input {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.ant-pagination {
|
||||
margin: 8px 0 !important;
|
||||
}
|
||||
|
||||
.ant-divider-horizontal {
|
||||
margin: 14px 0;
|
||||
}
|
||||
|
||||
.ant-form-item {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
}
|
||||
@@ -163,16 +163,16 @@ const TokenContent = ({ id }: TokenPropTypes) => {
|
||||
title: 'Действия',
|
||||
dataIndex: 'token',
|
||||
key: 'actions',
|
||||
render: (value) => {
|
||||
render: (value, record) => {
|
||||
return (
|
||||
<Button.Group>
|
||||
<Tooltip title="Скопировать">
|
||||
<Button icon={<CopyOutlined />} data-clipboard-text={value} />
|
||||
<Button className="copy-btn" icon={<CopyOutlined />} data-clipboard-text={value} />
|
||||
</Tooltip>
|
||||
<Tooltip title="Удалить">
|
||||
<Popconfirm
|
||||
title="Закончить эту сессию?"
|
||||
onConfirm={() => handleRevokeToken(value)}
|
||||
onConfirm={() => handleRevokeToken(record)}
|
||||
>
|
||||
<Button icon={<DeleteOutlined />} />
|
||||
</Popconfirm>
|
||||
|
||||
@@ -108,6 +108,7 @@ const AllVersionsPage = () => {
|
||||
const renderActionsField = (_: unknown, record: VersionType) => {
|
||||
return (
|
||||
<div className="all-version-page__actions-field">
|
||||
<Button.Group className="button_group">
|
||||
<CanEdit>
|
||||
<Tooltip title="Установить выбранную версию">
|
||||
<Popconfirm
|
||||
@@ -144,13 +145,14 @@ const AllVersionsPage = () => {
|
||||
<Button danger icon={<DeleteOutlined />} />
|
||||
</Popconfirm>
|
||||
</CanEdit>
|
||||
</Button.Group>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
const columns: ColumnsType<VersionType> = [
|
||||
{
|
||||
key: 'configVersion',
|
||||
title: 'Версия конфигурации',
|
||||
title: 'Версия',
|
||||
dataIndex: 'configVersion'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -81,6 +81,7 @@ const AppAccessPage = () => {
|
||||
return (
|
||||
<section className="app-access-page">
|
||||
<Column
|
||||
title="Приложения"
|
||||
showUpdateBtn={false}
|
||||
showAddBtn={false}
|
||||
showRemoveBtn={false}
|
||||
|
||||
@@ -40,7 +40,7 @@ const ApplicationsPage = () => {
|
||||
data: applicationsGroup = [],
|
||||
isError: isErrorApplicationsGroup,
|
||||
isLoading: isLoadingApplicationsGroup
|
||||
} = applicationsGroupApi.useGetApplicationsGroupByDomainIdQuery({ id: 2 })
|
||||
} = applicationsGroupApi.useGetApplicationsGroupByDomainIdQuery({ id: 1 })
|
||||
|
||||
const [createApplicationsGroup] =
|
||||
applicationsGroupApi.useCreateApplicationsGroupMutation()
|
||||
@@ -110,7 +110,7 @@ const ApplicationsPage = () => {
|
||||
const newService: NewApplicationsGroupType = {
|
||||
name: data.name,
|
||||
description: data.description,
|
||||
domainId: 2
|
||||
domainId: 1
|
||||
}
|
||||
createApplicationsGroup(newService)
|
||||
.unwrap()
|
||||
@@ -134,7 +134,7 @@ const ApplicationsPage = () => {
|
||||
const updateService: UpdateApplicationsGroupType = {
|
||||
name: data.name,
|
||||
description: data.description,
|
||||
domainId: 2,
|
||||
domainId: 1,
|
||||
id: Number(selectedItemId)
|
||||
}
|
||||
|
||||
@@ -150,7 +150,10 @@ const ApplicationsPage = () => {
|
||||
const handleRemoveApplicationsGtoup = () => {
|
||||
deleteApplicationsGroup([Number(selectedItemId)])
|
||||
.unwrap()
|
||||
.then(() => message.success('Элемент удален'))
|
||||
.then(() => {
|
||||
message.success('Элемент удален')
|
||||
navigate(routePaths.applicationsGroup)
|
||||
})
|
||||
.catch(() => message.error('Ошибка удаления элемента'))
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { useEffect, useMemo, useState } from 'react'
|
||||
import { Outlet, useNavigate, useParams } from 'react-router-dom'
|
||||
|
||||
import ActiveConfigurationsTable from '@components/ActiveConfigurationsTable'
|
||||
import CanEdit from '@components/CanEdit'
|
||||
import CompareVersionModal from '@components/CompareVersionModal'
|
||||
import ConfigSchemaModal from '@components/ConfigSchemaModal'
|
||||
import ConfigurationPreviewModal from '@components/ConfigurationPreviewModal'
|
||||
@@ -98,19 +97,8 @@ const Configurations = () => {
|
||||
className="configurations____buttons__show-schema-btn"
|
||||
onClick={() => setIsModalOpen(true)}
|
||||
>
|
||||
Текущая схема конфигурации
|
||||
Текущая схема
|
||||
</Button>
|
||||
<CanEdit>
|
||||
<Button
|
||||
type="primary"
|
||||
className="configurations__buttons__new-config-brn"
|
||||
onClick={() => {
|
||||
// TODO создание новой конфигурации
|
||||
}}
|
||||
>
|
||||
Создать конфигурацию
|
||||
</Button>
|
||||
</CanEdit>
|
||||
</div>
|
||||
<ActiveConfigurationsTable
|
||||
isActiveTable
|
||||
|
||||
@@ -49,7 +49,8 @@ const ModulesPage = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (!isPageAvailable) {
|
||||
navigate(routePaths.error)
|
||||
navigate(routePaths.profile)
|
||||
message.error('Страница не найдена')
|
||||
}
|
||||
}, [isPageAvailable])
|
||||
|
||||
@@ -176,7 +177,7 @@ const ModulesPage = () => {
|
||||
size="small"
|
||||
showZero
|
||||
count={(item.status && item.status.length) || 0}
|
||||
color={!item.status || !item.status.length ? '' : 'blue'}
|
||||
color={!item.status || !item.status.length ? '' : 'cyan'}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -194,13 +194,6 @@ const UserEditor = () => {
|
||||
name="lastName"
|
||||
/>
|
||||
</div>
|
||||
<div className="user-editor__content__description">
|
||||
<FormComponents.FormInput
|
||||
label="Описание"
|
||||
control={control}
|
||||
name="description"
|
||||
/>
|
||||
</div>
|
||||
<div className="user-editor__content__email">
|
||||
<FormComponents.FormInput
|
||||
label="Email"
|
||||
@@ -220,10 +213,18 @@ const UserEditor = () => {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="user-editor__content__description">
|
||||
<FormComponents.FormTextArea
|
||||
autoSize={{ minRows: 2, maxRows: 6 }}
|
||||
label="Описание"
|
||||
control={control}
|
||||
name="description"
|
||||
/>
|
||||
</div>
|
||||
<div className="user-editor__content__roles">
|
||||
<FormComponents.FormSelect
|
||||
label="Добавить роль"
|
||||
mode="multiple"
|
||||
label="Роли"
|
||||
optionFilterProp="label"
|
||||
disabled={!hasPermission(PermissionKeysType.write)}
|
||||
control={control}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
&__header {
|
||||
border-bottom: 1px solid $border-color;
|
||||
padding: $basic-padding *4 $basic-padding*3;
|
||||
padding: 22px 24px 0;
|
||||
|
||||
&__nav {
|
||||
display: flex;
|
||||
@@ -44,7 +44,7 @@
|
||||
&__content {
|
||||
&__wrap {
|
||||
overflow-x: scroll;
|
||||
height: calc(100vh - 200px);
|
||||
height: calc(100vh - 80px);
|
||||
}
|
||||
|
||||
.ant-form-item {
|
||||
|
||||
@@ -4,7 +4,8 @@ import {
|
||||
EditOutlined,
|
||||
EyeOutlined,
|
||||
HistoryOutlined,
|
||||
SwapOutlined
|
||||
SwapOutlined,
|
||||
EllipsisOutlined
|
||||
} from '@ant-design/icons'
|
||||
import { Button, Dropdown, Popconfirm, Tooltip } from 'antd'
|
||||
import { FC } from 'react'
|
||||
@@ -77,30 +78,32 @@ const ActiveTableActionButtons: FC<ActiveTableActionButtonsPropsType> =
|
||||
return (
|
||||
<>
|
||||
<CanEdit>
|
||||
<Tooltip key="3" title="Сделать конфигурацию активной">
|
||||
<Tooltip key="3" title="Сделать активной">
|
||||
<Button onClick={() => handleMarkConfigActive(record)} icon={<AlertOutlined />} />
|
||||
</Tooltip>
|
||||
</CanEdit>
|
||||
<Dropdown dropdownRender={() => renderDropDown(record)}>
|
||||
<Button>...</Button>
|
||||
<Button icon={<EllipsisOutlined />} />
|
||||
</Dropdown>
|
||||
</>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<div className="active-configurations-table-actions-field">
|
||||
<Tooltip title="Просмотр конфигурации">
|
||||
<Button.Group className="button_group">
|
||||
<Tooltip title="Просмотр">
|
||||
<Button
|
||||
onClick={() => handleShowConfig(record)}
|
||||
icon={<EyeOutlined />}
|
||||
/>
|
||||
</Tooltip>
|
||||
<CanEdit>
|
||||
<Tooltip title="Редактировать конфигурацию">
|
||||
<Tooltip title="Редактировать">
|
||||
<Button icon={<EditOutlined />} />
|
||||
</Tooltip>
|
||||
</CanEdit>
|
||||
{renderAdditionalButtons()}
|
||||
</Button.Group>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
font-size: 19px;
|
||||
font-weight: 600;
|
||||
font-family: 'PT Sans', sans-serif;
|
||||
padding-right: 120px;
|
||||
width: 100%;
|
||||
padding-left: 28px;
|
||||
}
|
||||
&__text-closed {
|
||||
margin: auto;
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
}
|
||||
&__title {
|
||||
color: $grey;
|
||||
font-size: 17px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
&__content {
|
||||
padding: 10px;
|
||||
@@ -58,7 +60,6 @@
|
||||
|
||||
body.modal-open {
|
||||
overflow: hidden;
|
||||
padding-right: 14px;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user