diff --git a/frontend/src/metabase-lib/lib/queries/StructuredQuery.ts b/frontend/src/metabase-lib/lib/queries/StructuredQuery.ts index 9eea3aff8fea39b78f47991be9ee26092d2afb59..ce58bc93da127c8f6562c25a899b9179d6bd3cd2 100644 --- a/frontend/src/metabase-lib/lib/queries/StructuredQuery.ts +++ b/frontend/src/metabase-lib/lib/queries/StructuredQuery.ts @@ -903,10 +903,13 @@ class StructuredQueryInner extends AtomicQuery { // special logic to only show aggregation dimensions for post-aggregation dimensions if (queries.length > 1) { - // set the section title to `Metrics` - sections[0].name = t`Metrics`; + const summarySection = { + name: t`Summaries`, + icon: "sum", + items: [], + }; // only include aggregation dimensions - sections[0].items = sections[0].items.filter(item => { + summarySection.items = sections[0].items.filter(item => { if (item.dimension) { const sourceDimension = queries[0].dimensionForSourceQuery( item.dimension, @@ -919,6 +922,8 @@ class StructuredQueryInner extends AtomicQuery { return true; }); + sections.shift(); + sections.push(summarySection); } return sections; diff --git a/frontend/src/metabase/query_builder/components/filters/modals/BulkFilterModal/BulkFilterModal.tsx b/frontend/src/metabase/query_builder/components/filters/modals/BulkFilterModal/BulkFilterModal.tsx index cd148b25a4291b0587f42a42bd59aa7bce5460a5..357ba6a56f38db2e920c38af22e1e2f9a92605ec 100644 --- a/frontend/src/metabase/query_builder/components/filters/modals/BulkFilterModal/BulkFilterModal.tsx +++ b/frontend/src/metabase/query_builder/components/filters/modals/BulkFilterModal/BulkFilterModal.tsx @@ -171,11 +171,7 @@ const BulkFilterModalSectionList = ({ <TabContent value={tab} onChange={setTab}> <ModalTabList> {sections.map((section, index) => ( - <Tab - key={index} - value={index} - icon={index > 0 ? section.icon : undefined} - > + <Tab key={index} value={index} icon={section.icon}> {section.name} </Tab> ))} diff --git a/frontend/test/metabase/scenarios/filters/filter-bulk.cy.spec.js b/frontend/test/metabase/scenarios/filters/filter-bulk.cy.spec.js index e937dbd020ee01c13c4170638bbb45a9ecf200a7..66f65bfcd12d926c44fd55ee9e061c3d373a7dbd 100644 --- a/frontend/test/metabase/scenarios/filters/filter-bulk.cy.spec.js +++ b/frontend/test/metabase/scenarios/filters/filter-bulk.cy.spec.js @@ -104,6 +104,7 @@ describe("scenarios > filters > bulk filtering", () => { openFilterModal(); modal().within(() => { + cy.findByText("Summaries").click(); cy.findByLabelText("Count").click(); });