mirror of
https://github.com/apache/superset.git
synced 2026-07-13 10:15:58 +00:00
fix(plugin-chart-handlebars): order by control not work (#21005)
(cherry picked from commit e70699fb43)
This commit is contained in:
committed by
Elizabeth Thompson
parent
47c3cd10bd
commit
c3e04d7ebf
@@ -16,15 +16,19 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { buildQueryContext, QueryFormData } from '@superset-ui/core';
|
||||
import {
|
||||
buildQueryContext,
|
||||
normalizeOrderBy,
|
||||
QueryFormData,
|
||||
} from '@superset-ui/core';
|
||||
|
||||
export default function buildQuery(formData: QueryFormData) {
|
||||
const { metric, sort_by_metric, groupby } = formData;
|
||||
const { groupby } = formData;
|
||||
|
||||
return buildQueryContext(formData, baseQueryObject => [
|
||||
{
|
||||
...baseQueryObject,
|
||||
...(sort_by_metric && { orderby: [[metric, false]] }),
|
||||
orderby: normalizeOrderBy(baseQueryObject).orderby,
|
||||
...(groupby && { groupby }),
|
||||
},
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user