Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: retain the query name,expression and disabled property on changing panel type (#4976)

Vikrant Gupta2dbe598b2c1b
diff --git a/frontend/src/container/NewWidget/utils.ts b/frontend/src/container/NewWidget/utils.ts
index 64d884de15..caf2604639 100644
--- a/frontend/src/container/NewWidget/utils.ts
+++ b/frontend/src/container/NewWidget/utils.ts
@@ -50,6 +50,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'having',
'orderBy',
'functions',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -65,6 +68,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'orderBy',
'functions',
'spaceAggregation',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -78,6 +84,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'limit',
'having',
'orderBy',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -94,6 +103,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'having',
'orderBy',
'functions',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -109,6 +121,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'orderBy',
'functions',
'spaceAggregation',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -122,6 +137,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'limit',
'having',
'orderBy',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -138,6 +156,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'having',
'orderBy',
'functions',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -153,6 +174,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'orderBy',
'functions',
'spaceAggregation',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -166,6 +190,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'limit',
'having',
'orderBy',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -182,6 +209,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'having',
'orderBy',
'functions',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -197,6 +227,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'orderBy',
'functions',
'spaceAggregation',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -210,6 +243,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'limit',
'having',
'orderBy',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -241,6 +277,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'reduceTo',
'having',
'functions',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -254,6 +293,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'reduceTo',
'functions',
'spaceAggregation',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
@@ -267,6 +309,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'limit',
'having',
'orderBy',
+ 'queryName',
+ 'expression',
+ 'disabled',
],
},
},
diff --git a/frontend/src/providers/QueryBuilder.tsx b/frontend/src/providers/QueryBuilder.tsx
index a2166a5bc8..f630b13f83 100644
--- a/frontend/src/providers/QueryBuilder.tsx
+++ b/frontend/src/providers/QueryBuilder.tsx
@@ -229,6 +229,9 @@ export function QueryBuilderProvider({
setCurrentQuery(
timeUpdated ? merge(currentQuery, newQueryState) : newQueryState,
);
+ setSupersetQuery(
+ timeUpdated ? merge(currentQuery, newQueryState) : newQueryState,
+ );
setQueryType(type);
},
[prepareQueryBuilderData, currentQuery],
@@ -802,6 +805,7 @@ export function QueryBuilderProvider({
if (newCurrentQuery) {
setCurrentQuery(newCurrentQuery);
+ setSupersetQuery(newCurrentQuery);
}
};