Skip to content
Snippets Groups Projects
Unverified Commit 2b973c79 authored by Ryan Laurie's avatar Ryan Laurie Committed by GitHub
Browse files

Update filter modal tab metrics (#23215)

* update modal tab names
parent 0b573e50
No related branches found
No related tags found
No related merge requests found
...@@ -903,10 +903,13 @@ class StructuredQueryInner extends AtomicQuery { ...@@ -903,10 +903,13 @@ class StructuredQueryInner extends AtomicQuery {
// special logic to only show aggregation dimensions for post-aggregation dimensions // special logic to only show aggregation dimensions for post-aggregation dimensions
if (queries.length > 1) { if (queries.length > 1) {
// set the section title to `Metrics` const summarySection = {
sections[0].name = t`Metrics`; name: t`Summaries`,
icon: "sum",
items: [],
};
// only include aggregation dimensions // only include aggregation dimensions
sections[0].items = sections[0].items.filter(item => { summarySection.items = sections[0].items.filter(item => {
if (item.dimension) { if (item.dimension) {
const sourceDimension = queries[0].dimensionForSourceQuery( const sourceDimension = queries[0].dimensionForSourceQuery(
item.dimension, item.dimension,
...@@ -919,6 +922,8 @@ class StructuredQueryInner extends AtomicQuery { ...@@ -919,6 +922,8 @@ class StructuredQueryInner extends AtomicQuery {
return true; return true;
}); });
sections.shift();
sections.push(summarySection);
} }
return sections; return sections;
......
...@@ -171,11 +171,7 @@ const BulkFilterModalSectionList = ({ ...@@ -171,11 +171,7 @@ const BulkFilterModalSectionList = ({
<TabContent value={tab} onChange={setTab}> <TabContent value={tab} onChange={setTab}>
<ModalTabList> <ModalTabList>
{sections.map((section, index) => ( {sections.map((section, index) => (
<Tab <Tab key={index} value={index} icon={section.icon}>
key={index}
value={index}
icon={index > 0 ? section.icon : undefined}
>
{section.name} {section.name}
</Tab> </Tab>
))} ))}
......
...@@ -104,6 +104,7 @@ describe("scenarios > filters > bulk filtering", () => { ...@@ -104,6 +104,7 @@ describe("scenarios > filters > bulk filtering", () => {
openFilterModal(); openFilterModal();
modal().within(() => { modal().within(() => {
cy.findByText("Summaries").click();
cy.findByLabelText("Count").click(); cy.findByLabelText("Count").click();
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment