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", diff --git a/src/components/ConfigurationEditorJson/index.tsx b/src/components/ConfigurationEditorJson/index.tsx index 96eaaab..74b0d72 100644 --- a/src/components/ConfigurationEditorJson/index.tsx +++ b/src/components/ConfigurationEditorJson/index.tsx @@ -4,12 +4,10 @@ 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 = ({ - bufConfig = {}, + bufConfig, setBufConfig, isCurrentConfigLoading }) => { @@ -23,7 +21,7 @@ const ConfigurationEditorJson: FC = ({ ...bufConfig, data: { ...updated_src } } - setBufConfig(cleanEmptyParamsObject(newData)) + setBufConfig(newData) } return ( @@ -37,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 (