Compare commits

...
1 Commits
5 changed files with 25 additions and 12 deletions

No files matched your search

+4
View File
@@ -1,3 +1,7 @@
## 0.12.6
- Добавлены кропки "удалить/добавть" в JsonView
- Добавлен скролл к JsonView
- Добавлена обработка ошибок к изменению конфига
## 0.12.5 ## 0.12.5
- Исправлено неверное поведение показа меню - Исправлено неверное поведение показа меню
- Добавлена страница NotFoundPage - Добавлена страница NotFoundPage
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "isp-admin-ui", "name": "isp-admin-ui",
"private": true, "private": true,
"version": "0.12.5", "version": "0.12.6",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "vite", "start": "vite",
@@ -4,26 +4,30 @@ import { ReactJsonView } from 'isp-ui-kit'
import {Spin} from 'antd' import {Spin} from 'antd'
import { cleanEmptyParamsObject } from '@utils/objectUtils.ts' import { cleanEmptyParamsObject } from '@utils/objectUtils.ts'
const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({ bufConfig = {}, setBufConfig, isCurrentConfigLoading, JsonSchema}) => { const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({ bufConfig = {}, setBufConfig, isCurrentConfigLoading}) => {
if (isCurrentConfigLoading) { if (isCurrentConfigLoading) {
return <Spin className="spin" /> return <Spin className="spin" />
} }
const handleEdit = (updated_src: any) => {
const newData = {
...bufConfig,
data: { ...updated_src }
}
setBufConfig(cleanEmptyParamsObject(newData))
}
return ( return (
<ReactJsonView <ReactJsonView
onAdd={true}
onDelete={({updated_src}: any) => handleEdit(updated_src)}
displayDataTypes={false} displayDataTypes={false}
displayObjectSize={false} displayObjectSize={false}
name={null} name={null}
enableClipboard={true} enableClipboard={true}
iconStyle="square" iconStyle="square"
onEdit={({updated_src}: any) => { onEdit={({updated_src}: any) => handleEdit(updated_src)}
const newData = {
...bufConfig,
data: { ...updated_src }
}
setBufConfig(cleanEmptyParamsObject(newData))
}
}
src={bufConfig.data} src={bufConfig.data}
sortKeys={true} sortKeys={true}
collapsed={1} collapsed={1}
@@ -4,10 +4,12 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: white; background: white;
height: 100%;
-ms-overflow-style: none; /* IE и Edge */ -ms-overflow-style: none; /* IE и Edge */
scrollbar-width: none; scrollbar-width: none;
border-left: 1px solid $border-color; border-left: 1px solid $border-color;
height: 100vh;
overflow: scroll;
padding-bottom: 80px;
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
} }
@@ -17,6 +19,7 @@
&__header { &__header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
padding: $basic-padding *2 $basic-padding; padding: $basic-padding *2 $basic-padding;
border-bottom: 1px solid $border-color; border-bottom: 1px solid $border-color;
} }
+3 -1
View File
@@ -92,8 +92,8 @@ const ConfigurationEditorPage: FC = () => {
createUpdateConfig(cleanEmptyParamsObject(newData)) createUpdateConfig(cleanEmptyParamsObject(newData))
.unwrap() .unwrap()
.then(({ id }) => { .then(({ id }) => {
message.success('Конфигурация успешно сохранена')
isNew && navigate(`/${moduleId}/configEditor/${id}`) isNew && navigate(`/${moduleId}/configEditor/${id}`)
message.success('Конфигурация успешно сохранена')
}) })
.catch((e) => { .catch((e) => {
if (e.data.errorCode === 2004) { if (e.data.errorCode === 2004) {
@@ -105,6 +105,7 @@ const ConfigurationEditorPage: FC = () => {
if (e.data.errorCode === 400) { if (e.data.errorCode === 400) {
message.error('Невалидный JSON объект') message.error('Невалидный JSON объект')
} }
message.error('Ошибка обновления элемента')
}) })
} }
@@ -152,6 +153,7 @@ const ConfigurationEditorPage: FC = () => {
<RollbackOutlined /> <RollbackOutlined />
Назад Назад
</Button> </Button>
<h1>{bufConfig?.name}</h1>
<div className="configuration-editor-page__controll"> <div className="configuration-editor-page__controll">
<Button <Button
disabled={!JsonSchema} disabled={!JsonSchema}