From bf9e0dfe1578ce34ba864ecf555fca3c8c5af0a3 Mon Sep 17 00:00:00 2001 From: mikheikinnv Date: Thu, 20 Jun 2024 15:40:54 +0300 Subject: [PATCH 1/5] MSP-3487 fix json scroll --- .../ConfigurationEditorPage/configuration-editor-page.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/ConfigurationEditorPage/configuration-editor-page.scss b/src/pages/ConfigurationEditorPage/configuration-editor-page.scss index 7a9abec..f7f37ce 100644 --- a/src/pages/ConfigurationEditorPage/configuration-editor-page.scss +++ b/src/pages/ConfigurationEditorPage/configuration-editor-page.scss @@ -4,10 +4,12 @@ display: flex; flex-direction: column; background: white; - height: 100%; -ms-overflow-style: none; /* IE и Edge */ scrollbar-width: none; border-left: 1px solid $border-color; + height: 100vh; + overflow: scroll; + padding-bottom: 80px; &::-webkit-scrollbar { display: none; } @@ -17,6 +19,7 @@ &__header { display: flex; justify-content: space-between; + align-items: center; padding: $basic-padding *2 $basic-padding; border-bottom: 1px solid $border-color; } From 0b5a076d712c8ca0111d7e353803a45c0f0ffa73 Mon Sep 17 00:00:00 2001 From: mikheikinnv Date: Thu, 20 Jun 2024 15:42:00 +0300 Subject: [PATCH 2/5] MSP-3487 add delete and add props to ReactJsonView --- .../ConfigurationEditorJson/index.tsx | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/components/ConfigurationEditorJson/index.tsx b/src/components/ConfigurationEditorJson/index.tsx index 06974a3..4978dca 100644 --- a/src/components/ConfigurationEditorJson/index.tsx +++ b/src/components/ConfigurationEditorJson/index.tsx @@ -4,26 +4,30 @@ import { ReactJsonView } from 'isp-ui-kit' import {Spin} from 'antd' import { cleanEmptyParamsObject } from '@utils/objectUtils.ts' -const ConfigurationEditorJson: FC = ({ bufConfig = {}, setBufConfig, isCurrentConfigLoading, JsonSchema}) => { +const ConfigurationEditorJson: FC = ({ bufConfig = {}, setBufConfig, isCurrentConfigLoading}) => { if (isCurrentConfigLoading) { return } + const handleEdit = (updated_src: any) => { + const newData = { + ...bufConfig, + data: { ...updated_src } + } + setBufConfig(cleanEmptyParamsObject(newData)) + } + return ( handleEdit(updated_src)} + displayDataTypes={false} displayObjectSize={false} name={null} enableClipboard={true} iconStyle="square" - onEdit={({updated_src}: any) => { - const newData = { - ...bufConfig, - data: { ...updated_src } - } - setBufConfig(cleanEmptyParamsObject(newData)) - } - } + onEdit={({updated_src}: any) => handleEdit(updated_src)} src={bufConfig.data} sortKeys={true} collapsed={1} @@ -31,4 +35,4 @@ const ConfigurationEditorJson: FC = ({ bufConfig = ) } -export default ConfigurationEditorJson \ No newline at end of file +export default ConfigurationEditorJson From 95e76a7e2a82bf72884e8aef519dadbafd2f3081 Mon Sep 17 00:00:00 2001 From: mikheikinnv Date: Thu, 20 Jun 2024 15:42:39 +0300 Subject: [PATCH 3/5] MSP-3487 add Config name to ConfigurationEditorPage header --- src/pages/ConfigurationEditorPage/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/ConfigurationEditorPage/index.tsx b/src/pages/ConfigurationEditorPage/index.tsx index ee48a6e..75f82a3 100644 --- a/src/pages/ConfigurationEditorPage/index.tsx +++ b/src/pages/ConfigurationEditorPage/index.tsx @@ -152,6 +152,7 @@ const ConfigurationEditorPage: FC = () => { Назад +

{bufConfig?.name}