mirror of
https://github.com/makeplane/plane.git
synced 2026-02-24 04:00:14 +01:00
chore: merge constants and services (#8623)
* fix: remove constants and services * fix: formatting * fix: types check
This commit is contained in:
committed by
GitHub
parent
06e4a1624c
commit
7793febcf8
@@ -29,7 +29,7 @@ import { useAppRouter } from "@/hooks/use-app-router";
|
||||
// plane web hooks
|
||||
import { EPageStoreType, usePage, usePageStore } from "@/plane-web/hooks/store";
|
||||
// plane web services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// services
|
||||
import { ProjectPageService, ProjectPageVersionService } from "@/services/page";
|
||||
import type { Route } from "./+types/page";
|
||||
|
||||
@@ -32,7 +32,7 @@ import { useAppRouter } from "@/hooks/use-app-router";
|
||||
// services
|
||||
import { AuthenticationWrapper } from "@/lib/wrappers/authentication-wrapper";
|
||||
// plane web services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
|
||||
const workspaceService = new WorkspaceService();
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import { useUser } from "@/hooks/store/user";
|
||||
// wrappers
|
||||
import { AuthenticationWrapper } from "@/lib/wrappers/authentication-wrapper";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
|
||||
const workspaceService = new WorkspaceService();
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import { useUser } from "@/hooks/store/user";
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
// wrappers
|
||||
import { AuthenticationWrapper } from "@/lib/wrappers/authentication-wrapper";
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// services
|
||||
|
||||
// service initialization
|
||||
|
||||
@@ -16,7 +16,7 @@ import { Tooltip } from "@plane/propel/tooltip";
|
||||
import { cn } from "@plane/utils";
|
||||
import { RichTextEditor } from "@/components/editor/rich-text";
|
||||
// plane web constants
|
||||
import { AI_EDITOR_TASKS, LOADING_TEXTS } from "@/plane-web/constants/ai";
|
||||
import { AI_EDITOR_TASKS, LOADING_TEXTS } from "@/constants/ai";
|
||||
// plane web services
|
||||
import type { TTaskPayload } from "@/services/ai.service";
|
||||
import { AIService } from "@/services/ai.service";
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
export * from "./settings";
|
||||
@@ -1,94 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
import type { ReactNode } from "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 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-tertiary" />,
|
||||
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-tertiary" />,
|
||||
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-tertiary" />,
|
||||
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-tertiary" />,
|
||||
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-tertiary" />,
|
||||
isPro: false,
|
||||
isEnabled: true,
|
||||
},
|
||||
};
|
||||
|
||||
type TProjectFeatures = {
|
||||
project_features: {
|
||||
key: string;
|
||||
title: string;
|
||||
description: string;
|
||||
featureList: TBaseFeatureList;
|
||||
};
|
||||
};
|
||||
|
||||
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,
|
||||
},
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
export * from "./features";
|
||||
@@ -1,8 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
export * from "./project";
|
||||
export * from "@/services/workspace.service";
|
||||
@@ -1,8 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
export * from "./estimate.service";
|
||||
export * from "@/services/view.service";
|
||||
@@ -1,7 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
export * from "@/services/project/project-state.service";
|
||||
@@ -14,7 +14,7 @@ import type {
|
||||
TEstimateSystemKeys,
|
||||
} from "@plane/types";
|
||||
// plane web services
|
||||
import estimateService from "@/plane-web/services/project/estimate.service";
|
||||
import estimateService from "@/services/estimate.service";
|
||||
// store
|
||||
import type { IEstimatePoint } from "@/store/estimates/estimate-point";
|
||||
import { EstimatePoint } from "@/store/estimates/estimate-point";
|
||||
|
||||
@@ -14,7 +14,7 @@ import { WorkspaceLogo } from "@/components/workspace/logo";
|
||||
// helpers
|
||||
import { EAuthModes, EAuthSteps } from "@/helpers/authentication.helper";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
|
||||
type TAuthHeader = {
|
||||
workspaceSlug: string | undefined;
|
||||
|
||||
@@ -23,7 +23,7 @@ import { useParseEditorContent } from "@/hooks/use-parse-editor-content";
|
||||
// plane web hooks
|
||||
import { useEditorFlagging } from "@/plane-web/hooks/use-editor-flagging";
|
||||
// plane web service
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
import { LiteToolbar } from "./lite-toolbar";
|
||||
const workspaceService = new WorkspaceService();
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import { RichTextEditor } from "@/components/editor/rich-text";
|
||||
import { useEditorAsset } from "@/hooks/store/use-editor-asset";
|
||||
import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
// plane web services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// local imports
|
||||
import { DescriptionInputLoader } from "./loader";
|
||||
// services init
|
||||
|
||||
@@ -15,7 +15,7 @@ import type { TActivityEntityData, THomeWidgetProps, TRecentActivityFilterKeys }
|
||||
// components
|
||||
import { ContentOverflowWrapper } from "@/components/core/content-overflow-HOC";
|
||||
// plane web services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
import { RecentsEmptyState } from "../empty-states";
|
||||
import { EWidgetKeys, WidgetLoader } from "../loaders";
|
||||
import { FiltersDropdown } from "./filters";
|
||||
|
||||
@@ -21,7 +21,7 @@ import { useEditorAsset } from "@/hooks/store/use-editor-asset";
|
||||
import { useProjectInbox } from "@/hooks/store/use-project-inbox";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
|
||||
const workspaceService = new WorkspaceService();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
import useKeypress from "@/hooks/use-keypress";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
// plane web services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// services
|
||||
import { AIService } from "@/services/ai.service";
|
||||
const workspaceService = new WorkspaceService();
|
||||
|
||||
@@ -20,7 +20,7 @@ import { CustomSelect, Input, Spinner } from "@plane/ui";
|
||||
import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
import { useUserProfile, useUserSettings } from "@/hooks/store/user";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
|
||||
type Props = {
|
||||
stepChange: (steps: Partial<TOnboardingSteps>) => Promise<void>;
|
||||
|
||||
@@ -20,7 +20,7 @@ import { WorkspaceLogo } from "@/components/workspace/logo";
|
||||
import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
import { useUserSettings } from "@/hooks/store/user";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
|
||||
type Props = {
|
||||
invitations: IWorkspaceMemberInvitation[];
|
||||
|
||||
@@ -31,7 +31,7 @@ import type { IUser, IWorkspace } from "@plane/types";
|
||||
// ui
|
||||
import { Input, Spinner } from "@plane/ui";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// components
|
||||
import { SwitchAccountDropdown } from "./switch-account-dropdown";
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import { Input, Spinner } from "@plane/ui";
|
||||
// hooks
|
||||
import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// components
|
||||
import { CommonOnboardingHeader } from "../common";
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
import { useUserProfile, useUserSettings } from "@/hooks/store/user";
|
||||
// plane-web imports
|
||||
import { getIsWorkspaceCreationDisabled } from "@/plane-web/helpers/instance.helper";
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// local components
|
||||
import { CommonOnboardingHeader } from "../common";
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import { WorkspaceLogo } from "@/components/workspace/logo";
|
||||
import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
import { useUserSettings } from "@/hooks/store/user";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// local components
|
||||
import { CommonOnboardingHeader } from "../common";
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import { usePowerK } from "@/hooks/store/use-power-k";
|
||||
import useDebounce from "@/hooks/use-debounce";
|
||||
// plane web imports
|
||||
import { PowerKModalNoSearchResultsCommand } from "@/plane-web/components/command-palette/power-k/search/no-results-command";
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// local imports
|
||||
import type { TPowerKContext, TPowerKPageType } from "../../core/types";
|
||||
import { PowerKModalSearchResults } from "./search-results";
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
// plane imports
|
||||
// import { useTranslation } from "@plane/i18n";
|
||||
import type { TIssueEntityData, TIssueSearchResponse, TActivityEntityData } from "@plane/types";
|
||||
@@ -18,7 +18,7 @@ import type { TIssueEntityData, TIssueSearchResponse, TActivityEntityData } from
|
||||
// import { useAppRouter } from "@/hooks/use-app-router";
|
||||
// plane web imports
|
||||
// import { IssueIdentifier } from "@/plane-web/components/issues/issue-details/issue-identifier";
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
|
||||
const workspaceService = new WorkspaceService();
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import { useTranslation } from "@plane/i18n";
|
||||
import { setPromiseToast } from "@plane/propel/toast";
|
||||
import { Tooltip } from "@plane/propel/tooltip";
|
||||
import type { IProject } from "@plane/types";
|
||||
import { CycleIcon, IntakeIcon, ModuleIcon, PageIcon, ViewsIcon } from "@plane/propel/icons";
|
||||
// components
|
||||
import { SettingsBoxedControlItem } from "@/components/settings/boxed-control-item";
|
||||
import { SettingsHeading } from "@/components/settings/heading";
|
||||
@@ -17,7 +18,6 @@ import { SettingsHeading } from "@/components/settings/heading";
|
||||
import { useProject } from "@/hooks/store/use-project";
|
||||
// plane web imports
|
||||
import { UpgradeBadge } from "@/plane-web/components/workspace/upgrade-badge";
|
||||
import { PROJECT_FEATURES_LIST } from "@/plane-web/constants/project/settings";
|
||||
// local imports
|
||||
import { ProjectFeatureToggle } from "./helper";
|
||||
|
||||
@@ -27,6 +27,54 @@ type Props = {
|
||||
isAdmin: boolean;
|
||||
};
|
||||
|
||||
const PROJECT_FEATURES_LIST = {
|
||||
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-tertiary" />,
|
||||
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-tertiary" />,
|
||||
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-tertiary" />,
|
||||
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-tertiary" />,
|
||||
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-tertiary" />,
|
||||
isPro: false,
|
||||
isEnabled: true,
|
||||
},
|
||||
};
|
||||
|
||||
export const ProjectFeaturesList = observer(function ProjectFeaturesList(props: Props) {
|
||||
const { workspaceSlug, projectId, isAdmin } = props;
|
||||
// store hooks
|
||||
@@ -62,43 +110,41 @@ export const ProjectFeaturesList = observer(function ProjectFeaturesList(props:
|
||||
|
||||
return (
|
||||
<>
|
||||
{Object.entries(PROJECT_FEATURES_LIST).map(([featureSectionKey, feature]) => (
|
||||
<div key={featureSectionKey}>
|
||||
<SettingsHeading title={t(feature.key)} description={t(`${feature.key}_description`)} />
|
||||
<div className="mt-6 flex flex-col gap-y-4">
|
||||
{Object.entries(feature.featureList).map(([featureItemKey, featureItem]) => (
|
||||
<div key={featureItemKey}>
|
||||
<SettingsBoxedControlItem
|
||||
title={
|
||||
<span className="flex items-center gap-2">
|
||||
{t(featureItem.key)}
|
||||
{featureItem.isPro && (
|
||||
<Tooltip tooltipContent="Pro feature" position="top">
|
||||
<UpgradeBadge className="rounded-sm" />
|
||||
</Tooltip>
|
||||
)}
|
||||
</span>
|
||||
}
|
||||
description={t(`${featureItem.key}_description`)}
|
||||
control={
|
||||
<ProjectFeatureToggle
|
||||
workspaceSlug={workspaceSlug}
|
||||
projectId={projectId}
|
||||
featureItem={featureItem}
|
||||
value={Boolean(currentProjectDetails?.[featureItem.property as keyof IProject])}
|
||||
handleSubmit={handleSubmit}
|
||||
disabled={!isAdmin}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
{currentProjectDetails?.[featureItem.property as keyof IProject] && (
|
||||
<div className="pl-14">{featureItem.renderChildren?.(currentProjectDetails, workspaceSlug)}</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div>
|
||||
<SettingsHeading title={t("projects_and_issues")} description={t("projects_and_issues_description")} />
|
||||
<div className="mt-6 flex flex-col gap-y-4">
|
||||
{Object.entries(PROJECT_FEATURES_LIST).map(([featureItemKey, featureItem]) => (
|
||||
<div key={featureItemKey}>
|
||||
<SettingsBoxedControlItem
|
||||
title={
|
||||
<span className="flex items-center gap-2">
|
||||
{t(featureItem.key)}
|
||||
{featureItem.isPro && (
|
||||
<Tooltip tooltipContent="Pro feature" position="top">
|
||||
<UpgradeBadge className="rounded-sm" />
|
||||
</Tooltip>
|
||||
)}
|
||||
</span>
|
||||
}
|
||||
description={t(`${featureItem.key}_description`)}
|
||||
control={
|
||||
<ProjectFeatureToggle
|
||||
workspaceSlug={workspaceSlug}
|
||||
projectId={projectId}
|
||||
featureItem={featureItem}
|
||||
value={Boolean(currentProjectDetails?.[featureItem.property as keyof IProject])}
|
||||
handleSubmit={handleSubmit}
|
||||
disabled={!isAdmin}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
{/* {currentProjectDetails?.[featureItem.property as keyof IProject] && (
|
||||
<div className="pl-14">{featureItem.renderChildren?.(currentProjectDetails, workspaceSlug)}</div>
|
||||
)} */}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -10,12 +10,11 @@ import { ChevronRightIcon } from "@plane/propel/icons";
|
||||
import { EPillVariant, Pill, EPillSize } from "@plane/propel/pill";
|
||||
import { ToggleSwitch } from "@plane/ui";
|
||||
import { joinUrlPath } from "@plane/utils";
|
||||
import type { TProperties } from "@/plane-web/constants/project/settings/features";
|
||||
|
||||
type Props = {
|
||||
workspaceSlug: string;
|
||||
projectId: string;
|
||||
featureItem: TProperties;
|
||||
featureItem: any;
|
||||
value: boolean;
|
||||
handleSubmit: (featureKey: string, featureProperty: string) => void;
|
||||
disabled?: boolean;
|
||||
@@ -23,8 +22,8 @@ type Props = {
|
||||
|
||||
export function ProjectFeatureToggle(props: Props) {
|
||||
const { workspaceSlug, projectId, featureItem, value, handleSubmit, disabled } = props;
|
||||
return featureItem.href ? (
|
||||
<Link href={joinUrlPath(workspaceSlug, "settings", "projects", projectId, "features", featureItem.href)}>
|
||||
return featureItem?.href ? (
|
||||
<Link href={joinUrlPath(workspaceSlug, "settings", "projects", projectId, "features", featureItem?.href)}>
|
||||
<div className="flex items-center gap-2">
|
||||
<Pill
|
||||
variant={value ? EPillVariant.PRIMARY : EPillVariant.DEFAULT}
|
||||
@@ -39,7 +38,7 @@ export function ProjectFeatureToggle(props: Props) {
|
||||
) : (
|
||||
<ToggleSwitch
|
||||
value={value}
|
||||
onChange={() => handleSubmit(featureItem.key, featureItem.property)}
|
||||
onChange={() => handleSubmit(featureItem?.key, featureItem?.property)}
|
||||
disabled={disabled}
|
||||
size="sm"
|
||||
data-ph-element={PROJECT_TRACKER_ELEMENTS.TOGGLE_FEATURE}
|
||||
|
||||
@@ -19,7 +19,7 @@ import { CustomSelect, Input } from "@plane/ui";
|
||||
import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
|
||||
type Props = {
|
||||
onSubmit?: (res: IWorkspace) => Promise<void>;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { PageIcon } from "@plane/propel/icons";
|
||||
import type { IFavorite, TLogoProps } from "@plane/types";
|
||||
// components
|
||||
// plane web constants
|
||||
import { FAVORITE_ITEM_ICONS, FAVORITE_ITEM_LINKS } from "@/plane-web/constants/sidebar-favorites";
|
||||
import { FAVORITE_ITEM_ICONS, FAVORITE_ITEM_LINKS } from "@/constants/sidebar-favorites";
|
||||
|
||||
export const getFavoriteItemIcon = (type: string, logo?: TLogoProps) => {
|
||||
const Icon = FAVORITE_ITEM_ICONS[type] || PageIcon;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
import type { TIssueRelationTypes } from "../types";
|
||||
import type { TIssueRelationTypes } from "../../ce/types";
|
||||
|
||||
export const REVERSE_RELATIONS: { [key in TIssueRelationTypes]: TIssueRelationTypes } = {
|
||||
blocked_by: "blocking",
|
||||
@@ -7,7 +7,7 @@
|
||||
// helpers
|
||||
import { API_BASE_URL } from "@plane/constants";
|
||||
// plane web constants
|
||||
import type { AI_EDITOR_TASKS } from "@/plane-web/constants/ai";
|
||||
import type { AI_EDITOR_TASKS } from "@/constants/ai";
|
||||
// services
|
||||
import { APIService } from "@/services/api.service";
|
||||
// types
|
||||
|
||||
@@ -11,7 +11,7 @@ import { action, computed, makeObservable, observable, runInAction } from "mobx"
|
||||
// types
|
||||
import type { IEstimate, IEstimatePoint as IEstimatePointType } from "@plane/types";
|
||||
// plane web services
|
||||
import estimateService from "@/plane-web/services/project/estimate.service";
|
||||
import estimateService from "@/services/estimate.service";
|
||||
// store
|
||||
import type { CoreRootStore } from "@/store/root.store";
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import type { IEstimate as IEstimateType, IEstimateFormData, TEstimateSystemKeys } from "@plane/types";
|
||||
// plane web services
|
||||
import estimateService from "@/plane-web/services/project/estimate.service";
|
||||
import estimateService from "@/services/estimate.service";
|
||||
// plane web store
|
||||
import type { IEstimate } from "@/plane-web/store/estimates/estimate";
|
||||
import { Estimate } from "@/plane-web/store/estimates/estimate";
|
||||
|
||||
@@ -10,7 +10,7 @@ import { computedFn } from "mobx-utils";
|
||||
// plane imports
|
||||
import type { IWorkspaceView } from "@plane/types";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// store
|
||||
import type { CoreRootStore } from "./root.store";
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import type { TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, TIssue } f
|
||||
// components
|
||||
import type { TRelationObject } from "@/components/issues/issue-detail-widgets/relations";
|
||||
// Plane-web
|
||||
import { REVERSE_RELATIONS } from "@/plane-web/constants/gantt-chart";
|
||||
import { REVERSE_RELATIONS } from "@/constants/gantt-chart";
|
||||
import type { TIssueRelationTypes } from "@/plane-web/types";
|
||||
// services
|
||||
import { IssueRelationService } from "@/services/issue";
|
||||
|
||||
@@ -24,7 +24,7 @@ import type {
|
||||
import { EIssuesStoreType } from "@plane/types";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
// services
|
||||
import { ViewService } from "@/plane-web/services";
|
||||
import { ViewService } from "@/services/view.service";
|
||||
import type { IBaseIssueFilterStore } from "../helpers/issue-filter-helper.store";
|
||||
import { IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
// helpers
|
||||
|
||||
@@ -24,7 +24,7 @@ import type {
|
||||
import { EIssuesStoreType, EIssueLayoutTypes, STATIC_VIEW_TYPES } from "@plane/types";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// local imports
|
||||
import type { IBaseIssueFilterStore, IIssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
import { IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {
|
||||
ViewFlags,
|
||||
} from "@plane/types";
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// types
|
||||
import type { IBaseIssuesStore } from "../helpers/base-issues.store";
|
||||
import { BaseIssuesStore } from "../helpers/base-issues.store";
|
||||
|
||||
@@ -12,7 +12,7 @@ import type { EUserPermissions } from "@plane/constants";
|
||||
import type { IWorkspaceBulkInviteFormData, IWorkspaceMember, IWorkspaceMemberInvitation } from "@plane/types";
|
||||
// plane-web constants
|
||||
// services
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// types
|
||||
import type { IRouterStore } from "@/store/router.store";
|
||||
import type { IUserStore } from "@/store/user";
|
||||
|
||||
@@ -13,7 +13,7 @@ import type { IProjectView, TViewFilters } from "@plane/types";
|
||||
// helpers
|
||||
import { getValidatedViewFilters, getViewName, orderViews, shouldFilterView } from "@plane/utils";
|
||||
// services
|
||||
import { ViewService } from "@/plane-web/services";
|
||||
import { ViewService } from "@/services/view.service";
|
||||
// store
|
||||
import type { CoreRootStore } from "./root.store";
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import type { IIntakeState, IState } from "@plane/types";
|
||||
// helpers
|
||||
import { sortStates } from "@plane/utils";
|
||||
// plane web
|
||||
import { ProjectStateService } from "@/plane-web/services/project/project-state.service";
|
||||
import { ProjectStateService } from "@/services/project/project-state.service";
|
||||
import type { RootStore } from "@/plane-web/store/root.store";
|
||||
|
||||
export interface IStateStore {
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
import type { EUserProjectRoles, IUserProjectsRole, IWorkspaceMemberMe, TProjectMembership } from "@plane/types";
|
||||
import { EUserWorkspaceRoles } from "@plane/types";
|
||||
// plane web imports
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
import type { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import projectMemberService from "@/services/project/project-member.service";
|
||||
|
||||
Reference in New Issue
Block a user