feat: support Filter Segment in other pages (#20461)

* feat: support Filter Segment in other pages

* minor changes to the behaviors

* remove comment

* fix type error

* fix e2e test
This commit is contained in:
Eunjae Lee authored and GitHub committed 2025-04-02 10:36:42 +02:00
1 parent 1fb778ae78
commit 4cd8dbbab4
13 files changed
+107 -48

No files matched your search

@@ -1,5 +1,6 @@
import { getTranslate } from "app/_utils";
import { CTA_CONTAINER_CLASS_NAME } from "@calcom/features/data-table/lib/utils";
import Shell from "@calcom/features/shell/Shell";
import UpgradeTipWrapper from "./UpgradeTipWrapper";
@@ -8,7 +9,11 @@ export default async function InsightsLayout({ children }: { children: React.Rea
const t = await getTranslate();
return (
<div>
<Shell withoutMain={false} heading={t("insights")} subtitle={t("insights_subtitle")}>
<Shell
withoutMain={false}
heading={t("insights")}
subtitle={t("insights_subtitle")}
actions={<div className={`mb-2 flex items-center gap-2 ${CTA_CONTAINER_CLASS_NAME}`} />}>
<UpgradeTipWrapper>{children}</UpgradeTipWrapper>
</Shell>
</div>
@@ -10,6 +10,7 @@ import {
DataTableProvider,
DataTableWrapper,
DataTableFilters,
DataTableSegment,
ColumnFilterType,
useFilterValue,
ZMultiSelectFilterValue,
@@ -374,10 +375,14 @@ function BookingsContent({ status }: BookingsProps) {
paginationMode="standard"
ToolbarLeft={
<>
<DataTableFilters.AddFilterButton table={table} hideWhenFilterApplied />
<DataTableFilters.ActiveFilters table={table} />
<DataTableFilters.AddFilterButton table={table} variant="sm" showWhenFilterApplied />
<DataTableFilters.FilterBar table={table} />
</>
}
ToolbarRight={
<>
<DataTableFilters.ClearFiltersButton />
<DataTableSegment.SaveButton />
<DataTableSegment.Select />
</>
}
LoaderView={<SkeletonLoader />}
-2
View File
@@ -676,7 +676,6 @@ test.describe("Out of office", () => {
);
await page.locator('[data-testid="add-filter-button"]').click();
await page.locator('[data-testid="add-filter-item-dateRange"]').click();
await page.locator('[data-testid="add-filter-button"]').click();
await page.locator('[data-testid="filter-popover-trigger-dateRange"]').click();
await expect(page.locator('[data-testid="date-range-options-tdy"]')).toBeVisible(); //Today
@@ -777,7 +776,6 @@ test.describe("Out of office", () => {
);
await page.locator('[data-testid="add-filter-item-dateRange"]').click();
await entriesListRespPromise;
await page.locator('[data-testid="add-filter-button"]').click(); //close popover
//1 OOO record should be visible for member3, end=currentDate-4days
expect(await page.locator('[data-testid^="table-redirect-"]').count()).toBe(1);