forked from github/plane
[WEB-1000] fix: handled edge case for color on custom analytics state_group (#4185)
* chore: handled edge case for color on custom analytics state_group * fix: error handler
This commit is contained in:
parent
8b6035d315
commit
251a432d8a
@ -1,12 +1,12 @@
|
||||
// nivo
|
||||
import { BarDatum } from "@nivo/bar";
|
||||
import { IAnalyticsData, IAnalyticsParams, IAnalyticsResponse, TStateGroups } from "@plane/types";
|
||||
// helpers
|
||||
import { DATE_KEYS } from "@/constants/analytics";
|
||||
import { MONTHS_LIST } from "@/constants/calendar";
|
||||
import { STATE_GROUPS } from "@/constants/state";
|
||||
import { addSpaceIfCamelCase, capitalizeFirstLetter, generateRandomColor } from "@/helpers/string.helper";
|
||||
// types
|
||||
import { IAnalyticsData, IAnalyticsParams, IAnalyticsResponse, TStateGroups } from "@plane/types";
|
||||
// constants
|
||||
|
||||
export const convertResponseToBarGraphData = (
|
||||
@ -75,7 +75,7 @@ export const generateBarColor = (
|
||||
if (params[type] === "labels__id")
|
||||
color = analytics?.extras.label_details.find((l) => l.labels__id === value)?.labels__color ?? undefined;
|
||||
|
||||
if (params[type] === "state__group") color = STATE_GROUPS[value.toLowerCase() as TStateGroups].color;
|
||||
if (params[type] === "state__group") color = STATE_GROUPS[value.toLowerCase() as TStateGroups]?.color ?? undefined;
|
||||
|
||||
if (params[type] === "priority") {
|
||||
const priority = value.toLowerCase();
|
||||
|
Loading…
Reference in New Issue
Block a user