mirror of
https://github.com/makeplane/plane.git
synced 2025-12-25 08:09:33 +01:00
* [WEB-5134] refactor: update `web` ESLint configuration and refactor imports to use type imports - Enhanced ESLint configuration by adding new rules for import consistency and type imports. - Refactored multiple files to replace regular imports with type imports for better clarity and performance. - Ensured consistent use of type imports across the application to align with TypeScript best practices. * refactor: standardize type imports across components - Updated multiple files to replace regular imports with type imports for improved clarity and consistency. - Ensured adherence to TypeScript best practices in the rich filters and issue layouts components.
118 lines
3.4 KiB
TypeScript
118 lines
3.4 KiB
TypeScript
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;
|
|
};
|
|
|
|
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,
|
|
},
|
|
};
|