Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(segments): use API query param for feature-specific filter #3431

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/common/types/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
7 changes: 7 additions & 0 deletions frontend/web/components/pages/SegmentsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const SegmentsPage: FC<SegmentsPageType> = (props) => {
const [showFeatureSpecific, setShowFeatureSpecific] = useState(false)

const { data, error, isLoading, refetch } = useGetSegmentsQuery({
include_feature_specific: showFeatureSpecific,
page,
page_size: 100,
projectId,
Expand Down Expand Up @@ -246,9 +247,15 @@ const SegmentsPage: FC<SegmentsPageType> = (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',
Expand Down
Loading