mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 19:49:06 +08:00
fix: tags is grabbed from the local state (#2106)
This commit is contained in:
parent
f1c7d72fc5
commit
2f1ca93eda
@ -1,8 +1,6 @@
|
|||||||
import { CloseOutlined } from '@ant-design/icons';
|
import { CloseOutlined } from '@ant-design/icons';
|
||||||
import { Select } from 'antd';
|
import { Select } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
|
||||||
import { AppState } from 'store/reducers';
|
|
||||||
import { TraceReducer } from 'types/reducer/trace';
|
import { TraceReducer } from 'types/reducer/trace';
|
||||||
|
|
||||||
import { Container, IconContainer, SelectComponent } from './styles';
|
import { Container, IconContainer, SelectComponent } from './styles';
|
||||||
@ -30,9 +28,13 @@ const AllMenu: AllMenuProps[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
function SingleTags(props: AllTagsProps): JSX.Element {
|
function SingleTags(props: AllTagsProps): JSX.Element {
|
||||||
const traces = useSelector<AppState, TraceReducer>((state) => state.traces);
|
const {
|
||||||
|
tag,
|
||||||
const { tag, onCloseHandler, setLocalSelectedTags, index } = props;
|
onCloseHandler,
|
||||||
|
setLocalSelectedTags,
|
||||||
|
index,
|
||||||
|
localSelectedTags,
|
||||||
|
} = props;
|
||||||
const {
|
const {
|
||||||
Key: selectedKey,
|
Key: selectedKey,
|
||||||
Operator: selectedOperator,
|
Operator: selectedOperator,
|
||||||
@ -46,13 +48,13 @@ function SingleTags(props: AllTagsProps): JSX.Element {
|
|||||||
const onChangeOperatorHandler = (key: unknown): void => {
|
const onChangeOperatorHandler = (key: unknown): void => {
|
||||||
if (typeof key === 'string') {
|
if (typeof key === 'string') {
|
||||||
setLocalSelectedTags([
|
setLocalSelectedTags([
|
||||||
...traces.selectedTags.slice(0, index),
|
...localSelectedTags.slice(0, index),
|
||||||
{
|
{
|
||||||
Key: selectedKey,
|
Key: selectedKey,
|
||||||
Values: selectedValues,
|
Values: selectedValues,
|
||||||
Operator: key as Tags,
|
Operator: key as Tags,
|
||||||
},
|
},
|
||||||
...traces.selectedTags.slice(index + 1, traces.selectedTags.length),
|
...localSelectedTags.slice(index + 1, localSelectedTags.length),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -100,6 +102,7 @@ interface AllTagsProps {
|
|||||||
setLocalSelectedTags: React.Dispatch<
|
setLocalSelectedTags: React.Dispatch<
|
||||||
React.SetStateAction<TraceReducer['selectedTags']>
|
React.SetStateAction<TraceReducer['selectedTags']>
|
||||||
>;
|
>;
|
||||||
|
localSelectedTags: TraceReducer['selectedTags'];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Value {
|
export interface Value {
|
||||||
|
@ -99,6 +99,7 @@ function AllTags({
|
|||||||
index={index}
|
index={index}
|
||||||
onCloseHandler={(): void => onCloseHandler(index)}
|
onCloseHandler={(): void => onCloseHandler(index)}
|
||||||
setLocalSelectedTags={setLocalSelectedTags}
|
setLocalSelectedTags={setLocalSelectedTags}
|
||||||
|
localSelectedTags={localSelectedTags}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</CurrentTagsContainer>
|
</CurrentTagsContainer>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user