mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 11:59:03 +08:00
fix: handle the super set query reset state when changing widgets (#5539)
This commit is contained in:
parent
d50530f58c
commit
d60daef171
@ -79,6 +79,7 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
|
|||||||
stagedQuery,
|
stagedQuery,
|
||||||
redirectWithQueryBuilderData,
|
redirectWithQueryBuilderData,
|
||||||
supersetQuery,
|
supersetQuery,
|
||||||
|
setSupersetQuery,
|
||||||
} = useQueryBuilder();
|
} = useQueryBuilder();
|
||||||
|
|
||||||
const isQueryModified = useMemo(
|
const isQueryModified = useMemo(
|
||||||
@ -548,6 +549,17 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
|
|||||||
isNewTraceLogsAvailable,
|
isNewTraceLogsAvailable,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
/**
|
||||||
|
* we need this extra handling for superset query because we cannot keep this in sync with current query
|
||||||
|
* always.we do not sync superset query in the initQueryBuilderData because that function is called on all stage and run
|
||||||
|
* actions. we do not want that as we loose out on superset functionalities if we do the same. hence initialising the superset query
|
||||||
|
* on mount here with the currentQuery in the begining itself
|
||||||
|
*/
|
||||||
|
setSupersetQuery(currentQuery);
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
registerShortcut(DashboardShortcuts.SaveChanges, onSaveDashboard);
|
registerShortcut(DashboardShortcuts.SaveChanges, onSaveDashboard);
|
||||||
registerShortcut(DashboardShortcuts.DiscardChanges, onClickDiscardHandler);
|
registerShortcut(DashboardShortcuts.DiscardChanges, onClickDiscardHandler);
|
||||||
|
@ -829,7 +829,7 @@ export function QueryBuilderProvider({
|
|||||||
unit,
|
unit,
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
[setCurrentQuery],
|
[setCurrentQuery, setSupersetQuery],
|
||||||
);
|
);
|
||||||
|
|
||||||
const query: Query = useMemo(
|
const query: Query = useMemo(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user