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 {
// 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;
......
......@@ -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>
))}
......
......@@ -104,6 +104,7 @@ describe("scenarios > filters > bulk filtering", () => {
openFilterModal();
modal().within(() => {
cy.findByText("Summaries").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