Skip to content

Commit

Permalink
fix: retain the query name,expression and disabled property on changi…
Browse files Browse the repository at this point in the history
…ng panel type (#4976)

* fix: retain the query name,expression and disabled property on changing panel type

* fix: missing reset and init query for superset query
  • Loading branch information
vikrantgupta25 committed May 20, 2024
1 parent cf64da2 commit 2dbe598
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
45 changes: 45 additions & 0 deletions frontend/src/container/NewWidget/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'having',
'orderBy',
'functions',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -65,6 +68,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'orderBy',
'functions',
'spaceAggregation',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -78,6 +84,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'limit',
'having',
'orderBy',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -94,6 +103,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'having',
'orderBy',
'functions',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -109,6 +121,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'orderBy',
'functions',
'spaceAggregation',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -122,6 +137,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'limit',
'having',
'orderBy',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -138,6 +156,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'having',
'orderBy',
'functions',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -153,6 +174,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'orderBy',
'functions',
'spaceAggregation',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -166,6 +190,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'limit',
'having',
'orderBy',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -182,6 +209,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'having',
'orderBy',
'functions',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -197,6 +227,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'orderBy',
'functions',
'spaceAggregation',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -210,6 +243,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'limit',
'having',
'orderBy',
'queryName',
'expression',
'disabled',
],
},
},
Expand Down Expand Up @@ -241,6 +277,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'reduceTo',
'having',
'functions',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -254,6 +293,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'reduceTo',
'functions',
'spaceAggregation',
'queryName',
'expression',
'disabled',
],
},
},
Expand All @@ -267,6 +309,9 @@ export const panelTypeDataSourceFormValuesMap: Record<
'limit',
'having',
'orderBy',
'queryName',
'expression',
'disabled',
],
},
},
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/providers/QueryBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ export function QueryBuilderProvider({
setCurrentQuery(
timeUpdated ? merge(currentQuery, newQueryState) : newQueryState,
);
setSupersetQuery(
timeUpdated ? merge(currentQuery, newQueryState) : newQueryState,
);
setQueryType(type);
},
[prepareQueryBuilderData, currentQuery],
Expand Down Expand Up @@ -802,6 +805,7 @@ export function QueryBuilderProvider({

if (newCurrentQuery) {
setCurrentQuery(newCurrentQuery);
setSupersetQuery(newCurrentQuery);
}
};

Expand Down

0 comments on commit 2dbe598

Please sign in to comment.