mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 06:15:57 +08:00
fix: adding 2 pipeline processors with same name should not break the UI (#3943)
* fix: ensure pipeline processor ids derived from name are unique * fix: update snapshots to get jest passing * chore: use uuid for processor ids
This commit is contained in:
parent
5a9f626da5
commit
f86fc03fd6
@ -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,
|
||||
};
|
||||
|
||||
|
@ -239,7 +239,7 @@ function PipelineExpandView({
|
||||
isDarkMode={isDarkMode}
|
||||
showHeader={false}
|
||||
columns={columns}
|
||||
rowKey="name"
|
||||
rowKey="id"
|
||||
size="small"
|
||||
components={tableComponents}
|
||||
dataSource={processorData}
|
||||
|
@ -66,7 +66,7 @@ exports[`PipelinePage should render PipelineExpandView section 1`] = `
|
||||
>
|
||||
<tr
|
||||
class="ant-table-row ant-table-row-level-0"
|
||||
data-row-key="grok use common asd"
|
||||
data-row-key="grokusecommon"
|
||||
draggable="true"
|
||||
>
|
||||
<td
|
||||
@ -97,7 +97,7 @@ exports[`PipelinePage should render PipelineExpandView section 1`] = `
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-table-row ant-table-row-level-0"
|
||||
data-row-key="rename auth"
|
||||
data-row-key="renameauth"
|
||||
draggable="true"
|
||||
>
|
||||
<td
|
||||
|
Loading…
x
Reference in New Issue
Block a user