Kaizen
Browse modulesInsightsinsights/sharedFunctions

Function: dashboardFilterLeaves()

function dashboardFilterLeaves(filters: readonly (
  | {
  field: string;
  id: string;
  kind: "date-range";
  label: string;
}
  | {
  field: string;
  id: string;
  kind: "select";
  label: string;
  multiple?: boolean;
  searchable?: boolean;
}
  | {
  defaultOperator?: "gt" | "lt" | "gte" | "lte" | "eq";
  field: string;
  format?: "number" | "currency";
  id: string;
  kind: "measure";
  label: string;
  operators?: ("gt" | "lt" | "gte" | "lte" | "eq")[];
}
  | {
  field: string;
  id: string;
  kind: "search";
  label: string;
})[], values: DashboardFilterValues): (
  | {
  field: string;
  kind: "condition";
  operator: "eq";
  value: string | number | boolean;
}
  | {
  field: string;
  kind: "condition";
  operator: "neq";
  value: string | number | boolean;
}
  | {
  field: string;
  kind: "condition";
  operator: "gt";
  value: string | number;
}
  | {
  field: string;
  kind: "condition";
  operator: "lt";
  value: string | number;
}
  | {
  field: string;
  kind: "condition";
  operator: "gte";
  value: string | number;
}
  | {
  field: string;
  kind: "condition";
  operator: "lte";
  value: string | number;
}
  | {
  field: string;
  kind: "condition";
  operator: "contains";
  value: string;
}
  | {
  field: string;
  kind: "condition";
  operator: "in";
  value: (string | number | boolean)[];
}
  | {
  field: string;
  kind: "condition";
  operator: "between";
  value: {
     from: string | number;
     to: string | number;
  };
}
  | {
  field: string;
  kind: "condition";
  operator: "isNull";
}
  | {
  field: string;
  kind: "condition";
  operator: "isNotNull";
})[];

Defined in: shared/insights/types/dashboard-filter.ts:319

Every active filter's compiled leaf, in the descriptors' order. Inactive / incomplete filters drop out (see dashboardFilterToLeaf).

Parameters

ParameterType
filtersreadonly ( | { field: string; id: string; kind: "date-range"; label: string; } | { field: string; id: string; kind: "select"; label: string; multiple?: boolean; searchable?: boolean; } | { defaultOperator?: "gt" | "lt" | "gte" | "lte" | "eq"; field: string; format?: "number" | "currency"; id: string; kind: "measure"; label: string; operators?: ("gt" | "lt" | "gte" | "lte" | "eq")[]; } | { field: string; id: string; kind: "search"; label: string; })[]
valuesDashboardFilterValues

Returns

( | { field: string; kind: "condition"; operator: "eq"; value: string | number | boolean; } | { field: string; kind: "condition"; operator: "neq"; value: string | number | boolean; } | { field: string; kind: "condition"; operator: "gt"; value: string | number; } | { field: string; kind: "condition"; operator: "lt"; value: string | number; } | { field: string; kind: "condition"; operator: "gte"; value: string | number; } | { field: string; kind: "condition"; operator: "lte"; value: string | number; } | { field: string; kind: "condition"; operator: "contains"; value: string; } | { field: string; kind: "condition"; operator: "in"; value: (string | number | boolean)[]; } | { field: string; kind: "condition"; operator: "between"; value: { from: string | number; to: string | number; }; } | { field: string; kind: "condition"; operator: "isNull"; } | { field: string; kind: "condition"; operator: "isNotNull"; })[]

On this page