fix: replace filter implementations on /insights (#19033)

* fix: replace filter implementations on /insights

* add authorization for teamIds

* replace all the implementations

* provide eventTypeId

* remove log

* fix teamId for isAll

* fix Download button

* remove legacy implementations

* clean up

* nullish check

* remove unusable filters

* revert style

* fix type error

* fix e2e test

* fix type error

* fix type error

* fix e2e

* extract util method

* fix type error

* fix type error

* fix type error

---------

Co-authored-by: Benny Joo <[email protected]>
This commit is contained in:
Eunjae LeeandBenny Joo authored and GitHub committed 2025-02-10 20:28:48 +01:00
1 parent 9bf3732717
commit 720136fcf9
55 files changed
+1037 -1829

No files matched your search

@@ -20,6 +20,7 @@ import {
singleSelectFilter,
multiSelectFilter,
ColumnFilterType,
convertFacetedValuesToMap,
} from "@calcom/features/data-table";
import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider";
import classNames from "@calcom/lib/classNames";
@@ -458,13 +459,28 @@ function UserListTableContent() {
if (facetedTeamValues) {
switch (columnId) {
case "role":
return new Map(facetedTeamValues.roles.map((role) => [role, 1]));
return convertFacetedValuesToMap(
facetedTeamValues.roles.map((role) => ({
label: role,
value: role,
}))
);
case "teams":
return new Map(facetedTeamValues.teams.map((team) => [team.name, 1]));
return convertFacetedValuesToMap(
facetedTeamValues.teams.map((team) => ({
label: team.name,
value: team.name,
}))
);
default:
const attribute = facetedTeamValues.attributes.find((attr) => attr.id === columnId);
if (attribute) {
return new Map(attribute?.options.map(({ value }) => [value, 1]) ?? []);
return convertFacetedValuesToMap(
attribute?.options.map(({ value }) => ({
label: value,
value,
})) ?? []
);
}
return new Map();
}