From 86cc3dabd8804f2d38ba8fc47913f30d1aeb943a Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Fri, 16 Feb 2024 11:33:11 +0000 Subject: [PATCH] fix(segments): use API query param for feature-specific filter (#3431) --- frontend/common/types/requests.ts | 1 + frontend/web/components/pages/SegmentsPage.tsx | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/frontend/common/types/requests.ts b/frontend/common/types/requests.ts index 2c664f232427..85bbaa43f168 100644 --- a/frontend/common/types/requests.ts +++ b/frontend/common/types/requests.ts @@ -27,6 +27,7 @@ export type Req = { q?: string projectId: number | string identity?: number + include_feature_specific?: boolean }> deleteSegment: { projectId: number | string; id: number } updateSegment: { projectId: number | string; segment: Segment } diff --git a/frontend/web/components/pages/SegmentsPage.tsx b/frontend/web/components/pages/SegmentsPage.tsx index dd433acd0418..961efa1a7630 100644 --- a/frontend/web/components/pages/SegmentsPage.tsx +++ b/frontend/web/components/pages/SegmentsPage.tsx @@ -64,6 +64,7 @@ const SegmentsPage: FC = (props) => { const [showFeatureSpecific, setShowFeatureSpecific] = useState(false) const { data, error, isLoading, refetch } = useGetSegmentsQuery({ + include_feature_specific: showFeatureSpecific, page, page_size: 100, projectId, @@ -246,9 +247,15 @@ const SegmentsPage: FC = (props) => { ) preselect.current = null } + + // TODO: remove this check + // I'm leaving this here for now so that we can deploy the FE and + // API independently, but we should remove this once PR #3430 is + // merged and released. if (feature && !showFeatureSpecific) { return null } + return renderWithPermission( manageSegmentsPermission, 'Manage segments',