From 836e40bc3e58ebef3a1f3df094e70c0ce583a93a Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Mon, 2 Dec 2024 21:23:43 +0530 Subject: [PATCH] chore: move constants to packages and refactor empty state --- packages/constants/package.json | 5 +- packages/constants/src/ce/ai.ts | 9 + packages/constants/src/ce/auth.ts | 4 + packages/constants/src/ce/empty-state.ts | 26 + packages/constants/src/ce/estimates.ts | 125 + packages/constants/src/ce/index.ts | 5 + packages/constants/src/ce/issues.ts | 34 + .../src/ce/user-permissions/index.ts | 36 + packages/constants/src/core/analytics.ts | 71 + packages/constants/src/{ => core}/auth.ts | 0 packages/constants/src/core/calendar.ts | 109 + packages/constants/src/core/common.ts | 30 + packages/constants/src/core/cycle.ts | 58 + packages/constants/src/core/dashboard.ts | 102 + .../constants/src/core}/empty-state.ts | 502 +-- .../constants/src/{ => core}/endpoints.ts | 4 + packages/constants/src/core/errors.ts | 25 + packages/constants/src/core/event-tracker.ts | 233 ++ packages/constants/src/core/fetch-keys.ts | 275 ++ packages/constants/src/core/filters.ts | 52 + packages/constants/src/core/index.ts | 30 + packages/constants/src/core/issue.ts | 641 ++++ packages/constants/src/core/label.ts | 12 + packages/constants/src/core/module.ts | 83 + packages/constants/src/core/notification.ts | 136 + packages/constants/src/core/page.ts | 34 + packages/constants/src/core/payment.ts | 8 + packages/constants/src/core/profile.ts | 30 + packages/constants/src/core/project.ts | 92 + packages/constants/src/core/seo-variables.ts | 8 + packages/constants/src/core/spreadsheet.ts | 22 + packages/constants/src/core/state.ts | 49 + packages/constants/src/core/swr-config.ts | 7 + packages/constants/src/core/tab-indices.ts | 94 + packages/constants/src/core/themes.ts | 75 + packages/constants/src/core/timezones.ts | 2983 +++++++++++++++++ packages/constants/src/core/views.ts | 23 + .../constants/src/core/workspace-drafts.ts | 6 + packages/constants/src/core/workspace.ts | 140 + packages/constants/src/ee/index.ts | 6 + packages/constants/src/helper.ts | 4 + packages/constants/src/index.ts | 6 +- packages/constants/src/issue.ts | 40 - packages/constants/src/workspace.ts | 76 - packages/constants/tsconfig.json | 10 + packages/eslint-config/next.js | 12 + .../(projects)/analytics/page.tsx | 2 +- .../(projects)/notifications/page.tsx | 2 +- .../[projectId]/cycles/(list)/page.tsx | 2 +- .../(detail)/[projectId]/inbox/page.tsx | 2 +- .../[projectId]/modules/(list)/page.tsx | 2 +- .../[projectId]/pages/(list)/page.tsx | 2 +- .../[projectId]/views/(list)/page.tsx | 2 +- .../(projects)/settings/api-tokens/page.tsx | 2 +- .../(projects)/settings/webhooks/page.tsx | 2 +- web/app/profile/activity/page.tsx | 2 +- .../components/cycles/active-cycle/root.tsx | 2 +- .../command-palette/command-modal.tsx | 2 +- .../core/modals/bulk-delete-issues-modal.tsx | 2 +- .../modals/issue-search-modal-empty-state.tsx | 4 +- .../cycles/active-cycle/cycle-stats.tsx | 2 +- .../cycles/active-cycle/productivity.tsx | 2 +- .../cycles/active-cycle/progress.tsx | 2 +- .../cycles/archived-cycles/root.tsx | 2 +- .../components/empty-state/empty-state.tsx | 12 +- web/core/components/exporter/guide.tsx | 2 +- .../inbox/modals/select-duplicate.tsx | 2 +- web/core/components/inbox/root.tsx | 2 +- web/core/components/inbox/sidebar/root.tsx | 2 +- web/core/components/integration/guide.tsx | 2 +- .../issue-activity/comments/root.tsx | 2 +- .../empty-states/archived-issues.tsx | 2 +- .../issue-layouts/empty-states/cycle.tsx | 2 +- .../empty-states/draft-issues.tsx | 2 +- .../empty-states/global-view.tsx | 5 +- .../issue-layouts/empty-states/module.tsx | 2 +- .../empty-states/profile-view.tsx | 6 +- .../empty-states/project-issues.tsx | 2 +- .../issues/workspace-draft/empty-state.tsx | 2 +- .../issues/workspace-draft/root.tsx | 2 +- .../labels/project-setting-label-list.tsx | 2 +- .../modules/archived-modules/root.tsx | 2 +- .../components/modules/modules-list-view.tsx | 2 +- .../page-views/workspace-dashboard.tsx | 2 +- .../pages/pages-list-main-content.tsx | 2 +- web/core/components/project/card-list.tsx | 2 +- web/core/components/views/views-list.tsx | 2 +- .../sidebar/empty-state.tsx | 2 +- .../layouts/auth-layout/project-wrapper.tsx | 2 +- 89 files changed, 6046 insertions(+), 391 deletions(-) create mode 100644 packages/constants/src/ce/ai.ts create mode 100644 packages/constants/src/ce/auth.ts create mode 100644 packages/constants/src/ce/empty-state.ts create mode 100644 packages/constants/src/ce/estimates.ts create mode 100644 packages/constants/src/ce/index.ts create mode 100644 packages/constants/src/ce/issues.ts create mode 100644 packages/constants/src/ce/user-permissions/index.ts create mode 100644 packages/constants/src/core/analytics.ts rename packages/constants/src/{ => core}/auth.ts (100%) create mode 100644 packages/constants/src/core/calendar.ts create mode 100644 packages/constants/src/core/common.ts create mode 100644 packages/constants/src/core/cycle.ts create mode 100644 packages/constants/src/core/dashboard.ts rename {web/core/constants => packages/constants/src/core}/empty-state.ts (63%) rename packages/constants/src/{ => core}/endpoints.ts (79%) create mode 100644 packages/constants/src/core/errors.ts create mode 100644 packages/constants/src/core/event-tracker.ts create mode 100644 packages/constants/src/core/fetch-keys.ts create mode 100644 packages/constants/src/core/filters.ts create mode 100644 packages/constants/src/core/index.ts create mode 100644 packages/constants/src/core/issue.ts create mode 100644 packages/constants/src/core/label.ts create mode 100644 packages/constants/src/core/module.ts create mode 100644 packages/constants/src/core/notification.ts create mode 100644 packages/constants/src/core/page.ts create mode 100644 packages/constants/src/core/payment.ts create mode 100644 packages/constants/src/core/profile.ts create mode 100644 packages/constants/src/core/project.ts create mode 100644 packages/constants/src/core/seo-variables.ts create mode 100644 packages/constants/src/core/spreadsheet.ts create mode 100644 packages/constants/src/core/state.ts create mode 100644 packages/constants/src/core/swr-config.ts create mode 100644 packages/constants/src/core/tab-indices.ts create mode 100644 packages/constants/src/core/themes.ts create mode 100644 packages/constants/src/core/timezones.ts create mode 100644 packages/constants/src/core/views.ts create mode 100644 packages/constants/src/core/workspace-drafts.ts create mode 100644 packages/constants/src/core/workspace.ts create mode 100644 packages/constants/src/ee/index.ts create mode 100644 packages/constants/src/helper.ts delete mode 100644 packages/constants/src/issue.ts delete mode 100644 packages/constants/src/workspace.ts create mode 100644 packages/constants/tsconfig.json diff --git a/packages/constants/package.json b/packages/constants/package.json index ce02a4946ba..a554fa58de3 100644 --- a/packages/constants/package.json +++ b/packages/constants/package.json @@ -2,5 +2,8 @@ "name": "@plane/constants", "version": "0.24.0", "private": true, - "main": "./src/index.ts" + "main": "./src/index.ts", + "dependencies": { + "@plane/types": "*" + } } diff --git a/packages/constants/src/ce/ai.ts b/packages/constants/src/ce/ai.ts new file mode 100644 index 00000000000..c5c1b04fa9a --- /dev/null +++ b/packages/constants/src/ce/ai.ts @@ -0,0 +1,9 @@ +export enum AI_EDITOR_TASKS { + ASK_ANYTHING = "ASK_ANYTHING", +} + +export const LOADING_TEXTS: { + [key in AI_EDITOR_TASKS]: string; +} = { + [AI_EDITOR_TASKS.ASK_ANYTHING]: "Pi is generating response", +}; diff --git a/packages/constants/src/ce/auth.ts b/packages/constants/src/ce/auth.ts new file mode 100644 index 00000000000..5561a5f8445 --- /dev/null +++ b/packages/constants/src/ce/auth.ts @@ -0,0 +1,4 @@ +export enum EAuthModes { + SIGN_IN = "SIGN_IN", + SIGN_UP = "SIGN_UP", +} \ No newline at end of file diff --git a/packages/constants/src/ce/empty-state.ts b/packages/constants/src/ce/empty-state.ts new file mode 100644 index 00000000000..a5da7ceb482 --- /dev/null +++ b/packages/constants/src/ce/empty-state.ts @@ -0,0 +1,26 @@ +import { mergeEnums } from "../helper"; +import { + EmptyStateDetails, + ECoreEmptyState, + coreEmptyStateDetails, +} from "../core/empty-state"; + +enum EEmptyState {} + +// Create a combined enum +export const EmptyStateType = mergeEnums(ECoreEmptyState, EEmptyState); + +const emptyStateDetails: Record< + EEmptyState, + EmptyStateDetails +> = {} as const; + +export type TEmptyStateType = ECoreEmptyState | EEmptyState; + +export const EMPTY_STATE_DETAILS: Record< + TEmptyStateType, + EmptyStateDetails +> = { + ...coreEmptyStateDetails, + ...emptyStateDetails, +}; diff --git a/packages/constants/src/ce/estimates.ts b/packages/constants/src/ce/estimates.ts new file mode 100644 index 00000000000..7ffe761a8b1 --- /dev/null +++ b/packages/constants/src/ce/estimates.ts @@ -0,0 +1,125 @@ +// types +import { TEstimateSystems } from "@plane/types"; + +export const MAX_ESTIMATE_POINT_INPUT_LENGTH = 20; + +export enum EEstimateSystem { + POINTS = "points", + CATEGORIES = "categories", + TIME = "time", +} + +export enum EEstimateUpdateStages { + CREATE = "create", + EDIT = "edit", + SWITCH = "switch", +} + +export const estimateCount = { + min: 2, + max: 6, +}; + +export const ESTIMATE_SYSTEMS: TEstimateSystems = { + points: { + name: "Points", + templates: { + fibonacci: { + title: "Fibonacci", + values: [ + { id: undefined, key: 1, value: "1" }, + { id: undefined, key: 2, value: "2" }, + { id: undefined, key: 3, value: "3" }, + { id: undefined, key: 4, value: "5" }, + { id: undefined, key: 5, value: "8" }, + { id: undefined, key: 6, value: "13" }, + ], + }, + linear: { + title: "Linear", + values: [ + { id: undefined, key: 1, value: "1" }, + { id: undefined, key: 2, value: "2" }, + { id: undefined, key: 3, value: "3" }, + { id: undefined, key: 4, value: "4" }, + { id: undefined, key: 5, value: "5" }, + { id: undefined, key: 6, value: "6" }, + ], + }, + squares: { + title: "Squares", + values: [ + { id: undefined, key: 1, value: "1" }, + { id: undefined, key: 2, value: "4" }, + { id: undefined, key: 3, value: "9" }, + { id: undefined, key: 4, value: "16" }, + { id: undefined, key: 5, value: "25" }, + { id: undefined, key: 6, value: "36" }, + ], + }, + custom: { + title: "Custom", + values: [ + { id: undefined, key: 1, value: "1" }, + { id: undefined, key: 2, value: "2" }, + ], + hide: true, + }, + }, + is_available: true, + is_ee: false, + }, + categories: { + name: "Categories", + templates: { + t_shirt_sizes: { + title: "T-Shirt Sizes", + values: [ + { id: undefined, key: 1, value: "XS" }, + { id: undefined, key: 2, value: "S" }, + { id: undefined, key: 3, value: "M" }, + { id: undefined, key: 4, value: "L" }, + { id: undefined, key: 5, value: "XL" }, + { id: undefined, key: 6, value: "XXL" }, + ], + }, + easy_to_hard: { + title: "Easy to hard", + values: [ + { id: undefined, key: 1, value: "Easy" }, + { id: undefined, key: 2, value: "Medium" }, + { id: undefined, key: 3, value: "Hard" }, + { id: undefined, key: 4, value: "Very Hard" }, + ], + }, + custom: { + title: "Custom", + values: [ + { id: undefined, key: 1, value: "Easy" }, + { id: undefined, key: 2, value: "Hard" }, + ], + hide: true, + }, + }, + is_available: true, + is_ee: false, + }, + time: { + name: "Time", + templates: { + hours: { + title: "Hours", + values: [ + { id: undefined, key: 1, value: "1" }, + { id: undefined, key: 2, value: "2" }, + { id: undefined, key: 3, value: "3" }, + { id: undefined, key: 4, value: "4" }, + { id: undefined, key: 5, value: "5" }, + { id: undefined, key: 6, value: "6" }, + ], + }, + }, + is_available: false, + is_ee: true, + }, +}; diff --git a/packages/constants/src/ce/index.ts b/packages/constants/src/ce/index.ts new file mode 100644 index 00000000000..4086b51d3e7 --- /dev/null +++ b/packages/constants/src/ce/index.ts @@ -0,0 +1,5 @@ +export * from "./ai"; +export * from "./estimates"; +export * from "./empty-state"; +export * from "./issues"; +export * from "./user-permissions"; diff --git a/packages/constants/src/ce/issues.ts b/packages/constants/src/ce/issues.ts new file mode 100644 index 00000000000..dc6ffbcb8c2 --- /dev/null +++ b/packages/constants/src/ce/issues.ts @@ -0,0 +1,34 @@ +import { TIssueActivityComment } from "@plane/types"; + +export enum EActivityFilterType { + ACTIVITY = "ACTIVITY", + COMMENT = "COMMENT", +} + +export type TActivityFilters = EActivityFilterType; + +export const ACTIVITY_FILTER_TYPE_OPTIONS: Record = { + [EActivityFilterType.ACTIVITY]: { + label: "Updates", + }, + [EActivityFilterType.COMMENT]: { + label: "Comments", + }, +}; + +export const defaultActivityFilters: TActivityFilters[] = [EActivityFilterType.ACTIVITY, EActivityFilterType.COMMENT]; + +export type TActivityFilterOption = { + key: EActivityFilterType; + label: string; + isSelected: boolean; + onClick: () => void; +}; + +export const filterActivityOnSelectedFilters = ( + activity: TIssueActivityComment[], + filter: TActivityFilters[] +): TIssueActivityComment[] => + activity.filter((activity) => filter.includes(activity.activity_type as TActivityFilters)); + +export const ENABLE_ISSUE_DEPENDENCIES = false; diff --git a/packages/constants/src/ce/user-permissions/index.ts b/packages/constants/src/ce/user-permissions/index.ts new file mode 100644 index 00000000000..e37a2aae929 --- /dev/null +++ b/packages/constants/src/ce/user-permissions/index.ts @@ -0,0 +1,36 @@ +export enum EUserPermissionsLevel { + WORKSPACE = "WORKSPACE", + PROJECT = "PROJECT", +} +export type TUserPermissionsLevel = EUserPermissionsLevel; + +export enum EUserPermissions { + ADMIN = 20, + MEMBER = 15, + GUEST = 5, +} +export type TUserPermissions = EUserPermissions; + +export type TUserAllowedPermissionsObject = { + create: TUserPermissions[]; + update: TUserPermissions[]; + delete: TUserPermissions[]; + read: TUserPermissions[]; +}; +export type TUserAllowedPermissions = { + workspace: { + [key: string]: Partial; + }; + project: { + [key: string]: Partial; + }; +}; + +export const USER_ALLOWED_PERMISSIONS: TUserAllowedPermissions = { + workspace: { + dashboard: { + read: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST], + }, + }, + project: {}, +}; diff --git a/packages/constants/src/core/analytics.ts b/packages/constants/src/core/analytics.ts new file mode 100644 index 00000000000..58abd208c63 --- /dev/null +++ b/packages/constants/src/core/analytics.ts @@ -0,0 +1,71 @@ +// types +import { TXAxisValues, TYAxisValues } from "@plane/types"; + +export const ANALYTICS_TABS = [ + { key: "scope_and_demand", title: "Scope and Demand" }, + { key: "custom", title: "Custom Analytics" }, +]; + +export const ANALYTICS_X_AXIS_VALUES: { value: TXAxisValues; label: string }[] = [ + { + value: "state_id", + label: "State name", + }, + { + value: "state__group", + label: "State group", + }, + { + value: "priority", + label: "Priority", + }, + { + value: "labels__id", + label: "Label", + }, + { + value: "assignees__id", + label: "Assignee", + }, + { + value: "estimate_point__value", + label: "Estimate point", + }, + { + value: "issue_cycle__cycle_id", + label: "Cycle", + }, + { + value: "issue_module__module_id", + label: "Module", + }, + { + value: "completed_at", + label: "Completed date", + }, + { + value: "target_date", + label: "Due date", + }, + { + value: "start_date", + label: "Start date", + }, + { + value: "created_at", + label: "Created date", + }, +]; + +export const ANALYTICS_Y_AXIS_VALUES: { value: TYAxisValues; label: string }[] = [ + { + value: "issue_count", + label: "Issue Count", + }, + { + value: "estimate", + label: "Estimate", + }, +]; + +export const DATE_KEYS = ["completed_at", "target_date", "start_date", "created_at"]; diff --git a/packages/constants/src/auth.ts b/packages/constants/src/core/auth.ts similarity index 100% rename from packages/constants/src/auth.ts rename to packages/constants/src/core/auth.ts diff --git a/packages/constants/src/core/calendar.ts b/packages/constants/src/core/calendar.ts new file mode 100644 index 00000000000..b2d0624c564 --- /dev/null +++ b/packages/constants/src/core/calendar.ts @@ -0,0 +1,109 @@ +import { TCalendarLayouts } from "@plane/types"; + +export const MONTHS_LIST: { + [monthNumber: number]: { + shortTitle: string; + title: string; + }; +} = { + 1: { + shortTitle: "Jan", + title: "January", + }, + 2: { + shortTitle: "Feb", + title: "February", + }, + 3: { + shortTitle: "Mar", + title: "March", + }, + 4: { + shortTitle: "Apr", + title: "April", + }, + 5: { + shortTitle: "May", + title: "May", + }, + 6: { + shortTitle: "Jun", + title: "June", + }, + 7: { + shortTitle: "Jul", + title: "July", + }, + 8: { + shortTitle: "Aug", + title: "August", + }, + 9: { + shortTitle: "Sep", + title: "September", + }, + 10: { + shortTitle: "Oct", + title: "October", + }, + 11: { + shortTitle: "Nov", + title: "November", + }, + 12: { + shortTitle: "Dec", + title: "December", + }, +}; + +export const DAYS_LIST: { + [dayIndex: number]: { + shortTitle: string; + title: string; + }; +} = { + 1: { + shortTitle: "Sun", + title: "Sunday", + }, + 2: { + shortTitle: "Mon", + title: "Monday", + }, + 3: { + shortTitle: "Tue", + title: "Tuesday", + }, + 4: { + shortTitle: "Wed", + title: "Wednesday", + }, + 5: { + shortTitle: "Thu", + title: "Thursday", + }, + 6: { + shortTitle: "Fri", + title: "Friday", + }, + 7: { + shortTitle: "Sat", + title: "Saturday", + }, +}; + +export const CALENDAR_LAYOUTS: { + [layout in TCalendarLayouts]: { + key: TCalendarLayouts; + title: string; + }; +} = { + month: { + key: "month", + title: "Month layout", + }, + week: { + key: "week", + title: "Week layout", + }, +}; diff --git a/packages/constants/src/core/common.ts b/packages/constants/src/core/common.ts new file mode 100644 index 00000000000..99dce1b2112 --- /dev/null +++ b/packages/constants/src/core/common.ts @@ -0,0 +1,30 @@ +export const MAX_STATIC_FILE_SIZE = 5 * 1024 * 1024; // 5MB + +export const MARKETING_PRICING_PAGE_LINK = "https://plane.so/pricing"; + +export const MARKETING_CONTACT_US_PAGE_LINK = "https://plane.so/contact"; + +export const MARKETING_PLANE_ONE_PAGE_LINK = "https://plane.so/one"; + +export const PROGRESS_STATE_GROUPS_DETAILS = [ + { + key: "completed_issues", + title: "Completed", + color: "#16A34A", + }, + { + key: "started_issues", + title: "Started", + color: "#F59E0B", + }, + { + key: "unstarted_issues", + title: "Unstarted", + color: "#3A3A3A", + }, + { + key: "backlog_issues", + title: "Backlog", + color: "#A3A3A3", + }, +]; diff --git a/packages/constants/src/core/cycle.ts b/packages/constants/src/core/cycle.ts new file mode 100644 index 00000000000..33b2e4ca5f2 --- /dev/null +++ b/packages/constants/src/core/cycle.ts @@ -0,0 +1,58 @@ +// types +import { TCycleTabOptions } from "@plane/types"; + +export const CYCLE_TABS_LIST: { + key: TCycleTabOptions; + name: string; +}[] = [ + { + key: "active", + name: "Active", + }, + { + key: "all", + name: "All", + }, +]; + +export const CYCLE_STATUS: { + label: string; + value: "current" | "upcoming" | "completed" | "draft"; + title: string; + color: string; + textColor: string; + bgColor: string; +}[] = [ + { + label: "day left", + value: "current", + title: "In progress", + color: "#F59E0B", + textColor: "text-amber-500", + bgColor: "bg-amber-50", + }, + { + label: "Yet to start", + value: "upcoming", + title: "Yet to start", + color: "#3F76FF", + textColor: "text-blue-500", + bgColor: "bg-indigo-50", + }, + { + label: "Completed", + value: "completed", + title: "Completed", + color: "#16A34A", + textColor: "text-green-600", + bgColor: "bg-green-50", + }, + { + label: "Draft", + value: "draft", + title: "Draft", + color: "#525252", + textColor: "text-custom-text-300", + bgColor: "bg-custom-background-90", + }, +]; diff --git a/packages/constants/src/core/dashboard.ts b/packages/constants/src/core/dashboard.ts new file mode 100644 index 00000000000..16a626e1bc0 --- /dev/null +++ b/packages/constants/src/core/dashboard.ts @@ -0,0 +1,102 @@ +"use client"; + +// types +import { TIssuesListTypes, TStateGroups } from "@plane/types"; + +export const STATE_GROUP_GRAPH_COLORS: Record = { + backlog: "#CDCED6", + unstarted: "#80838D", + started: "#FFC53D", + completed: "#3E9B4F", + cancelled: "#E5484D", +}; + +export enum EDurationFilters { + NONE = "none", + TODAY = "today", + THIS_WEEK = "this_week", + THIS_MONTH = "this_month", + THIS_YEAR = "this_year", + CUSTOM = "custom", +} + +// filter duration options +export const DURATION_FILTER_OPTIONS: { + key: EDurationFilters; + label: string; +}[] = [ + { + key: EDurationFilters.NONE, + label: "All time", + }, + { + key: EDurationFilters.TODAY, + label: "Due today", + }, + { + key: EDurationFilters.THIS_WEEK, + label: "Due this week", + }, + { + key: EDurationFilters.THIS_MONTH, + label: "Due this month", + }, + { + key: EDurationFilters.THIS_YEAR, + label: "Due this year", + }, + { + key: EDurationFilters.CUSTOM, + label: "Custom", + }, +]; + +// random background colors for project cards +export const PROJECT_BACKGROUND_COLORS = [ + "bg-gray-500/20", + "bg-green-500/20", + "bg-red-500/20", + "bg-orange-500/20", + "bg-blue-500/20", + "bg-yellow-500/20", + "bg-pink-500/20", + "bg-purple-500/20", +]; + +// assigned and created issues widgets tabs list +export const FILTERED_ISSUES_TABS_LIST: { + key: TIssuesListTypes; + label: string; +}[] = [ + { + key: "upcoming", + label: "Upcoming", + }, + { + key: "overdue", + label: "Overdue", + }, + { + key: "completed", + label: "Marked completed", + }, +]; + +// assigned and created issues widgets tabs list +export const UNFILTERED_ISSUES_TABS_LIST: { + key: TIssuesListTypes; + label: string; +}[] = [ + { + key: "pending", + label: "Pending", + }, + { + key: "completed", + label: "Marked completed", + }, +]; + +export type TLinkOptions = { + userId: string | undefined; +}; diff --git a/web/core/constants/empty-state.ts b/packages/constants/src/core/empty-state.ts similarity index 63% rename from web/core/constants/empty-state.ts rename to packages/constants/src/core/empty-state.ts index a86b18870ad..34a889555a5 100644 --- a/web/core/constants/empty-state.ts +++ b/packages/constants/src/core/empty-state.ts @@ -1,7 +1,8 @@ -import { EUserPermissions } from "ee/constants/user-permissions"; +// types +import { EUserPermissions } from "../ce/user-permissions"; -export interface EmptyStateDetails { - key: EmptyStateType; +export interface EmptyStateDetails { + key: T; title?: string; description?: string; path?: string; @@ -22,10 +23,10 @@ export interface EmptyStateDetails { }; }; accessType?: "workspace" | "project"; - access?: any; + access?: EUserPermissions[]; } -export enum EmptyStateType { +export enum ECoreEmptyState { WORKSPACE_DASHBOARD = "workspace-dashboard", WORKSPACE_ANALYTICS = "workspace-analytics", WORKSPACE_PROJECTS = "workspace-projects", @@ -110,10 +111,13 @@ export enum EmptyStateType { WORKSPACE_DRAFT_ISSUES = "workspace-draft-issues", } -const emptyStateDetails = { +export const coreEmptyStateDetails: Record< + ECoreEmptyState, + EmptyStateDetails +> = { // workspace - [EmptyStateType.WORKSPACE_DASHBOARD]: { - key: EmptyStateType.WORKSPACE_DASHBOARD, + [ECoreEmptyState.WORKSPACE_DASHBOARD]: { + key: ECoreEmptyState.WORKSPACE_DASHBOARD, title: "Overview of your projects, activity, and metrics", description: " Welcome to Plane, we are excited to have you here. Create your first project and track your issues, and this page will transform into a space that helps you progress. Admins will also see items which help their team progress.", @@ -123,16 +127,18 @@ const emptyStateDetails = { text: "Build your first project", comicBox: { title: "Everything starts with a project in Plane", - description: "A project could be a product’s roadmap, a marketing campaign, or launching a new car.", + description: + "A project could be a product’s roadmap, a marketing campaign, or launching a new car.", }, }, accessType: "workspace", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.WORKSPACE_ANALYTICS]: { - key: EmptyStateType.WORKSPACE_ANALYTICS, - title: "Track progress, workloads, and allocations. Spot trends, remove blockers, and move work faster", + [ECoreEmptyState.WORKSPACE_ANALYTICS]: { + key: ECoreEmptyState.WORKSPACE_ANALYTICS, + title: + "Track progress, workloads, and allocations. Spot trends, remove blockers, and move work faster", description: "See scope versus demand, estimates, and scope creep. Get performance by team members and teams, and make sure your project runs on time.", path: "/empty-state/onboarding/analytics", @@ -147,8 +153,8 @@ const emptyStateDetails = { accessType: "workspace", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.WORKSPACE_PROJECTS]: { - key: EmptyStateType.WORKSPACE_PROJECTS, + [ECoreEmptyState.WORKSPACE_PROJECTS]: { + key: ECoreEmptyState.WORKSPACE_PROJECTS, title: "No active projects", description: "Think of each project as the parent for goal-oriented work. Projects are where Jobs, Cycles, and Modules live and, along with your colleagues, help you achieve that goal. Create a new project or filter for archived projects.", @@ -157,17 +163,19 @@ const emptyStateDetails = { text: "Start your first project", comicBox: { title: "Everything starts with a project in Plane", - description: "A project could be a product’s roadmap, a marketing campaign, or launching a new car.", + description: + "A project could be a product’s roadmap, a marketing campaign, or launching a new car.", }, }, accessType: "workspace", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, // all-issues - [EmptyStateType.WORKSPACE_ALL_ISSUES]: { - key: EmptyStateType.WORKSPACE_ALL_ISSUES, + [ECoreEmptyState.WORKSPACE_ALL_ISSUES]: { + key: ECoreEmptyState.WORKSPACE_ALL_ISSUES, title: "No issues in the project", - description: "First project done! Now, slice your work into trackable pieces with issues. Let's go!", + description: + "First project done! Now, slice your work into trackable pieces with issues. Let's go!", path: "/empty-state/all-issues/all-issues", primaryButton: { text: "Create new issue", @@ -175,8 +183,8 @@ const emptyStateDetails = { accessType: "workspace", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.WORKSPACE_ASSIGNED]: { - key: EmptyStateType.WORKSPACE_ASSIGNED, + [ECoreEmptyState.WORKSPACE_ASSIGNED]: { + key: ECoreEmptyState.WORKSPACE_ASSIGNED, title: "No issues yet", description: "Issues assigned to you can be tracked from here.", path: "/empty-state/all-issues/assigned", @@ -186,10 +194,11 @@ const emptyStateDetails = { accessType: "workspace", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.WORKSPACE_CREATED]: { - key: EmptyStateType.WORKSPACE_CREATED, + [ECoreEmptyState.WORKSPACE_CREATED]: { + key: ECoreEmptyState.WORKSPACE_CREATED, title: "No issues yet", - description: "All issues created by you come here, track them here directly.", + description: + "All issues created by you come here, track them here directly.", path: "/empty-state/all-issues/created", primaryButton: { text: "Create new issue", @@ -197,123 +206,135 @@ const emptyStateDetails = { accessType: "workspace", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.WORKSPACE_SUBSCRIBED]: { - key: EmptyStateType.WORKSPACE_SUBSCRIBED, + [ECoreEmptyState.WORKSPACE_SUBSCRIBED]: { + key: ECoreEmptyState.WORKSPACE_SUBSCRIBED, title: "No issues yet", - description: "Subscribe to issues you are interested in, track all of them here.", + description: + "Subscribe to issues you are interested in, track all of them here.", path: "/empty-state/all-issues/subscribed", }, - [EmptyStateType.WORKSPACE_CUSTOM_VIEW]: { - key: EmptyStateType.WORKSPACE_CUSTOM_VIEW, + [ECoreEmptyState.WORKSPACE_CUSTOM_VIEW]: { + key: ECoreEmptyState.WORKSPACE_CUSTOM_VIEW, title: "No issues yet", description: "Issues that applies to the filters, track all of them here.", path: "/empty-state/all-issues/custom-view", }, - [EmptyStateType.WORKSPACE_PROJECT_NOT_FOUND]: { - key: EmptyStateType.WORKSPACE_PROJECT_NOT_FOUND, + [ECoreEmptyState.WORKSPACE_PROJECT_NOT_FOUND]: { + key: ECoreEmptyState.WORKSPACE_PROJECT_NOT_FOUND, title: "No such project exists", - description: 'To create issues or manage your work, you need to create a project or be a part of one.', + description: + "To create issues or manage your work, you need to create a project or be a part of one.", path: "/empty-state/onboarding/projects", primaryButton: { text: "Create Project", comicBox: { title: "Everything starts with a project in Plane", - description: "A project could be a product’s roadmap, a marketing campaign, or launching a new car.", + description: + "A project could be a product’s roadmap, a marketing campaign, or launching a new car.", }, }, accessType: "workspace", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.WORKSPACE_NO_PROJECTS]: { - key: EmptyStateType.WORKSPACE_NO_PROJECTS, + [ECoreEmptyState.WORKSPACE_NO_PROJECTS]: { + key: ECoreEmptyState.WORKSPACE_NO_PROJECTS, title: "No project", - description: "To create issues or manage your work, you need to create a project or be a part of one.", + description: + "To create issues or manage your work, you need to create a project or be a part of one.", path: "/empty-state/onboarding/projects", primaryButton: { text: "Start your first project", comicBox: { title: "Everything starts with a project in Plane", - description: "A project could be a product’s roadmap, a marketing campaign, or launching a new car.", + description: + "A project could be a product’s roadmap, a marketing campaign, or launching a new car.", }, }, accessType: "workspace", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, // workspace settings - [EmptyStateType.WORKSPACE_SETTINGS_API_TOKENS]: { - key: EmptyStateType.WORKSPACE_SETTINGS_API_TOKENS, + [ECoreEmptyState.WORKSPACE_SETTINGS_API_TOKENS]: { + key: ECoreEmptyState.WORKSPACE_SETTINGS_API_TOKENS, title: "No API tokens created", description: "Plane APIs can be used to integrate your data in Plane with any external system. Create a token to get started.", path: "/empty-state/workspace-settings/api-tokens", }, - [EmptyStateType.WORKSPACE_SETTINGS_WEBHOOKS]: { - key: EmptyStateType.WORKSPACE_SETTINGS_WEBHOOKS, + [ECoreEmptyState.WORKSPACE_SETTINGS_WEBHOOKS]: { + key: ECoreEmptyState.WORKSPACE_SETTINGS_WEBHOOKS, title: "No webhooks added", - description: "Create webhooks to receive real-time updates and automate actions.", + description: + "Create webhooks to receive real-time updates and automate actions.", path: "/empty-state/workspace-settings/webhooks", }, - [EmptyStateType.WORKSPACE_SETTINGS_EXPORT]: { - key: EmptyStateType.WORKSPACE_SETTINGS_EXPORT, + [ECoreEmptyState.WORKSPACE_SETTINGS_EXPORT]: { + key: ECoreEmptyState.WORKSPACE_SETTINGS_EXPORT, title: "No previous exports yet", - description: "Anytime you export, you will also have a copy here for reference.", + description: + "Anytime you export, you will also have a copy here for reference.", path: "/empty-state/workspace-settings/exports", }, - [EmptyStateType.WORKSPACE_SETTINGS_IMPORT]: { - key: EmptyStateType.WORKSPACE_SETTINGS_IMPORT, + [ECoreEmptyState.WORKSPACE_SETTINGS_IMPORT]: { + key: ECoreEmptyState.WORKSPACE_SETTINGS_IMPORT, title: "No previous imports yet", description: "Find all your previous imports here and download them.", path: "/empty-state/workspace-settings/imports", }, // profile - [EmptyStateType.PROFILE_ACTIVITY]: { - key: EmptyStateType.PROFILE_ASSIGNED, + [ECoreEmptyState.PROFILE_ACTIVITY]: { + key: ECoreEmptyState.PROFILE_ASSIGNED, title: "No activities yet", description: "Get started by creating a new issue! Add details and properties to it. Explore more in Plane to see your activity.", path: "/empty-state/profile/activity", }, - [EmptyStateType.PROFILE_ASSIGNED]: { - key: EmptyStateType.PROFILE_ASSIGNED, + [ECoreEmptyState.PROFILE_ASSIGNED]: { + key: ECoreEmptyState.PROFILE_ASSIGNED, title: "No issues are assigned to you", description: "Issues assigned to you can be tracked from here.", path: "/empty-state/profile/assigned", }, - [EmptyStateType.PROFILE_CREATED]: { - key: EmptyStateType.PROFILE_CREATED, + [ECoreEmptyState.PROFILE_CREATED]: { + key: ECoreEmptyState.PROFILE_CREATED, title: "No issues yet", - description: "All issues created by you come here, track them here directly.", + description: + "All issues created by you come here, track them here directly.", path: "/empty-state/profile/created", }, - [EmptyStateType.PROFILE_SUBSCRIBED]: { - key: EmptyStateType.PROFILE_SUBSCRIBED, + [ECoreEmptyState.PROFILE_SUBSCRIBED]: { + key: ECoreEmptyState.PROFILE_SUBSCRIBED, title: "No issues yet", - description: "Subscribe to issues you are interested in, track all of them here.", + description: + "Subscribe to issues you are interested in, track all of them here.", path: "/empty-state/profile/subscribed", }, // project settings - [EmptyStateType.PROJECT_SETTINGS_LABELS]: { - key: EmptyStateType.PROJECT_SETTINGS_LABELS, + [ECoreEmptyState.PROJECT_SETTINGS_LABELS]: { + key: ECoreEmptyState.PROJECT_SETTINGS_LABELS, title: "No labels yet", - description: "Create labels to help organize and filter issues in you project.", + description: + "Create labels to help organize and filter issues in you project.", path: "/empty-state/project-settings/labels", }, - [EmptyStateType.PROJECT_SETTINGS_INTEGRATIONS]: { - key: EmptyStateType.PROJECT_SETTINGS_INTEGRATIONS, + [ECoreEmptyState.PROJECT_SETTINGS_INTEGRATIONS]: { + key: ECoreEmptyState.PROJECT_SETTINGS_INTEGRATIONS, title: "No integrations configured", - description: "Configure GitHub and other integrations to sync your project issues.", + description: + "Configure GitHub and other integrations to sync your project issues.", path: "/empty-state/project-settings/integrations", }, - [EmptyStateType.PROJECT_SETTINGS_ESTIMATE]: { - key: EmptyStateType.PROJECT_SETTINGS_ESTIMATE, + [ECoreEmptyState.PROJECT_SETTINGS_ESTIMATE]: { + key: ECoreEmptyState.PROJECT_SETTINGS_ESTIMATE, title: "No estimates added", - description: "Create a set of estimates to communicate the amount of work per issue.", + description: + "Create a set of estimates to communicate the amount of work per issue.", path: "/empty-state/project-settings/estimates", }, // project cycles - [EmptyStateType.PROJECT_CYCLES]: { - key: EmptyStateType.PROJECT_CYCLES, + [ECoreEmptyState.PROJECT_CYCLES]: { + key: ECoreEmptyState.PROJECT_CYCLES, title: "Group and timebox your work in Cycles.", description: "Break work down by timeboxed chunks, work backwards from your project deadline to set dates, and make tangible progress as a team.", @@ -329,10 +350,11 @@ const emptyStateDetails = { accessType: "project", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.PROJECT_CYCLE_NO_ISSUES]: { - key: EmptyStateType.PROJECT_CYCLE_NO_ISSUES, + [ECoreEmptyState.PROJECT_CYCLE_NO_ISSUES]: { + key: ECoreEmptyState.PROJECT_CYCLE_NO_ISSUES, title: "No issues added to the cycle", - description: "Add or create issues you wish to timebox and deliver within this cycle", + description: + "Add or create issues you wish to timebox and deliver within this cycle", path: "/empty-state/cycle-issues/", primaryButton: { text: "Create new issue ", @@ -343,36 +365,37 @@ const emptyStateDetails = { accessType: "project", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.PROJECT_CYCLE_ACTIVE]: { - key: EmptyStateType.PROJECT_CYCLE_ACTIVE, + [ECoreEmptyState.PROJECT_CYCLE_ACTIVE]: { + key: ECoreEmptyState.PROJECT_CYCLE_ACTIVE, title: "No active cycle", description: "An active cycle includes any period that encompasses today's date within its range. Find the progress and details of the active cycle here.", path: "/empty-state/cycle/active", }, - [EmptyStateType.PROJECT_CYCLE_COMPLETED_NO_ISSUES]: { - key: EmptyStateType.PROJECT_CYCLE_COMPLETED_NO_ISSUES, + [ECoreEmptyState.PROJECT_CYCLE_COMPLETED_NO_ISSUES]: { + key: ECoreEmptyState.PROJECT_CYCLE_COMPLETED_NO_ISSUES, title: "No issues in the cycle", description: "No issues in the cycle. Issues are either transferred or hidden. To see hidden issues if any, update your display properties accordingly.", path: "/empty-state/cycle/completed-no-issues", }, - [EmptyStateType.PROJECT_ARCHIVED_NO_CYCLES]: { - key: EmptyStateType.PROJECT_ARCHIVED_NO_CYCLES, + [ECoreEmptyState.PROJECT_ARCHIVED_NO_CYCLES]: { + key: ECoreEmptyState.PROJECT_ARCHIVED_NO_CYCLES, title: "No archived cycles yet", - description: "To tidy up your project, archive completed cycles. Find them here once archived.", + description: + "To tidy up your project, archive completed cycles. Find them here once archived.", path: "/empty-state/archived/empty-cycles", }, - [EmptyStateType.PROJECT_CYCLE_ALL]: { - key: EmptyStateType.PROJECT_CYCLE_ALL, + [ECoreEmptyState.PROJECT_CYCLE_ALL]: { + key: ECoreEmptyState.PROJECT_CYCLE_ALL, title: "No cycles", description: "An active cycle includes any period that encompasses today's date within its range. Find the progress and details of the active cycle here.", path: "/empty-state/cycle/active", }, // empty filters - [EmptyStateType.PROJECT_EMPTY_FILTER]: { - key: EmptyStateType.PROJECT_EMPTY_FILTER, + [ECoreEmptyState.PROJECT_EMPTY_FILTER]: { + key: ECoreEmptyState.PROJECT_EMPTY_FILTER, title: "No issues found matching the filters applied", path: "/empty-state/empty-filters/", secondaryButton: { @@ -381,8 +404,8 @@ const emptyStateDetails = { accessType: "project", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.PROJECT_ARCHIVED_EMPTY_FILTER]: { - key: EmptyStateType.PROJECT_ARCHIVED_EMPTY_FILTER, + [ECoreEmptyState.PROJECT_ARCHIVED_EMPTY_FILTER]: { + key: ECoreEmptyState.PROJECT_ARCHIVED_EMPTY_FILTER, title: "No issues found matching the filters applied", path: "/empty-state/empty-filters/", secondaryButton: { @@ -391,8 +414,8 @@ const emptyStateDetails = { accessType: "project", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.PROJECT_DRAFT_EMPTY_FILTER]: { - key: EmptyStateType.PROJECT_DRAFT_EMPTY_FILTER, + [ECoreEmptyState.PROJECT_DRAFT_EMPTY_FILTER]: { + key: ECoreEmptyState.PROJECT_DRAFT_EMPTY_FILTER, title: "No issues found matching the filters applied", path: "/empty-state/empty-filters/", secondaryButton: { @@ -402,8 +425,8 @@ const emptyStateDetails = { access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, // project issues - [EmptyStateType.PROJECT_NO_ISSUES]: { - key: EmptyStateType.PROJECT_NO_ISSUES, + [ECoreEmptyState.PROJECT_NO_ISSUES]: { + key: ECoreEmptyState.PROJECT_NO_ISSUES, title: "Create an issue and assign it to someone, even yourself", description: "Think of issues as jobs, tasks, work, or JTBD. Which we like. An issue and its sub-issues are usually time-based actionables assigned to members of your team. Your team creates, assigns, and completes issues to move your project towards its goal.", @@ -419,8 +442,8 @@ const emptyStateDetails = { accessType: "project", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.PROJECT_ARCHIVED_NO_ISSUES]: { - key: EmptyStateType.PROJECT_ARCHIVED_NO_ISSUES, + [ECoreEmptyState.PROJECT_ARCHIVED_NO_ISSUES]: { + key: ECoreEmptyState.PROJECT_ARCHIVED_NO_ISSUES, title: "No archived issues yet", description: "Manually or through automation, you can archive issues that are completed or cancelled. Find them here once archived.", @@ -431,36 +454,40 @@ const emptyStateDetails = { accessType: "project", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.PROJECT_DRAFT_NO_ISSUES]: { - key: EmptyStateType.PROJECT_DRAFT_NO_ISSUES, + [ECoreEmptyState.PROJECT_DRAFT_NO_ISSUES]: { + key: ECoreEmptyState.PROJECT_DRAFT_NO_ISSUES, title: "No draft issues yet", description: "Quickly stepping away but want to keep your place? No worries – save a draft now. Your issues will be right here waiting for you.", path: "/empty-state/draft/draft-issues-empty", }, - [EmptyStateType.VIEWS_EMPTY_SEARCH]: { - key: EmptyStateType.VIEWS_EMPTY_SEARCH, + [ECoreEmptyState.VIEWS_EMPTY_SEARCH]: { + key: ECoreEmptyState.VIEWS_EMPTY_SEARCH, title: "No matching views", - description: "No views match the search criteria. \n Create a new view instead.", + description: + "No views match the search criteria. \n Create a new view instead.", path: "/empty-state/search/views", }, - [EmptyStateType.PROJECTS_EMPTY_SEARCH]: { - key: EmptyStateType.PROJECTS_EMPTY_SEARCH, + [ECoreEmptyState.PROJECTS_EMPTY_SEARCH]: { + key: ECoreEmptyState.PROJECTS_EMPTY_SEARCH, title: "No matching projects", - description: "No projects detected with the matching criteria. Create a new project instead.", + description: + "No projects detected with the matching criteria. Create a new project instead.", path: "/empty-state/search/project", }, - [EmptyStateType.MEMBERS_EMPTY_SEARCH]: { - key: EmptyStateType.MEMBERS_EMPTY_SEARCH, + [ECoreEmptyState.MEMBERS_EMPTY_SEARCH]: { + key: ECoreEmptyState.MEMBERS_EMPTY_SEARCH, title: "No matching members", - description: "Add them to the project if they are already a part of the workspace", + description: + "Add them to the project if they are already a part of the workspace", path: "/empty-state/search/member", }, // project module - [EmptyStateType.PROJECT_MODULE_ISSUES]: { - key: EmptyStateType.PROJECT_MODULE_ISSUES, + [ECoreEmptyState.PROJECT_MODULE_ISSUES]: { + key: ECoreEmptyState.PROJECT_MODULE_ISSUES, title: "No issues in the module", - description: "Create or add issues which you want to accomplish as part of this module", + description: + "Create or add issues which you want to accomplish as part of this module", path: "/empty-state/module-issues/", primaryButton: { text: "Create new issue ", @@ -471,9 +498,10 @@ const emptyStateDetails = { accessType: "project", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.PROJECT_MODULE]: { - key: EmptyStateType.PROJECT_MODULE, - title: "Map your project milestones to Modules and track aggregated work easily.", + [ECoreEmptyState.PROJECT_MODULE]: { + key: ECoreEmptyState.PROJECT_MODULE, + title: + "Map your project milestones to Modules and track aggregated work easily.", description: "A group of issues that belong to a logical, hierarchical parent form a module. Think of them as a way to track work by project milestones. They have their own periods and deadlines as well as analytics to help you see how close or far you are from a milestone.", path: "/empty-state/onboarding/modules", @@ -481,21 +509,23 @@ const emptyStateDetails = { text: "Build your first module", comicBox: { title: "Modules help group work by hierarchy.", - description: "A cart module, a chassis module, and a warehouse module are all good example of this grouping.", + description: + "A cart module, a chassis module, and a warehouse module are all good example of this grouping.", }, }, accessType: "project", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, - [EmptyStateType.PROJECT_ARCHIVED_NO_MODULES]: { - key: EmptyStateType.PROJECT_ARCHIVED_NO_MODULES, + [ECoreEmptyState.PROJECT_ARCHIVED_NO_MODULES]: { + key: ECoreEmptyState.PROJECT_ARCHIVED_NO_MODULES, title: "No archived Modules yet", - description: "To tidy up your project, archive completed or cancelled modules. Find them here once archived.", + description: + "To tidy up your project, archive completed or cancelled modules. Find them here once archived.", path: "/empty-state/archived/empty-modules", }, // project views - [EmptyStateType.PROJECT_VIEW]: { - key: EmptyStateType.PROJECT_VIEW, + [ECoreEmptyState.PROJECT_VIEW]: { + key: ECoreEmptyState.PROJECT_VIEW, title: "Save filtered views for your project. Create as many as you need", description: "Views are a set of saved filters that you use frequently or want easy access to. All your colleagues in a project can see everyone’s views and choose whichever suits their needs best.", @@ -504,16 +534,22 @@ const emptyStateDetails = { text: "Create your first view", comicBox: { title: "Views work atop Issue properties.", - description: "You can create a view from here with as many properties as filters as you see fit.", + description: + "You can create a view from here with as many properties as filters as you see fit.", }, }, accessType: "project", - access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST], + access: [ + EUserPermissions.ADMIN, + EUserPermissions.MEMBER, + EUserPermissions.GUEST, + ], }, // project pages - [EmptyStateType.PROJECT_PAGE]: { - key: EmptyStateType.PROJECT_PAGE, - title: "Write a note, a doc, or a full knowledge base. Get Galileo, Plane’s AI assistant, to help you get started", + [ECoreEmptyState.PROJECT_PAGE]: { + key: ECoreEmptyState.PROJECT_PAGE, + title: + "Write a note, a doc, or a full knowledge base. Get Galileo, Plane’s AI assistant, to help you get started", description: "Pages are thoughts potting space in Plane. Take down meeting notes, format them easily, embed issues, lay them out using a library of components, and keep them all in your project’s context. To make short work of any doc, invoke Galileo, Plane’s AI, with a shortcut or the click of a button.", path: "/empty-state/onboarding/pages", @@ -521,21 +557,30 @@ const emptyStateDetails = { text: "Create your first page", }, accessType: "project", - access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST], - }, - [EmptyStateType.PROJECT_PAGE_PRIVATE]: { - key: EmptyStateType.PROJECT_PAGE_PRIVATE, + access: [ + EUserPermissions.ADMIN, + EUserPermissions.MEMBER, + EUserPermissions.GUEST, + ], + }, + [ECoreEmptyState.PROJECT_PAGE_PRIVATE]: { + key: ECoreEmptyState.PROJECT_PAGE_PRIVATE, title: "No private pages yet", - description: "Keep your private thoughts here. When you're ready to share, the team's just a click away.", + description: + "Keep your private thoughts here. When you're ready to share, the team's just a click away.", path: "/empty-state/pages/private", primaryButton: { text: "Create your first page", }, accessType: "project", - access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST], - }, - [EmptyStateType.PROJECT_PAGE_PUBLIC]: { - key: EmptyStateType.PROJECT_PAGE_PUBLIC, + access: [ + EUserPermissions.ADMIN, + EUserPermissions.MEMBER, + EUserPermissions.GUEST, + ], + }, + [ECoreEmptyState.PROJECT_PAGE_PUBLIC]: { + key: ECoreEmptyState.PROJECT_PAGE_PUBLIC, title: "No public pages yet", description: "See pages shared with everyone in your project right here.", path: "/empty-state/pages/public", @@ -543,17 +588,23 @@ const emptyStateDetails = { text: "Create your first page", }, accessType: "project", - access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST], - }, - [EmptyStateType.PROJECT_PAGE_ARCHIVED]: { - key: EmptyStateType.PROJECT_PAGE_ARCHIVED, + access: [ + EUserPermissions.ADMIN, + EUserPermissions.MEMBER, + EUserPermissions.GUEST, + ], + }, + [ECoreEmptyState.PROJECT_PAGE_ARCHIVED]: { + key: ECoreEmptyState.PROJECT_PAGE_ARCHIVED, title: "No archived pages yet", - description: "Archive pages not on your radar. Access them here when needed.", + description: + "Archive pages not on your radar. Access them here when needed.", path: "/empty-state/pages/archived", }, - [EmptyStateType.WORKSPACE_PAGE]: { - key: EmptyStateType.WORKSPACE_PAGE, - title: "Write a note, a doc, or a full knowledge base. Get Galileo, Plane’s AI assistant, to help you get started", + [ECoreEmptyState.WORKSPACE_PAGE]: { + key: ECoreEmptyState.WORKSPACE_PAGE, + title: + "Write a note, a doc, or a full knowledge base. Get Galileo, Plane’s AI assistant, to help you get started", description: "Pages are thoughts potting space in Plane. Take down meeting notes, format them easily, embed issues, lay them out using a library of components, and keep them all in your project’s context. To make short work of any doc, invoke Galileo, Plane’s AI, with a shortcut or the click of a button.", path: "/empty-state/onboarding/pages", @@ -561,21 +612,30 @@ const emptyStateDetails = { text: "Create your first page", }, accessType: "workspace", - access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST], - }, - [EmptyStateType.WORKSPACE_PAGE_PRIVATE]: { - key: EmptyStateType.WORKSPACE_PAGE_PRIVATE, + access: [ + EUserPermissions.ADMIN, + EUserPermissions.MEMBER, + EUserPermissions.GUEST, + ], + }, + [ECoreEmptyState.WORKSPACE_PAGE_PRIVATE]: { + key: ECoreEmptyState.WORKSPACE_PAGE_PRIVATE, title: "No private pages yet", - description: "Keep your private thoughts here. When you're ready to share, the team's just a click away.", + description: + "Keep your private thoughts here. When you're ready to share, the team's just a click away.", path: "/empty-state/pages/private", primaryButton: { text: "Create your first page", }, accessType: "workspace", - access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST], - }, - [EmptyStateType.WORKSPACE_PAGE_PUBLIC]: { - key: EmptyStateType.WORKSPACE_PAGE_PUBLIC, + access: [ + EUserPermissions.ADMIN, + EUserPermissions.MEMBER, + EUserPermissions.GUEST, + ], + }, + [ECoreEmptyState.WORKSPACE_PAGE_PUBLIC]: { + key: ECoreEmptyState.WORKSPACE_PAGE_PUBLIC, title: "No public pages yet", description: "See pages shared with everyone in your workspace right here.", path: "/empty-state/pages/public", @@ -583,118 +643,129 @@ const emptyStateDetails = { text: "Create your first page", }, accessType: "workspace", - access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST], - }, - [EmptyStateType.WORKSPACE_PAGE_ARCHIVED]: { - key: EmptyStateType.WORKSPACE_PAGE_ARCHIVED, + access: [ + EUserPermissions.ADMIN, + EUserPermissions.MEMBER, + EUserPermissions.GUEST, + ], + }, + [ECoreEmptyState.WORKSPACE_PAGE_ARCHIVED]: { + key: ECoreEmptyState.WORKSPACE_PAGE_ARCHIVED, title: "No archived pages yet", - description: "Archive pages not on your radar. Access them here when needed.", + description: + "Archive pages not on your radar. Access them here when needed.", path: "/empty-state/pages/archived", }, - [EmptyStateType.COMMAND_K_SEARCH_EMPTY_STATE]: { - key: EmptyStateType.COMMAND_K_SEARCH_EMPTY_STATE, + [ECoreEmptyState.COMMAND_K_SEARCH_EMPTY_STATE]: { + key: ECoreEmptyState.COMMAND_K_SEARCH_EMPTY_STATE, title: "No results found", path: "/empty-state/search/search", }, - [EmptyStateType.ISSUE_RELATION_SEARCH_EMPTY_STATE]: { - key: EmptyStateType.ISSUE_RELATION_SEARCH_EMPTY_STATE, + [ECoreEmptyState.ISSUE_RELATION_SEARCH_EMPTY_STATE]: { + key: ECoreEmptyState.ISSUE_RELATION_SEARCH_EMPTY_STATE, title: "No maching issues found", path: "/empty-state/search/search", }, - [EmptyStateType.ISSUE_RELATION_EMPTY_STATE]: { - key: EmptyStateType.ISSUE_RELATION_EMPTY_STATE, + [ECoreEmptyState.ISSUE_RELATION_EMPTY_STATE]: { + key: ECoreEmptyState.ISSUE_RELATION_EMPTY_STATE, title: "No issues found", path: "/empty-state/search/issues", }, - [EmptyStateType.ISSUE_COMMENT_EMPTY_STATE]: { - key: EmptyStateType.ISSUE_COMMENT_EMPTY_STATE, + [ECoreEmptyState.ISSUE_COMMENT_EMPTY_STATE]: { + key: ECoreEmptyState.ISSUE_COMMENT_EMPTY_STATE, title: "No comments yet", - description: "Comments can be used as a discussion and \n follow-up space for the issues", + description: + "Comments can be used as a discussion and \n follow-up space for the issues", path: "/empty-state/search/comments", }, - [EmptyStateType.NOTIFICATION_DETAIL_EMPTY_STATE]: { - key: EmptyStateType.INBOX_DETAIL_EMPTY_STATE, + [ECoreEmptyState.NOTIFICATION_DETAIL_EMPTY_STATE]: { + key: ECoreEmptyState.INBOX_DETAIL_EMPTY_STATE, title: "Select to view details.", path: "/empty-state/intake/issue-detail", }, - [EmptyStateType.NOTIFICATION_ALL_EMPTY_STATE]: { - key: EmptyStateType.NOTIFICATION_ALL_EMPTY_STATE, + [ECoreEmptyState.NOTIFICATION_ALL_EMPTY_STATE]: { + key: ECoreEmptyState.NOTIFICATION_ALL_EMPTY_STATE, title: "No issues assigned", description: "Updates for issues assigned to you can be \n seen here", path: "/empty-state/search/notification", }, - [EmptyStateType.NOTIFICATION_MENTIONS_EMPTY_STATE]: { - key: EmptyStateType.NOTIFICATION_MENTIONS_EMPTY_STATE, + [ECoreEmptyState.NOTIFICATION_MENTIONS_EMPTY_STATE]: { + key: ECoreEmptyState.NOTIFICATION_MENTIONS_EMPTY_STATE, title: "No issues assigned", description: "Updates for issues assigned to you can be \n seen here", path: "/empty-state/search/notification", }, - [EmptyStateType.NOTIFICATION_MY_ISSUE_EMPTY_STATE]: { - key: EmptyStateType.NOTIFICATION_MY_ISSUE_EMPTY_STATE, + [ECoreEmptyState.NOTIFICATION_MY_ISSUE_EMPTY_STATE]: { + key: ECoreEmptyState.NOTIFICATION_MY_ISSUE_EMPTY_STATE, title: "No issues assigned", description: "Updates for issues assigned to you can be \n seen here", path: "/empty-state/search/notification", }, - [EmptyStateType.NOTIFICATION_CREATED_EMPTY_STATE]: { - key: EmptyStateType.NOTIFICATION_CREATED_EMPTY_STATE, + [ECoreEmptyState.NOTIFICATION_CREATED_EMPTY_STATE]: { + key: ECoreEmptyState.NOTIFICATION_CREATED_EMPTY_STATE, title: "No updates to issues", description: "Updates to issues created by you can be \n seen here", path: "/empty-state/search/notification", }, - [EmptyStateType.NOTIFICATION_SUBSCRIBED_EMPTY_STATE]: { - key: EmptyStateType.NOTIFICATION_SUBSCRIBED_EMPTY_STATE, + [ECoreEmptyState.NOTIFICATION_SUBSCRIBED_EMPTY_STATE]: { + key: ECoreEmptyState.NOTIFICATION_SUBSCRIBED_EMPTY_STATE, title: "No updates to issues", - description: "Updates to any issue you are \n subscribed to can be seen here", + description: + "Updates to any issue you are \n subscribed to can be seen here", path: "/empty-state/search/notification", }, - [EmptyStateType.NOTIFICATION_UNREAD_EMPTY_STATE]: { - key: EmptyStateType.NOTIFICATION_UNREAD_EMPTY_STATE, + [ECoreEmptyState.NOTIFICATION_UNREAD_EMPTY_STATE]: { + key: ECoreEmptyState.NOTIFICATION_UNREAD_EMPTY_STATE, title: "No unread notifications", - description: "Congratulations, you are up-to-date \n with everything happening in the issues \n you care about", + description: + "Congratulations, you are up-to-date \n with everything happening in the issues \n you care about", path: "/empty-state/search/notification", }, - [EmptyStateType.NOTIFICATION_SNOOZED_EMPTY_STATE]: { - key: EmptyStateType.NOTIFICATION_SNOOZED_EMPTY_STATE, + [ECoreEmptyState.NOTIFICATION_SNOOZED_EMPTY_STATE]: { + key: ECoreEmptyState.NOTIFICATION_SNOOZED_EMPTY_STATE, title: "No snoozed notifications yet", - description: "Any notification you snooze for later will \n be available here to act upon", + description: + "Any notification you snooze for later will \n be available here to act upon", path: "/empty-state/search/snooze", }, - [EmptyStateType.NOTIFICATION_ARCHIVED_EMPTY_STATE]: { - key: EmptyStateType.NOTIFICATION_ARCHIVED_EMPTY_STATE, + [ECoreEmptyState.NOTIFICATION_ARCHIVED_EMPTY_STATE]: { + key: ECoreEmptyState.NOTIFICATION_ARCHIVED_EMPTY_STATE, title: "No archived notifications yet", - description: "Any notification you archive will be \n available here to help you focus", + description: + "Any notification you archive will be \n available here to help you focus", path: "/empty-state/search/archive", }, - [EmptyStateType.ACTIVE_CYCLE_PROGRESS_EMPTY_STATE]: { - key: EmptyStateType.ACTIVE_CYCLE_PROGRESS_EMPTY_STATE, + [ECoreEmptyState.ACTIVE_CYCLE_PROGRESS_EMPTY_STATE]: { + key: ECoreEmptyState.ACTIVE_CYCLE_PROGRESS_EMPTY_STATE, title: "Add issues to the cycle to view it's \n progress", path: "/empty-state/active-cycle/progress", }, - [EmptyStateType.ACTIVE_CYCLE_CHART_EMPTY_STATE]: { - key: EmptyStateType.ACTIVE_CYCLE_CHART_EMPTY_STATE, + [ECoreEmptyState.ACTIVE_CYCLE_CHART_EMPTY_STATE]: { + key: ECoreEmptyState.ACTIVE_CYCLE_CHART_EMPTY_STATE, title: "Add issues to the cycle to view the \n burndown chart.", path: "/empty-state/active-cycle/chart", }, - [EmptyStateType.ACTIVE_CYCLE_PRIORITY_ISSUE_EMPTY_STATE]: { - key: EmptyStateType.ACTIVE_CYCLE_PRIORITY_ISSUE_EMPTY_STATE, + [ECoreEmptyState.ACTIVE_CYCLE_PRIORITY_ISSUE_EMPTY_STATE]: { + key: ECoreEmptyState.ACTIVE_CYCLE_PRIORITY_ISSUE_EMPTY_STATE, title: "Observe high priority issues tackled in \n the cycle at a glance.", path: "/empty-state/active-cycle/priority", }, - [EmptyStateType.ACTIVE_CYCLE_ASSIGNEE_EMPTY_STATE]: { - key: EmptyStateType.ACTIVE_CYCLE_ASSIGNEE_EMPTY_STATE, - title: "Add assignees to issues to see a \n breakdown of work by assignees.", + [ECoreEmptyState.ACTIVE_CYCLE_ASSIGNEE_EMPTY_STATE]: { + key: ECoreEmptyState.ACTIVE_CYCLE_ASSIGNEE_EMPTY_STATE, + title: + "Add assignees to issues to see a \n breakdown of work by assignees.", path: "/empty-state/active-cycle/assignee", }, - [EmptyStateType.ACTIVE_CYCLE_LABEL_EMPTY_STATE]: { - key: EmptyStateType.ACTIVE_CYCLE_LABEL_EMPTY_STATE, + [ECoreEmptyState.ACTIVE_CYCLE_LABEL_EMPTY_STATE]: { + key: ECoreEmptyState.ACTIVE_CYCLE_LABEL_EMPTY_STATE, title: "Add labels to issues to see the \n breakdown of work by labels.", path: "/empty-state/active-cycle/label", }, - [EmptyStateType.DISABLED_PROJECT_INBOX]: { - key: EmptyStateType.DISABLED_PROJECT_INBOX, + [ECoreEmptyState.DISABLED_PROJECT_INBOX]: { + key: ECoreEmptyState.DISABLED_PROJECT_INBOX, title: "Intake is not enabled for the project.", description: "Intake helps you manage incoming requests to your project and add them as issues in your workflow. Enable intake \n from project settings to manage requests.", @@ -705,8 +776,8 @@ const emptyStateDetails = { text: "Manage features", }, }, - [EmptyStateType.DISABLED_PROJECT_CYCLE]: { - key: EmptyStateType.DISABLED_PROJECT_CYCLE, + [ECoreEmptyState.DISABLED_PROJECT_CYCLE]: { + key: ECoreEmptyState.DISABLED_PROJECT_CYCLE, title: "Cycles is not enabled for this project.", description: "Break work down by timeboxed chunks, work backwards from your project deadline to set dates, and make tangible progress as a team. Enable the cycles feature for your project to start using them.", @@ -717,8 +788,8 @@ const emptyStateDetails = { text: "Manage features", }, }, - [EmptyStateType.DISABLED_PROJECT_MODULE]: { - key: EmptyStateType.DISABLED_PROJECT_MODULE, + [ECoreEmptyState.DISABLED_PROJECT_MODULE]: { + key: ECoreEmptyState.DISABLED_PROJECT_MODULE, title: "Modules are not enabled for the project.", description: "A group of issues that belong to a logical, hierarchical parent form a module. Think of them as a way to track work by project milestones. Enable modules from project settings.", @@ -729,8 +800,8 @@ const emptyStateDetails = { text: "Manage features", }, }, - [EmptyStateType.DISABLED_PROJECT_PAGE]: { - key: EmptyStateType.DISABLED_PROJECT_PAGE, + [ECoreEmptyState.DISABLED_PROJECT_PAGE]: { + key: ECoreEmptyState.DISABLED_PROJECT_PAGE, title: "Pages are not enabled for the project.", description: "Pages are thought spotting space in Plane. Take down meeting notes, format them easily, embed issues, lay them out using a library of components, and keep them all in your project’s context. Enable the pages feature to start creating them in your project.", @@ -741,8 +812,8 @@ const emptyStateDetails = { text: "Manage features", }, }, - [EmptyStateType.DISABLED_PROJECT_VIEW]: { - key: EmptyStateType.DISABLED_PROJECT_VIEW, + [ECoreEmptyState.DISABLED_PROJECT_VIEW]: { + key: ECoreEmptyState.DISABLED_PROJECT_VIEW, title: "Views is not enabled for this project.", description: "Views are a set of saved filters that you use frequently or want easy access to. All your colleagues in a project can see everyone’s views and choose whichever suits their needs best. Enable views in the project settings to start using them.", @@ -753,33 +824,36 @@ const emptyStateDetails = { text: "Manage features", }, }, - [EmptyStateType.INBOX_SIDEBAR_OPEN_TAB]: { - key: EmptyStateType.INBOX_SIDEBAR_OPEN_TAB, + [ECoreEmptyState.INBOX_SIDEBAR_OPEN_TAB]: { + key: ECoreEmptyState.INBOX_SIDEBAR_OPEN_TAB, title: "No open issues", description: "Find open issues here. Create new issue.", path: "/empty-state/intake/intake-issue", }, - [EmptyStateType.INBOX_SIDEBAR_CLOSED_TAB]: { - key: EmptyStateType.INBOX_SIDEBAR_CLOSED_TAB, + [ECoreEmptyState.INBOX_SIDEBAR_CLOSED_TAB]: { + key: ECoreEmptyState.INBOX_SIDEBAR_CLOSED_TAB, title: "No closed issues", - description: "All the issues whether accepted or \n declined can be found here.", + description: + "All the issues whether accepted or \n declined can be found here.", path: "/empty-state/intake/intake-issue", }, - [EmptyStateType.INBOX_SIDEBAR_FILTER_EMPTY_STATE]: { - key: EmptyStateType.INBOX_SIDEBAR_FILTER_EMPTY_STATE, + [ECoreEmptyState.INBOX_SIDEBAR_FILTER_EMPTY_STATE]: { + key: ECoreEmptyState.INBOX_SIDEBAR_FILTER_EMPTY_STATE, title: "No matching issues", - description: "No issue matches filter applied in intake. \n Create a new issue.", + description: + "No issue matches filter applied in intake. \n Create a new issue.", path: "/empty-state/intake/filter-issue", }, - [EmptyStateType.INBOX_DETAIL_EMPTY_STATE]: { - key: EmptyStateType.INBOX_DETAIL_EMPTY_STATE, + [ECoreEmptyState.INBOX_DETAIL_EMPTY_STATE]: { + key: ECoreEmptyState.INBOX_DETAIL_EMPTY_STATE, title: "Select an issue to view its details.", path: "/empty-state/intake/issue-detail", }, - [EmptyStateType.WORKSPACE_DRAFT_ISSUES]: { - key: EmptyStateType.WORKSPACE_DRAFT_ISSUES, + [ECoreEmptyState.WORKSPACE_DRAFT_ISSUES]: { + key: ECoreEmptyState.WORKSPACE_DRAFT_ISSUES, title: "Half-written issues, and soon, comments will show up here.", - description: "To try this out, start adding an issue and leave it mid-way or create your first draft below. 😉", + description: + "To try this out, start adding an issue and leave it mid-way or create your first draft below. 😉", path: "/empty-state/workspace-draft/issue", primaryButton: { text: "Create your first draft", @@ -788,5 +862,3 @@ const emptyStateDetails = { access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER], }, } as const; - -export const EMPTY_STATE_DETAILS: Record = emptyStateDetails; diff --git a/packages/constants/src/endpoints.ts b/packages/constants/src/core/endpoints.ts similarity index 79% rename from packages/constants/src/endpoints.ts rename to packages/constants/src/core/endpoints.ts index 751ee20dd3d..2e55eb418d2 100644 --- a/packages/constants/src/endpoints.ts +++ b/packages/constants/src/core/endpoints.ts @@ -13,3 +13,7 @@ export const SITES_URL = encodeURI(`${SPACE_BASE_URL}${SPACE_BASE_PATH}/`); export const LIVE_BASE_URL = process.env.NEXT_PUBLIC_LIVE_BASE_URL || ""; export const LIVE_BASE_PATH = process.env.NEXT_PUBLIC_LIVE_BASE_PATH || ""; export const LIVE_URL = encodeURI(`${LIVE_BASE_URL}${LIVE_BASE_PATH}/`); +// Silo Base Url +export const SILO_BASE_URL = process.env.NEXT_PUBLIC_SILO_BASE_URL || ""; +export const SILO_BASE_PATH = process.env.NEXT_PUBLIC_SILO_BASE_PATH || ""; +export const SILO_URL = encodeURI(`${SILO_BASE_URL}${SILO_BASE_PATH}/`); diff --git a/packages/constants/src/core/errors.ts b/packages/constants/src/core/errors.ts new file mode 100644 index 00000000000..b682c2ee109 --- /dev/null +++ b/packages/constants/src/core/errors.ts @@ -0,0 +1,25 @@ +export enum EErrorCodes { + "INVALID_ARCHIVE_STATE_GROUP" = 4091, + "INVALID_ISSUE_START_DATE" = 4101, + "INVALID_ISSUE_TARGET_DATE" = 4102, +} + +export const ERROR_DETAILS: { + [key in EErrorCodes]: { + title: string; + message: string; + }; +} = { + [EErrorCodes.INVALID_ARCHIVE_STATE_GROUP]: { + title: "Unable to archive issues", + message: "Only issues belonging to Completed or Canceled state groups can be archived.", + }, + [EErrorCodes.INVALID_ISSUE_START_DATE]: { + title: "Unable to update issues", + message: "Start date selected succeeds the due date for some issues. Ensure start date to be before the due date.", + }, + [EErrorCodes.INVALID_ISSUE_TARGET_DATE]: { + title: "Unable to update issues", + message: "Due date selected precedes the start date for some issues. Ensure due date to be after the start date.", + }, +}; diff --git a/packages/constants/src/core/event-tracker.ts b/packages/constants/src/core/event-tracker.ts new file mode 100644 index 00000000000..c0ac86935c7 --- /dev/null +++ b/packages/constants/src/core/event-tracker.ts @@ -0,0 +1,233 @@ +export type IssueEventProps = { + eventName: string; + payload: any; + updates?: any; + path?: string; +}; + +export type EventProps = { + eventName: string; + payload: any; +}; + +export const getWorkspaceEventPayload = (payload: any) => ({ + workspace_id: payload.id, + created_at: payload.created_at, + updated_at: payload.updated_at, + organization_size: payload.organization_size, + first_time: payload.first_time, + state: payload.state, + element: payload.element, +}); + +export const getProjectEventPayload = (payload: any) => ({ + workspace_id: payload.workspace_id, + project_id: payload.id, + identifier: payload.identifier, + project_visibility: payload.network == 2 ? "Public" : "Private", + changed_properties: payload.changed_properties, + lead_id: payload.project_lead, + created_at: payload.created_at, + updated_at: payload.updated_at, + state: payload.state, + element: payload.element, +}); + +export const getCycleEventPayload = (payload: any) => ({ + workspace_id: payload.workspace_id, + project_id: payload.project, + cycle_id: payload.id, + created_at: payload.created_at, + updated_at: payload.updated_at, + start_date: payload.start_date, + target_date: payload.target_date, + cycle_status: payload.status, + changed_properties: payload.changed_properties, + state: payload.state, + element: payload.element, +}); + +export const getModuleEventPayload = (payload: any) => ({ + workspace_id: payload.workspace_id, + project_id: payload.project, + module_id: payload.id, + created_at: payload.created_at, + updated_at: payload.updated_at, + start_date: payload.start_date, + target_date: payload.target_date, + module_status: payload.status, + lead_id: payload.lead, + changed_properties: payload.changed_properties, + member_ids: payload.members, + state: payload.state, + element: payload.element, +}); + +export const getPageEventPayload = (payload: any) => ({ + workspace_id: payload.workspace_id, + project_id: payload.project, + created_at: payload.created_at, + updated_at: payload.updated_at, + access: payload.access === 0 ? "Public" : "Private", + is_locked: payload.is_locked, + archived_at: payload.archived_at, + created_by: payload.created_by, + state: payload.state, + element: payload.element, +}); + +export const getIssueEventPayload = (props: IssueEventProps) => { + const { eventName, payload, updates, path } = props; + let eventPayload: any = { + issue_id: payload.id, + estimate_point: payload.estimate_point, + link_count: payload.link_count, + target_date: payload.target_date, + is_draft: payload.is_draft, + label_ids: payload.label_ids, + assignee_ids: payload.assignee_ids, + created_at: payload.created_at, + updated_at: payload.updated_at, + sequence_id: payload.sequence_id, + module_ids: payload.module_ids, + sub_issues_count: payload.sub_issues_count, + parent_id: payload.parent_id, + project_id: payload.project_id, + workspace_id: payload.workspace_id, + priority: payload.priority, + state_id: payload.state_id, + start_date: payload.start_date, + attachment_count: payload.attachment_count, + cycle_id: payload.cycle_id, + module_id: payload.module_id, + archived_at: payload.archived_at, + state: payload.state, + view_id: path?.includes("workspace-views") || path?.includes("views") ? path.split("/").pop() : "", + }; + + if (eventName === ISSUE_UPDATED) { + eventPayload = { + ...eventPayload, + ...updates, + updated_from: props.path?.includes("workspace-views") + ? "All views" + : props.path?.includes("cycles") + ? "Cycle" + : props.path?.includes("modules") + ? "Module" + : props.path?.includes("views") + ? "Project view" + : props.path?.includes("inbox") + ? "Inbox" + : props.path?.includes("draft") + ? "Draft" + : "Project", + }; + } + return eventPayload; +}; + +export const getProjectStateEventPayload = (payload: any) => ({ + workspace_id: payload.workspace_id, + project_id: payload.id, + state_id: payload.id, + created_at: payload.created_at, + updated_at: payload.updated_at, + group: payload.group, + color: payload.color, + default: payload.default, + state: payload.state, + element: payload.element, +}); + +// Workspace crud Events +export const WORKSPACE_CREATED = "Workspace created"; +export const WORKSPACE_UPDATED = "Workspace updated"; +export const WORKSPACE_DELETED = "Workspace deleted"; +// Project Events +export const PROJECT_CREATED = "Project created"; +export const PROJECT_UPDATED = "Project updated"; +export const PROJECT_DELETED = "Project deleted"; +// Cycle Events +export const CYCLE_CREATED = "Cycle created"; +export const CYCLE_UPDATED = "Cycle updated"; +export const CYCLE_DELETED = "Cycle deleted"; +export const CYCLE_FAVORITED = "Cycle favorited"; +export const CYCLE_UNFAVORITED = "Cycle unfavorited"; +// Module Events +export const MODULE_CREATED = "Module created"; +export const MODULE_UPDATED = "Module updated"; +export const MODULE_DELETED = "Module deleted"; +export const MODULE_FAVORITED = "Module favorited"; +export const MODULE_UNFAVORITED = "Module unfavorited"; +export const MODULE_LINK_CREATED = "Module link created"; +export const MODULE_LINK_UPDATED = "Module link updated"; +export const MODULE_LINK_DELETED = "Module link deleted"; +// Issue Events +export const ISSUE_CREATED = "Issue created"; +export const ISSUE_UPDATED = "Issue updated"; +export const ISSUE_DELETED = "Issue deleted"; +export const ISSUE_ARCHIVED = "Issue archived"; +export const ISSUE_RESTORED = "Issue restored"; +export const ISSUE_OPENED = "Issue opened"; +// Project State Events +export const STATE_CREATED = "State created"; +export const STATE_UPDATED = "State updated"; +export const STATE_DELETED = "State deleted"; +// Project Page Events +export const PAGE_CREATED = "Page created"; +export const PAGE_UPDATED = "Page updated"; +export const PAGE_DELETED = "Page deleted"; +// Member Events +export const MEMBER_INVITED = "Member invited"; +export const MEMBER_ACCEPTED = "Member accepted"; +export const PROJECT_MEMBER_ADDED = "Project member added"; +export const PROJECT_MEMBER_LEAVE = "Project member leave"; +export const WORKSPACE_MEMBER_LEAVE = "Workspace member leave"; +// Sign-in & Sign-up Events +export const NAVIGATE_TO_SIGNUP = "Navigate to sign-up page"; +export const NAVIGATE_TO_SIGNIN = "Navigate to sign-in page"; +export const CODE_VERIFIED = "Code verified"; +export const SETUP_PASSWORD = "Password setup"; +export const PASSWORD_CREATE_SELECTED = "Password created"; +export const PASSWORD_CREATE_SKIPPED = "Skipped to setup"; +export const SIGN_IN_WITH_PASSWORD = "Sign in with password"; +export const SIGN_UP_WITH_PASSWORD = "Sign up with password"; +export const SIGN_IN_WITH_CODE = "Sign in with magic link"; +export const FORGOT_PASSWORD = "Forgot password clicked"; +export const FORGOT_PASS_LINK = "Forgot password link generated"; +export const NEW_PASS_CREATED = "New password created"; +// Onboarding Events +export const USER_DETAILS = "User details added"; +export const USER_ONBOARDING_COMPLETED = "User onboarding completed"; +// Product Tour Events +export const PRODUCT_TOUR_STARTED = "Product tour started"; +export const PRODUCT_TOUR_COMPLETED = "Product tour completed"; +export const PRODUCT_TOUR_SKIPPED = "Product tour skipped"; +// Dashboard Events +export const CHANGELOG_REDIRECTED = "Changelog redirected"; +export const GITHUB_REDIRECTED = "Github redirected"; +// Sidebar Events +export const SIDEBAR_CLICKED = "Sidenav clicked"; +// Global View Events +export const GLOBAL_VIEW_CREATED = "Global view created"; +export const GLOBAL_VIEW_UPDATED = "Global view updated"; +export const GLOBAL_VIEW_DELETED = "Global view deleted"; +export const GLOBAL_VIEW_OPENED = "Global view opened"; +// Notification Events +export const NOTIFICATION_ARCHIVED = "Notification archived"; +export const NOTIFICATION_SNOOZED = "Notification snoozed"; +export const NOTIFICATION_READ = "Notification marked read"; +export const UNREAD_NOTIFICATIONS = "Unread notifications viewed"; +export const NOTIFICATIONS_READ = "All notifications marked read"; +export const SNOOZED_NOTIFICATIONS = "Snoozed notifications viewed"; +export const ARCHIVED_NOTIFICATIONS = "Archived notifications viewed"; +// Groups +export const GROUP_WORKSPACE = "Workspace_metrics"; + +//Elements +export const E_ONBOARDING = "Onboarding"; +export const E_ONBOARDING_STEP_1 = "Onboarding step 1"; +export const E_ONBOARDING_STEP_2 = "Onboarding step 2"; +// Favorites +export const FAVORITE_ADDED = "Favorite added"; diff --git a/packages/constants/src/core/fetch-keys.ts b/packages/constants/src/core/fetch-keys.ts new file mode 100644 index 00000000000..ec5de760f6f --- /dev/null +++ b/packages/constants/src/core/fetch-keys.ts @@ -0,0 +1,275 @@ +import { IAnalyticsParams, IJiraMetadata } from "@plane/types"; + +const paramsToKey = (params: any) => { + const { + state, + state_group, + priority, + mentions, + assignees, + created_by, + labels, + start_date, + target_date, + sub_issue, + project, + layout, + subscriber, + } = params; + + let projectKey = project ? project.split(",") : []; + let stateKey = state ? state.split(",") : []; + let stateGroupKey = state_group ? state_group.split(",") : []; + let priorityKey = priority ? priority.split(",") : []; + let mentionsKey = mentions ? mentions.split(",") : []; + let assigneesKey = assignees ? assignees.split(",") : []; + let createdByKey = created_by ? created_by.split(",") : []; + let labelsKey = labels ? labels.split(",") : []; + let subscriberKey = subscriber ? subscriber.split(",") : []; + const startDateKey = start_date ?? ""; + const targetDateKey = target_date ?? ""; + const type = params.type ? params.type.toUpperCase() : "NULL"; + const groupBy = params.group_by ? params.group_by.toUpperCase() : "NULL"; + const orderBy = params.order_by ? params.order_by.toUpperCase() : "NULL"; + const layoutKey = layout ? layout.toUpperCase() : ""; + + // sorting each keys in ascending order + projectKey = projectKey.sort().join("_"); + stateKey = stateKey.sort().join("_"); + stateGroupKey = stateGroupKey.sort().join("_"); + priorityKey = priorityKey.sort().join("_"); + assigneesKey = assigneesKey.sort().join("_"); + mentionsKey = mentionsKey.sort().join("_"); + createdByKey = createdByKey.sort().join("_"); + labelsKey = labelsKey.sort().join("_"); + subscriberKey = subscriberKey.sort().join("_"); + + return `${layoutKey}_${projectKey}_${stateGroupKey}_${stateKey}_${priorityKey}_${assigneesKey}_${mentionsKey}_${createdByKey}_${type}_${groupBy}_${orderBy}_${labelsKey}_${startDateKey}_${targetDateKey}_${sub_issue}_${subscriberKey}`; +}; + +const myIssuesParamsToKey = (params: any) => { + const { assignees, created_by, labels, priority, state_group, subscriber, start_date, target_date } = params; + + let assigneesKey = assignees ? assignees.split(",") : []; + let createdByKey = created_by ? created_by.split(",") : []; + let stateGroupKey = state_group ? state_group.split(",") : []; + let subscriberKey = subscriber ? subscriber.split(",") : []; + let priorityKey = priority ? priority.split(",") : []; + let labelsKey = labels ? labels.split(",") : []; + const startDateKey = start_date ?? ""; + const targetDateKey = target_date ?? ""; + const type = params?.type ? params.type.toUpperCase() : "NULL"; + const groupBy = params?.group_by ? params.group_by.toUpperCase() : "NULL"; + const orderBy = params?.order_by ? params.order_by.toUpperCase() : "NULL"; + + // sorting each keys in ascending order + assigneesKey = assigneesKey.sort().join("_"); + createdByKey = createdByKey.sort().join("_"); + stateGroupKey = stateGroupKey.sort().join("_"); + subscriberKey = subscriberKey.sort().join("_"); + priorityKey = priorityKey.sort().join("_"); + labelsKey = labelsKey.sort().join("_"); + + return `${assigneesKey}_${createdByKey}_${stateGroupKey}_${subscriberKey}_${priorityKey}_${type}_${groupBy}_${orderBy}_${labelsKey}_${startDateKey}_${targetDateKey}`; +}; + +export const CURRENT_USER = "CURRENT_USER"; +export const USER_WORKSPACE_INVITATIONS = "USER_WORKSPACE_INVITATIONS"; +export const USER_WORKSPACES_LIST = "USER_WORKSPACES_LIST"; + +export const WORKSPACE_DETAILS = (workspaceSlug: string) => `WORKSPACE_DETAILS_${workspaceSlug.toUpperCase()}`; + +export const WORKSPACE_MEMBERS = (workspaceSlug: string) => `WORKSPACE_MEMBERS_${workspaceSlug.toUpperCase()}`; +export const WORKSPACE_MEMBERS_ME = (workspaceSlug: string) => `WORKSPACE_MEMBERS_ME${workspaceSlug.toUpperCase()}`; +export const WORKSPACE_INVITATIONS = (workspaceSlug: string) => `WORKSPACE_INVITATIONS_${workspaceSlug.toString()}`; +export const WORKSPACE_INVITATION = (invitationId: string) => `WORKSPACE_INVITATION_${invitationId}`; +export const LAST_ACTIVE_WORKSPACE_AND_PROJECTS = "LAST_ACTIVE_WORKSPACE_AND_PROJECTS"; + +export const PROJECTS_LIST = ( + workspaceSlug: string, + params: { + is_favorite: "all" | boolean; + } +) => { + if (!params) return `PROJECTS_LIST_${workspaceSlug.toUpperCase()}`; + + return `PROJECTS_LIST_${workspaceSlug.toUpperCase()}_${params.is_favorite.toString().toUpperCase()}`; +}; +export const PROJECT_DETAILS = (projectId: string) => `PROJECT_DETAILS_${projectId.toUpperCase()}`; + +export const PROJECT_MEMBERS = (projectId: string) => `PROJECT_MEMBERS_${projectId.toUpperCase()}`; +export const PROJECT_INVITATIONS = (projectId: string) => `PROJECT_INVITATIONS_${projectId.toString()}`; + +export const PROJECT_ISSUES_LIST = (workspaceSlug: string, projectId: string) => + `PROJECT_ISSUES_LIST_${workspaceSlug.toUpperCase()}_${projectId.toUpperCase()}`; +export const PROJECT_ISSUES_LIST_WITH_PARAMS = (projectId: string, params?: any) => { + if (!params) return `PROJECT_ISSUES_LIST_WITH_PARAMS_${projectId.toUpperCase()}`; + + const paramsKey = paramsToKey(params); + + return `PROJECT_ISSUES_LIST_WITH_PARAMS_${projectId.toUpperCase()}_${paramsKey}`; +}; +export const PROJECT_ARCHIVED_ISSUES_LIST_WITH_PARAMS = (projectId: string, params?: any) => { + if (!params) return `PROJECT_ARCHIVED_ISSUES_LIST_WITH_PARAMS_${projectId.toUpperCase()}`; + + const paramsKey = paramsToKey(params); + + return `PROJECT_ARCHIVED_ISSUES_LIST_WITH_PARAMS_${projectId.toUpperCase()}_${paramsKey}`; +}; + +export const PROJECT_DRAFT_ISSUES_LIST_WITH_PARAMS = (projectId: string, params?: any) => { + if (!params) return `PROJECT_DRAFT_ISSUES_LIST_WITH_PARAMS${projectId.toUpperCase()}`; + + const paramsKey = paramsToKey(params); + + return `PROJECT_DRAFT_ISSUES_LIST_WITH_PARAMS${projectId.toUpperCase()}_${paramsKey}`; +}; + +export const GLOBAL_VIEWS_LIST = (workspaceSlug: string) => `GLOBAL_VIEWS_LIST_${workspaceSlug.toUpperCase()}`; +export const GLOBAL_VIEW_DETAILS = (globalViewId: string) => `GLOBAL_VIEW_DETAILS_${globalViewId.toUpperCase()}`; +export const GLOBAL_VIEW_ISSUES = (globalViewId: string) => `GLOBAL_VIEW_ISSUES_${globalViewId.toUpperCase()}`; + +export const PROJECT_ISSUES_DETAILS = (issueId: string) => `PROJECT_ISSUES_DETAILS_${issueId.toUpperCase()}`; +export const PROJECT_ISSUES_PROPERTIES = (projectId: string) => `PROJECT_ISSUES_PROPERTIES_${projectId.toUpperCase()}`; +export const PROJECT_ISSUES_COMMENTS = (issueId: string) => `PROJECT_ISSUES_COMMENTS_${issueId.toUpperCase()}`; +export const PROJECT_ISSUES_ACTIVITY = (issueId: string) => `PROJECT_ISSUES_ACTIVITY_${issueId.toUpperCase()}`; +export const PROJECT_ISSUE_BY_STATE = (projectId: string) => `PROJECT_ISSUE_BY_STATE_${projectId.toUpperCase()}`; +export const PROJECT_ISSUE_LABELS = (projectId: string) => `PROJECT_ISSUE_LABELS_${projectId.toUpperCase()}`; +export const WORKSPACE_LABELS = (workspaceSlug: string) => `WORKSPACE_LABELS_${workspaceSlug.toUpperCase()}`; +export const PROJECT_GITHUB_REPOSITORY = (projectId: string) => `PROJECT_GITHUB_REPOSITORY_${projectId.toUpperCase()}`; + +// cycles +export const CYCLES_LIST = (projectId: string) => `CYCLE_LIST_${projectId.toUpperCase()}`; +export const INCOMPLETE_CYCLES_LIST = (projectId: string) => `INCOMPLETE_CYCLES_LIST_${projectId.toUpperCase()}`; +export const CURRENT_CYCLE_LIST = (projectId: string) => `CURRENT_CYCLE_LIST_${projectId.toUpperCase()}`; +export const UPCOMING_CYCLES_LIST = (projectId: string) => `UPCOMING_CYCLES_LIST_${projectId.toUpperCase()}`; +export const DRAFT_CYCLES_LIST = (projectId: string) => `DRAFT_CYCLES_LIST_${projectId.toUpperCase()}`; +export const COMPLETED_CYCLES_LIST = (projectId: string) => `COMPLETED_CYCLES_LIST_${projectId.toUpperCase()}`; +export const CYCLE_ISSUES = (cycleId: string) => `CYCLE_ISSUES_${cycleId.toUpperCase()}`; +export const CYCLE_ISSUES_WITH_PARAMS = (cycleId: string, params?: any) => { + if (!params) return `CYCLE_ISSUES_WITH_PARAMS_${cycleId.toUpperCase()}`; + + const paramsKey = paramsToKey(params); + + return `CYCLE_ISSUES_WITH_PARAMS_${cycleId.toUpperCase()}_${paramsKey.toUpperCase()}`; +}; +export const CYCLE_DETAILS = (cycleId: string) => `CYCLE_DETAILS_${cycleId.toUpperCase()}`; + +export const STATES_LIST = (projectId: string) => `STATES_LIST_${projectId.toUpperCase()}`; + +export const USER_ISSUE = (workspaceSlug: string) => `USER_ISSUE_${workspaceSlug.toUpperCase()}`; +export const USER_ISSUES = (workspaceSlug: string, params: any) => { + const paramsKey = myIssuesParamsToKey(params); + + return `USER_ISSUES_${workspaceSlug.toUpperCase()}_${paramsKey}`; +}; +export const USER_ACTIVITY = (params: { cursor?: string }) => `USER_ACTIVITY_${params?.cursor}`; +export const USER_WORKSPACE_DASHBOARD = (workspaceSlug: string) => + `USER_WORKSPACE_DASHBOARD_${workspaceSlug.toUpperCase()}`; +export const USER_PROJECT_VIEW = (projectId: string) => `USER_PROJECT_VIEW_${projectId.toUpperCase()}`; + +export const MODULE_LIST = (projectId: string) => `MODULE_LIST_${projectId.toUpperCase()}`; +export const MODULE_ISSUES = (moduleId: string) => `MODULE_ISSUES_${moduleId.toUpperCase()}`; +export const MODULE_ISSUES_WITH_PARAMS = (moduleId: string, params?: any) => { + if (!params) return `MODULE_ISSUES_WITH_PARAMS_${moduleId.toUpperCase()}`; + + const paramsKey = paramsToKey(params); + + return `MODULE_ISSUES_WITH_PARAMS_${moduleId.toUpperCase()}_${paramsKey.toUpperCase()}`; +}; +export const MODULE_DETAILS = (moduleId: string) => `MODULE_DETAILS_${moduleId.toUpperCase()}`; + +export const VIEWS_LIST = (projectId: string) => `VIEWS_LIST_${projectId.toUpperCase()}`; +export const VIEW_DETAILS = (viewId: string) => `VIEW_DETAILS_${viewId.toUpperCase()}`; +export const VIEW_ISSUES = (viewId: string, params: any) => { + if (!params) return `VIEW_ISSUES_${viewId.toUpperCase()}`; + + const paramsKey = paramsToKey(params); + + return `VIEW_ISSUES_${viewId.toUpperCase()}_${paramsKey.toUpperCase()}`; +}; + +// Issues +export const ISSUE_DETAILS = (issueId: string) => `ISSUE_DETAILS_${issueId.toUpperCase()}`; +export const SUB_ISSUES = (issueId: string) => `SUB_ISSUES_${issueId.toUpperCase()}`; +export const ISSUE_ATTACHMENTS = (issueId: string) => `ISSUE_ATTACHMENTS_${issueId.toUpperCase()}`; +export const ARCHIVED_ISSUE_DETAILS = (issueId: string) => `ARCHIVED_ISSUE_DETAILS_${issueId.toUpperCase()}`; + +// integrations +export const APP_INTEGRATIONS = "APP_INTEGRATIONS"; +export const WORKSPACE_INTEGRATIONS = (workspaceSlug: string) => + `WORKSPACE_INTEGRATIONS_${workspaceSlug.toUpperCase()}`; + +export const JIRA_IMPORTER_DETAIL = (workspaceSlug: string, params: IJiraMetadata) => { + const { api_token, cloud_hostname, email, project_key } = params; + + return `JIRA_IMPORTER_DETAIL_${workspaceSlug.toUpperCase()}_${api_token}_${cloud_hostname}_${email}_${project_key}`; +}; + +//import-export +export const IMPORTER_SERVICES_LIST = (workspaceSlug: string) => + `IMPORTER_SERVICES_LIST_${workspaceSlug.toUpperCase()}`; + +//export +export const EXPORT_SERVICES_LIST = (workspaceSlug: string, cursor: string, per_page: string) => + `EXPORTER_SERVICES_LIST_${workspaceSlug.toUpperCase()}_${cursor.toUpperCase()}_${per_page.toUpperCase()}`; + +// github-importer +export const GITHUB_REPOSITORY_INFO = (workspaceSlug: string, repoName: string) => + `GITHUB_REPO_INFO_${workspaceSlug.toString().toUpperCase()}_${repoName.toUpperCase()}`; + +// slack-project-integration +export const SLACK_CHANNEL_INFO = (workspaceSlug: string, projectId: string) => + `SLACK_CHANNEL_INFO_${workspaceSlug.toString().toUpperCase()}_${projectId.toUpperCase()}`; + +// Pages +export const RECENT_PAGES_LIST = (projectId: string) => `RECENT_PAGES_LIST_${projectId.toUpperCase()}`; +export const ALL_PAGES_LIST = (projectId: string) => `ALL_PAGES_LIST_${projectId.toUpperCase()}`; +export const ARCHIVED_PAGES_LIST = (projectId: string) => `ARCHIVED_PAGES_LIST_${projectId.toUpperCase}`; +export const FAVORITE_PAGES_LIST = (projectId: string) => `FAVORITE_PAGES_LIST_${projectId.toUpperCase()}`; +export const PRIVATE_PAGES_LIST = (projectId: string) => `PRIVATE_PAGES_LIST_${projectId.toUpperCase()}`; +export const SHARED_PAGES_LIST = (projectId: string) => `SHARED_PAGES_LIST_${projectId.toUpperCase()}`; +export const PAGE_DETAILS = (pageId: string) => `PAGE_DETAILS_${pageId.toUpperCase()}`; +export const PAGE_BLOCKS_LIST = (pageId: string) => `PAGE_BLOCK_LIST_${pageId.toUpperCase()}`; +export const PAGE_BLOCK_DETAILS = (pageId: string) => `PAGE_BLOCK_DETAILS_${pageId.toUpperCase()}`; +export const MY_PAGES_LIST = (pageId: string) => `MY_PAGE_LIST_${pageId}`; +// estimates +export const ESTIMATES_LIST = (projectId: string) => `ESTIMATES_LIST_${projectId.toUpperCase()}`; +export const ESTIMATE_DETAILS = (estimateId: string) => `ESTIMATE_DETAILS_${estimateId.toUpperCase()}`; + +// analytics +export const ANALYTICS = (workspaceSlug: string, params: IAnalyticsParams) => + `ANALYTICS${workspaceSlug.toUpperCase()}_${params.x_axis}_${params.y_axis}_${ + params.segment + }_${params.project?.toString()}`; +export const DEFAULT_ANALYTICS = (workspaceSlug: string, params?: Partial) => + `DEFAULT_ANALYTICS_${workspaceSlug.toUpperCase()}_${params?.project?.toString()}_${params?.cycle}_${params?.module}`; + +// profile +export const USER_PROFILE_DATA = (workspaceSlug: string, userId: string) => + `USER_PROFILE_ACTIVITY_${workspaceSlug.toUpperCase()}_${userId.toUpperCase()}`; +export const USER_PROFILE_ACTIVITY = ( + workspaceSlug: string, + userId: string, + params: { + cursor?: string; + } +) => `USER_WORKSPACE_PROFILE_ACTIVITY_${workspaceSlug.toUpperCase()}_${userId.toUpperCase()}_${params?.cursor}`; +export const USER_PROFILE_PROJECT_SEGREGATION = (workspaceSlug: string, userId: string) => + `USER_PROFILE_PROJECT_SEGREGATION_${workspaceSlug.toUpperCase()}_${userId.toUpperCase()}`; +export const USER_PROFILE_ISSUES = (workspaceSlug: string, userId: string, params: any) => { + const paramsKey = myIssuesParamsToKey(params); + + return `USER_PROFILE_ISSUES_${workspaceSlug.toUpperCase()}_${userId.toUpperCase()}_${paramsKey}`; +}; + +// reactions +export const ISSUE_REACTION_LIST = (workspaceSlug: string, projectId: string, issueId: string) => + `ISSUE_REACTION_LIST_${workspaceSlug.toUpperCase()}_${projectId.toUpperCase()}_${issueId.toUpperCase()}`; +export const COMMENT_REACTION_LIST = (workspaceSlug: string, projectId: string, commendId: string) => + `COMMENT_REACTION_LIST_${workspaceSlug.toUpperCase()}_${projectId.toUpperCase()}_${commendId.toUpperCase()}`; + +// api-tokens +export const API_TOKENS_LIST = (workspaceSlug: string) => `API_TOKENS_LIST_${workspaceSlug.toUpperCase()}`; +export const API_TOKEN_DETAILS = (workspaceSlug: string, tokenId: string) => + `API_TOKEN_DETAILS_${workspaceSlug.toUpperCase()}_${tokenId.toUpperCase()}`; diff --git a/packages/constants/src/core/filters.ts b/packages/constants/src/core/filters.ts new file mode 100644 index 00000000000..98189bc78eb --- /dev/null +++ b/packages/constants/src/core/filters.ts @@ -0,0 +1,52 @@ +export const DATE_AFTER_FILTER_OPTIONS = [ + { + name: "1 week from now", + value: "1_weeks;after;fromnow", + }, + { + name: "2 weeks from now", + value: "2_weeks;after;fromnow", + }, + { + name: "1 month from now", + value: "1_months;after;fromnow", + }, + { + name: "2 months from now", + value: "2_months;after;fromnow", + }, +]; + +export const DATE_BEFORE_FILTER_OPTIONS = [ + { + name: "1 week ago", + value: "1_weeks;before;fromnow", + }, + { + name: "2 weeks ago", + value: "2_weeks;before;fromnow", + }, + { + name: "1 month ago", + value: "1_months;before;fromnow", + }, +]; + +export const PROJECT_CREATED_AT_FILTER_OPTIONS = [ + { + name: "Today", + value: "today;custom;custom", + }, + { + name: "Yesterday", + value: "yesterday;custom;custom", + }, + { + name: "Last 7 days", + value: "last_7_days;custom;custom", + }, + { + name: "Last 30 days", + value: "last_30_days;custom;custom", + }, +]; diff --git a/packages/constants/src/core/index.ts b/packages/constants/src/core/index.ts new file mode 100644 index 00000000000..bf32e78e221 --- /dev/null +++ b/packages/constants/src/core/index.ts @@ -0,0 +1,30 @@ +export * from "./analytics"; +export * from "./auth"; +export * from "./calendar"; +export * from "./common"; +export * from "./cycle"; +export * from "./dashboard"; +export * from "./empty-state"; +export * from "./endpoints"; +export * from "./errors"; +export * from "./event-tracker"; +export * from "./fetch-keys"; +export * from "./filters"; +export * from "./issue"; +export * from "./label"; +export * from "./module"; +export * from "./notification"; +export * from "./page"; +export * from "./payment"; +export * from "./profile"; +export * from "./project"; +export * from "./seo-variables"; +export * from "./spreadsheet"; +export * from "./state"; +export * from "./swr-config"; +export * from "./tab-indices"; +export * from "./themes"; +export * from "./timezones"; +export * from "./views"; +export * from "./workspace"; +export * from "./workspace-drafts"; diff --git a/packages/constants/src/core/issue.ts b/packages/constants/src/core/issue.ts new file mode 100644 index 00000000000..975b1809702 --- /dev/null +++ b/packages/constants/src/core/issue.ts @@ -0,0 +1,641 @@ +// types +import { + IIssueFilterOptions, + IIssueDisplayProperties, + TIssueExtraOptions, + TIssueGroupByOptions, + TIssueOrderByOptions, + TIssuePriorities, + TIssueGroupingFilters, +} from "@plane/types"; + +export const DRAG_ALLOWED_GROUPS: TIssueGroupByOptions[] = [ + "state", + "priority", + "assignees", + "labels", + "module", + "cycle", +]; + +export enum EIssuesStoreType { + GLOBAL = "GLOBAL", + PROFILE = "PROFILE", + PROJECT = "PROJECT", + CYCLE = "CYCLE", + MODULE = "MODULE", + PROJECT_VIEW = "PROJECT_VIEW", + ARCHIVED = "ARCHIVED", + DRAFT = "DRAFT", + DEFAULT = "DEFAULT", + WORKSPACE_DRAFT = "WORKSPACE_DRAFT", +} + +export enum EIssueLayoutTypes { + LIST = "list", + KANBAN = "kanban", + CALENDAR = "calendar", + GANTT = "gantt_chart", + SPREADSHEET = "spreadsheet", +} + +export type TCreateModalStoreTypes = + | EIssuesStoreType.PROJECT + | EIssuesStoreType.PROJECT_VIEW + | EIssuesStoreType.PROFILE + | EIssuesStoreType.CYCLE + | EIssuesStoreType.MODULE; + +export enum EIssueFilterType { + FILTERS = "filters", + DISPLAY_FILTERS = "display_filters", + DISPLAY_PROPERTIES = "display_properties", + KANBAN_FILTERS = "kanban_filters", +} + +export enum EIssueCommentAccessSpecifier { + EXTERNAL = "EXTERNAL", + INTERNAL = "INTERNAL", +} + +export const ISSUE_PRIORITIES: { + key: TIssuePriorities; + title: string; +}[] = [ + { key: "urgent", title: "Urgent" }, + { key: "high", title: "High" }, + { key: "medium", title: "Medium" }, + { key: "low", title: "Low" }, + { key: "none", title: "None" }, +]; + +export const ISSUE_GROUP_BY_OPTIONS: { + key: TIssueGroupByOptions; + title: string; +}[] = [ + { key: "state", title: "States" }, + { key: "state_detail.group", title: "State Groups" }, + { key: "priority", title: "Priority" }, + { key: "project", title: "Project" }, // required this on my issues + { key: "cycle", title: "Cycle" }, // required this on my issues + { key: "module", title: "Module" }, // required this on my issues + { key: "labels", title: "Labels" }, + { key: "assignees", title: "Assignees" }, + { key: "created_by", title: "Created By" }, + { key: null, title: "None" }, +]; + +export const ISSUE_ORDER_BY_OPTIONS: { + key: TIssueOrderByOptions; + title: string; +}[] = [ + { key: "sort_order", title: "Manual" }, + { key: "-created_at", title: "Last Created" }, + { key: "-updated_at", title: "Last Updated" }, + { key: "start_date", title: "Start Date" }, + { key: "target_date", title: "Due Date" }, + { key: "-priority", title: "Priority" }, +]; + +export const ISSUE_FILTER_OPTIONS: { + key: TIssueGroupingFilters; + title: string; +}[] = [ + { key: null, title: "All" }, + { key: "active", title: "Active Issues" }, + { key: "backlog", title: "Backlog Issues" }, + // { key: "draft", title: "Draft Issues" }, +]; + +export const ISSUE_DISPLAY_PROPERTIES_KEYS: (keyof IIssueDisplayProperties)[] = + [ + "assignee", + "start_date", + "due_date", + "labels", + "key", + "priority", + "state", + "sub_issue_count", + "link", + "attachment_count", + "estimate", + "created_on", + "updated_on", + "modules", + "cycle", + "issue_type", + ]; + +export const ISSUE_DISPLAY_PROPERTIES: { + key: keyof IIssueDisplayProperties; + title: string; +}[] = [ + { key: "key", title: "ID" }, + { key: "issue_type", title: "Issue Type" }, + { key: "assignee", title: "Assignee" }, + { key: "start_date", title: "Start date" }, + { key: "due_date", title: "Due date" }, + { key: "labels", title: "Labels" }, + { key: "priority", title: "Priority" }, + { key: "state", title: "State" }, + { key: "sub_issue_count", title: "Sub issue count" }, + { key: "attachment_count", title: "Attachment count" }, + { key: "link", title: "Link" }, + { key: "estimate", title: "Estimate" }, + { key: "modules", title: "Modules" }, + { key: "cycle", title: "Cycle" }, +]; + +export const ISSUE_EXTRA_OPTIONS: { + key: TIssueExtraOptions; + title: string; +}[] = [ + { key: "sub_issue", title: "Show sub-issues" }, // in spreadsheet its always false + { key: "show_empty_groups", title: "Show empty groups" }, // filter on front-end +]; + +export interface ILayoutDisplayFiltersOptions { + filters: (keyof IIssueFilterOptions)[]; + display_properties: (keyof IIssueDisplayProperties)[]; + display_filters: { + group_by?: TIssueGroupByOptions[]; + sub_group_by?: TIssueGroupByOptions[]; + order_by?: TIssueOrderByOptions[]; + type?: TIssueGroupingFilters[]; + }; + extra_options: { + access: boolean; + values: TIssueExtraOptions[]; + }; +} + +export const ISSUE_DISPLAY_FILTERS_BY_LAYOUT: { + [pageType: string]: { [layoutType: string]: ILayoutDisplayFiltersOptions }; +} = { + profile_issues: { + list: { + filters: [ + "priority", + "state_group", + "labels", + "start_date", + "target_date", + ], + display_properties: ISSUE_DISPLAY_PROPERTIES_KEYS, + display_filters: { + group_by: ["state_detail.group", "priority", "project", "labels", null], + order_by: [ + "sort_order", + "-created_at", + "-updated_at", + "start_date", + "-priority", + ], + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["show_empty_groups", "sub_issue"], + }, + }, + kanban: { + filters: [ + "priority", + "state_group", + "labels", + "start_date", + "target_date", + ], + display_properties: ISSUE_DISPLAY_PROPERTIES_KEYS, + display_filters: { + group_by: ["state_detail.group", "priority", "project", "labels"], + order_by: [ + "sort_order", + "-created_at", + "-updated_at", + "start_date", + "-priority", + ], + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["show_empty_groups"], + }, + }, + }, + archived_issues: { + list: { + filters: [ + "priority", + "state", + "cycle", + "module", + "assignees", + "created_by", + "labels", + "start_date", + "target_date", + "issue_type", + ], + display_properties: ISSUE_DISPLAY_PROPERTIES_KEYS, + display_filters: { + group_by: [ + "state", + "cycle", + "module", + "state_detail.group", + "priority", + "labels", + "assignees", + "created_by", + null, + ], + order_by: [ + "sort_order", + "-created_at", + "-updated_at", + "start_date", + "-priority", + ], + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["show_empty_groups"], + }, + }, + }, + draft_issues: { + list: { + filters: [ + "priority", + "state_group", + "cycle", + "module", + "labels", + "start_date", + "target_date", + "issue_type", + ], + display_properties: ISSUE_DISPLAY_PROPERTIES_KEYS, + display_filters: { + group_by: [ + "state_detail.group", + "cycle", + "module", + "priority", + "project", + "labels", + null, + ], + order_by: [ + "sort_order", + "-created_at", + "-updated_at", + "start_date", + "-priority", + ], + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["show_empty_groups"], + }, + }, + kanban: { + filters: [ + "priority", + "state_group", + "cycle", + "module", + "labels", + "start_date", + "target_date", + "issue_type", + ], + display_properties: ISSUE_DISPLAY_PROPERTIES_KEYS, + display_filters: { + group_by: [ + "state_detail.group", + "cycle", + "module", + "priority", + "project", + "labels", + ], + order_by: [ + "sort_order", + "-created_at", + "-updated_at", + "start_date", + "-priority", + ], + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["show_empty_groups"], + }, + }, + }, + my_issues: { + spreadsheet: { + filters: [ + "priority", + "state_group", + "labels", + "assignees", + "created_by", + "subscriber", + "project", + "start_date", + "target_date", + ], + display_properties: ISSUE_DISPLAY_PROPERTIES_KEYS, + display_filters: { + order_by: [], + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["sub_issue"], + }, + }, + list: { + filters: [ + "priority", + "state_group", + "labels", + "assignees", + "created_by", + "subscriber", + "project", + "start_date", + "target_date", + ], + display_properties: ISSUE_DISPLAY_PROPERTIES_KEYS, + display_filters: { + type: [null, "active", "backlog"], + }, + extra_options: { + access: false, + values: [], + }, + }, + }, + issues: { + list: { + filters: [ + "priority", + "state", + "cycle", + "module", + "assignees", + "mentions", + "created_by", + "labels", + "start_date", + "target_date", + "issue_type", + ], + display_properties: ISSUE_DISPLAY_PROPERTIES_KEYS, + display_filters: { + group_by: [ + "state", + "priority", + "cycle", + "module", + "labels", + "assignees", + "created_by", + null, + ], + order_by: [ + "sort_order", + "-created_at", + "-updated_at", + "start_date", + "-priority", + ], + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["show_empty_groups", "sub_issue"], + }, + }, + kanban: { + filters: [ + "priority", + "state", + "cycle", + "module", + "assignees", + "mentions", + "created_by", + "labels", + "start_date", + "target_date", + "issue_type", + ], + display_properties: ISSUE_DISPLAY_PROPERTIES_KEYS, + display_filters: { + group_by: [ + "state", + "priority", + "cycle", + "module", + "labels", + "assignees", + "created_by", + ], + sub_group_by: [ + "state", + "priority", + "cycle", + "module", + "labels", + "assignees", + "created_by", + null, + ], + order_by: [ + "sort_order", + "-created_at", + "-updated_at", + "start_date", + "-priority", + "target_date", + ], + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["show_empty_groups", "sub_issue"], + }, + }, + calendar: { + filters: [ + "priority", + "state", + "cycle", + "module", + "assignees", + "mentions", + "created_by", + "labels", + "start_date", + "issue_type", + ], + display_properties: ["key", "issue_type"], + display_filters: { + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["sub_issue"], + }, + }, + spreadsheet: { + filters: [ + "priority", + "state", + "cycle", + "module", + "assignees", + "mentions", + "created_by", + "labels", + "start_date", + "target_date", + "issue_type", + ], + display_properties: ISSUE_DISPLAY_PROPERTIES_KEYS, + display_filters: { + order_by: [ + "sort_order", + "-created_at", + "-updated_at", + "start_date", + "-priority", + ], + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["sub_issue"], + }, + }, + gantt_chart: { + filters: [ + "priority", + "state", + "cycle", + "module", + "assignees", + "mentions", + "created_by", + "labels", + "start_date", + "target_date", + "issue_type", + ], + display_properties: ["key", "issue_type"], + display_filters: { + order_by: [ + "sort_order", + "-created_at", + "-updated_at", + "start_date", + "-priority", + ], + type: [null, "active", "backlog"], + }, + extra_options: { + access: true, + values: ["sub_issue"], + }, + }, + }, +}; + +export enum EIssueListRow { + HEADER = "HEADER", + ISSUE = "ISSUE", + NO_ISSUES = "NO_ISSUES", + QUICK_ADD = "QUICK_ADD", +} + +// issue reactions +export const issueReactionEmojis = [ + "128077", + "128078", + "128516", + "128165", + "128533", + "129505", + "9992", + "128064", +]; + +export const groupReactionEmojis = (reactions: any) => { + let groupedEmojis: any = {}; + + issueReactionEmojis.map((_r) => { + groupedEmojis = { ...groupedEmojis, [_r]: [] }; + }); + + if (reactions && reactions.length > 0) { + reactions.map((_reaction: any) => { + groupedEmojis = { + ...groupedEmojis, + [_reaction.reaction]: [...groupedEmojis[_reaction.reaction], _reaction], + }; + }); + } + + return groupedEmojis; +}; + +export const ALL_ISSUES = "All Issues"; + +export enum EIssueGroupByToServerOptions { + "state" = "state_id", + "priority" = "priority", + "labels" = "labels__id", + "state_detail.group" = "state__group", + "assignees" = "assignees__id", + "cycle" = "cycle_id", + "module" = "issue_module__module_id", + "target_date" = "target_date", + "project" = "project_id", + "created_by" = "created_by", +} + +export enum EIssueGroupBYServerToProperty { + "state_id" = "state_id", + "priority" = "priority", + "labels__id" = "label_ids", + "state__group" = "state__group", + "assignees__id" = "assignee_ids", + "cycle_id" = "cycle_id", + "issue_module__module_id" = "module_ids", + "target_date" = "target_date", + "project_id" = "project_id", + "created_by" = "created_by", +} + +export enum EServerGroupByToFilterOptions { + "state_id" = "state", + "priority" = "priority", + "labels__id" = "labels", + "state__group" = "state_group", + "assignees__id" = "assignees", + "cycle_id" = "cycle", + "issue_module__module_id" = "module", + "target_date" = "target_date", + "project_id" = "project", + "created_by" = "created_by", +} diff --git a/packages/constants/src/core/label.ts b/packages/constants/src/core/label.ts new file mode 100644 index 00000000000..1b12375dafc --- /dev/null +++ b/packages/constants/src/core/label.ts @@ -0,0 +1,12 @@ +export const LABEL_COLOR_OPTIONS = [ + "#FF6900", + "#FCB900", + "#7BDCB5", + "#00D084", + "#8ED1FC", + "#0693E3", + "#ABB8C3", + "#EB144C", + "#F78DA7", + "#9900EF", +]; diff --git a/packages/constants/src/core/module.ts b/packages/constants/src/core/module.ts new file mode 100644 index 00000000000..b43943f7d3c --- /dev/null +++ b/packages/constants/src/core/module.ts @@ -0,0 +1,83 @@ +// types +import { TModuleOrderByOptions, TModuleStatus } from "@plane/types"; + +export const MODULE_STATUS: { + label: string; + value: TModuleStatus; + color: string; + textColor: string; + bgColor: string; +}[] = [ + { + label: "Backlog", + value: "backlog", + color: "#a3a3a2", + textColor: "text-custom-text-400", + bgColor: "bg-custom-background-80", + }, + { + label: "Planned", + value: "planned", + color: "#3f76ff", + textColor: "text-blue-500", + bgColor: "bg-indigo-50", + }, + { + label: "In Progress", + value: "in-progress", + color: "#f39e1f", + textColor: "text-amber-500", + bgColor: "bg-amber-50", + }, + { + label: "Paused", + value: "paused", + color: "#525252", + textColor: "text-custom-text-300", + bgColor: "bg-custom-background-90", + }, + { + label: "Completed", + value: "completed", + color: "#16a34a", + textColor: "text-green-600", + bgColor: "bg-green-100", + }, + { + label: "Cancelled", + value: "cancelled", + color: "#ef4444", + textColor: "text-red-500", + bgColor: "bg-red-50", + }, +]; + +export const MODULE_ORDER_BY_OPTIONS: { + key: TModuleOrderByOptions; + label: string; +}[] = [ + { + key: "name", + label: "Name", + }, + { + key: "progress", + label: "Progress", + }, + { + key: "issues_length", + label: "Number of issues", + }, + { + key: "target_date", + label: "Due date", + }, + { + key: "created_at", + label: "Created date", + }, + { + key: "sort_order", + label: "Manual", + }, +]; diff --git a/packages/constants/src/core/notification.ts b/packages/constants/src/core/notification.ts new file mode 100644 index 00000000000..36ab3c8eeda --- /dev/null +++ b/packages/constants/src/core/notification.ts @@ -0,0 +1,136 @@ +import { TUnreadNotificationsCount } from "@plane/types"; + +export enum ENotificationTab { + ALL = "all", + MENTIONS = "mentions", +} + +export enum ENotificationFilterType { + CREATED = "created", + ASSIGNED = "assigned", + SUBSCRIBED = "subscribed", +} + +export enum ENotificationLoader { + INIT_LOADER = "init-loader", + MUTATION_LOADER = "mutation-loader", + PAGINATION_LOADER = "pagination-loader", + REFRESH = "refresh", + MARK_ALL_AS_READY = "mark-all-as-read", +} + +export enum ENotificationQueryParamType { + INIT = "init", + CURRENT = "current", + NEXT = "next", +} + +export type TNotificationTab = ENotificationTab.ALL | ENotificationTab.MENTIONS; + +export const NOTIFICATION_TABS = [ + { + label: "All", + value: ENotificationTab.ALL, + count: (unReadNotification: TUnreadNotificationsCount) => unReadNotification?.total_unread_notifications_count || 0, + }, + { + label: "Mentions", + value: ENotificationTab.MENTIONS, + count: (unReadNotification: TUnreadNotificationsCount) => + unReadNotification?.mention_unread_notifications_count || 0, + }, +]; + +export const FILTER_TYPE_OPTIONS = [ + { + label: "Assigned to me", + value: ENotificationFilterType.ASSIGNED, + }, + { + label: "Created by me", + value: ENotificationFilterType.CREATED, + }, + { + label: "Subscribed by me", + value: ENotificationFilterType.SUBSCRIBED, + }, +]; + +export const NOTIFICATION_SNOOZE_OPTIONS = [ + { + key: "1_day", + label: "1 day", + value: () => { + const date = new Date(); + return new Date(date.getTime() + 24 * 60 * 60 * 1000); + }, + }, + { + key: "3_days", + label: "3 days", + value: () => { + const date = new Date(); + return new Date(date.getTime() + 3 * 24 * 60 * 60 * 1000); + }, + }, + { + key: "5_days", + label: "5 days", + value: () => { + const date = new Date(); + return new Date(date.getTime() + 5 * 24 * 60 * 60 * 1000); + }, + }, + { + key: "1_week", + label: "1 week", + value: () => { + const date = new Date(); + return new Date(date.getTime() + 7 * 24 * 60 * 60 * 1000); + }, + }, + { + key: "2_weeks", + label: "2 weeks", + value: () => { + const date = new Date(); + return new Date(date.getTime() + 14 * 24 * 60 * 60 * 1000); + }, + }, + { + key: "custom", + label: "Custom", + value: undefined, + }, +]; + +// Constant for all time values in 30 minutes interval in 12 hours format +export const allTimeIn30MinutesInterval12HoursFormat: Array<{ + label: string; + value: string; +}> = [ + { label: "12:00", value: "12:00" }, + { label: "12:30", value: "12:30" }, + { label: "01:00", value: "01:00" }, + { label: "01:30", value: "01:30" }, + { label: "02:00", value: "02:00" }, + { label: "02:30", value: "02:30" }, + { label: "03:00", value: "03:00" }, + { label: "03:30", value: "03:30" }, + { label: "04:00", value: "04:00" }, + { label: "04:30", value: "04:30" }, + { label: "05:00", value: "05:00" }, + { label: "05:30", value: "05:30" }, + { label: "06:00", value: "06:00" }, + { label: "06:30", value: "06:30" }, + { label: "07:00", value: "07:00" }, + { label: "07:30", value: "07:30" }, + { label: "08:00", value: "08:00" }, + { label: "08:30", value: "08:30" }, + { label: "09:00", value: "09:00" }, + { label: "09:30", value: "09:30" }, + { label: "10:00", value: "10:00" }, + { label: "10:30", value: "10:30" }, + { label: "11:00", value: "11:00" }, + { label: "11:30", value: "11:30" }, +]; diff --git a/packages/constants/src/core/page.ts b/packages/constants/src/core/page.ts new file mode 100644 index 00000000000..a8c5c4dc3d3 --- /dev/null +++ b/packages/constants/src/core/page.ts @@ -0,0 +1,34 @@ +// types +import { TPageFiltersSortKey, TPageFiltersSortBy } from "@plane/types"; + +export enum EPageAccess { + PUBLIC = 0, + PRIVATE = 1, +} + +export const PAGE_SORTING_KEY_OPTIONS: { + key: TPageFiltersSortKey; + label: string; +}[] = [ + { key: "name", label: "Name" }, + { key: "created_at", label: "Date created" }, + { key: "updated_at", label: "Date modified" }, +]; + +export const PAGE_SORT_BY_OPTIONS: { + key: TPageFiltersSortBy; + label: string; +}[] = [ + { key: "asc", label: "Ascending" }, + { key: "desc", label: "Descending" }, +]; + +export type TCreatePageModal = { + isOpen: boolean; + pageAccess?: EPageAccess; +}; + +export const DEFAULT_CREATE_PAGE_MODAL_DATA: TCreatePageModal = { + isOpen: false, + pageAccess: EPageAccess.PUBLIC, +}; diff --git a/packages/constants/src/core/payment.ts b/packages/constants/src/core/payment.ts new file mode 100644 index 00000000000..efc7f6a1794 --- /dev/null +++ b/packages/constants/src/core/payment.ts @@ -0,0 +1,8 @@ +// Product subscription tiers +export enum EProductSubscriptionTier { + FREE = 0, + ONE = 5, + PRO = 10, + BUSINESS = 20, + ENTERPRISE = 30, +} diff --git a/packages/constants/src/core/profile.ts b/packages/constants/src/core/profile.ts new file mode 100644 index 00000000000..179173d39ce --- /dev/null +++ b/packages/constants/src/core/profile.ts @@ -0,0 +1,30 @@ +export const PROFILE_VIEWER_TAB = [ + { + route: "", + label: "Summary", + selected: "/", + }, +]; + +export const PROFILE_ADMINS_TAB = [ + { + route: "assigned", + label: "Assigned", + selected: "/assigned/", + }, + { + route: "created", + label: "Created", + selected: "/created/", + }, + { + route: "subscribed", + label: "Subscribed", + selected: "/subscribed/", + }, + { + route: "activity", + label: "Activity", + selected: "/activity/", + }, +]; diff --git a/packages/constants/src/core/project.ts b/packages/constants/src/core/project.ts new file mode 100644 index 00000000000..e08ec5f19be --- /dev/null +++ b/packages/constants/src/core/project.ts @@ -0,0 +1,92 @@ +// types +import { TProjectAppliedDisplayFilterKeys, TProjectOrderByOptions } from "@plane/types"; + +export const GROUP_CHOICES = { + backlog: "Backlog", + unstarted: "Unstarted", + started: "Started", + completed: "Completed", + cancelled: "Cancelled", +}; + +export const PROJECT_AUTOMATION_MONTHS = [ + { label: "1 month", value: 1 }, + { label: "3 months", value: 3 }, + { label: "6 months", value: 6 }, + { label: "9 months", value: 9 }, + { label: "12 months", value: 12 }, +]; + +export const PROJECT_UNSPLASH_COVERS = [ + "https://images.unsplash.com/photo-1531045535792-b515d59c3d1f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=870&q=80", + "https://images.unsplash.com/photo-1693027407934-e3aa8a54c7ae?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=870&q=80", + "https://images.unsplash.com/photo-1518837695005-2083093ee35b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=870&q=80", + "https://images.unsplash.com/photo-1464925257126-6450e871c667?auto=format&fit=crop&q=80&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&w=870&q=80", + "https://images.unsplash.com/photo-1606768666853-403c90a981ad?auto=format&fit=crop&q=80&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&w=870&q=80", + "https://images.unsplash.com/photo-1627556592933-ffe99c1cd9eb?auto=format&fit=crop&q=80&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&w=870&q=80", + "https://images.unsplash.com/photo-1643330683233-ff2ac89b002c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=870&q=80", + "https://images.unsplash.com/photo-1542202229-7d93c33f5d07?auto=format&fit=crop&q=80&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&w=870&q=80", + "https://images.unsplash.com/photo-1511497584788-876760111969?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=870&q=80", + "https://images.unsplash.com/photo-1475738972911-5b44ce984c42?auto=format&fit=crop&q=80&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&w=870&q=80", + "https://images.unsplash.com/photo-1418065460487-3e41a6c84dc5?auto=format&fit=crop&q=80&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&w=870&q=80", + "https://images.unsplash.com/photo-1673393058808-50e9baaf4d2c?auto=format&fit=crop&q=80&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&w=870&q=80", + "https://images.unsplash.com/photo-1696643830146-44a8755f1905?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=870&q=80", + "https://images.unsplash.com/photo-1693868769698-6c7440636a09?auto=format&fit=crop&q=80&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&w=870&q=80", + "https://images.unsplash.com/photo-1691230995681-480d86cbc135?auto=format&fit=crop&q=80&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&w=870&q=80", + "https://images.unsplash.com/photo-1675351066828-6fc770b90dd2?auto=format&fit=crop&q=80&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&w=870&q=80", +]; + +export const PROJECT_ORDER_BY_OPTIONS: { + key: TProjectOrderByOptions; + label: string; +}[] = [ + { + key: "sort_order", + label: "Manual", + }, + { + key: "name", + label: "Name", + }, + { + key: "created_at", + label: "Created date", + }, + { + key: "members_length", + label: "Number of members", + }, +]; + +export const PROJECT_DISPLAY_FILTER_OPTIONS: { + key: TProjectAppliedDisplayFilterKeys; + label: string; +}[] = [ + { + key: "my_projects", + label: "My projects", + }, + { + key: "archived_projects", + label: "Archived", + }, +]; + +export const PROJECT_ERROR_MESSAGES = { + permissionError: { + title: "You don't have permission to perform this action.", + message: undefined, + }, + cycleDeleteError: { + title: "Error", + message: "Failed to delete cycle", + }, + moduleDeleteError: { + title: "Error", + message: "Failed to delete module", + }, + issueDeleteError: { + title: "Error", + message: "Failed to delete issue", + }, +}; diff --git a/packages/constants/src/core/seo-variables.ts b/packages/constants/src/core/seo-variables.ts new file mode 100644 index 00000000000..aafd5f7a3ed --- /dev/null +++ b/packages/constants/src/core/seo-variables.ts @@ -0,0 +1,8 @@ +export const SITE_NAME = "Plane | Simple, extensible, open-source project management tool."; +export const SITE_TITLE = "Plane | Simple, extensible, open-source project management tool."; +export const SITE_DESCRIPTION = + "Open-source project management tool to manage issues, sprints, and product roadmaps with peace of mind."; +export const SITE_KEYWORDS = + "software development, plan, ship, software, accelerate, code management, release management, project management, issue tracking, agile, scrum, kanban, collaboration"; +export const SITE_URL = "https://app.plane.so/"; +export const TWITTER_USER_NAME = "Plane | Simple, extensible, open-source project management tool."; diff --git a/packages/constants/src/core/spreadsheet.ts b/packages/constants/src/core/spreadsheet.ts new file mode 100644 index 00000000000..abf1f8611b2 --- /dev/null +++ b/packages/constants/src/core/spreadsheet.ts @@ -0,0 +1,22 @@ +"use client"; +// types +import { IIssueDisplayProperties } from "@plane/types"; + +export const SPREADSHEET_PROPERTY_LIST: (keyof IIssueDisplayProperties)[] = [ + "state", + "priority", + "assignee", + "labels", + "modules", + "cycle", + "start_date", + "due_date", + "estimate", + "created_on", + "updated_on", + "link", + "attachment_count", + "sub_issue_count", +]; + +export const SPREADSHEET_SELECT_GROUP = "spreadsheet-issues"; diff --git a/packages/constants/src/core/state.ts b/packages/constants/src/core/state.ts new file mode 100644 index 00000000000..b35951046b2 --- /dev/null +++ b/packages/constants/src/core/state.ts @@ -0,0 +1,49 @@ +import { TStateGroups } from "@plane/types"; + +export type TDraggableData = { + groupKey: TStateGroups; + id: string; +}; + +export const STATE_GROUPS: { + [key in TStateGroups]: { + key: TStateGroups; + label: string; + color: string; + }; +} = { + backlog: { + key: "backlog", + label: "Backlog", + color: "#d9d9d9", + }, + unstarted: { + key: "unstarted", + label: "Unstarted", + color: "#3f76ff", + }, + started: { + key: "started", + label: "Started", + color: "#f59e0b", + }, + completed: { + key: "completed", + label: "Completed", + color: "#16a34a", + }, + cancelled: { + key: "cancelled", + label: "Canceled", + color: "#dc2626", + }, +}; + +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, +]; diff --git a/packages/constants/src/core/swr-config.ts b/packages/constants/src/core/swr-config.ts new file mode 100644 index 00000000000..59a9450513f --- /dev/null +++ b/packages/constants/src/core/swr-config.ts @@ -0,0 +1,7 @@ +export const SWR_CONFIG = { + refreshWhenHidden: false, + revalidateIfStale: true, + revalidateOnFocus: true, + revalidateOnMount: true, + errorRetryCount: 3, +}; diff --git a/packages/constants/src/core/tab-indices.ts b/packages/constants/src/core/tab-indices.ts new file mode 100644 index 00000000000..58a12f4174c --- /dev/null +++ b/packages/constants/src/core/tab-indices.ts @@ -0,0 +1,94 @@ +export const ISSUE_FORM_TAB_INDICES = [ + "name", + "description_html", + "feeling_lucky", + "ai_assistant", + "state_id", + "priority", + "assignee_ids", + "label_ids", + "start_date", + "target_date", + "cycle_id", + "module_ids", + "estimate_point", + "parent_id", + "create_more", + "discard_button", + "draft_button", + "submit_button", + "project_id", + "remove_parent", +]; + +export const INTAKE_ISSUE_CREATE_FORM_TAB_INDICES = [ + "name", + "description_html", + "state_id", + "priority", + "assignee_ids", + "label_ids", + "start_date", + "target_date", + "cycle_id", + "module_ids", + "estimate_point", + "parent_id", + "create_more", + "discard_button", + "submit_button", +]; + +export const CREATE_LABEL_TAB_INDICES = ["name", "color", "cancel", "submit"]; + +export const PROJECT_CREATE_TAB_INDICES = [ + "name", + "identifier", + "description", + "network", + "lead", + "cancel", + "submit", + "close", + "cover_image", + "logo_props", +]; + +export const PROJECT_CYCLE_TAB_INDICES = ["name", "description", "date_range", "cancel", "submit", "project_id"]; + +export const PROJECT_MODULE_TAB_INDICES = [ + "name", + "description", + "date_range", + "status", + "lead", + "member_ids", + "cancel", + "submit", +]; + +export const PROJECT_VIEW_TAB_INDICES = ["name", "description", "filters", "cancel", "submit"]; + +export const PROJECT_PAGE_TAB_INDICES = ["name", "public", "private", "cancel", "submit"]; + +export enum ETabIndices { + ISSUE_FORM = "issue-form", + INTAKE_ISSUE_FORM = "intake-issue-form", + CREATE_LABEL = "create-label", + PROJECT_CREATE = "project-create", + PROJECT_CYCLE = "project-cycle", + PROJECT_MODULE = "project-module", + PROJECT_VIEW = "project-view", + PROJECT_PAGE = "project-page", +} + +export const TAB_INDEX_MAP: Record = { + [ETabIndices.ISSUE_FORM]: ISSUE_FORM_TAB_INDICES, + [ETabIndices.INTAKE_ISSUE_FORM]: INTAKE_ISSUE_CREATE_FORM_TAB_INDICES, + [ETabIndices.CREATE_LABEL]: CREATE_LABEL_TAB_INDICES, + [ETabIndices.PROJECT_CREATE]: PROJECT_CREATE_TAB_INDICES, + [ETabIndices.PROJECT_CYCLE]: PROJECT_CYCLE_TAB_INDICES, + [ETabIndices.PROJECT_MODULE]: PROJECT_MODULE_TAB_INDICES, + [ETabIndices.PROJECT_VIEW]: PROJECT_VIEW_TAB_INDICES, + [ETabIndices.PROJECT_PAGE]: PROJECT_PAGE_TAB_INDICES, +}; diff --git a/packages/constants/src/core/themes.ts b/packages/constants/src/core/themes.ts new file mode 100644 index 00000000000..c221a631edc --- /dev/null +++ b/packages/constants/src/core/themes.ts @@ -0,0 +1,75 @@ +export const THEMES = ["light", "dark", "light-contrast", "dark-contrast", "custom"]; + +export interface I_THEME_OPTION { + value: string; + label: string; + type: string; + icon: { + border: string; + color1: string; + color2: string; + }; +} + +export const THEME_OPTIONS: I_THEME_OPTION[] = [ + { + value: "system", + label: "System preference", + type: "light", + icon: { + border: "#DEE2E6", + color1: "#FAFAFA", + color2: "#3F76FF", + }, + }, + { + value: "light", + label: "Light", + type: "light", + icon: { + border: "#DEE2E6", + color1: "#FAFAFA", + color2: "#3F76FF", + }, + }, + { + value: "dark", + label: "Dark", + type: "dark", + icon: { + border: "#2E3234", + color1: "#191B1B", + color2: "#3C85D9", + }, + }, + { + value: "light-contrast", + label: "Light high contrast", + type: "light", + icon: { + border: "#000000", + color1: "#FFFFFF", + color2: "#3F76FF", + }, + }, + { + value: "dark-contrast", + label: "Dark high contrast", + type: "dark", + icon: { + border: "#FFFFFF", + color1: "#030303", + color2: "#3A8BE9", + }, + }, + { + value: "custom", + label: "Custom theme", + type: "light", + icon: { + border: "#FFC9C9", + color1: "#FFF7F7", + color2: "#FF5151", + }, + }, +]; diff --git a/packages/constants/src/core/timezones.ts b/packages/constants/src/core/timezones.ts new file mode 100644 index 00000000000..6db9dfea860 --- /dev/null +++ b/packages/constants/src/core/timezones.ts @@ -0,0 +1,2983 @@ +export type TTimezone = { + name: string; + gmtOffset: string; + value: string; +}; + +export const TIME_ZONES: TTimezone[] = [ + { + name: "Africa/Abidjan", + gmtOffset: "GMT", + value: "Africa/Abidjan", + }, + { + name: "Africa/Accra", + gmtOffset: "GMT", + value: "Africa/Accra", + }, + { + name: "Africa/Addis_Ababa", + gmtOffset: "GMT+03:00", + value: "Africa/Addis_Ababa", + }, + { + name: "Africa/Algiers", + gmtOffset: "GMT+01:00", + value: "Africa/Algiers", + }, + { + name: "Africa/Asmara", + gmtOffset: "GMT+03:00", + value: "Africa/Asmara", + }, + { + name: "Africa/Asmera", + gmtOffset: "GMT+03:00", + value: "Africa/Asmera", + }, + { + name: "Africa/Bamako", + gmtOffset: "GMT", + value: "Africa/Bamako", + }, + { + name: "Africa/Bangui", + gmtOffset: "GMT+01:00", + value: "Africa/Bangui", + }, + { + name: "Africa/Banjul", + gmtOffset: "GMT", + value: "Africa/Banjul", + }, + { + name: "Africa/Bissau", + gmtOffset: "GMT", + value: "Africa/Bissau", + }, + { + name: "Africa/Blantyre", + gmtOffset: "GMT+02:00", + value: "Africa/Blantyre", + }, + { + name: "Africa/Brazzaville", + gmtOffset: "GMT+01:00", + value: "Africa/Brazzaville", + }, + { + name: "Africa/Bujumbura", + gmtOffset: "GMT+02:00", + value: "Africa/Bujumbura", + }, + { + name: "Africa/Cairo", + gmtOffset: "GMT+03:00", + value: "Africa/Cairo", + }, + { + name: "Africa/Casablanca", + gmtOffset: "GMT+01:00", + value: "Africa/Casablanca", + }, + { + name: "Africa/Ceuta", + gmtOffset: "GMT+02:00", + value: "Africa/Ceuta", + }, + { + name: "Africa/Conakry", + gmtOffset: "GMT", + value: "Africa/Conakry", + }, + { + name: "Africa/Dakar", + gmtOffset: "GMT", + value: "Africa/Dakar", + }, + { + name: "Africa/Dar_es_Salaam", + gmtOffset: "GMT+03:00", + value: "Africa/Dar_es_Salaam", + }, + { + name: "Africa/Djibouti", + gmtOffset: "GMT+03:00", + value: "Africa/Djibouti", + }, + { + name: "Africa/Douala", + gmtOffset: "GMT+01:00", + value: "Africa/Douala", + }, + { + name: "Africa/El_Aaiun", + gmtOffset: "GMT+01:00", + value: "Africa/El_Aaiun", + }, + { + name: "Africa/Freetown", + gmtOffset: "GMT", + value: "Africa/Freetown", + }, + { + name: "Africa/Gaborone", + gmtOffset: "GMT+02:00", + value: "Africa/Gaborone", + }, + { + name: "Africa/Harare", + gmtOffset: "GMT+02:00", + value: "Africa/Harare", + }, + { + name: "Africa/Johannesburg", + gmtOffset: "GMT+02:00", + value: "Africa/Johannesburg", + }, + { + name: "Africa/Juba", + gmtOffset: "GMT+02:00", + value: "Africa/Juba", + }, + { + name: "Africa/Kampala", + gmtOffset: "GMT+03:00", + value: "Africa/Kampala", + }, + { + name: "Africa/Khartoum", + gmtOffset: "GMT+02:00", + value: "Africa/Khartoum", + }, + { + name: "Africa/Kigali", + gmtOffset: "GMT+02:00", + value: "Africa/Kigali", + }, + { + name: "Africa/Kinshasa", + gmtOffset: "GMT+01:00", + value: "Africa/Kinshasa", + }, + { + name: "Africa/Lagos", + gmtOffset: "GMT+01:00", + value: "Africa/Lagos", + }, + { + name: "Africa/Libreville", + gmtOffset: "GMT+01:00", + value: "Africa/Libreville", + }, + { + name: "Africa/Lome", + gmtOffset: "GMT", + value: "Africa/Lome", + }, + { + name: "Africa/Luanda", + gmtOffset: "GMT+01:00", + value: "Africa/Luanda", + }, + { + name: "Africa/Lubumbashi", + gmtOffset: "GMT+02:00", + value: "Africa/Lubumbashi", + }, + { + name: "Africa/Lusaka", + gmtOffset: "GMT+02:00", + value: "Africa/Lusaka", + }, + { + name: "Africa/Malabo", + gmtOffset: "GMT+01:00", + value: "Africa/Malabo", + }, + { + name: "Africa/Maputo", + gmtOffset: "GMT+02:00", + value: "Africa/Maputo", + }, + { + name: "Africa/Maseru", + gmtOffset: "GMT+02:00", + value: "Africa/Maseru", + }, + { + name: "Africa/Mbabane", + gmtOffset: "GMT+02:00", + value: "Africa/Mbabane", + }, + { + name: "Africa/Mogadishu", + gmtOffset: "GMT+03:00", + value: "Africa/Mogadishu", + }, + { + name: "Africa/Monrovia", + gmtOffset: "GMT", + value: "Africa/Monrovia", + }, + { + name: "Africa/Nairobi", + gmtOffset: "GMT+03:00", + value: "Africa/Nairobi", + }, + { + name: "Africa/Ndjamena", + gmtOffset: "GMT+01:00", + value: "Africa/Ndjamena", + }, + { + name: "Africa/Niamey", + gmtOffset: "GMT+01:00", + value: "Africa/Niamey", + }, + { + name: "Africa/Nouakchott", + gmtOffset: "GMT", + value: "Africa/Nouakchott", + }, + { + name: "Africa/Ouagadougou", + gmtOffset: "GMT", + value: "Africa/Ouagadougou", + }, + { + name: "Africa/Porto-Novo", + gmtOffset: "GMT+01:00", + value: "Africa/Porto-Novo", + }, + { + name: "Africa/Sao_Tome", + gmtOffset: "GMT", + value: "Africa/Sao_Tome", + }, + { + name: "Africa/Timbuktu", + gmtOffset: "GMT", + value: "Africa/Timbuktu", + }, + { + name: "Africa/Tripoli", + gmtOffset: "GMT+02:00", + value: "Africa/Tripoli", + }, + { + name: "Africa/Tunis", + gmtOffset: "GMT+01:00", + value: "Africa/Tunis", + }, + { + name: "Africa/Windhoek", + gmtOffset: "GMT+02:00", + value: "Africa/Windhoek", + }, + { + name: "America/Adak", + gmtOffset: "GMT-09:00", + value: "America/Adak", + }, + { + name: "America/Anchorage", + gmtOffset: "GMT-08:00", + value: "America/Anchorage", + }, + { + name: "America/Anguilla", + gmtOffset: "GMT-04:00", + value: "America/Anguilla", + }, + { + name: "America/Antigua", + gmtOffset: "GMT-04:00", + value: "America/Antigua", + }, + { + name: "America/Araguaina", + gmtOffset: "GMT-03:00", + value: "America/Araguaina", + }, + { + name: "America/Argentina/Buenos_Aires", + gmtOffset: "GMT-03:00", + value: "America/Argentina/Buenos_Aires", + }, + { + name: "America/Argentina/Catamarca", + gmtOffset: "GMT-03:00", + value: "America/Argentina/Catamarca", + }, + { + name: "America/Argentina/ComodRivadavia", + gmtOffset: "GMT-03:00", + value: "America/Argentina/ComodRivadavia", + }, + { + name: "America/Argentina/Cordoba", + gmtOffset: "GMT-03:00", + value: "America/Argentina/Cordoba", + }, + { + name: "America/Argentina/Jujuy", + gmtOffset: "GMT-03:00", + value: "America/Argentina/Jujuy", + }, + { + name: "America/Argentina/La_Rioja", + gmtOffset: "GMT-03:00", + value: "America/Argentina/La_Rioja", + }, + { + name: "America/Argentina/Mendoza", + gmtOffset: "GMT-03:00", + value: "America/Argentina/Mendoza", + }, + { + name: "America/Argentina/Rio_Gallegos", + gmtOffset: "GMT-03:00", + value: "America/Argentina/Rio_Gallegos", + }, + { + name: "America/Argentina/Salta", + gmtOffset: "GMT-03:00", + value: "America/Argentina/Salta", + }, + { + name: "America/Argentina/San_Juan", + gmtOffset: "GMT-03:00", + value: "America/Argentina/San_Juan", + }, + { + name: "America/Argentina/San_Luis", + gmtOffset: "GMT-03:00", + value: "America/Argentina/San_Luis", + }, + { + name: "America/Argentina/Tucuman", + gmtOffset: "GMT-03:00", + value: "America/Argentina/Tucuman", + }, + { + name: "America/Argentina/Ushuaia", + gmtOffset: "GMT-03:00", + value: "America/Argentina/Ushuaia", + }, + { + name: "America/Aruba", + gmtOffset: "GMT-04:00", + value: "America/Aruba", + }, + { + name: "America/Asuncion", + gmtOffset: "GMT-04:00", + value: "America/Asuncion", + }, + { + name: "America/Atikokan", + gmtOffset: "GMT-05:00", + value: "America/Atikokan", + }, + { + name: "America/Atka", + gmtOffset: "GMT-09:00", + value: "America/Atka", + }, + { + name: "America/Bahia", + gmtOffset: "GMT-03:00", + value: "America/Bahia", + }, + { + name: "America/Bahia_Banderas", + gmtOffset: "GMT-06:00", + value: "America/Bahia_Banderas", + }, + { + name: "America/Barbados", + gmtOffset: "GMT-04:00", + value: "America/Barbados", + }, + { + name: "America/Belem", + gmtOffset: "GMT-03:00", + value: "America/Belem", + }, + { + name: "America/Belize", + gmtOffset: "GMT-06:00", + value: "America/Belize", + }, + { + name: "America/Blanc-Sablon", + gmtOffset: "GMT-04:00", + value: "America/Blanc-Sablon", + }, + { + name: "America/Boa_Vista", + gmtOffset: "GMT-04:00", + value: "America/Boa_Vista", + }, + { + name: "America/Bogota", + gmtOffset: "GMT-05:00", + value: "America/Bogota", + }, + { + name: "America/Boise", + gmtOffset: "GMT-06:00", + value: "America/Boise", + }, + { + name: "America/Buenos_Aires", + gmtOffset: "GMT-03:00", + value: "America/Buenos_Aires", + }, + { + name: "America/Cambridge_Bay", + gmtOffset: "GMT-06:00", + value: "America/Cambridge_Bay", + }, + { + name: "America/Campo_Grande", + gmtOffset: "GMT-04:00", + value: "America/Campo_Grande", + }, + { + name: "America/Cancun", + gmtOffset: "GMT-05:00", + value: "America/Cancun", + }, + { + name: "America/Caracas", + gmtOffset: "GMT-04:00", + value: "America/Caracas", + }, + { + name: "America/Catamarca", + gmtOffset: "GMT-03:00", + value: "America/Catamarca", + }, + { + name: "America/Cayenne", + gmtOffset: "GMT-03:00", + value: "America/Cayenne", + }, + { + name: "America/Cayman", + gmtOffset: "GMT-05:00", + value: "America/Cayman", + }, + { + name: "America/Chicago", + gmtOffset: "GMT-05:00", + value: "America/Chicago", + }, + { + name: "America/Chihuahua", + gmtOffset: "GMT-06:00", + value: "America/Chihuahua", + }, + { + name: "America/Ciudad_Juarez", + gmtOffset: "GMT-06:00", + value: "America/Ciudad_Juarez", + }, + { + name: "America/Coral_Harbour", + gmtOffset: "GMT-05:00", + value: "America/Coral_Harbour", + }, + { + name: "America/Cordoba", + gmtOffset: "GMT-03:00", + value: "America/Cordoba", + }, + { + name: "America/Costa_Rica", + gmtOffset: "GMT-06:00", + value: "America/Costa_Rica", + }, + { + name: "America/Creston", + gmtOffset: "GMT-07:00", + value: "America/Creston", + }, + { + name: "America/Cuiaba", + gmtOffset: "GMT-04:00", + value: "America/Cuiaba", + }, + { + name: "America/Curacao", + gmtOffset: "GMT-04:00", + value: "America/Curacao", + }, + { + name: "America/Danmarkshavn", + gmtOffset: "GMT", + value: "America/Danmarkshavn", + }, + { + name: "America/Dawson", + gmtOffset: "GMT-07:00", + value: "America/Dawson", + }, + { + name: "America/Dawson_Creek", + gmtOffset: "GMT-07:00", + value: "America/Dawson_Creek", + }, + { + name: "America/Denver", + gmtOffset: "GMT-06:00", + value: "America/Denver", + }, + { + name: "America/Detroit", + gmtOffset: "GMT-04:00", + value: "America/Detroit", + }, + { + name: "America/Dominica", + gmtOffset: "GMT-04:00", + value: "America/Dominica", + }, + { + name: "America/Edmonton", + gmtOffset: "GMT-06:00", + value: "America/Edmonton", + }, + { + name: "America/Eirunepe", + gmtOffset: "GMT-05:00", + value: "America/Eirunepe", + }, + { + name: "America/El_Salvador", + gmtOffset: "GMT-06:00", + value: "America/El_Salvador", + }, + { + name: "America/Ensenada", + gmtOffset: "GMT-07:00", + value: "America/Ensenada", + }, + { + name: "America/Fort_Nelson", + gmtOffset: "GMT-07:00", + value: "America/Fort_Nelson", + }, + { + name: "America/Fort_Wayne", + gmtOffset: "GMT-04:00", + value: "America/Fort_Wayne", + }, + { + name: "America/Fortaleza", + gmtOffset: "GMT-03:00", + value: "America/Fortaleza", + }, + { + name: "America/Glace_Bay", + gmtOffset: "GMT-03:00", + value: "America/Glace_Bay", + }, + { + name: "America/Godthab", + gmtOffset: "GMT-02:00", + value: "America/Godthab", + }, + { + name: "America/Goose_Bay", + gmtOffset: "GMT-03:00", + value: "America/Goose_Bay", + }, + { + name: "America/Grand_Turk", + gmtOffset: "GMT-04:00", + value: "America/Grand_Turk", + }, + { + name: "America/Grenada", + gmtOffset: "GMT-04:00", + value: "America/Grenada", + }, + { + name: "America/Guadeloupe", + gmtOffset: "GMT-04:00", + value: "America/Guadeloupe", + }, + { + name: "America/Guatemala", + gmtOffset: "GMT-06:00", + value: "America/Guatemala", + }, + { + name: "America/Guayaquil", + gmtOffset: "GMT-05:00", + value: "America/Guayaquil", + }, + { + name: "America/Guyana", + gmtOffset: "GMT-04:00", + value: "America/Guyana", + }, + { + name: "America/Halifax", + gmtOffset: "GMT-03:00", + value: "America/Halifax", + }, + { + name: "America/Havana", + gmtOffset: "GMT-04:00", + value: "America/Havana", + }, + { + name: "America/Hermosillo", + gmtOffset: "GMT-07:00", + value: "America/Hermosillo", + }, + { + name: "America/Indiana/Indianapolis", + gmtOffset: "GMT-04:00", + value: "America/Indiana/Indianapolis", + }, + { + name: "America/Indiana/Knox", + gmtOffset: "GMT-05:00", + value: "America/Indiana/Knox", + }, + { + name: "America/Indiana/Marengo", + gmtOffset: "GMT-04:00", + value: "America/Indiana/Marengo", + }, + { + name: "America/Indiana/Petersburg", + gmtOffset: "GMT-04:00", + value: "America/Indiana/Petersburg", + }, + { + name: "America/Indiana/Tell_City", + gmtOffset: "GMT-05:00", + value: "America/Indiana/Tell_City", + }, + { + name: "America/Indiana/Vevay", + gmtOffset: "GMT-04:00", + value: "America/Indiana/Vevay", + }, + { + name: "America/Indiana/Vincennes", + gmtOffset: "GMT-04:00", + value: "America/Indiana/Vincennes", + }, + { + name: "America/Indiana/Winamac", + gmtOffset: "GMT-04:00", + value: "America/Indiana/Winamac", + }, + { + name: "America/Indianapolis", + gmtOffset: "GMT-04:00", + value: "America/Indianapolis", + }, + { + name: "America/Inuvik", + gmtOffset: "GMT-06:00", + value: "America/Inuvik", + }, + { + name: "America/Iqaluit", + gmtOffset: "GMT-04:00", + value: "America/Iqaluit", + }, + { + name: "America/Jamaica", + gmtOffset: "GMT-05:00", + value: "America/Jamaica", + }, + { + name: "America/Jujuy", + gmtOffset: "GMT-03:00", + value: "America/Jujuy", + }, + { + name: "America/Juneau", + gmtOffset: "GMT-08:00", + value: "America/Juneau", + }, + { + name: "America/Kentucky/Louisville", + gmtOffset: "GMT-04:00", + value: "America/Kentucky/Louisville", + }, + { + name: "America/Kentucky/Monticello", + gmtOffset: "GMT-04:00", + value: "America/Kentucky/Monticello", + }, + { + name: "America/Knox_IN", + gmtOffset: "GMT-05:00", + value: "America/Knox_IN", + }, + { + name: "America/Kralendijk", + gmtOffset: "GMT-04:00", + value: "America/Kralendijk", + }, + { + name: "America/La_Paz", + gmtOffset: "GMT-04:00", + value: "America/La_Paz", + }, + { + name: "America/Lima", + gmtOffset: "GMT-05:00", + value: "America/Lima", + }, + { + name: "America/Los_Angeles", + gmtOffset: "GMT-07:00", + value: "America/Los_Angeles", + }, + { + name: "America/Louisville", + gmtOffset: "GMT-04:00", + value: "America/Louisville", + }, + { + name: "America/Lower_Princes", + gmtOffset: "GMT-04:00", + value: "America/Lower_Princes", + }, + { + name: "America/Maceio", + gmtOffset: "GMT-03:00", + value: "America/Maceio", + }, + { + name: "America/Managua", + gmtOffset: "GMT-06:00", + value: "America/Managua", + }, + { + name: "America/Manaus", + gmtOffset: "GMT-04:00", + value: "America/Manaus", + }, + { + name: "America/Marigot", + gmtOffset: "GMT-04:00", + value: "America/Marigot", + }, + { + name: "America/Martinique", + gmtOffset: "GMT-04:00", + value: "America/Martinique", + }, + { + name: "America/Matamoros", + gmtOffset: "GMT-05:00", + value: "America/Matamoros", + }, + { + name: "America/Mazatlan", + gmtOffset: "GMT-07:00", + value: "America/Mazatlan", + }, + { + name: "America/Mendoza", + gmtOffset: "GMT-03:00", + value: "America/Mendoza", + }, + { + name: "America/Menominee", + gmtOffset: "GMT-05:00", + value: "America/Menominee", + }, + { + name: "America/Merida", + gmtOffset: "GMT-06:00", + value: "America/Merida", + }, + { + name: "America/Metlakatla", + gmtOffset: "GMT-08:00", + value: "America/Metlakatla", + }, + { + name: "America/Mexico_City", + gmtOffset: "GMT-06:00", + value: "America/Mexico_City", + }, + { + name: "America/Miquelon", + gmtOffset: "GMT-02:00", + value: "America/Miquelon", + }, + { + name: "America/Moncton", + gmtOffset: "GMT-03:00", + value: "America/Moncton", + }, + { + name: "America/Monterrey", + gmtOffset: "GMT-06:00", + value: "America/Monterrey", + }, + { + name: "America/Montevideo", + gmtOffset: "GMT-03:00", + value: "America/Montevideo", + }, + { + name: "America/Montreal", + gmtOffset: "GMT-04:00", + value: "America/Montreal", + }, + { + name: "America/Montserrat", + gmtOffset: "GMT-04:00", + value: "America/Montserrat", + }, + { + name: "America/Nassau", + gmtOffset: "GMT-04:00", + value: "America/Nassau", + }, + { + name: "America/New_York", + gmtOffset: "GMT-04:00", + value: "America/New_York", + }, + { + name: "America/Nipigon", + gmtOffset: "GMT-04:00", + value: "America/Nipigon", + }, + { + name: "America/Nome", + gmtOffset: "GMT-08:00", + value: "America/Nome", + }, + { + name: "America/Noronha", + gmtOffset: "GMT-02:00", + value: "America/Noronha", + }, + { + name: "America/North_Dakota/Beulah", + gmtOffset: "GMT-05:00", + value: "America/North_Dakota/Beulah", + }, + { + name: "America/North_Dakota/Center", + gmtOffset: "GMT-05:00", + value: "America/North_Dakota/Center", + }, + { + name: "America/North_Dakota/New_Salem", + gmtOffset: "GMT-05:00", + value: "America/North_Dakota/New_Salem", + }, + { + name: "America/Nuuk", + gmtOffset: "GMT-02:00", + value: "America/Nuuk", + }, + { + name: "America/Ojinaga", + gmtOffset: "GMT-05:00", + value: "America/Ojinaga", + }, + { + name: "America/Panama", + gmtOffset: "GMT-05:00", + value: "America/Panama", + }, + { + name: "America/Pangnirtung", + gmtOffset: "GMT-04:00", + value: "America/Pangnirtung", + }, + { + name: "America/Paramaribo", + gmtOffset: "GMT-03:00", + value: "America/Paramaribo", + }, + { + name: "America/Phoenix", + gmtOffset: "GMT-07:00", + value: "America/Phoenix", + }, + { + name: "America/Port-au-Prince", + gmtOffset: "GMT-04:00", + value: "America/Port-au-Prince", + }, + { + name: "America/Port_of_Spain", + gmtOffset: "GMT-04:00", + value: "America/Port_of_Spain", + }, + { + name: "America/Porto_Acre", + gmtOffset: "GMT-05:00", + value: "America/Porto_Acre", + }, + { + name: "America/Porto_Velho", + gmtOffset: "GMT-04:00", + value: "America/Porto_Velho", + }, + { + name: "America/Puerto_Rico", + gmtOffset: "GMT-04:00", + value: "America/Puerto_Rico", + }, + { + name: "America/Punta_Arenas", + gmtOffset: "GMT-03:00", + value: "America/Punta_Arenas", + }, + { + name: "America/Rainy_River", + gmtOffset: "GMT-05:00", + value: "America/Rainy_River", + }, + { + name: "America/Rankin_Inlet", + gmtOffset: "GMT-05:00", + value: "America/Rankin_Inlet", + }, + { + name: "America/Recife", + gmtOffset: "GMT-03:00", + value: "America/Recife", + }, + { + name: "America/Regina", + gmtOffset: "GMT-06:00", + value: "America/Regina", + }, + { + name: "America/Resolute", + gmtOffset: "GMT-05:00", + value: "America/Resolute", + }, + { + name: "America/Rio_Branco", + gmtOffset: "GMT-05:00", + value: "America/Rio_Branco", + }, + { + name: "America/Rosario", + gmtOffset: "GMT-03:00", + value: "America/Rosario", + }, + { + name: "America/Santa_Isabel", + gmtOffset: "GMT-07:00", + value: "America/Santa_Isabel", + }, + { + name: "America/Santarem", + gmtOffset: "GMT-03:00", + value: "America/Santarem", + }, + { + name: "America/Santiago", + gmtOffset: "GMT-04:00", + value: "America/Santiago", + }, + { + name: "America/Santo_Domingo", + gmtOffset: "GMT-04:00", + value: "America/Santo_Domingo", + }, + { + name: "America/Sao_Paulo", + gmtOffset: "GMT-03:00", + value: "America/Sao_Paulo", + }, + { + name: "America/Scoresbysund", + gmtOffset: "GMT-01:00", + value: "America/Scoresbysund", + }, + { + name: "America/Shiprock", + gmtOffset: "GMT-06:00", + value: "America/Shiprock", + }, + { + name: "America/Sitka", + gmtOffset: "GMT-08:00", + value: "America/Sitka", + }, + { + name: "America/St_Barthelemy", + gmtOffset: "GMT-04:00", + value: "America/St_Barthelemy", + }, + { + name: "America/St_Johns", + gmtOffset: "GMT-02:30", + value: "America/St_Johns", + }, + { + name: "America/St_Kitts", + gmtOffset: "GMT-04:00", + value: "America/St_Kitts", + }, + { + name: "America/St_Lucia", + gmtOffset: "GMT-04:00", + value: "America/St_Lucia", + }, + { + name: "America/St_Thomas", + gmtOffset: "GMT-04:00", + value: "America/St_Thomas", + }, + { + name: "America/St_Vincent", + gmtOffset: "GMT-04:00", + value: "America/St_Vincent", + }, + { + name: "America/Swift_Current", + gmtOffset: "GMT-06:00", + value: "America/Swift_Current", + }, + { + name: "America/Tegucigalpa", + gmtOffset: "GMT-06:00", + value: "America/Tegucigalpa", + }, + { + name: "America/Thule", + gmtOffset: "GMT-03:00", + value: "America/Thule", + }, + { + name: "America/Thunder_Bay", + gmtOffset: "GMT-04:00", + value: "America/Thunder_Bay", + }, + { + name: "America/Tijuana", + gmtOffset: "GMT-07:00", + value: "America/Tijuana", + }, + { + name: "America/Toronto", + gmtOffset: "GMT-04:00", + value: "America/Toronto", + }, + { + name: "America/Tortola", + gmtOffset: "GMT-04:00", + value: "America/Tortola", + }, + { + name: "America/Vancouver", + gmtOffset: "GMT-07:00", + value: "America/Vancouver", + }, + { + name: "America/Virgin", + gmtOffset: "GMT-04:00", + value: "America/Virgin", + }, + { + name: "America/Whitehorse", + gmtOffset: "GMT-07:00", + value: "America/Whitehorse", + }, + { + name: "America/Winnipeg", + gmtOffset: "GMT-05:00", + value: "America/Winnipeg", + }, + { + name: "America/Yakutat", + gmtOffset: "GMT-08:00", + value: "America/Yakutat", + }, + { + name: "America/Yellowknife", + gmtOffset: "GMT-06:00", + value: "America/Yellowknife", + }, + { + name: "Antarctica/Casey", + gmtOffset: "GMT+11:00", + value: "Antarctica/Casey", + }, + { + name: "Antarctica/Davis", + gmtOffset: "GMT+07:00", + value: "Antarctica/Davis", + }, + { + name: "Antarctica/DumontDUrville", + gmtOffset: "GMT+10:00", + value: "Antarctica/DumontDUrville", + }, + { + name: "Antarctica/Macquarie", + gmtOffset: "GMT+11:00", + value: "Antarctica/Macquarie", + }, + { + name: "Antarctica/Mawson", + gmtOffset: "GMT+05:00", + value: "Antarctica/Mawson", + }, + { + name: "Antarctica/McMurdo", + gmtOffset: "GMT+13:00", + value: "Antarctica/McMurdo", + }, + { + name: "Antarctica/Palmer", + gmtOffset: "GMT-03:00", + value: "Antarctica/Palmer", + }, + { + name: "Antarctica/Rothera", + gmtOffset: "GMT-03:00", + value: "Antarctica/Rothera", + }, + { + name: "Antarctica/South_Pole", + gmtOffset: "GMT+13:00", + value: "Antarctica/South_Pole", + }, + { + name: "Antarctica/Syowa", + gmtOffset: "GMT+03:00", + value: "Antarctica/Syowa", + }, + { + name: "Antarctica/Troll", + gmtOffset: "GMT", + value: "Antarctica/Troll", + }, + { + name: "Antarctica/Vostok", + gmtOffset: "GMT+06:00", + value: "Antarctica/Vostok", + }, + { + name: "Arctic/Longyearbyen", + gmtOffset: "GMT+02:00", + value: "Arctic/Longyearbyen", + }, + { + name: "Asia/Aden", + gmtOffset: "GMT+03:00", + value: "Asia/Aden", + }, + { + name: "Asia/Almaty", + gmtOffset: "GMT+06:00", + value: "Asia/Almaty", + }, + { + name: "Asia/Amman", + gmtOffset: "GMT+03:00", + value: "Asia/Amman", + }, + { + name: "Asia/Anadyr", + gmtOffset: "GMT+12:00", + value: "Asia/Anadyr", + }, + { + name: "Asia/Aqtau", + gmtOffset: "GMT+05:00", + value: "Asia/Aqtau", + }, + { + name: "Asia/Aqtobe", + gmtOffset: "GMT+05:00", + value: "Asia/Aqtobe", + }, + { + name: "Asia/Ashgabat", + gmtOffset: "GMT+05:00", + value: "Asia/Ashgabat", + }, + { + name: "Asia/Ashkhabad", + gmtOffset: "GMT+05:00", + value: "Asia/Ashkhabad", + }, + { + name: "Asia/Atyrau", + gmtOffset: "GMT+05:00", + value: "Asia/Atyrau", + }, + { + name: "Asia/Baghdad", + gmtOffset: "GMT+03:00", + value: "Asia/Baghdad", + }, + { + name: "Asia/Bahrain", + gmtOffset: "GMT+03:00", + value: "Asia/Bahrain", + }, + { + name: "Asia/Baku", + gmtOffset: "GMT+04:00", + value: "Asia/Baku", + }, + { + name: "Asia/Bangkok", + gmtOffset: "GMT+07:00", + value: "Asia/Bangkok", + }, + { + name: "Asia/Barnaul", + gmtOffset: "GMT+07:00", + value: "Asia/Barnaul", + }, + { + name: "Asia/Beirut", + gmtOffset: "GMT+03:00", + value: "Asia/Beirut", + }, + { + name: "Asia/Bishkek", + gmtOffset: "GMT+06:00", + value: "Asia/Bishkek", + }, + { + name: "Asia/Brunei", + gmtOffset: "GMT+08:00", + value: "Asia/Brunei", + }, + { + name: "Asia/Calcutta", + gmtOffset: "GMT+05:30", + value: "Asia/Calcutta", + }, + { + name: "Asia/Chita", + gmtOffset: "GMT+09:00", + value: "Asia/Chita", + }, + { + name: "Asia/Choibalsan", + gmtOffset: "GMT+08:00", + value: "Asia/Choibalsan", + }, + { + name: "Asia/Chongqing", + gmtOffset: "GMT+08:00", + value: "Asia/Chongqing", + }, + { + name: "Asia/Chungking", + gmtOffset: "GMT+08:00", + value: "Asia/Chungking", + }, + { + name: "Asia/Colombo", + gmtOffset: "GMT+05:30", + value: "Asia/Colombo", + }, + { + name: "Asia/Dacca", + gmtOffset: "GMT+06:00", + value: "Asia/Dacca", + }, + { + name: "Asia/Damascus", + gmtOffset: "GMT+03:00", + value: "Asia/Damascus", + }, + { + name: "Asia/Dhaka", + gmtOffset: "GMT+06:00", + value: "Asia/Dhaka", + }, + { + name: "Asia/Dili", + gmtOffset: "GMT+09:00", + value: "Asia/Dili", + }, + { + name: "Asia/Dubai", + gmtOffset: "GMT+04:00", + value: "Asia/Dubai", + }, + { + name: "Asia/Dushanbe", + gmtOffset: "GMT+05:00", + value: "Asia/Dushanbe", + }, + { + name: "Asia/Famagusta", + gmtOffset: "GMT+03:00", + value: "Asia/Famagusta", + }, + { + name: "Asia/Gaza", + gmtOffset: "GMT+03:00", + value: "Asia/Gaza", + }, + { + name: "Asia/Harbin", + gmtOffset: "GMT+08:00", + value: "Asia/Harbin", + }, + { + name: "Asia/Hebron", + gmtOffset: "GMT+03:00", + value: "Asia/Hebron", + }, + { + name: "Asia/Ho_Chi_Minh", + gmtOffset: "GMT+07:00", + value: "Asia/Ho_Chi_Minh", + }, + { + name: "Asia/Hong_Kong", + gmtOffset: "GMT+08:00", + value: "Asia/Hong_Kong", + }, + { + name: "Asia/Hovd", + gmtOffset: "GMT+07:00", + value: "Asia/Hovd", + }, + { + name: "Asia/Irkutsk", + gmtOffset: "GMT+08:00", + value: "Asia/Irkutsk", + }, + { + name: "Asia/Istanbul", + gmtOffset: "GMT+03:00", + value: "Asia/Istanbul", + }, + { + name: "Asia/Jakarta", + gmtOffset: "GMT+07:00", + value: "Asia/Jakarta", + }, + { + name: "Asia/Jayapura", + gmtOffset: "GMT+09:00", + value: "Asia/Jayapura", + }, + { + name: "Asia/Jerusalem", + gmtOffset: "GMT+03:00", + value: "Asia/Jerusalem", + }, + { + name: "Asia/Kabul", + gmtOffset: "GMT+04:30", + value: "Asia/Kabul", + }, + { + name: "Asia/Kamchatka", + gmtOffset: "GMT+12:00", + value: "Asia/Kamchatka", + }, + { + name: "Asia/Karachi", + gmtOffset: "GMT+05:00", + value: "Asia/Karachi", + }, + { + name: "Asia/Kashgar", + gmtOffset: "GMT+06:00", + value: "Asia/Kashgar", + }, + { + name: "Asia/Kathmandu", + gmtOffset: "GMT+05:45", + value: "Asia/Kathmandu", + }, + { + name: "Asia/Katmandu", + gmtOffset: "GMT+05:45", + value: "Asia/Katmandu", + }, + { + name: "Asia/Khandyga", + gmtOffset: "GMT+09:00", + value: "Asia/Khandyga", + }, + { + name: "Asia/Kolkata", + gmtOffset: "GMT+05:30", + value: "Asia/Kolkata", + }, + { + name: "Asia/Krasnoyarsk", + gmtOffset: "GMT+07:00", + value: "Asia/Krasnoyarsk", + }, + { + name: "Asia/Kuala_Lumpur", + gmtOffset: "GMT+08:00", + value: "Asia/Kuala_Lumpur", + }, + { + name: "Asia/Kuching", + gmtOffset: "GMT+08:00", + value: "Asia/Kuching", + }, + { + name: "Asia/Kuwait", + gmtOffset: "GMT+03:00", + value: "Asia/Kuwait", + }, + { + name: "Asia/Macao", + gmtOffset: "GMT+08:00", + value: "Asia/Macao", + }, + { + name: "Asia/Macau", + gmtOffset: "GMT+08:00", + value: "Asia/Macau", + }, + { + name: "Asia/Magadan", + gmtOffset: "GMT+11:00", + value: "Asia/Magadan", + }, + { + name: "Asia/Makassar", + gmtOffset: "GMT+08:00", + value: "Asia/Makassar", + }, + { + name: "Asia/Manila", + gmtOffset: "GMT+08:00", + value: "Asia/Manila", + }, + { + name: "Asia/Muscat", + gmtOffset: "GMT+04:00", + value: "Asia/Muscat", + }, + { + name: "Asia/Nicosia", + gmtOffset: "GMT+03:00", + value: "Asia/Nicosia", + }, + { + name: "Asia/Novokuznetsk", + gmtOffset: "GMT+07:00", + value: "Asia/Novokuznetsk", + }, + { + name: "Asia/Novosibirsk", + gmtOffset: "GMT+07:00", + value: "Asia/Novosibirsk", + }, + { + name: "Asia/Omsk", + gmtOffset: "GMT+06:00", + value: "Asia/Omsk", + }, + { + name: "Asia/Oral", + gmtOffset: "GMT+05:00", + value: "Asia/Oral", + }, + { + name: "Asia/Phnom_Penh", + gmtOffset: "GMT+07:00", + value: "Asia/Phnom_Penh", + }, + { + name: "Asia/Pontianak", + gmtOffset: "GMT+07:00", + value: "Asia/Pontianak", + }, + { + name: "Asia/Pyongyang", + gmtOffset: "GMT+09:00", + value: "Asia/Pyongyang", + }, + { + name: "Asia/Qatar", + gmtOffset: "GMT+03:00", + value: "Asia/Qatar", + }, + { + name: "Asia/Qostanay", + gmtOffset: "GMT+06:00", + value: "Asia/Qostanay", + }, + { + name: "Asia/Qyzylorda", + gmtOffset: "GMT+05:00", + value: "Asia/Qyzylorda", + }, + { + name: "Asia/Rangoon", + gmtOffset: "GMT+06:30", + value: "Asia/Rangoon", + }, + { + name: "Asia/Riyadh", + gmtOffset: "GMT+03:00", + value: "Asia/Riyadh", + }, + { + name: "Asia/Saigon", + gmtOffset: "GMT+07:00", + value: "Asia/Saigon", + }, + { + name: "Asia/Sakhalin", + gmtOffset: "GMT+11:00", + value: "Asia/Sakhalin", + }, + { + name: "Asia/Samarkand", + gmtOffset: "GMT+05:00", + value: "Asia/Samarkand", + }, + { + name: "Asia/Seoul", + gmtOffset: "GMT+09:00", + value: "Asia/Seoul", + }, + { + name: "Asia/Shanghai", + gmtOffset: "GMT+08:00", + value: "Asia/Shanghai", + }, + { + name: "Asia/Singapore", + gmtOffset: "GMT+08:00", + value: "Asia/Singapore", + }, + { + name: "Asia/Srednekolymsk", + gmtOffset: "GMT+11:00", + value: "Asia/Srednekolymsk", + }, + { + name: "Asia/Taipei", + gmtOffset: "GMT+08:00", + value: "Asia/Taipei", + }, + { + name: "Asia/Tashkent", + gmtOffset: "GMT+05:00", + value: "Asia/Tashkent", + }, + { + name: "Asia/Tbilisi", + gmtOffset: "GMT+04:00", + value: "Asia/Tbilisi", + }, + { + name: "Asia/Tehran", + gmtOffset: "GMT+03:30", + value: "Asia/Tehran", + }, + { + name: "Asia/Tel_Aviv", + gmtOffset: "GMT+03:00", + value: "Asia/Tel_Aviv", + }, + { + name: "Asia/Thimbu", + gmtOffset: "GMT+06:00", + value: "Asia/Thimbu", + }, + { + name: "Asia/Thimphu", + gmtOffset: "GMT+06:00", + value: "Asia/Thimphu", + }, + { + name: "Asia/Tokyo", + gmtOffset: "GMT+09:00", + value: "Asia/Tokyo", + }, + { + name: "Asia/Tomsk", + gmtOffset: "GMT+07:00", + value: "Asia/Tomsk", + }, + { + name: "Asia/Ujung_Pandang", + gmtOffset: "GMT+08:00", + value: "Asia/Ujung_Pandang", + }, + { + name: "Asia/Ulaanbaatar", + gmtOffset: "GMT+08:00", + value: "Asia/Ulaanbaatar", + }, + { + name: "Asia/Ulan_Bator", + gmtOffset: "GMT+08:00", + value: "Asia/Ulan_Bator", + }, + { + name: "Asia/Urumqi", + gmtOffset: "GMT+06:00", + value: "Asia/Urumqi", + }, + { + name: "Asia/Ust-Nera", + gmtOffset: "GMT+10:00", + value: "Asia/Ust-Nera", + }, + { + name: "Asia/Vientiane", + gmtOffset: "GMT+07:00", + value: "Asia/Vientiane", + }, + { + name: "Asia/Vladivostok", + gmtOffset: "GMT+10:00", + value: "Asia/Vladivostok", + }, + { + name: "Asia/Yakutsk", + gmtOffset: "GMT+09:00", + value: "Asia/Yakutsk", + }, + { + name: "Asia/Yangon", + gmtOffset: "GMT+06:30", + value: "Asia/Yangon", + }, + { + name: "Asia/Yekaterinburg", + gmtOffset: "GMT+05:00", + value: "Asia/Yekaterinburg", + }, + { + name: "Asia/Yerevan", + gmtOffset: "GMT+04:00", + value: "Asia/Yerevan", + }, + { + name: "Atlantic/Azores", + gmtOffset: "GMT-01:00", + value: "Atlantic/Azores", + }, + { + name: "Atlantic/Bermuda", + gmtOffset: "GMT-03:00", + value: "Atlantic/Bermuda", + }, + { + name: "Atlantic/Canary", + gmtOffset: "GMT", + value: "Atlantic/Canary", + }, + { + name: "Atlantic/Cape_Verde", + gmtOffset: "GMT-01:00", + value: "Atlantic/Cape_Verde", + }, + { + name: "Atlantic/Faeroe", + gmtOffset: "GMT", + value: "Atlantic/Faeroe", + }, + { + name: "Atlantic/Faroe", + gmtOffset: "GMT", + value: "Atlantic/Faroe", + }, + { + name: "Atlantic/Jan_Mayen", + gmtOffset: "GMT+01:00", + value: "Atlantic/Jan_Mayen", + }, + { + name: "Atlantic/Madeira", + gmtOffset: "GMT", + value: "Atlantic/Madeira", + }, + { + name: "Atlantic/Reykjavik", + gmtOffset: "GMT", + value: "Atlantic/Reykjavik", + }, + { + name: "Atlantic/South_Georgia", + gmtOffset: "GMT-02:00", + value: "Atlantic/South_Georgia", + }, + { + name: "Atlantic/St_Helena", + gmtOffset: "GMT", + value: "Atlantic/St_Helena", + }, + { + name: "Atlantic/Stanley", + gmtOffset: "GMT-03:00", + value: "Atlantic/Stanley", + }, + { + name: "Australia/ACT", + gmtOffset: "GMT+11:00", + value: "Australia/ACT", + }, + { + name: "Australia/Adelaide", + gmtOffset: "GMT+10:30", + value: "Australia/Adelaide", + }, + { + name: "Australia/Brisbane", + gmtOffset: "GMT+10:00", + value: "Australia/Brisbane", + }, + { + name: "Australia/Broken_Hill", + gmtOffset: "GMT+10:30", + value: "Australia/Broken_Hill", + }, + { + name: "Australia/Canberra", + gmtOffset: "GMT+11:00", + value: "Australia/Canberra", + }, + { + name: "Australia/Currie", + gmtOffset: "GMT+11:00", + value: "Australia/Currie", + }, + { + name: "Australia/Darwin", + gmtOffset: "GMT+09:30", + value: "Australia/Darwin", + }, + { + name: "Australia/Eucla", + gmtOffset: "GMT+08:45", + value: "Australia/Eucla", + }, + { + name: "Australia/Hobart", + gmtOffset: "GMT+11:00", + value: "Australia/Hobart", + }, + { + name: "Australia/LHI", + gmtOffset: "GMT+11:00", + value: "Australia/LHI", + }, + { + name: "Australia/Lindeman", + gmtOffset: "GMT+10:00", + value: "Australia/Lindeman", + }, + { + name: "Australia/Lord_Howe", + gmtOffset: "GMT+11:00", + value: "Australia/Lord_Howe", + }, + { + name: "Australia/Melbourne", + gmtOffset: "GMT+11:00", + value: "Australia/Melbourne", + }, + { + name: "Australia/NSW", + gmtOffset: "GMT+11:00", + value: "Australia/NSW", + }, + { + name: "Australia/North", + gmtOffset: "GMT+09:30", + value: "Australia/North", + }, + { + name: "Australia/Perth", + gmtOffset: "GMT+08:00", + value: "Australia/Perth", + }, + { + name: "Australia/Queensland", + gmtOffset: "GMT+10:00", + value: "Australia/Queensland", + }, + { + name: "Australia/South", + gmtOffset: "GMT+10:30", + value: "Australia/South", + }, + { + name: "Australia/Sydney", + gmtOffset: "GMT+11:00", + value: "Australia/Sydney", + }, + { + name: "Australia/Tasmania", + gmtOffset: "GMT+11:00", + value: "Australia/Tasmania", + }, + { + name: "Australia/Victoria", + gmtOffset: "GMT+11:00", + value: "Australia/Victoria", + }, + { + name: "Australia/West", + gmtOffset: "GMT+08:00", + value: "Australia/West", + }, + { + name: "Australia/Yancowinna", + gmtOffset: "GMT+10:30", + value: "Australia/Yancowinna", + }, + { + name: "Brazil/Acre", + gmtOffset: "GMT-05:00", + value: "Brazil/Acre", + }, + { + name: "Brazil/DeNoronha", + gmtOffset: "GMT-02:00", + value: "Brazil/DeNoronha", + }, + { + name: "Brazil/East", + gmtOffset: "GMT-03:00", + value: "Brazil/East", + }, + { + name: "Brazil/West", + gmtOffset: "GMT-04:00", + value: "Brazil/West", + }, + { + name: "CET", + gmtOffset: "GMT+01:00", + value: "CET", + }, + { + name: "CST6CDT", + gmtOffset: "GMT-06:00", + value: "CST6CDT", + }, + { + name: "Canada/Atlantic", + gmtOffset: "GMT-03:00", + value: "Canada/Atlantic", + }, + { + name: "Canada/Central", + gmtOffset: "GMT-06:00", + value: "Canada/Central", + }, + { + name: "Canada/Eastern", + gmtOffset: "GMT-04:00", + value: "Canada/Eastern", + }, + { + name: "Canada/Mountain", + gmtOffset: "GMT-07:00", + value: "Canada/Mountain", + }, + { + name: "Canada/Newfoundland", + gmtOffset: "GMT-02:30", + value: "Canada/Newfoundland", + }, + { + name: "Canada/Pacific", + gmtOffset: "GMT-07:00", + value: "Canada/Pacific", + }, + { + name: "Canada/Saskatchewan", + gmtOffset: "GMT-06:00", + value: "Canada/Saskatchewan", + }, + { + name: "Canada/Yukon", + gmtOffset: "GMT-07:00", + value: "Canada/Yukon", + }, + { + name: "Chile/Continental", + gmtOffset: "GMT-04:00", + value: "Chile/Continental", + }, + { + name: "Chile/EasterIsland", + gmtOffset: "GMT-06:00", + value: "Chile/EasterIsland", + }, + { + name: "Cuba", + gmtOffset: "GMT-04:00", + value: "Cuba", + }, + { + name: "EET", + gmtOffset: "GMT+02:00", + value: "EET", + }, + { + name: "EST", + gmtOffset: "GMT-05:00", + value: "EST", + }, + { + name: "EST5EDT", + gmtOffset: "GMT-05:00", + value: "EST5EDT", + }, + { + name: "Egypt", + gmtOffset: "GMT+02:00", + value: "Egypt", + }, + { + name: "Eire", + gmtOffset: "GMT", + value: "Eire", + }, + { + name: "Etc/GMT", + gmtOffset: "GMT", + value: "Etc/GMT", + }, + { + name: "Etc/GMT+0", + gmtOffset: "GMT", + value: "Etc/GMT+0", + }, + { + name: "Etc/GMT+1", + gmtOffset: "GMT-01:00", + value: "Etc/GMT+1", + }, + { + name: "Etc/GMT+10", + gmtOffset: "GMT-10:00", + value: "Etc/GMT+10", + }, + { + name: "Etc/GMT+11", + gmtOffset: "GMT-11:00", + value: "Etc/GMT+11", + }, + { + name: "Etc/GMT+12", + gmtOffset: "GMT-12:00", + value: "Etc/GMT+12", + }, + { + name: "Etc/GMT+2", + gmtOffset: "GMT-02:00", + value: "Etc/GMT+2", + }, + { + name: "Etc/GMT+3", + gmtOffset: "GMT-03:00", + value: "Etc/GMT+3", + }, + { + name: "Etc/GMT+4", + gmtOffset: "GMT-04:00", + value: "Etc/GMT+4", + }, + { + name: "Etc/GMT+5", + gmtOffset: "GMT-05:00", + value: "Etc/GMT+5", + }, + { + name: "Etc/GMT+6", + gmtOffset: "GMT-06:00", + value: "Etc/GMT+6", + }, + { + name: "Etc/GMT+7", + gmtOffset: "GMT-07:00", + value: "Etc/GMT+7", + }, + { + name: "Etc/GMT+8", + gmtOffset: "GMT-08:00", + value: "Etc/GMT+8", + }, + { + name: "Etc/GMT+9", + gmtOffset: "GMT-09:00", + value: "Etc/GMT+9", + }, + { + name: "Etc/GMT-0", + gmtOffset: "GMT", + value: "Etc/GMT-0", + }, + { + name: "Etc/GMT-1", + gmtOffset: "GMT+01:00", + value: "Etc/GMT-1", + }, + { + name: "Etc/GMT-10", + gmtOffset: "GMT+10:00", + value: "Etc/GMT-10", + }, + { + name: "Etc/GMT-11", + gmtOffset: "GMT+11:00", + value: "Etc/GMT-11", + }, + { + name: "Etc/GMT-12", + gmtOffset: "GMT+12:00", + value: "Etc/GMT-12", + }, + { + name: "Etc/GMT-13", + gmtOffset: "GMT+13:00", + value: "Etc/GMT-13", + }, + { + name: "Etc/GMT-14", + gmtOffset: "GMT+14:00", + value: "Etc/GMT-14", + }, + { + name: "Etc/GMT-2", + gmtOffset: "GMT+02:00", + value: "Etc/GMT-2", + }, + { + name: "Etc/GMT-3", + gmtOffset: "GMT+03:00", + value: "Etc/GMT-3", + }, + { + name: "Etc/GMT-4", + gmtOffset: "GMT+04:00", + value: "Etc/GMT-4", + }, + { + name: "Etc/GMT-5", + gmtOffset: "GMT+05:00", + value: "Etc/GMT-5", + }, + { + name: "Etc/GMT-6", + gmtOffset: "GMT+06:00", + value: "Etc/GMT-6", + }, + { + name: "Etc/GMT-7", + gmtOffset: "GMT+07:00", + value: "Etc/GMT-7", + }, + { + name: "Etc/GMT-8", + gmtOffset: "GMT+08:00", + value: "Etc/GMT-8", + }, + { + name: "Etc/GMT-9", + gmtOffset: "GMT+09:00", + value: "Etc/GMT-9", + }, + { + name: "Etc/GMT0", + gmtOffset: "GMT", + value: "Etc/GMT0", + }, + { + name: "Etc/Greenwich", + gmtOffset: "GMT", + value: "Etc/Greenwich", + }, + { + name: "Etc/UCT", + gmtOffset: "GMT", + value: "Etc/UCT", + }, + { + name: "Etc/UTC", + gmtOffset: "GMT", + value: "Etc/UTC", + }, + { + name: "Etc/Universal", + gmtOffset: "GMT", + value: "Etc/Universal", + }, + { + name: "Etc/Zulu", + gmtOffset: "GMT", + value: "Etc/Zulu", + }, + { + name: "Europe/Amsterdam", + gmtOffset: "GMT+01:00", + value: "Europe/Amsterdam", + }, + { + name: "Europe/Andorra", + gmtOffset: "GMT+01:00", + value: "Europe/Andorra", + }, + { + name: "Europe/Astrakhan", + gmtOffset: "GMT+04:00", + value: "Europe/Astrakhan", + }, + { + name: "Europe/Athens", + gmtOffset: "GMT+03:00", + value: "Europe/Athens", + }, + { + name: "Europe/Belfast", + gmtOffset: "GMT", + value: "Europe/Belfast", + }, + { + name: "Europe/Belgrade", + gmtOffset: "GMT+01:00", + value: "Europe/Belgrade", + }, + { + name: "Europe/Berlin", + gmtOffset: "GMT+01:00", + value: "Europe/Berlin", + }, + { + name: "Europe/Bratislava", + gmtOffset: "GMT+01:00", + value: "Europe/Bratislava", + }, + { + name: "Europe/Brussels", + gmtOffset: "GMT+01:00", + value: "Europe/Brussels", + }, + { + name: "Europe/Bucharest", + gmtOffset: "GMT+03:00", + value: "Europe/Bucharest", + }, + { + name: "Europe/Budapest", + gmtOffset: "GMT+01:00", + value: "Europe/Budapest", + }, + { + name: "Europe/Busingen", + gmtOffset: "GMT+01:00", + value: "Europe/Busingen", + }, + { + name: "Europe/Chisinau", + gmtOffset: "GMT+03:00", + value: "Europe/Chisinau", + }, + { + name: "Europe/Copenhagen", + gmtOffset: "GMT+01:00", + value: "Europe/Copenhagen", + }, + { + name: "Europe/Dublin", + gmtOffset: "GMT", + value: "Europe/Dublin", + }, + { + name: "Europe/Gibraltar", + gmtOffset: "GMT+01:00", + value: "Europe/Gibraltar", + }, + { + name: "Europe/Guernsey", + gmtOffset: "GMT", + value: "Europe/Guernsey", + }, + { + name: "Europe/Helsinki", + gmtOffset: "GMT+03:00", + value: "Europe/Helsinki", + }, + { + name: "Europe/Isle_of_Man", + gmtOffset: "GMT", + value: "Europe/Isle_of_Man", + }, + { + name: "Europe/Istanbul", + gmtOffset: "GMT+03:00", + value: "Europe/Istanbul", + }, + { + name: "Europe/Jersey", + gmtOffset: "GMT", + value: "Europe/Jersey", + }, + { + name: "Europe/Kaliningrad", + gmtOffset: "GMT+02:00", + value: "Europe/Kaliningrad", + }, + { + name: "Europe/Kiev", + gmtOffset: "GMT+03:00", + value: "Europe/Kiev", + }, + { + name: "Europe/Kirov", + gmtOffset: "GMT+03:00", + value: "Europe/Kirov", + }, + { + name: "Europe/Lisbon", + gmtOffset: "GMT", + value: "Europe/Lisbon", + }, + { + name: "Europe/Ljubljana", + gmtOffset: "GMT+01:00", + value: "Europe/Ljubljana", + }, + { + name: "Europe/London", + gmtOffset: "GMT", + value: "Europe/London", + }, + { + name: "Europe/Luxembourg", + gmtOffset: "GMT+01:00", + value: "Europe/Luxembourg", + }, + { + name: "Europe/Madrid", + gmtOffset: "GMT+01:00", + value: "Europe/Madrid", + }, + { + name: "Europe/Malta", + gmtOffset: "GMT+01:00", + value: "Europe/Malta", + }, + { + name: "Europe/Mariehamn", + gmtOffset: "GMT+02:00", + value: "Europe/Mariehamn", + }, + { + name: "Europe/Minsk", + gmtOffset: "GMT+03:00", + value: "Europe/Minsk", + }, + { + name: "Europe/Monaco", + gmtOffset: "GMT+01:00", + value: "Europe/Monaco", + }, + { + name: "Europe/Moscow", + gmtOffset: "GMT+03:00", + value: "Europe/Moscow", + }, + { + name: "Europe/Nicosia", + gmtOffset: "GMT+03:00", + value: "Europe/Nicosia", + }, + { + name: "Europe/Oslo", + gmtOffset: "GMT+01:00", + value: "Europe/Oslo", + }, + { + name: "Europe/Paris", + gmtOffset: "GMT+01:00", + value: "Europe/Paris", + }, + { + name: "Europe/Podgorica", + gmtOffset: "GMT+01:00", + value: "Europe/Podgorica", + }, + { + name: "Europe/Prague", + gmtOffset: "GMT+01:00", + value: "Europe/Prague", + }, + { + name: "Europe/Riga", + gmtOffset: "GMT+03:00", + value: "Europe/Riga", + }, + { + name: "Europe/Rome", + gmtOffset: "GMT+01:00", + value: "Europe/Rome", + }, + { + name: "Europe/Samara", + gmtOffset: "GMT+04:00", + value: "Europe/Samara", + }, + { + name: "Europe/San_Marino", + gmtOffset: "GMT+01:00", + value: "Europe/San_Marino", + }, + { + name: "Europe/Sarajevo", + gmtOffset: "GMT+01:00", + value: "Europe/Sarajevo", + }, + { + name: "Europe/Saratov", + gmtOffset: "GMT+04:00", + value: "Europe/Saratov", + }, + { + name: "Europe/Simferopol", + gmtOffset: "GMT+03:00", + value: "Europe/Simferopol", + }, + { + name: "Europe/Skopje", + gmtOffset: "GMT+01:00", + value: "Europe/Skopje", + }, + { + name: "Europe/Sofia", + gmtOffset: "GMT+03:00", + value: "Europe/Sofia", + }, + { + name: "Europe/Stockholm", + gmtOffset: "GMT+01:00", + value: "Europe/Stockholm", + }, + { + name: "Europe/Tallinn", + gmtOffset: "GMT+03:00", + value: "Europe/Tallinn", + }, + { + name: "Europe/Tirane", + gmtOffset: "GMT+01:00", + value: "Europe/Tirane", + }, + { + name: "Europe/Tiraspol", + gmtOffset: "GMT+03:00", + value: "Europe/Tiraspol", + }, + { + name: "Europe/Ulyanovsk", + gmtOffset: "GMT+04:00", + value: "Europe/Ulyanovsk", + }, + { + name: "Europe/Uzhgorod", + gmtOffset: "GMT+03:00", + value: "Europe/Uzhgorod", + }, + { + name: "Europe/Vaduz", + gmtOffset: "GMT+01:00", + value: "Europe/Vaduz", + }, + { + name: "Europe/Vatican", + gmtOffset: "GMT+01:00", + value: "Europe/Vatican", + }, + { + name: "Europe/Vienna", + gmtOffset: "GMT+01:00", + value: "Europe/Vienna", + }, + { + name: "Europe/Vilnius", + gmtOffset: "GMT+03:00", + value: "Europe/Vilnius", + }, + { + name: "Europe/Volgograd", + gmtOffset: "GMT+03:00", + value: "Europe/Volgograd", + }, + { + name: "Europe/Warsaw", + gmtOffset: "GMT+01:00", + value: "Europe/Warsaw", + }, + { + name: "Europe/Zagreb", + gmtOffset: "GMT+01:00", + value: "Europe/Zagreb", + }, + { + name: "Europe/Zaporozhye", + gmtOffset: "GMT+03:00", + value: "Europe/Zaporozhye", + }, + { + name: "Europe/Zurich", + gmtOffset: "GMT+02:00", + value: "Europe/Zurich", + }, + { + name: "GB", + gmtOffset: "GMT+01:00", + value: "GB", + }, + { + name: "GB-Eire", + gmtOffset: "GMT+01:00", + value: "GB-Eire", + }, + { + name: "GMT", + gmtOffset: "GMT", + value: "GMT", + }, + { + name: "GMT+0", + gmtOffset: "GMT", + value: "GMT+0", + }, + { + name: "GMT-0", + gmtOffset: "GMT", + value: "GMT-0", + }, + { + name: "GMT0", + gmtOffset: "GMT", + value: "GMT0", + }, + { + name: "Greenwich", + gmtOffset: "GMT", + value: "Greenwich", + }, + { + name: "HST", + gmtOffset: "GMT-10:00", + value: "HST", + }, + { + name: "Hongkong", + gmtOffset: "GMT+08:00", + value: "Hongkong", + }, + { + name: "Iceland", + gmtOffset: "GMT", + value: "Iceland", + }, + { + name: "Indian/Antananarivo", + gmtOffset: "GMT+03:00", + value: "Indian/Antananarivo", + }, + { + name: "Indian/Chagos", + gmtOffset: "GMT+06:00", + value: "Indian/Chagos", + }, + { + name: "Indian/Christmas", + gmtOffset: "GMT+07:00", + value: "Indian/Christmas", + }, + { + name: "Indian/Cocos", + gmtOffset: "GMT+06:30", + value: "Indian/Cocos", + }, + { + name: "Indian/Comoro", + gmtOffset: "GMT+03:00", + value: "Indian/Comoro", + }, + { + name: "Indian/Kerguelen", + gmtOffset: "GMT+05:00", + value: "Indian/Kerguelen", + }, + { + name: "Indian/Mahe", + gmtOffset: "GMT+04:00", + value: "Indian/Mahe", + }, + { + name: "Indian/Maldives", + gmtOffset: "GMT+05:00", + value: "Indian/Maldives", + }, + { + name: "Indian/Mauritius", + gmtOffset: "GMT+04:00", + value: "Indian/Mauritius", + }, + { + name: "Indian/Mayotte", + gmtOffset: "GMT+03:00", + value: "Indian/Mayotte", + }, + { + name: "Indian/Reunion", + gmtOffset: "GMT+04:00", + value: "Indian/Reunion", + }, + { + name: "Iran", + gmtOffset: "GMT+03:30", + value: "Iran", + }, + { + name: "Israel", + gmtOffset: "GMT+03:00", + value: "Israel", + }, + { + name: "Jamaica", + gmtOffset: "GMT-05:00", + value: "Jamaica", + }, + { + name: "Japan", + gmtOffset: "GMT+09:00", + value: "Japan", + }, + { + name: "Kwajalein", + gmtOffset: "GMT+12:00", + value: "Kwajalein", + }, + { + name: "Libya", + gmtOffset: "GMT+02:00", + value: "Libya", + }, + { + name: "MET", + gmtOffset: "GMT+02:00", + value: "MET", + }, + { + name: "MST", + gmtOffset: "GMT-07:00", + value: "MST", + }, + { + name: "MST7MDT", + gmtOffset: "GMT-06:00", + value: "MST7MDT", + }, + { + name: "Mexico/BajaNorte", + gmtOffset: "GMT-07:00", + value: "Mexico/BajaNorte", + }, + { + name: "Mexico/BajaSur", + gmtOffset: "GMT-07:00", + value: "Mexico/BajaSur", + }, + { + name: "Mexico/General", + gmtOffset: "GMT-06:00", + value: "Mexico/General", + }, + { + name: "NZ", + gmtOffset: "GMT+12:00", + value: "NZ", + }, + { + name: "NZ-CHAT", + gmtOffset: "GMT+12:45", + value: "NZ-CHAT", + }, + { + name: "Navajo", + gmtOffset: "GMT-06:00", + value: "Navajo", + }, + { + name: "PRC", + gmtOffset: "GMT+08:00", + value: "PRC", + }, + { + name: "PST8PDT", + gmtOffset: "GMT-07:00", + value: "PST8PDT", + }, + { + name: "Pacific/Apia", + gmtOffset: "GMT+13:00", + value: "Pacific/Apia", + }, + { + name: "Pacific/Auckland", + gmtOffset: "GMT+12:00", + value: "Pacific/Auckland", + }, + { + name: "Pacific/Bougainville", + gmtOffset: "GMT+11:00", + value: "Pacific/Bougainville", + }, + { + name: "Pacific/Chatham", + gmtOffset: "GMT+12:45", + value: "Pacific/Chatham", + }, + { + name: "Pacific/Chuuk", + gmtOffset: "GMT+10:00", + value: "Pacific/Chuuk", + }, + { + name: "Pacific/Easter", + gmtOffset: "GMT-06:00", + value: "Pacific/Easter", + }, + { + name: "Pacific/Efate", + gmtOffset: "GMT+11:00", + value: "Pacific/Efate", + }, + { + name: "Pacific/Enderbury", + gmtOffset: "GMT+13:00", + value: "Pacific/Enderbury", + }, + { + name: "Pacific/Fakaofo", + gmtOffset: "GMT+13:00", + value: "Pacific/Fakaofo", + }, + { + name: "Pacific/Fiji", + gmtOffset: "GMT+12:00", + value: "Pacific/Fiji", + }, + { + name: "Pacific/Funafuti", + gmtOffset: "GMT+12:00", + value: "Pacific/Funafuti", + }, + { + name: "Pacific/Galapagos", + gmtOffset: "GMT-06:00", + value: "Pacific/Galapagos", + }, + { + name: "Pacific/Gambier", + gmtOffset: "GMT-09:00", + value: "Pacific/Gambier", + }, + { + name: "Pacific/Guadalcanal", + gmtOffset: "GMT+11:00", + value: "Pacific/Guadalcanal", + }, + { + name: "Pacific/Guam", + gmtOffset: "GMT+10:00", + value: "Pacific/Guam", + }, + { + name: "Pacific/Honolulu", + gmtOffset: "GMT-10:00", + value: "Pacific/Honolulu", + }, + { + name: "Pacific/Johnston", + gmtOffset: "GMT-10:00", + value: "Pacific/Johnston", + }, + { + name: "Pacific/Kanton", + gmtOffset: "GMT+13:00", + value: "Pacific/Kanton", + }, + { + name: "Pacific/Kiritimati", + gmtOffset: "GMT+14:00", + value: "Pacific/Kiritimati", + }, + { + name: "Pacific/Kosrae", + gmtOffset: "GMT+11:00", + value: "Pacific/Kosrae", + }, + { + name: "Pacific/Kwajalein", + gmtOffset: "GMT+12:00", + value: "Pacific/Kwajalein", + }, + { + name: "Pacific/Majuro", + gmtOffset: "GMT+12:00", + value: "Pacific/Majuro", + }, + { + name: "Pacific/Marquesas", + gmtOffset: "GMT-09:30", + value: "Pacific/Marquesas", + }, + { + name: "Pacific/Midway", + gmtOffset: "GMT-11:00", + value: "Pacific/Midway", + }, + { + name: "Pacific/Nauru", + gmtOffset: "GMT+12:00", + value: "Pacific/Nauru", + }, + { + name: "Pacific/Niue", + gmtOffset: "GMT-11:00", + value: "Pacific/Niue", + }, + { + name: "Pacific/Norfolk", + gmtOffset: "GMT+11:00", + value: "Pacific/Norfolk", + }, + { + name: "Pacific/Noumea", + gmtOffset: "GMT+11:00", + value: "Pacific/Noumea", + }, + { + name: "Pacific/Pago_Pago", + gmtOffset: "GMT-11:00", + value: "Pacific/Pago_Pago", + }, + { + name: "Pacific/Palau", + gmtOffset: "GMT+09:00", + value: "Pacific/Palau", + }, + { + name: "Pacific/Pitcairn", + gmtOffset: "GMT-08:00", + value: "Pacific/Pitcairn", + }, + { + name: "Pacific/Pohnpei", + gmtOffset: "GMT+11:00", + value: "Pacific/Pohnpei", + }, + { + name: "Pacific/Ponape", + gmtOffset: "GMT+11:00", + value: "Pacific/Ponape", + }, + { + name: "Pacific/Port_Moresby", + gmtOffset: "GMT+10:00", + value: "Pacific/Port_Moresby", + }, + { + name: "Pacific/Rarotonga", + gmtOffset: "GMT-10:00", + value: "Pacific/Rarotonga", + }, + { + name: "Pacific/Saipan", + gmtOffset: "GMT+10:00", + value: "Pacific/Saipan", + }, + { + name: "Pacific/Samoa", + gmtOffset: "GMT-11:00", + value: "Pacific/Samoa", + }, + { + name: "Pacific/Tahiti", + gmtOffset: "GMT-10:00", + value: "Pacific/Tahiti", + }, + { + name: "Pacific/Tarawa", + gmtOffset: "GMT+12:00", + value: "Pacific/Tarawa", + }, + { + name: "Pacific/Tongatapu", + gmtOffset: "GMT+13:00", + value: "Pacific/Tongatapu", + }, + { + name: "Pacific/Truk", + gmtOffset: "GMT+10:00", + value: "Pacific/Truk", + }, + { + name: "Pacific/Wake", + gmtOffset: "GMT+12:00", + value: "Pacific/Wake", + }, + { + name: "Pacific/Wallis", + gmtOffset: "GMT+12:00", + value: "Pacific/Wallis", + }, + { + name: "Pacific/Yap", + gmtOffset: "GMT+10:00", + value: "Pacific/Yap", + }, + { + name: "Poland", + gmtOffset: "GMT+02:00", + value: "Poland", + }, + { + name: "Portugal", + gmtOffset: "GMT+01:00", + value: "Portugal", + }, + { + name: "ROC", + gmtOffset: "GMT+08:00", + value: "ROC", + }, + { + name: "ROK", + gmtOffset: "GMT+09:00", + value: "ROK", + }, + { + name: "Singapore", + gmtOffset: "GMT+08:00", + value: "Singapore", + }, + { + name: "Turkey", + gmtOffset: "GMT+03:00", + value: "Turkey", + }, + { + name: "UCT", + gmtOffset: "GMT", + value: "UCT", + }, + { + name: "US/Alaska", + gmtOffset: "GMT-08:00", + value: "US/Alaska", + }, + { + name: "US/Aleutian", + gmtOffset: "GMT-09:00", + value: "US/Aleutian", + }, + { + name: "US/Arizona", + gmtOffset: "GMT-07:00", + value: "US/Arizona", + }, + { + name: "US/Central", + gmtOffset: "GMT-05:00", + value: "US/Central", + }, + { + name: "US/East-Indiana", + gmtOffset: "GMT-04:00", + value: "US/East-Indiana", + }, + { + name: "US/Eastern", + gmtOffset: "GMT-04:00", + value: "US/Eastern", + }, + { + name: "US/Hawaii", + gmtOffset: "GMT-10:00", + value: "US/Hawaii", + }, + { + name: "US/Indiana-Starke", + gmtOffset: "GMT-05:00", + value: "US/Indiana-Starke", + }, + { + name: "US/Michigan", + gmtOffset: "GMT-04:00", + value: "US/Michigan", + }, + { + name: "US/Mountain", + gmtOffset: "GMT-06:00", + value: "US/Mountain", + }, + { + name: "US/Pacific", + gmtOffset: "GMT-07:00", + value: "US/Pacific", + }, + { + name: "US/Samoa", + gmtOffset: "GMT-11:00", + value: "US/Samoa", + }, + { + name: "UTC", + gmtOffset: "GMT", + value: "UTC", + }, + { + name: "Universal", + gmtOffset: "GMT", + value: "Universal", + }, + { + name: "W-SU", + gmtOffset: "GMT+03:00", + value: "W-SU", + }, + { + name: "WET", + gmtOffset: "GMT+01:00", + value: "WET", + }, + { + name: "Zulu", + gmtOffset: "GMT", + value: "Zulu", + }, +]; diff --git a/packages/constants/src/core/views.ts b/packages/constants/src/core/views.ts new file mode 100644 index 00000000000..536e9dc89a7 --- /dev/null +++ b/packages/constants/src/core/views.ts @@ -0,0 +1,23 @@ +import { TViewFiltersSortBy, TViewFiltersSortKey } from "@plane/types"; + +export enum EViewAccess { + PRIVATE, + PUBLIC, +} + +export const VIEW_SORTING_KEY_OPTIONS: { + key: TViewFiltersSortKey; + label: string; +}[] = [ + { key: "name", label: "Name" }, + { key: "created_at", label: "Date created" }, + { key: "updated_at", label: "Date modified" }, +]; + +export const VIEW_SORT_BY_OPTIONS: { + key: TViewFiltersSortBy; + label: string; +}[] = [ + { key: "asc", label: "Ascending" }, + { key: "desc", label: "Descending" }, +]; diff --git a/packages/constants/src/core/workspace-drafts.ts b/packages/constants/src/core/workspace-drafts.ts new file mode 100644 index 00000000000..4c1c88f9f60 --- /dev/null +++ b/packages/constants/src/core/workspace-drafts.ts @@ -0,0 +1,6 @@ +export enum EDraftIssuePaginationType { + INIT = "INIT", + NEXT = "NEXT", + PREV = "PREV", + CURRENT = "CURRENT", +} diff --git a/packages/constants/src/core/workspace.ts b/packages/constants/src/core/workspace.ts new file mode 100644 index 00000000000..31e702706b9 --- /dev/null +++ b/packages/constants/src/core/workspace.ts @@ -0,0 +1,140 @@ +// types +import { TStaticViewTypes } from "@plane/types"; +import { EUserPermissions } from "../ce/user-permissions"; + +export const ROLE = { + [EUserPermissions.GUEST]: "Guest", + [EUserPermissions.MEMBER]: "Member", + [EUserPermissions.ADMIN]: "Admin", +}; + +export const ROLE_DETAILS = { + [EUserPermissions.GUEST]: { + title: "Guest", + description: "External members of organizations can be invited as guests.", + }, + [EUserPermissions.MEMBER]: { + title: "Member", + description: + "Ability to read, write, edit, and delete entities inside projects, cycles, and modules", + }, + [EUserPermissions.ADMIN]: { + title: "Admin", + description: "All permissions set to true within the workspace.", + }, +}; + +export const USER_ROLES = [ + { value: "Product / Project Manager", label: "Product / Project Manager" }, + { value: "Development / Engineering", label: "Development / Engineering" }, + { value: "Founder / Executive", label: "Founder / Executive" }, + { value: "Freelancer / Consultant", label: "Freelancer / Consultant" }, + { value: "Marketing / Growth", label: "Marketing / Growth" }, + { + value: "Sales / Business Development", + label: "Sales / Business Development", + }, + { value: "Support / Operations", label: "Support / Operations" }, + { value: "Student / Professor", label: "Student / Professor" }, + { value: "Human Resources", label: "Human Resources" }, + { value: "Other", label: "Other" }, +]; + +export const DEFAULT_GLOBAL_VIEWS_LIST: { + key: TStaticViewTypes; + label: string; +}[] = [ + { + key: "all-issues", + label: "All issues", + }, + { + key: "assigned", + label: "Assigned", + }, + { + key: "created", + label: "Created", + }, + { + key: "subscribed", + label: "Subscribed", + }, +]; + +export const ORGANIZATION_SIZE = [ + "Just myself", + "2-10", + "11-50", + "51-200", + "201-500", + "500+", +]; + +export const RESTRICTED_URLS = [ + "404", + "accounts", + "api", + "create-workspace", + "god-mode", + "installations", + "invitations", + "onboarding", + "profile", + "spaces", + "workspace-invitations", + "password", + "flags", + "monitor", + "monitoring", + "ingest", + "plane-pro", + "plane-ultimate", + "enterprise", + "plane-enterprise", + "disco", + "silo", + "chat", + "calendar", + "drive", + "channels", + "upgrade", + "billing", + "sign-in", + "sign-up", + "signin", + "signup", + "config", + "live", + "admin", + "m", + "import", + "importers", + "integrations", + "integration", + "configuration", + "initiatives", + "initiative", + "config", + "workflow", + "workflows", + "epics", + "epic", + "story", + "mobile", + "dashboard", + "desktop", + "onload", + "real-time", + "one", + "pages", + "mobile", + "business", + "pro", + "settings", + "monitor", + "license", + "licenses", + "instances", + "instance", +]; diff --git a/packages/constants/src/ee/index.ts b/packages/constants/src/ee/index.ts new file mode 100644 index 00000000000..e198bf34c97 --- /dev/null +++ b/packages/constants/src/ee/index.ts @@ -0,0 +1,6 @@ +export * from "../ce/ai"; +export * from "../ce/auth"; +export * from "../ce/empty-state"; +export * from "../ce/estimates"; +export * from "../ce/issues"; +export * from "../ce/user-permissions"; diff --git a/packages/constants/src/helper.ts b/packages/constants/src/helper.ts new file mode 100644 index 00000000000..aff5a56b49c --- /dev/null +++ b/packages/constants/src/helper.ts @@ -0,0 +1,4 @@ +// Utility function to merge enums +export const mergeEnums = (enum1: T, enum2: U): T & U => { + return { ...enum1, ...enum2 }; +}; diff --git a/packages/constants/src/index.ts b/packages/constants/src/index.ts index 4189086225d..f6f394d0907 100644 --- a/packages/constants/src/index.ts +++ b/packages/constants/src/index.ts @@ -1,4 +1,2 @@ -export * from "./auth"; -export * from "./endpoints"; -export * from "./issue"; -export * from "./workspace"; +export * from "./core"; +export * from "./ce"; diff --git a/packages/constants/src/issue.ts b/packages/constants/src/issue.ts deleted file mode 100644 index 5db398c7634..00000000000 --- a/packages/constants/src/issue.ts +++ /dev/null @@ -1,40 +0,0 @@ -export const ALL_ISSUES = "All Issues"; - -export enum EIssueGroupByToServerOptions { - "state" = "state_id", - "priority" = "priority", - "labels" = "labels__id", - "state_detail.group" = "state__group", - "assignees" = "assignees__id", - "cycle" = "cycle_id", - "module" = "issue_module__module_id", - "target_date" = "target_date", - "project" = "project_id", - "created_by" = "created_by", -} - -export enum EIssueGroupBYServerToProperty { - "state_id" = "state_id", - "priority" = "priority", - "labels__id" = "label_ids", - "state__group" = "state__group", - "assignees__id" = "assignee_ids", - "cycle_id" = "cycle_id", - "issue_module__module_id" = "module_ids", - "target_date" = "target_date", - "project_id" = "project_id", - "created_by" = "created_by", -} - -export enum EServerGroupByToFilterOptions { - "state_id" = "state", - "priority" = "priority", - "labels__id" = "labels", - "state__group" = "state_group", - "assignees__id" = "assignees", - "cycle_id" = "cycle", - "issue_module__module_id" = "module", - "target_date" = "target_date", - "project_id" = "project", - "created_by" = "created_by", -} diff --git a/packages/constants/src/workspace.ts b/packages/constants/src/workspace.ts deleted file mode 100644 index c17b5432ee8..00000000000 --- a/packages/constants/src/workspace.ts +++ /dev/null @@ -1,76 +0,0 @@ -export const ORGANIZATION_SIZE = [ - "Just myself", - "2-10", - "11-50", - "51-200", - "201-500", - "500+", -]; - -export const RESTRICTED_URLS = [ - "404", - "accounts", - "api", - "create-workspace", - "god-mode", - "installations", - "invitations", - "onboarding", - "profile", - "spaces", - "workspace-invitations", - "password", - "flags", - "monitor", - "monitoring", - "ingest", - "plane-pro", - "plane-ultimate", - "enterprise", - "plane-enterprise", - "disco", - "silo", - "chat", - "calendar", - "drive", - "channels", - "upgrade", - "billing", - "sign-in", - "sign-up", - "signin", - "signup", - "config", - "live", - "admin", - "m", - "import", - "importers", - "integrations", - "integration", - "configuration", - "initiatives", - "initiative", - "config", - "workflow", - "workflows", - "epics", - "epic", - "story", - "mobile", - "dashboard", - "desktop", - "onload", - "real-time", - "one", - "pages", - "mobile", - "business", - "pro", - "settings", - "monitor", - "license", - "licenses", - "instances", - "instance", -]; diff --git a/packages/constants/tsconfig.json b/packages/constants/tsconfig.json new file mode 100644 index 00000000000..350751a3b4c --- /dev/null +++ b/packages/constants/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@plane/typescript-config/base.json", + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["src/core/*"], + "@/plane-constants/*": ["src/ce/*"] + } + } +} diff --git a/packages/eslint-config/next.js b/packages/eslint-config/next.js index 543cd131a42..c78ac0c14cb 100644 --- a/packages/eslint-config/next.js +++ b/packages/eslint-config/next.js @@ -88,5 +88,17 @@ module.exports = { }, }, ], + "no-restricted-imports": [ + "warn", + { + patterns: [ + { + group: ["@/constants/*", "@/*/constants"], + message: + "Please use @plane/constants package instead and move existing constants there.", + }, + ], + }, + ], }, }; diff --git a/web/app/[workspaceSlug]/(projects)/analytics/page.tsx b/web/app/[workspaceSlug]/(projects)/analytics/page.tsx index b66c0d19ee7..1c89d047340 100644 --- a/web/app/[workspaceSlug]/(projects)/analytics/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/analytics/page.tsx @@ -4,6 +4,7 @@ import React, { Fragment } from "react"; import { observer } from "mobx-react"; import { useSearchParams } from "next/navigation"; import { Tab } from "@headlessui/react"; +import { EmptyStateType } from "@plane/constants"; // components import { Header, EHeaderVariant } from "@plane/ui"; import { CustomAnalytics, ScopeAndDemand } from "@/components/analytics"; @@ -11,7 +12,6 @@ import { PageHead } from "@/components/core"; import { EmptyState } from "@/components/empty-state"; // constants import { ANALYTICS_TABS } from "@/constants/analytics"; -import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useCommandPalette, useEventTracker, useProject, useWorkspace } from "@/hooks/store"; diff --git a/web/app/[workspaceSlug]/(projects)/notifications/page.tsx b/web/app/[workspaceSlug]/(projects)/notifications/page.tsx index 4ea0c8e4258..12dc8311d8e 100644 --- a/web/app/[workspaceSlug]/(projects)/notifications/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/notifications/page.tsx @@ -4,6 +4,7 @@ import { useCallback, useEffect } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; import useSWR from "swr"; +import { EmptyStateType } from "@plane/constants"; // components import { LogoSpinner } from "@/components/common"; import { PageHead } from "@/components/core"; @@ -11,7 +12,6 @@ import { EmptyState } from "@/components/empty-state"; import { InboxContentRoot } from "@/components/inbox"; import { IssuePeekOverview } from "@/components/issues"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { ENotificationLoader, ENotificationQueryParamType } from "@/constants/notification"; // hooks import { useIssueDetail, useUserPermissions, useWorkspace, useWorkspaceNotifications } from "@/hooks/store"; diff --git a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/page.tsx b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/page.tsx index 5b1793d5d1f..527fa57e2b3 100644 --- a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/page.tsx @@ -4,6 +4,7 @@ import { useState } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; // types +import { EmptyStateType } from "@plane/constants"; import { TCycleFilters } from "@plane/types"; // components import { Header, EHeaderVariant } from "@plane/ui"; @@ -12,7 +13,6 @@ import { CyclesView, CycleCreateUpdateModal, CycleAppliedFiltersList } from "@/c import { EmptyState } from "@/components/empty-state"; import { CycleModuleListLayout } from "@/components/ui"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // helpers import { calculateTotalFilters } from "@/helpers/filter.helper"; // hooks diff --git a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/inbox/page.tsx b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/inbox/page.tsx index 36aa37e302c..b28fa3a8c11 100644 --- a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/inbox/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/inbox/page.tsx @@ -2,11 +2,11 @@ import { observer } from "mobx-react"; // components import { useParams, useSearchParams } from "next/navigation"; +import { EmptyStateType } from "@plane/constants"; import { PageHead } from "@/components/core"; import { EmptyState } from "@/components/empty-state"; import { InboxIssueRoot } from "@/components/inbox"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // helpers import { EInboxIssueCurrentTab } from "@/helpers/inbox.helper"; // hooks diff --git a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(list)/page.tsx b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(list)/page.tsx index 9417016e385..c05e524f138 100644 --- a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(list)/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(list)/page.tsx @@ -4,13 +4,13 @@ import { useCallback } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; // types +import { EmptyStateType } from "@plane/constants"; import { TModuleFilters } from "@plane/types"; // components import { PageHead } from "@/components/core"; import { EmptyState } from "@/components/empty-state"; import { ModuleAppliedFiltersList, ModulesListView } from "@/components/modules"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // helpers import { calculateTotalFilters } from "@/helpers/filter.helper"; // hooks diff --git a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/page.tsx b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/page.tsx index 4171e1f332d..5ab41a2a7f6 100644 --- a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/page.tsx @@ -3,13 +3,13 @@ import { observer } from "mobx-react"; import { useParams, useSearchParams } from "next/navigation"; // types +import { EmptyStateType } from "@plane/constants"; import { TPageNavigationTabs } from "@plane/types"; // components import { PageHead } from "@/components/core"; import { EmptyState } from "@/components/empty-state"; import { PagesListRoot, PagesListView } from "@/components/pages"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useProject } from "@/hooks/store"; diff --git a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(list)/page.tsx b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(list)/page.tsx index 387f6e5b423..746fc741f58 100644 --- a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(list)/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(list)/page.tsx @@ -4,13 +4,13 @@ import { useCallback } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; // components +import { EmptyStateType } from "@plane/constants"; import { TViewFilterProps } from "@plane/types"; import { Header, EHeaderVariant } from "@plane/ui"; import { PageHead } from "@/components/core"; import { EmptyState } from "@/components/empty-state"; import { ProjectViewsList } from "@/components/views"; import { ViewAppliedFiltersList } from "@/components/views/applied-filters"; -import { EmptyStateType } from "@/constants/empty-state"; // constants import { EViewAccess } from "@/constants/views"; // helpers diff --git a/web/app/[workspaceSlug]/(projects)/settings/api-tokens/page.tsx b/web/app/[workspaceSlug]/(projects)/settings/api-tokens/page.tsx index fd2ed9669b2..4b4f143e98d 100644 --- a/web/app/[workspaceSlug]/(projects)/settings/api-tokens/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/settings/api-tokens/page.tsx @@ -5,6 +5,7 @@ import { observer } from "mobx-react"; import { useParams } from "next/navigation"; import useSWR from "swr"; // ui +import { EmptyStateType } from "@plane/constants"; import { Button } from "@plane/ui"; // component import { ApiTokenListItem, CreateApiTokenModal } from "@/components/api-token"; @@ -13,7 +14,6 @@ import { PageHead } from "@/components/core"; import { EmptyState } from "@/components/empty-state"; import { APITokenSettingsLoader } from "@/components/ui"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { API_TOKENS_LIST } from "@/constants/fetch-keys"; // store hooks import { useUserPermissions, useWorkspace } from "@/hooks/store"; diff --git a/web/app/[workspaceSlug]/(projects)/settings/webhooks/page.tsx b/web/app/[workspaceSlug]/(projects)/settings/webhooks/page.tsx index 86c922f07fb..b4d54025886 100644 --- a/web/app/[workspaceSlug]/(projects)/settings/webhooks/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/settings/webhooks/page.tsx @@ -5,6 +5,7 @@ import { observer } from "mobx-react"; import { useParams } from "next/navigation"; import useSWR from "swr"; // ui +import { EmptyStateType } from "@plane/constants"; import { Button } from "@plane/ui"; // components import { NotAuthorizedView } from "@/components/auth-screens"; @@ -13,7 +14,6 @@ import { EmptyState } from "@/components/empty-state"; import { WebhookSettingsLoader } from "@/components/ui"; import { WebhooksList, CreateWebhookModal } from "@/components/web-hooks"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useUserPermissions, useWebhook, useWorkspace } from "@/hooks/store"; import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; diff --git a/web/app/profile/activity/page.tsx b/web/app/profile/activity/page.tsx index afc9b29bf8d..5a3a68a1698 100644 --- a/web/app/profile/activity/page.tsx +++ b/web/app/profile/activity/page.tsx @@ -3,6 +3,7 @@ import { useState } from "react"; import { observer } from "mobx-react"; // ui +import { EmptyStateType } from "@plane/constants"; import { Button } from "@plane/ui"; // components import { PageHead } from "@/components/core"; @@ -13,7 +14,6 @@ import { ProfileSettingContentWrapper, } from "@/components/profile"; // constants -import { EmptyStateType } from "@/constants/empty-state"; const PER_PAGE = 100; diff --git a/web/ce/components/cycles/active-cycle/root.tsx b/web/ce/components/cycles/active-cycle/root.tsx index a173cfda03a..b2a88f9e5fc 100644 --- a/web/ce/components/cycles/active-cycle/root.tsx +++ b/web/ce/components/cycles/active-cycle/root.tsx @@ -3,6 +3,7 @@ import { observer } from "mobx-react"; import { Disclosure } from "@headlessui/react"; // ui +import { EmptyStateType } from "@plane/constants"; import { Row } from "@plane/ui"; // components import { @@ -15,7 +16,6 @@ import { import useCyclesDetails from "@/components/cycles/active-cycle/use-cycles-details"; import { EmptyState } from "@/components/empty-state"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { useCycle } from "@/hooks/store"; import { ActiveCycleIssueDetails } from "@/store/issue/cycle"; diff --git a/web/core/components/command-palette/command-modal.tsx b/web/core/components/command-palette/command-modal.tsx index b80b0dfe145..58d80b80ed4 100644 --- a/web/core/components/command-palette/command-modal.tsx +++ b/web/core/components/command-palette/command-modal.tsx @@ -8,6 +8,7 @@ import useSWR from "swr"; import { FolderPlus, Search, Settings } from "lucide-react"; import { Dialog, Transition } from "@headlessui/react"; // types +import { EmptyStateType } from "@plane/constants"; import { IWorkspaceSearchResults } from "@plane/types"; // ui import { LayersIcon, Loader, ToggleSwitch, Tooltip } from "@plane/ui"; @@ -25,7 +26,6 @@ import { } from "@/components/command-palette"; import { EmptyState } from "@/components/empty-state"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // fetch-keys import { ISSUE_DETAILS } from "@/constants/fetch-keys"; // helpers diff --git a/web/core/components/core/modals/bulk-delete-issues-modal.tsx b/web/core/components/core/modals/bulk-delete-issues-modal.tsx index 1d397a315e0..a33b690e9c5 100644 --- a/web/core/components/core/modals/bulk-delete-issues-modal.tsx +++ b/web/core/components/core/modals/bulk-delete-issues-modal.tsx @@ -7,13 +7,13 @@ import { SubmitHandler, useForm } from "react-hook-form"; import { Search } from "lucide-react"; import { Combobox, Dialog, Transition } from "@headlessui/react"; // types +import { EmptyStateType } from "@plane/constants"; import { ISearchIssueResponse, IUser } from "@plane/types"; // ui import { Button, Loader, TOAST_TYPE, setToast } from "@plane/ui"; // components import { EmptyState } from "@/components/empty-state"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { EIssuesStoreType } from "@/constants/issue"; // hooks import { useIssues } from "@/hooks/store"; diff --git a/web/core/components/core/modals/issue-search-modal-empty-state.tsx b/web/core/components/core/modals/issue-search-modal-empty-state.tsx index 578d39a60fc..dd119147f46 100644 --- a/web/core/components/core/modals/issue-search-modal-empty-state.tsx +++ b/web/core/components/core/modals/issue-search-modal-empty-state.tsx @@ -1,9 +1,9 @@ import React from "react"; // components +import { EmptyStateType, TEmptyStateType } from "@plane/constants"; import { ISearchIssueResponse } from "@plane/types"; import { EmptyState } from "@/components/empty-state"; // types -import { EmptyStateType } from "@/constants/empty-state"; // constants interface EmptyStateProps { @@ -19,7 +19,7 @@ export const IssueSearchModalEmptyState: React.FC = ({ debouncedSearchTerm, isSearching, }) => { - const renderEmptyState = (type: EmptyStateType) => ( + const renderEmptyState = (type: TEmptyStateType) => (
diff --git a/web/core/components/cycles/active-cycle/cycle-stats.tsx b/web/core/components/cycles/active-cycle/cycle-stats.tsx index 6fcdaebd539..77c7fc139ae 100644 --- a/web/core/components/cycles/active-cycle/cycle-stats.tsx +++ b/web/core/components/cycles/active-cycle/cycle-stats.tsx @@ -7,6 +7,7 @@ import { CalendarCheck } from "lucide-react"; // headless ui import { Tab } from "@headlessui/react"; // types +import { EmptyStateType } from "@plane/constants"; import { ICycle, IIssueFilterOptions } from "@plane/types"; // ui import { Tooltip, Loader, PriorityIcon, Avatar } from "@plane/ui"; @@ -15,7 +16,6 @@ import { SingleProgressStats } from "@/components/core"; import { StateDropdown } from "@/components/dropdowns"; import { EmptyState } from "@/components/empty-state"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { EIssuesStoreType } from "@/constants/issue"; // helpers import { cn } from "@/helpers/common.helper"; diff --git a/web/core/components/cycles/active-cycle/productivity.tsx b/web/core/components/cycles/active-cycle/productivity.tsx index 74957af03c7..8e7ddc6bf80 100644 --- a/web/core/components/cycles/active-cycle/productivity.tsx +++ b/web/core/components/cycles/active-cycle/productivity.tsx @@ -1,13 +1,13 @@ import { FC, Fragment } from "react"; import { observer } from "mobx-react"; import Link from "next/link"; +import { EmptyStateType } from "@plane/constants"; import { ICycle, TCycleEstimateType } from "@plane/types"; import { Loader } from "@plane/ui"; // components import ProgressChart from "@/components/core/sidebar/progress-chart"; import { EmptyState } from "@/components/empty-state"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { useCycle, useProjectEstimates } from "@/hooks/store"; // plane web constants import { EEstimateSystem } from "@/plane-web/constants/estimates"; diff --git a/web/core/components/cycles/active-cycle/progress.tsx b/web/core/components/cycles/active-cycle/progress.tsx index f75c51526c4..4aa82458376 100644 --- a/web/core/components/cycles/active-cycle/progress.tsx +++ b/web/core/components/cycles/active-cycle/progress.tsx @@ -3,6 +3,7 @@ import { FC } from "react"; import { observer } from "mobx-react"; // types +import { EmptyStateType } from "@plane/constants"; import { ICycle, IIssueFilterOptions } from "@plane/types"; // ui import { LinearProgressIndicator, Loader } from "@plane/ui"; @@ -10,7 +11,6 @@ import { LinearProgressIndicator, Loader } from "@plane/ui"; import { EmptyState } from "@/components/empty-state"; // constants import { PROGRESS_STATE_GROUPS_DETAILS } from "@/constants/common"; -import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useProjectState } from "@/hooks/store"; diff --git a/web/core/components/cycles/archived-cycles/root.tsx b/web/core/components/cycles/archived-cycles/root.tsx index 06f61b66f51..a130b9a67ab 100644 --- a/web/core/components/cycles/archived-cycles/root.tsx +++ b/web/core/components/cycles/archived-cycles/root.tsx @@ -3,13 +3,13 @@ import { observer } from "mobx-react"; import { useParams } from "next/navigation"; import useSWR from "swr"; // types +import { EmptyStateType } from "@plane/constants"; import { TCycleFilters } from "@plane/types"; // components import { ArchivedCyclesView, CycleAppliedFiltersList } from "@/components/cycles"; import { EmptyState } from "@/components/empty-state"; import { CycleModuleListLayout } from "@/components/ui"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // helpers import { calculateTotalFilters } from "@/helpers/filter.helper"; // hooks diff --git a/web/core/components/empty-state/empty-state.tsx b/web/core/components/empty-state/empty-state.tsx index 883faab3884..d955bd5233f 100644 --- a/web/core/components/empty-state/empty-state.tsx +++ b/web/core/components/empty-state/empty-state.tsx @@ -4,21 +4,19 @@ import React from "react"; import { observer } from "mobx-react"; import Image from "next/image"; import Link from "next/link"; - import { useTheme } from "next-themes"; +// constant +import { EMPTY_STATE_DETAILS, EUserPermissionsLevel, TEmptyStateType } from "@plane/constants"; // hooks // components import { Button, TButtonVariant } from "@plane/ui"; -// constant -import { EMPTY_STATE_DETAILS, EmptyStateType } from "@/constants/empty-state"; // helpers import { cn } from "@/helpers/common.helper"; import { useUserPermissions } from "@/hooks/store"; -import { EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; import { ComicBoxButton } from "./comic-box-button"; export type EmptyStateProps = { - type: EmptyStateType; + type: TEmptyStateType; size?: "sm" | "md" | "lg"; layout?: "screen-detailed" | "screen-simple"; additionalPath?: string; @@ -136,7 +134,7 @@ export const EmptyState: React.FC = observer((props) => { {path && ( {key = observer((props) => {
{key { // store hooks diff --git a/web/core/components/issues/issue-layouts/empty-states/project-issues.tsx b/web/core/components/issues/issue-layouts/empty-states/project-issues.tsx index 5ec86340d79..dfd461077b1 100644 --- a/web/core/components/issues/issue-layouts/empty-states/project-issues.tsx +++ b/web/core/components/issues/issue-layouts/empty-states/project-issues.tsx @@ -2,11 +2,11 @@ import size from "lodash/size"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; // types +import { EmptyStateType } from "@plane/constants"; import { IIssueFilterOptions } from "@plane/types"; // components import { EmptyState } from "@/components/empty-state"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue"; // hooks import { useCommandPalette, useEventTracker, useIssues } from "@/hooks/store"; diff --git a/web/core/components/issues/workspace-draft/empty-state.tsx b/web/core/components/issues/workspace-draft/empty-state.tsx index 4a1292d6160..7bd7b7fcb41 100644 --- a/web/core/components/issues/workspace-draft/empty-state.tsx +++ b/web/core/components/issues/workspace-draft/empty-state.tsx @@ -2,10 +2,10 @@ import { FC, Fragment, useState } from "react"; // components +import { EmptyStateType } from "@plane/constants"; import { EmptyState } from "@/components/empty-state"; import { CreateUpdateIssueModal } from "@/components/issues"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { EIssuesStoreType } from "@/constants/issue"; export const WorkspaceDraftEmptyState: FC = () => { diff --git a/web/core/components/issues/workspace-draft/root.tsx b/web/core/components/issues/workspace-draft/root.tsx index 177b8af556c..5cd5a32878f 100644 --- a/web/core/components/issues/workspace-draft/root.tsx +++ b/web/core/components/issues/workspace-draft/root.tsx @@ -4,9 +4,9 @@ import { FC, Fragment } from "react"; import { observer } from "mobx-react"; import useSWR from "swr"; // components +import { EmptyStateType } from "@plane/constants"; import { EmptyState } from "@/components/empty-state"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { EDraftIssuePaginationType } from "@/constants/workspace-drafts"; // helpers import { cn } from "@/helpers/common.helper"; diff --git a/web/core/components/labels/project-setting-label-list.tsx b/web/core/components/labels/project-setting-label-list.tsx index 2fc9c838277..bcbbaa223c2 100644 --- a/web/core/components/labels/project-setting-label-list.tsx +++ b/web/core/components/labels/project-setting-label-list.tsx @@ -3,6 +3,7 @@ import React, { useState, useRef } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; +import { EmptyStateType } from "@plane/constants"; import { IIssueLabel } from "@plane/types"; // hooks import { Button, Loader } from "@plane/ui"; @@ -13,7 +14,6 @@ import { ProjectSettingLabelGroup, ProjectSettingLabelItem, } from "@/components/labels"; -import { EmptyStateType } from "@/constants/empty-state"; import { useLabel, useUserPermissions } from "@/hooks/store"; import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; // components diff --git a/web/core/components/modules/archived-modules/root.tsx b/web/core/components/modules/archived-modules/root.tsx index b74814add67..0241406ad7b 100644 --- a/web/core/components/modules/archived-modules/root.tsx +++ b/web/core/components/modules/archived-modules/root.tsx @@ -3,13 +3,13 @@ import { observer } from "mobx-react"; import { useParams } from "next/navigation"; import useSWR from "swr"; // types +import { EmptyStateType } from "@plane/constants"; import { TModuleFilters } from "@plane/types"; // components import { EmptyState } from "@/components/empty-state"; import { ArchivedModulesView, ModuleAppliedFiltersList } from "@/components/modules"; import { CycleModuleListLayout } from "@/components/ui"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // helpers import { calculateTotalFilters } from "@/helpers/filter.helper"; // hooks diff --git a/web/core/components/modules/modules-list-view.tsx b/web/core/components/modules/modules-list-view.tsx index 4b45879f7a2..fa05a30dc5d 100644 --- a/web/core/components/modules/modules-list-view.tsx +++ b/web/core/components/modules/modules-list-view.tsx @@ -2,13 +2,13 @@ import { observer } from "mobx-react"; import Image from "next/image"; import { useParams, useSearchParams } from "next/navigation"; // components +import { EmptyStateType } from "@plane/constants"; import { ContentWrapper, Row, ERowVariant } from "@plane/ui"; import { ListLayout } from "@/components/core/list"; import { EmptyState } from "@/components/empty-state"; import { ModuleCardItem, ModuleListItem, ModulePeekOverview, ModulesListGanttChartView } from "@/components/modules"; import { CycleModuleBoardLayout, CycleModuleListLayout, GanttLayoutLoader } from "@/components/ui"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useCommandPalette, useEventTracker, useModule, useModuleFilter } from "@/hooks/store"; import AllFiltersImage from "@/public/empty-state/module/all-filters.svg"; diff --git a/web/core/components/page-views/workspace-dashboard.tsx b/web/core/components/page-views/workspace-dashboard.tsx index 05546af56fc..8734b98db6a 100644 --- a/web/core/components/page-views/workspace-dashboard.tsx +++ b/web/core/components/page-views/workspace-dashboard.tsx @@ -2,6 +2,7 @@ import { useEffect } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; // components +import { EmptyStateType } from "@plane/constants"; import { ContentWrapper } from "@plane/ui"; import { DashboardWidgets } from "@/components/dashboard"; import { EmptyState } from "@/components/empty-state"; @@ -9,7 +10,6 @@ import { IssuePeekOverview } from "@/components/issues"; import { TourRoot } from "@/components/onboarding"; import { UserGreetingsView } from "@/components/user"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { PRODUCT_TOUR_COMPLETED } from "@/constants/event-tracker"; // helpers import { cn } from "@/helpers/common.helper"; diff --git a/web/core/components/pages/pages-list-main-content.tsx b/web/core/components/pages/pages-list-main-content.tsx index a0b4b356591..66552c94952 100644 --- a/web/core/components/pages/pages-list-main-content.tsx +++ b/web/core/components/pages/pages-list-main-content.tsx @@ -1,12 +1,12 @@ import { observer } from "mobx-react"; import Image from "next/image"; // types +import { EmptyStateType } from "@plane/constants"; import { TPageNavigationTabs } from "@plane/types"; // components import { EmptyState } from "@/components/empty-state"; import { PageLoader } from "@/components/pages"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // hooks import { EPageAccess } from "@/constants/page"; import { useCommandPalette, useProjectPages } from "@/hooks/store"; diff --git a/web/core/components/project/card-list.tsx b/web/core/components/project/card-list.tsx index 2578be7276b..dfb92d901b1 100644 --- a/web/core/components/project/card-list.tsx +++ b/web/core/components/project/card-list.tsx @@ -1,12 +1,12 @@ import { observer } from "mobx-react"; import Image from "next/image"; // components +import { EmptyStateType } from "@plane/constants"; import { ContentWrapper } from "@plane/ui"; import { EmptyState } from "@/components/empty-state"; import { ProjectCard } from "@/components/project"; import { ProjectsLoader } from "@/components/ui"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useCommandPalette, useEventTracker, useProject, useProjectFilter } from "@/hooks/store"; // assets diff --git a/web/core/components/views/views-list.tsx b/web/core/components/views/views-list.tsx index 6b7d4117241..d3051d0a81e 100644 --- a/web/core/components/views/views-list.tsx +++ b/web/core/components/views/views-list.tsx @@ -1,12 +1,12 @@ import { observer } from "mobx-react"; import { useParams } from "next/navigation"; // components +import { EmptyStateType } from "@plane/constants"; import { ListLayout } from "@/components/core/list"; import { EmptyState } from "@/components/empty-state"; import { ViewListLoader } from "@/components/ui"; import { ProjectViewListItem } from "@/components/views"; // constants -import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useCommandPalette, useProjectView } from "@/hooks/store"; // assets diff --git a/web/core/components/workspace-notifications/sidebar/empty-state.tsx b/web/core/components/workspace-notifications/sidebar/empty-state.tsx index 3b2b0c0f546..b35e9cd5e7e 100644 --- a/web/core/components/workspace-notifications/sidebar/empty-state.tsx +++ b/web/core/components/workspace-notifications/sidebar/empty-state.tsx @@ -3,9 +3,9 @@ import { FC } from "react"; import { observer } from "mobx-react"; // components +import { EmptyStateType } from "@plane/constants"; import { EmptyState } from "@/components/empty-state"; // constants -import { EmptyStateType } from "@/constants/empty-state"; import { ENotificationTab } from "@/constants/notification"; export const NotificationEmptyState: FC = observer(() => { diff --git a/web/core/layouts/auth-layout/project-wrapper.tsx b/web/core/layouts/auth-layout/project-wrapper.tsx index 70e427043ed..01f39920603 100644 --- a/web/core/layouts/auth-layout/project-wrapper.tsx +++ b/web/core/layouts/auth-layout/project-wrapper.tsx @@ -6,12 +6,12 @@ import { useParams } from "next/navigation"; import useSWR from "swr"; // components +import { EmptyStateType } from "@plane/constants"; import { JoinProject } from "@/components/auth-screens"; import { LogoSpinner } from "@/components/common"; import { EmptyState } from "@/components/empty-state"; import { ETimeLineTypeType } from "@/components/gantt-chart/contexts"; //constants -import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useCommandPalette,