From 58c4546531e5109f86f3ede3ea4a605f65bf9849 Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Fri, 1 Nov 2024 10:51:01 +0300 Subject: [PATCH 1/3] MSP-4330 update handleEdit function in ConfigurationEditorJson --- src/components/ConfigurationEditorJson/index.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/ConfigurationEditorJson/index.tsx b/src/components/ConfigurationEditorJson/index.tsx index 96eaaab..9a17675 100644 --- a/src/components/ConfigurationEditorJson/index.tsx +++ b/src/components/ConfigurationEditorJson/index.tsx @@ -4,8 +4,6 @@ import { FC, useContext } from 'react' import { ConfigurationEditorPropsType } from '@pages/ConfigurationEditorPage/ConfigurationEditor.type.ts' -import { cleanEmptyParamsObject } from '@utils/objectUtils.ts' - import { Context } from '@stores/index.tsx' const ConfigurationEditorJson: FC = ({ @@ -23,7 +21,7 @@ const ConfigurationEditorJson: FC = ({ ...bufConfig, data: { ...updated_src } } - setBufConfig(cleanEmptyParamsObject(newData)) + setBufConfig(newData) } return ( From cd095b3e0bc362453e9e92cfef67d7dce070d87e Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Fri, 1 Nov 2024 10:53:15 +0300 Subject: [PATCH 2/3] MSP-4330 update ConfigurationEditorPropsType --- src/components/ConfigurationEditorJson/index.tsx | 4 ++-- .../ConfigurationEditorPage/ConfigurationEditor.type.ts | 2 +- src/pages/ConfigurationEditorPage/index.tsx | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/ConfigurationEditorJson/index.tsx b/src/components/ConfigurationEditorJson/index.tsx index 9a17675..74b0d72 100644 --- a/src/components/ConfigurationEditorJson/index.tsx +++ b/src/components/ConfigurationEditorJson/index.tsx @@ -7,7 +7,7 @@ import { ConfigurationEditorPropsType } from '@pages/ConfigurationEditorPage/Con import { Context } from '@stores/index.tsx' const ConfigurationEditorJson: FC = ({ - bufConfig = {}, + bufConfig, setBufConfig, isCurrentConfigLoading }) => { @@ -35,7 +35,7 @@ const ConfigurationEditorJson: FC = ({ enableClipboard={true} iconStyle="square" onEdit={({ updated_src }: any) => handleEdit(updated_src)} - src={bufConfig.data} + src={bufConfig?.data} sortKeys={true} collapsed={1} /> diff --git a/src/pages/ConfigurationEditorPage/ConfigurationEditor.type.ts b/src/pages/ConfigurationEditorPage/ConfigurationEditor.type.ts index ba8f928..510fd67 100644 --- a/src/pages/ConfigurationEditorPage/ConfigurationEditor.type.ts +++ b/src/pages/ConfigurationEditorPage/ConfigurationEditor.type.ts @@ -13,7 +13,7 @@ import { export interface ConfigurationEditorPropsType { jsonSchema?: ResponseSchemaType - bufConfig?: ConfigType + bufConfig: ConfigType setBufConfig: Dispatch> isCurrentConfigLoading: boolean setDisableBtn?: Dispatch> diff --git a/src/pages/ConfigurationEditorPage/index.tsx b/src/pages/ConfigurationEditorPage/index.tsx index c616366..baa5d26 100644 --- a/src/pages/ConfigurationEditorPage/index.tsx +++ b/src/pages/ConfigurationEditorPage/index.tsx @@ -130,7 +130,7 @@ const ConfigurationEditorPage: FC = () => { return ( { case jsonRadio: return ( @@ -149,7 +149,7 @@ const ConfigurationEditorPage: FC = () => { return ( From 13841c61d157e8975fcd814bd2dc1c9c2b0dbf2e Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Fri, 1 Nov 2024 10:56:11 +0300 Subject: [PATCH 3/3] MSP-4330 up version to 0.18.0 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60d4600..3691e4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.18.0 +- Исправлено редактирование JSON в конфиге ## 0.17.3 - Обновлены зависимости в package.json ## 0.17.1 diff --git a/package.json b/package.json index 2966798..7010b10 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "isp-admin-ui", "private": true, - "version": "0.17.3", + "version": "0.18.0", "type": "module", "scripts": { "start": "vite",