Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/constants/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ export type TStateGroups =
| "completed"
| "cancelled";

export type TDraggableData = {
groupKey: TStateGroups;
id: string;
};

export const STATE_GROUPS: {
[key in TStateGroups]: {
key: TStateGroups;
Expand Down Expand Up @@ -43,6 +48,13 @@ export const ARCHIVABLE_STATE_GROUPS = [
STATE_GROUPS.completed.key,
STATE_GROUPS.cancelled.key,
];
export const COMPLETED_STATE_GROUPS = [STATE_GROUPS.completed.key];
export const PENDING_STATE_GROUPS = [
STATE_GROUPS.backlog.key,
STATE_GROUPS.unstarted.key,
STATE_GROUPS.started.key,
STATE_GROUPS.cancelled.key,
];

export const PROGRESS_STATE_GROUPS_DETAILS = [
{
Expand All @@ -66,3 +78,5 @@ export const PROGRESS_STATE_GROUPS_DETAILS = [
color: "#A3A3A3",
},
];

export const DISPLAY_WORKFLOW_PRO_CTA = false;
2 changes: 1 addition & 1 deletion web/ce/components/workflow/state-item-child.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SetStateAction } from "react";
import { observer } from "mobx-react";
// Plane
import { DISPLAY_WORKFLOW_PRO_CTA } from "@plane/constants";
import { IState } from "@plane/types";
// components
import { StateItemTitle } from "@/components/project-states/state-item-title";
// constants
import { DISPLAY_WORKFLOW_PRO_CTA } from "@/constants/state";
//
import { AddStateTransition } from "./add-state-transition";

Expand Down
3 changes: 2 additions & 1 deletion web/core/components/analytics/scope-and-demand/demand.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// plane imports
import { STATE_GROUPS } from "@plane/constants";
// types
import { IDefaultAnalyticsResponse, TStateGroups } from "@plane/types";
// constants
import { Card } from "@plane/ui";
import { STATE_GROUPS } from "@/constants/state";

type Props = {
defaultAnalytics: IDefaultAnalyticsResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { observer } from "mobx-react";
import Link from "next/link";
// types
import { STATE_GROUPS } from "@plane/constants";
import { TIssuesByStateGroupsWidgetFilters, TIssuesByStateGroupsWidgetResponse, TStateGroups } from "@plane/types";
// components
import { Card } from "@plane/ui";
Expand All @@ -14,7 +15,6 @@ import {
import { PieGraph } from "@/components/ui";
// constants
import { EDurationFilters, STATE_GROUP_GRAPH_COLORS, STATE_GROUP_GRAPH_GRADIENTS } from "@/constants/dashboard";
import { STATE_GROUPS } from "@/constants/state";
// helpers
import { getCustomDates } from "@/helpers/dashboard.helper";
// hooks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import React, { FC, useState } from "react";
import { observer } from "mobx-react";
import { usePathname } from "next/navigation";
import { ArchiveIcon, ArchiveRestoreIcon, LinkIcon, Trash2 } from "lucide-react";
import { EIssuesStoreType } from "@plane/constants";
import { ARCHIVABLE_STATE_GROUPS, EIssuesStoreType } from "@plane/constants";
import { TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
// components
import { ArchiveIssueModal, DeleteIssueModal, IssueSubscription } from "@/components/issues";
// constants
import { ISSUE_ARCHIVED, ISSUE_DELETED } from "@/constants/event-tracker";
import { ARCHIVABLE_STATE_GROUPS } from "@/constants/state";
// helpers
import { cn } from "@/helpers/common.helper";
import { copyTextToClipboard } from "@/helpers/string.helper";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import React, { useState } from "react";
import { observer } from "mobx-react";
// components
// plane imports
import { STATE_GROUPS } from "@plane/constants";
import { StateGroupIcon } from "@plane/ui";
// components
import { FilterHeader, FilterOption } from "@/components/issues";
// icons
import { STATE_GROUPS } from "@/constants/state";
// constants

type Props = {
appliedFilters: string[] | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { Copy, ExternalLink, Link, Pencil, Trash2 } from "lucide-react";
// types
import { EIssuesStoreType } from "@plane/constants";
import { ARCHIVABLE_STATE_GROUPS, EIssuesStoreType } from "@plane/constants";
import { TIssue } from "@plane/types";
// ui
import { ArchiveIcon, ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui";
// components
import { ArchiveIssueModal, CreateUpdateIssueModal, DeleteIssueModal } from "@/components/issues";
// constants
import { ARCHIVABLE_STATE_GROUPS } from "@/constants/state";
// helpers
import { cn } from "@/helpers/common.helper";
import { copyUrlToClipboard } from "@/helpers/string.helper";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { Copy, ExternalLink, Link, Pencil, Trash2, XCircle } from "lucide-react";
// types
import { EIssuesStoreType } from "@plane/constants";
import { ARCHIVABLE_STATE_GROUPS, EIssuesStoreType } from "@plane/constants";
import { TIssue } from "@plane/types";
// ui
import { ArchiveIcon, ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui";
// components
import { ArchiveIssueModal, CreateUpdateIssueModal, DeleteIssueModal } from "@/components/issues";
// constants
import { ARCHIVABLE_STATE_GROUPS } from "@/constants/state";
// helpers
import { cn } from "@/helpers/common.helper";
import { copyUrlToClipboard } from "@/helpers/string.helper";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { Copy, ExternalLink, Link, Pencil, Trash2, XCircle } from "lucide-react";
// types
import { EIssuesStoreType } from "@plane/constants";
import { ARCHIVABLE_STATE_GROUPS, EIssuesStoreType } from "@plane/constants";
import { TIssue } from "@plane/types";
// ui
import { ArchiveIcon, ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui";
// components
import { ArchiveIssueModal, CreateUpdateIssueModal, DeleteIssueModal } from "@/components/issues";
// constants
import { ARCHIVABLE_STATE_GROUPS } from "@/constants/state";
// helpers
import { cn } from "@/helpers/common.helper";
import { copyUrlToClipboard } from "@/helpers/string.helper";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import { observer } from "mobx-react";
import { useParams, usePathname } from "next/navigation";
import { Copy, ExternalLink, Link, Pencil, Trash2 } from "lucide-react";
// types
import { EIssuesStoreType } from "@plane/constants";
import { ARCHIVABLE_STATE_GROUPS, EIssuesStoreType } from "@plane/constants";
import { TIssue } from "@plane/types";
// ui
import { ArchiveIcon, ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui";
// components
import { ArchiveIssueModal, CreateUpdateIssueModal, DeleteIssueModal } from "@/components/issues";
// constants
import { ARCHIVABLE_STATE_GROUPS } from "@/constants/state";
// helpers
import { cn } from "@/helpers/common.helper";
import { copyUrlToClipboard } from "@/helpers/string.helper";
Expand Down
3 changes: 1 addition & 2 deletions web/core/components/issues/issue-layouts/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import uniq from "lodash/uniq";
import scrollIntoView from "smooth-scroll-into-view-if-needed";
import { ContrastIcon } from "lucide-react";
// plane types
import { EIssuesStoreType, ISSUE_PRIORITIES } from "@plane/constants";
import { EIssuesStoreType, ISSUE_PRIORITIES, STATE_GROUPS } from "@plane/constants";
import {
GroupByColumnTypes,
IGroupByColumn,
Expand All @@ -30,7 +30,6 @@ import {
import { Avatar, CycleGroupIcon, DiceIcon, PriorityIcon, StateGroupIcon } from "@plane/ui";
// components
import { Logo } from "@/components/common";
import { STATE_GROUPS } from "@/constants/state";
// helpers
import { renderFormattedDate } from "@/helpers/date-time.helper";
import { getFileURL } from "@/helpers/file.helper";
Expand Down
3 changes: 2 additions & 1 deletion web/core/components/issues/peek-overview/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { FC } from "react";
import { observer } from "mobx-react";
import Link from "next/link";
import { ArchiveRestoreIcon, Link2, MoveDiagonal, MoveRight, Trash2 } from "lucide-react";
// plane imports
import { ARCHIVABLE_STATE_GROUPS } from "@plane/constants";
// types
import { TNameDescriptionLoader } from "@plane/types";
// ui
Expand All @@ -19,7 +21,6 @@ import {
} from "@plane/ui";
// components
import { IssueSubscription, NameDescriptionUpdateStatus } from "@/components/issues";
import { ARCHIVABLE_STATE_GROUPS } from "@/constants/state";
// helpers
import { cn } from "@/helpers/common.helper";
import { copyUrlToClipboard } from "@/helpers/string.helper";
Expand Down
8 changes: 3 additions & 5 deletions web/core/components/profile/overview/state-distribution.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// ui
// plane imports
import { STATE_GROUPS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { IUserProfileData, IUserStateDistribution } from "@plane/types";
// ui
import { Card } from "@plane/ui";
import { ProfileEmptyState, PieGraph } from "@/components/ui";

// image
import { STATE_GROUPS } from "@/constants/state";
import stateGraph from "@/public/empty-state/state_graph.svg";
// types
// constants

type Props = {
stateDistribution: IUserStateDistribution[];
Expand Down
3 changes: 2 additions & 1 deletion web/core/components/profile/overview/workload.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// plane imports
import { STATE_GROUPS } from "@plane/constants";
// types
import { useTranslation } from "@plane/i18n";
import { IUserStateDistribution } from "@plane/types";
import { Card, ECardDirection, ECardSpacing } from "@plane/ui";
import { STATE_GROUPS } from "@/constants/state";
// constants

type Props = {
Expand Down
3 changes: 2 additions & 1 deletion web/core/components/project-states/create-update/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import { FC, useState } from "react";
import { observer } from "mobx-react";
// plane imports
import { STATE_GROUPS } from "@plane/constants";
import { IState, TStateGroups } from "@plane/types";
import { TOAST_TYPE, setToast } from "@plane/ui";
// components
import { StateForm } from "@/components/project-states";
// constants
import { STATE_CREATED } from "@/constants/event-tracker";
import { STATE_GROUPS } from "@/constants/state";
// hooks
import { useEventTracker, useProjectState } from "@/hooks/store";

Expand Down
2 changes: 1 addition & 1 deletion web/core/components/project-states/state-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-d
import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
import { observer } from "mobx-react";
// Plane
import { TDraggableData } from "@plane/constants";
import { IState, TStateGroups } from "@plane/types";
import { DropIndicator } from "@plane/ui";
// components
import { StateUpdate } from "@/components/project-states";
// helpers
import { TDraggableData } from "@/constants/state";
import { cn } from "@/helpers/common.helper";
import { getCurrentStateSequence } from "@/helpers/state.helper";
// hooks
Expand Down
51 changes: 0 additions & 51 deletions web/core/constants/state.ts

This file was deleted.

3 changes: 1 addition & 2 deletions web/helpers/analytics.helper.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// nivo
import { BarDatum } from "@nivo/bar";
// plane imports
import { ANALYTICS_DATE_KEYS } from "@plane/constants";
import { ANALYTICS_DATE_KEYS, STATE_GROUPS } from "@plane/constants";
import { IAnalyticsData, IAnalyticsParams, IAnalyticsResponse, TStateGroups } from "@plane/types";
// constants
import { MONTHS_LIST } from "@/constants/calendar";
import { STATE_GROUPS } from "@/constants/state";
// helpers
import { addSpaceIfCamelCase, capitalizeFirstLetter, generateRandomColor } from "@/helpers/string.helper";

Expand Down
4 changes: 2 additions & 2 deletions web/helpers/distribution-update.helper.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { format } from "date-fns";
import get from "lodash/get";
import set from "lodash/set";
// plane imports
import { STATE_GROUPS, COMPLETED_STATE_GROUPS } from "@plane/constants";
// types
import { ICycle, IEstimatePoint, IModule, IState, TIssue } from "@plane/types";
// constants
import { STATE_GROUPS, COMPLETED_STATE_GROUPS } from "@/constants/state";
// helper
import { getDate } from "./date-time.helper";

Expand Down
3 changes: 1 addition & 2 deletions web/helpers/issue.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import isEmpty from "lodash/isEmpty";
import set from "lodash/set";
import { v4 as uuidv4 } from "uuid";
// plane constants
import { EIssueLayoutTypes, ISSUE_DISPLAY_FILTERS_BY_PAGE } from "@plane/constants";
import { EIssueLayoutTypes, ISSUE_DISPLAY_FILTERS_BY_PAGE, STATE_GROUPS } from "@plane/constants";
// types
import {
IIssueDisplayFilterOptions,
Expand All @@ -18,7 +18,6 @@ import {
TUnGroupedIssues,
} from "@plane/types";
import { IGanttBlock } from "@/components/gantt-chart";
import { STATE_GROUPS } from "@/constants/state";
// helpers
import { orderArrayBy } from "@/helpers/array.helper";
import { getDate } from "@/helpers/date-time.helper";
Expand Down
3 changes: 2 additions & 1 deletion web/helpers/state.helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// plane imports
import { STATE_GROUPS, TDraggableData } from "@plane/constants";
// types
import { IState, IStateResponse } from "@plane/types";
import { STATE_GROUPS, TDraggableData } from "@/constants/state";

export const orderStateGroups = (unorderedStateGroups: IStateResponse | undefined): IStateResponse | undefined => {
if (!unorderedStateGroups) return undefined;
Expand Down
Loading