mirror of
https://github.com/makeplane/plane.git
synced 2026-02-24 04:00:14 +01:00
Merge branch 'sync/ce-ee' of github.com:makeplane/plane-ee into develop
This commit is contained in:
@@ -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 = (
|
||||
@@ -36,8 +36,8 @@ export const convertResponseToBarGraphData = (
|
||||
name: DATE_KEYS.includes(params.x_axis)
|
||||
? renderMonthAndYear(key)
|
||||
: params.x_axis === "priority" || params.x_axis === "state__group"
|
||||
? capitalizeFirstLetter(key)
|
||||
: key,
|
||||
? capitalizeFirstLetter(key)
|
||||
: key,
|
||||
...segments,
|
||||
});
|
||||
} else {
|
||||
@@ -49,8 +49,8 @@ export const convertResponseToBarGraphData = (
|
||||
name: DATE_KEYS.includes(params.x_axis)
|
||||
? renderMonthAndYear(item.dimension)
|
||||
: params.x_axis === "priority" || params.x_axis === "state__group"
|
||||
? capitalizeFirstLetter(item.dimension ?? "None")
|
||||
: item.dimension ?? "None",
|
||||
? capitalizeFirstLetter(item.dimension ?? "None")
|
||||
: item.dimension ?? "None",
|
||||
[yAxisKey]: item[yAxisKey] ?? 0,
|
||||
});
|
||||
}
|
||||
@@ -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();
|
||||
@@ -84,12 +84,12 @@ export const generateBarColor = (
|
||||
priority === "urgent"
|
||||
? "#ef4444"
|
||||
: priority === "high"
|
||||
? "#f97316"
|
||||
: priority === "medium"
|
||||
? "#eab308"
|
||||
: priority === "low"
|
||||
? "#22c55e"
|
||||
: "#ced4da";
|
||||
? "#f97316"
|
||||
: priority === "medium"
|
||||
? "#eab308"
|
||||
: priority === "low"
|
||||
? "#22c55e"
|
||||
: "#ced4da";
|
||||
}
|
||||
|
||||
return color ?? generateRandomColor(value);
|
||||
|
||||
Reference in New Issue
Block a user