chore: moving web constants to packages
This commit is contained in:
parent
ae3b588081
commit
e9372adcf4
36 changed files with 305 additions and 314 deletions
|
|
@ -1,9 +1,10 @@
|
|||
// nivo
|
||||
import { BarTooltipProps } from "@nivo/bar";
|
||||
// plane imports
|
||||
import { ANALYTICS_DATE_KEYS } from "@plane/constants";
|
||||
import { IAnalyticsParams, IAnalyticsResponse } from "@plane/types";
|
||||
import { DATE_KEYS } from "@/constants/analytics";
|
||||
// helpers
|
||||
import { renderMonthAndYear } from "@/helpers/analytics.helper";
|
||||
// types
|
||||
|
||||
type Props = {
|
||||
datum: BarTooltipProps<any>;
|
||||
|
|
@ -23,7 +24,7 @@ export const CustomTooltip: React.FC<Props> = ({ datum, analytics, params }) =>
|
|||
};
|
||||
|
||||
if (params.segment) {
|
||||
if (DATE_KEYS.includes(params.segment)) tooltipValue = renderMonthAndYear(datum.id);
|
||||
if (ANALYTICS_DATE_KEYS.includes(params.segment)) tooltipValue = renderMonthAndYear(datum.id);
|
||||
else if (params.segment === "labels__id") {
|
||||
const label = analytics.extras.label_details.find((l) => l.labels__id === datum.id);
|
||||
tooltipValue = label && label.labels__name ? label.labels__name : "None";
|
||||
|
|
@ -41,7 +42,7 @@ export const CustomTooltip: React.FC<Props> = ({ datum, analytics, params }) =>
|
|||
: "None";
|
||||
} else tooltipValue = datum.id;
|
||||
} else {
|
||||
if (DATE_KEYS.includes(params.x_axis)) tooltipValue = datum.indexValue;
|
||||
if (ANALYTICS_DATE_KEYS.includes(params.x_axis)) tooltipValue = datum.indexValue;
|
||||
else tooltipValue = datum.id === "count" ? "Issue count" : "Estimate";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import { observer } from "mobx-react";
|
||||
import { Control, Controller, UseFormSetValue } from "react-hook-form";
|
||||
// types
|
||||
// plane imports
|
||||
import { ANALYTICS_X_AXIS_VALUES } from "@plane/constants";
|
||||
import { IAnalyticsParams } from "@plane/types";
|
||||
// ui
|
||||
import { Row } from "@plane/ui";
|
||||
// components
|
||||
import { SelectProject, SelectSegment, SelectXAxis, SelectYAxis } from "@/components/analytics";
|
||||
import { ANALYTICS_X_AXIS_VALUES } from "@/constants/analytics";
|
||||
// hooks
|
||||
import { useProject } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
// plane imports
|
||||
import { ANALYTICS_Y_AXIS_VALUES } from "@plane/constants";
|
||||
import { TYAxisValues } from "@plane/types";
|
||||
import { CustomSelect } from "@plane/ui";
|
||||
// constants
|
||||
import { ANALYTICS_Y_AXIS_VALUES } from "@/constants/analytics";
|
||||
// hooks
|
||||
import { useProjectEstimates } from "@/hooks/store";
|
||||
// plane web constants
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
"use client";
|
||||
|
||||
import { BarDatum } from "@nivo/bar";
|
||||
// plane package imports
|
||||
import { ANALYTICS_X_AXIS_VALUES, ANALYTICS_Y_AXIS_VALUES } from "@plane/constants";
|
||||
import { IAnalyticsParams, IAnalyticsResponse, TIssuePriorities } from "@plane/types";
|
||||
import { PriorityIcon, Tooltip } from "@plane/ui";
|
||||
// helpers
|
||||
import { ANALYTICS_X_AXIS_VALUES, ANALYTICS_Y_AXIS_VALUES } from "@/constants/analytics";
|
||||
import { generateBarColor, generateDisplayName, renderChartDynamicLabel } from "@/helpers/analytics.helper";
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import React, { Fragment } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Tab } from "@headlessui/react";
|
||||
// plane package imports
|
||||
import { ANALYTICS_TABS } from "@plane/constants";
|
||||
import { ICycle, IModule, IProject } from "@plane/types";
|
||||
// components
|
||||
import { CustomAnalytics, ScopeAndDemand } from "@/components/analytics";
|
||||
// types
|
||||
import { ANALYTICS_TABS } from "@/constants/analytics";
|
||||
// constants
|
||||
|
||||
type Props = {
|
||||
fullScreen: boolean;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue