mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 06:55:58 +08:00
fix: arithmetic operators are removed from Dashboard query builder formulas (#6276)
* fix: the redirect from dashboard landing page to edit removing arithmetic operations * fix: the url for the dashboard edit widget
This commit is contained in:
parent
f7b80524a5
commit
8137ec54ba
@ -18,6 +18,7 @@ import { QueryParams } from 'constants/query';
|
|||||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||||
import useCreateAlerts from 'hooks/queryBuilder/useCreateAlerts';
|
import useCreateAlerts from 'hooks/queryBuilder/useCreateAlerts';
|
||||||
import useComponentPermission from 'hooks/useComponentPermission';
|
import useComponentPermission from 'hooks/useComponentPermission';
|
||||||
|
import useUrlQuery from 'hooks/useUrlQuery';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { RowData } from 'lib/query/createTableColumnsFromQuery';
|
import { RowData } from 'lib/query/createTableColumnsFromQuery';
|
||||||
import { isEmpty } from 'lodash-es';
|
import { isEmpty } from 'lodash-es';
|
||||||
@ -72,16 +73,18 @@ function WidgetHeader({
|
|||||||
tableProcessedDataRef,
|
tableProcessedDataRef,
|
||||||
setSearchTerm,
|
setSearchTerm,
|
||||||
}: IWidgetHeaderProps): JSX.Element | null {
|
}: IWidgetHeaderProps): JSX.Element | null {
|
||||||
|
const urlQuery = useUrlQuery();
|
||||||
const onEditHandler = useCallback((): void => {
|
const onEditHandler = useCallback((): void => {
|
||||||
const widgetId = widget.id;
|
const widgetId = widget.id;
|
||||||
history.push(
|
urlQuery.set(QueryParams.widgetId, widgetId);
|
||||||
`${window.location.pathname}/new?widgetId=${widgetId}&graphType=${
|
urlQuery.set(QueryParams.graphType, widget.panelTypes);
|
||||||
widget.panelTypes
|
urlQuery.set(
|
||||||
}&${QueryParams.compositeQuery}=${encodeURIComponent(
|
QueryParams.compositeQuery,
|
||||||
JSON.stringify(widget.query),
|
encodeURIComponent(JSON.stringify(widget.query)),
|
||||||
)}`,
|
|
||||||
);
|
);
|
||||||
}, [widget.id, widget.panelTypes, widget.query]);
|
const generatedUrl = `${window.location.pathname}/new?${urlQuery}`;
|
||||||
|
history.push(generatedUrl);
|
||||||
|
}, [urlQuery, widget.id, widget.panelTypes, widget.query]);
|
||||||
|
|
||||||
const onCreateAlertsHandler = useCreateAlerts(widget, 'dashboardView');
|
const onCreateAlertsHandler = useCreateAlerts(widget, 'dashboardView');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user