-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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: re-implement filter components in /insights/routing #18655
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
7fb53c5
to
46c7c11
Compare
46c7c11
to
b698f40
Compare
b698f40
to
2dbcb73
Compare
2dbcb73
to
96e21a0
Compare
table: Table<TData>; | ||
externalFilters?: ExternalFilter[]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
externalFilters
is no longer needed as I've migrated Routing Form and People filter properly.
@@ -263,43 +261,56 @@ export function RoutingFormResponsesTableContent() { | |||
const { t } = useLocale(); | |||
const { filter } = useFilterContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, we rely on useFilterContext()
only for the date selectors. All the other parameters are managed below.
columnHelper.accessor("formId", { | ||
id: "formId", | ||
header: t("routing_forms"), | ||
enableColumnFilter: true, | ||
enableSorting: false, | ||
meta: { | ||
filter: { type: "single_select" }, | ||
}, | ||
cell: () => null, | ||
}), | ||
columnHelper.accessor("bookingUserId", { | ||
id: "bookingUserId", | ||
header: t("people"), | ||
enableColumnFilter: true, | ||
enableSorting: false, | ||
meta: { | ||
filter: { type: "single_select" }, | ||
}, | ||
cell: () => null, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are hidden columns but they exist to feed the filterable columns to the tanstack table.
@@ -582,7 +630,7 @@ export function RoutingFormResponsesTableContent() { | |||
<DataTableFilters.ColumnVisibilityButton table={table} /> | |||
</> | |||
}> | |||
<RoutingKPICards /> | |||
<RoutingKPICards given={{ isAll, teamId, userId }} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We caxn provide isAll, teamId, userId
to this component, so that it won't attempt to read them from useFilterContext()
.
export type OrgTeamsType = "org" | "team" | "yours"; | ||
|
||
// This is a cleaned-up version of TeamAndSelfList. | ||
export const OrgTeamsFilter = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
); | ||
} | ||
); | ||
export const RoutingFormFilterList = memo(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed showOnlyWhenSelectedInContext
as it's no longer needed
showOnlyWhenSelectedInContext?: boolean; | ||
onClear?: () => void; | ||
}) => { | ||
export const UserListInTeam = ({ onClear }: { onClear?: () => void }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed showOnlyWhenSelectedInContext
as it's no longer needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has no logic change. Just a bit cleaned up for readability.
96e21a0
to
2cf0187
Compare
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (01/14/25)1 reviewer was added to this PR based on Keith Williams's automation. |
2cf0187
to
26a4e15
Compare
E2E results are ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new implementation! Screenshot.2025-01-16.at.15.20.12.mp4 |
a51a903
to
30d0dee
Compare
What does this PR do?
TeamAndSelfList
intoOrgTeamsFilter
and removed implementation regardinguseFilterContext()
ClearFilters
intoDataTableFilters.ClearFiltersButton
and removed implementation regardinguseFilterContext()
externalFilters
-related code fromuseDataTable()
. It was a temporary way to keep "Routing Form" and "People" filter as-is.Screenshot.2025-01-14.at.17.17.33.mp4
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
All the filters work the same on /insights/routing