mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-31 06:52:01 +08:00
fix: dependent variable panel not updating (#5283)
* fix: dependent variable panel not updating * fix: build issues
This commit is contained in:
parent
38b1de5ccc
commit
67965c8e4d
@ -138,6 +138,7 @@ function DashboardVariableSelection(): JSX.Element | null {
|
||||
}}
|
||||
onValueUpdate={onValueUpdate}
|
||||
variablesToGetUpdated={variablesToGetUpdated}
|
||||
setVariablesToGetUpdated={setVariablesToGetUpdated}
|
||||
/>
|
||||
))}
|
||||
</Row>
|
||||
|
@ -54,6 +54,7 @@ describe('VariableItem', () => {
|
||||
existingVariables={{}}
|
||||
onValueUpdate={mockOnValueUpdate}
|
||||
variablesToGetUpdated={[]}
|
||||
setVariablesToGetUpdated={(): void => {}}
|
||||
/>
|
||||
</MockQueryClientProvider>,
|
||||
);
|
||||
@ -69,6 +70,7 @@ describe('VariableItem', () => {
|
||||
existingVariables={{}}
|
||||
onValueUpdate={mockOnValueUpdate}
|
||||
variablesToGetUpdated={[]}
|
||||
setVariablesToGetUpdated={(): void => {}}
|
||||
/>
|
||||
</MockQueryClientProvider>,
|
||||
);
|
||||
@ -83,6 +85,7 @@ describe('VariableItem', () => {
|
||||
existingVariables={{}}
|
||||
onValueUpdate={mockOnValueUpdate}
|
||||
variablesToGetUpdated={[]}
|
||||
setVariablesToGetUpdated={(): void => {}}
|
||||
/>
|
||||
</MockQueryClientProvider>,
|
||||
);
|
||||
@ -111,6 +114,7 @@ describe('VariableItem', () => {
|
||||
existingVariables={{}}
|
||||
onValueUpdate={mockOnValueUpdate}
|
||||
variablesToGetUpdated={[]}
|
||||
setVariablesToGetUpdated={(): void => {}}
|
||||
/>
|
||||
</MockQueryClientProvider>,
|
||||
);
|
||||
@ -134,6 +138,7 @@ describe('VariableItem', () => {
|
||||
existingVariables={{}}
|
||||
onValueUpdate={mockOnValueUpdate}
|
||||
variablesToGetUpdated={[]}
|
||||
setVariablesToGetUpdated={(): void => {}}
|
||||
/>
|
||||
</MockQueryClientProvider>,
|
||||
);
|
||||
@ -149,6 +154,7 @@ describe('VariableItem', () => {
|
||||
existingVariables={{}}
|
||||
onValueUpdate={mockOnValueUpdate}
|
||||
variablesToGetUpdated={[]}
|
||||
setVariablesToGetUpdated={(): void => {}}
|
||||
/>
|
||||
</MockQueryClientProvider>,
|
||||
);
|
||||
|
@ -52,6 +52,7 @@ interface VariableItemProps {
|
||||
allSelected: boolean,
|
||||
) => void;
|
||||
variablesToGetUpdated: string[];
|
||||
setVariablesToGetUpdated: React.Dispatch<React.SetStateAction<string[]>>;
|
||||
}
|
||||
|
||||
const getSelectValue = (
|
||||
@ -73,6 +74,7 @@ function VariableItem({
|
||||
existingVariables,
|
||||
onValueUpdate,
|
||||
variablesToGetUpdated,
|
||||
setVariablesToGetUpdated,
|
||||
}: VariableItemProps): JSX.Element {
|
||||
const [optionsData, setOptionsData] = useState<(string | number | boolean)[]>(
|
||||
[],
|
||||
@ -171,6 +173,10 @@ function VariableItem({
|
||||
}
|
||||
|
||||
setOptionsData(newOptionsData);
|
||||
} else {
|
||||
setVariablesToGetUpdated((prev) =>
|
||||
prev.filter((name) => name !== variableData.name),
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user