feat: init
This commit is contained in:
9
apps/web/ce/constants/ai.ts
Normal file
9
apps/web/ce/constants/ai.ts
Normal file
@@ -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",
|
||||
};
|
||||
4
apps/web/ce/constants/editor.ts
Normal file
4
apps/web/ce/constants/editor.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// plane types
|
||||
import type { TSearchEntities } from "@plane/types";
|
||||
|
||||
export const EDITOR_MENTION_TYPES: TSearchEntities[] = ["user_mention"];
|
||||
8
apps/web/ce/constants/gantt-chart.ts
Normal file
8
apps/web/ce/constants/gantt-chart.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { TIssueRelationTypes } from "../types";
|
||||
|
||||
export const REVERSE_RELATIONS: { [key in TIssueRelationTypes]: TIssueRelationTypes } = {
|
||||
blocked_by: "blocking",
|
||||
blocking: "blocked_by",
|
||||
relates_to: "relates_to",
|
||||
duplicate: "duplicate",
|
||||
};
|
||||
1
apps/web/ce/constants/project/index.ts
Normal file
1
apps/web/ce/constants/project/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./settings";
|
||||
118
apps/web/ce/constants/project/settings/features.tsx
Normal file
118
apps/web/ce/constants/project/settings/features.tsx
Normal file
@@ -0,0 +1,118 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { Timer } from "lucide-react";
|
||||
// plane imports
|
||||
import { CycleIcon, IntakeIcon, ModuleIcon, PageIcon, ViewsIcon } from "@plane/propel/icons";
|
||||
import type { IProject } from "@plane/types";
|
||||
|
||||
export type TProperties = {
|
||||
key: string;
|
||||
property: string;
|
||||
title: string;
|
||||
description: string;
|
||||
icon: ReactNode;
|
||||
isPro: boolean;
|
||||
isEnabled: boolean;
|
||||
renderChildren?: (currentProjectDetails: IProject, workspaceSlug: string) => ReactNode;
|
||||
href?: string;
|
||||
};
|
||||
|
||||
type TProjectBaseFeatureKeys = "cycles" | "modules" | "views" | "pages" | "inbox";
|
||||
type TProjectOtherFeatureKeys = "is_time_tracking_enabled";
|
||||
|
||||
type TBaseFeatureList = {
|
||||
[key in TProjectBaseFeatureKeys]: TProperties;
|
||||
};
|
||||
|
||||
export const PROJECT_BASE_FEATURES_LIST: TBaseFeatureList = {
|
||||
cycles: {
|
||||
key: "cycles",
|
||||
property: "cycle_view",
|
||||
title: "Cycles",
|
||||
description: "Timebox work as you see fit per project and change frequency from one period to the next.",
|
||||
icon: <CycleIcon className="h-5 w-5 flex-shrink-0 rotate-180 text-custom-text-300" />,
|
||||
isPro: false,
|
||||
isEnabled: true,
|
||||
},
|
||||
modules: {
|
||||
key: "modules",
|
||||
property: "module_view",
|
||||
title: "Modules",
|
||||
description: "Group work into sub-project-like set-ups with their own leads and assignees.",
|
||||
icon: <ModuleIcon width={20} height={20} className="flex-shrink-0 text-custom-text-300" />,
|
||||
isPro: false,
|
||||
isEnabled: true,
|
||||
},
|
||||
views: {
|
||||
key: "views",
|
||||
property: "issue_views_view",
|
||||
title: "Views",
|
||||
description: "Save sorts, filters, and display options for later or share them.",
|
||||
icon: <ViewsIcon className="h-5 w-5 flex-shrink-0 text-custom-text-300" />,
|
||||
isPro: false,
|
||||
isEnabled: true,
|
||||
},
|
||||
pages: {
|
||||
key: "pages",
|
||||
property: "page_view",
|
||||
title: "Pages",
|
||||
description: "Write anything like you write anything.",
|
||||
icon: <PageIcon className="h-5 w-5 flex-shrink-0 text-custom-text-300" />,
|
||||
isPro: false,
|
||||
isEnabled: true,
|
||||
},
|
||||
inbox: {
|
||||
key: "intake",
|
||||
property: "inbox_view",
|
||||
title: "Intake",
|
||||
description: "Consider and discuss work items before you add them to your project.",
|
||||
icon: <IntakeIcon className="h-5 w-5 flex-shrink-0 text-custom-text-300" />,
|
||||
isPro: false,
|
||||
isEnabled: true,
|
||||
},
|
||||
};
|
||||
|
||||
type TOtherFeatureList = {
|
||||
[key in TProjectOtherFeatureKeys]: TProperties;
|
||||
};
|
||||
|
||||
export const PROJECT_OTHER_FEATURES_LIST: TOtherFeatureList = {
|
||||
is_time_tracking_enabled: {
|
||||
key: "time_tracking",
|
||||
property: "is_time_tracking_enabled",
|
||||
title: "Time Tracking",
|
||||
description: "Log time, see timesheets, and download full CSVs for your entire workspace.",
|
||||
icon: <Timer className="h-5 w-5 flex-shrink-0 text-custom-text-300" />,
|
||||
isPro: true,
|
||||
isEnabled: false,
|
||||
},
|
||||
};
|
||||
|
||||
type TProjectFeatures = {
|
||||
project_features: {
|
||||
key: string;
|
||||
title: string;
|
||||
description: string;
|
||||
featureList: TBaseFeatureList;
|
||||
};
|
||||
project_others: {
|
||||
key: string;
|
||||
title: string;
|
||||
description: string;
|
||||
featureList: TOtherFeatureList;
|
||||
};
|
||||
};
|
||||
|
||||
export const PROJECT_FEATURES_LIST: TProjectFeatures = {
|
||||
project_features: {
|
||||
key: "projects_and_issues",
|
||||
title: "Projects and work items",
|
||||
description: "Toggle these on or off this project.",
|
||||
featureList: PROJECT_BASE_FEATURES_LIST,
|
||||
},
|
||||
project_others: {
|
||||
key: "work_management",
|
||||
title: "Work management",
|
||||
description: "Available only on some plans as indicated by the label next to the feature below.",
|
||||
featureList: PROJECT_OTHER_FEATURES_LIST,
|
||||
},
|
||||
};
|
||||
2
apps/web/ce/constants/project/settings/index.ts
Normal file
2
apps/web/ce/constants/project/settings/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./features";
|
||||
export * from "./tabs";
|
||||
82
apps/web/ce/constants/project/settings/tabs.ts
Normal file
82
apps/web/ce/constants/project/settings/tabs.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
// icons
|
||||
import { EUserPermissions } from "@plane/constants";
|
||||
import { SettingIcon } from "@/components/icons/attachment";
|
||||
// types
|
||||
import type { Props } from "@/components/icons/types";
|
||||
// constants
|
||||
|
||||
export const PROJECT_SETTINGS = {
|
||||
general: {
|
||||
key: "general",
|
||||
i18n_label: "common.general",
|
||||
href: ``,
|
||||
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
|
||||
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/`,
|
||||
Icon: SettingIcon,
|
||||
},
|
||||
members: {
|
||||
key: "members",
|
||||
i18n_label: "common.members",
|
||||
href: `/members`,
|
||||
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
|
||||
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/members/`,
|
||||
Icon: SettingIcon,
|
||||
},
|
||||
features: {
|
||||
key: "features",
|
||||
i18n_label: "common.features",
|
||||
href: `/features`,
|
||||
access: [EUserPermissions.ADMIN],
|
||||
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/features/`,
|
||||
Icon: SettingIcon,
|
||||
},
|
||||
states: {
|
||||
key: "states",
|
||||
i18n_label: "common.states",
|
||||
href: `/states`,
|
||||
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER],
|
||||
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/states/`,
|
||||
Icon: SettingIcon,
|
||||
},
|
||||
labels: {
|
||||
key: "labels",
|
||||
i18n_label: "common.labels",
|
||||
href: `/labels`,
|
||||
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER],
|
||||
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/labels/`,
|
||||
Icon: SettingIcon,
|
||||
},
|
||||
estimates: {
|
||||
key: "estimates",
|
||||
i18n_label: "common.estimates",
|
||||
href: `/estimates`,
|
||||
access: [EUserPermissions.ADMIN],
|
||||
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/estimates/`,
|
||||
Icon: SettingIcon,
|
||||
},
|
||||
automations: {
|
||||
key: "automations",
|
||||
i18n_label: "project_settings.automations.label",
|
||||
href: `/automations`,
|
||||
access: [EUserPermissions.ADMIN],
|
||||
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/automations/`,
|
||||
Icon: SettingIcon,
|
||||
},
|
||||
};
|
||||
|
||||
export const PROJECT_SETTINGS_LINKS: {
|
||||
key: string;
|
||||
i18n_label: string;
|
||||
href: string;
|
||||
access: EUserPermissions[];
|
||||
highlight: (pathname: string, baseUrl: string) => boolean;
|
||||
Icon: React.FC<Props>;
|
||||
}[] = [
|
||||
PROJECT_SETTINGS["general"],
|
||||
PROJECT_SETTINGS["members"],
|
||||
PROJECT_SETTINGS["features"],
|
||||
PROJECT_SETTINGS["states"],
|
||||
PROJECT_SETTINGS["labels"],
|
||||
PROJECT_SETTINGS["estimates"],
|
||||
PROJECT_SETTINGS["automations"],
|
||||
];
|
||||
42
apps/web/ce/constants/sidebar-favorites.ts
Normal file
42
apps/web/ce/constants/sidebar-favorites.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { LucideIcon } from "lucide-react";
|
||||
// plane imports
|
||||
import type { ISvgIcons } from "@plane/propel/icons";
|
||||
import { CycleIcon, FavoriteFolderIcon, ModuleIcon, PageIcon, ProjectIcon, ViewsIcon } from "@plane/propel/icons";
|
||||
import type { IFavorite } from "@plane/types";
|
||||
|
||||
export const FAVORITE_ITEM_ICONS: Record<string, React.FC<ISvgIcons> | LucideIcon> = {
|
||||
page: PageIcon,
|
||||
project: ProjectIcon,
|
||||
view: ViewsIcon,
|
||||
module: ModuleIcon,
|
||||
cycle: CycleIcon,
|
||||
folder: FavoriteFolderIcon,
|
||||
};
|
||||
|
||||
export const FAVORITE_ITEM_LINKS: {
|
||||
[key: string]: {
|
||||
itemLevel: "project" | "workspace";
|
||||
getLink: (favorite: IFavorite) => string;
|
||||
};
|
||||
} = {
|
||||
project: {
|
||||
itemLevel: "project",
|
||||
getLink: () => `issues`,
|
||||
},
|
||||
cycle: {
|
||||
itemLevel: "project",
|
||||
getLink: (favorite) => `cycles/${favorite.entity_identifier}`,
|
||||
},
|
||||
module: {
|
||||
itemLevel: "project",
|
||||
getLink: (favorite) => `modules/${favorite.entity_identifier}`,
|
||||
},
|
||||
view: {
|
||||
itemLevel: "project",
|
||||
getLink: (favorite) => `views/${favorite.entity_identifier}`,
|
||||
},
|
||||
page: {
|
||||
itemLevel: "project",
|
||||
getLink: (favorite) => `pages/${favorite.entity_identifier}`,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user