diff --git a/frontend/src/container/PipelinePage/PipelineListsView/AddNewProcessor/index.tsx b/frontend/src/container/PipelinePage/PipelineListsView/AddNewProcessor/index.tsx index c9ab5d8aeb..8281655952 100644 --- a/frontend/src/container/PipelinePage/PipelineListsView/AddNewProcessor/index.tsx +++ b/frontend/src/container/PipelinePage/PipelineListsView/AddNewProcessor/index.tsx @@ -7,6 +7,7 @@ import { PipelineData, ProcessorData, } from 'types/api/pipeline/def'; +import { v4 } from 'uuid'; import { ModalButtonWrapper, ModalTitle } from '../styles'; import { getEditedDataSource, getRecordIndex } from '../utils'; @@ -59,7 +60,7 @@ function AddNewProcessor({ const totalDataLength = expandedPipelineData?.config?.length || 0; const newProcessorData = { - id: values.name.replace(/\s/g, ''), + id: v4(), orderId: Number(totalDataLength || 0) + 1, type: processorType, enabled: true, @@ -73,12 +74,14 @@ function AddNewProcessor({ 'id', ); + const processorData = expandedPipelineData?.config?.[findRecordIndex]; + const updatedProcessorData = { - id: values.name.replace(/\s/g, ''), - orderId: expandedPipelineData?.config?.[findRecordIndex].orderId, + id: processorData?.id || v4(), + orderId: processorData?.orderId, type: processorType, - enabled: expandedPipelineData?.config?.[findRecordIndex].enabled, - output: expandedPipelineData?.config?.[findRecordIndex].output, + enabled: processorData?.enabled, + output: processorData?.output, ...values, }; diff --git a/frontend/src/container/PipelinePage/PipelineListsView/PipelineExpandView.tsx b/frontend/src/container/PipelinePage/PipelineListsView/PipelineExpandView.tsx index 1e5b1add33..bcd1e37670 100644 --- a/frontend/src/container/PipelinePage/PipelineListsView/PipelineExpandView.tsx +++ b/frontend/src/container/PipelinePage/PipelineListsView/PipelineExpandView.tsx @@ -239,7 +239,7 @@ function PipelineExpandView({ isDarkMode={isDarkMode} showHeader={false} columns={columns} - rowKey="name" + rowKey="id" size="small" components={tableComponents} dataSource={processorData} diff --git a/frontend/src/container/PipelinePage/tests/__snapshots__/PipelineExpandView.test.tsx.snap b/frontend/src/container/PipelinePage/tests/__snapshots__/PipelineExpandView.test.tsx.snap index ab46e3dd8e..3b61952952 100644 --- a/frontend/src/container/PipelinePage/tests/__snapshots__/PipelineExpandView.test.tsx.snap +++ b/frontend/src/container/PipelinePage/tests/__snapshots__/PipelineExpandView.test.tsx.snap @@ -66,7 +66,7 @@ exports[`PipelinePage should render PipelineExpandView section 1`] = ` >