mirror of
https://github.com/makeplane/plane.git
synced 2026-06-14 03:30:00 +00:00
[GIT-238] refactor: migrate types from apps/web to @plane/types (#9203)
* refactor: migrate types from apps/web to @plane/types * [WEB-238] resolved lint errors * [WEB-238] Resolved coderabbit comments
This commit is contained in:
@@ -22,7 +22,7 @@ import { SidebarProjectsListItem } from "@/components/workspace/sidebar/projects
|
||||
import { useAppTheme } from "@/hooks/store/use-app-theme";
|
||||
import { useProject } from "@/hooks/store/use-project";
|
||||
import { useUserPermissions } from "@/hooks/store/user";
|
||||
import type { TProject } from "@/plane-web/types";
|
||||
import type { TProject } from "@plane/types";
|
||||
import { ExtendedSidebarWrapper } from "./extended-sidebar-wrapper";
|
||||
|
||||
export const ExtendedProjectSidebar = observer(function ExtendedProjectSidebar() {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { SwitcherLabel } from "@/components/common/switcher-label";
|
||||
// hooks
|
||||
import { useProject } from "@/hooks/store/use-project";
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
import type { TProject } from "@/plane-web/types";
|
||||
import type { TProject } from "@plane/types";
|
||||
|
||||
type TProjectBreadcrumbProps = {
|
||||
workspaceSlug: string;
|
||||
|
||||
@@ -20,7 +20,7 @@ import { getCoverImageType, uploadCoverImage } from "@/helpers/cover-image.helpe
|
||||
import { useProject } from "@/hooks/store/use-project";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
// plane web types
|
||||
import type { TProject } from "@/plane-web/types/projects";
|
||||
import type { TProject } from "@plane/types";
|
||||
import { ProjectAttributes } from "./attributes";
|
||||
import { getProjectFormValues } from "./utils";
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { CircleDot, XCircle } from "lucide-react";
|
||||
import { RelatedIcon, DuplicatePropertyIcon } from "@plane/propel/icons";
|
||||
import type { TRelationObject } from "@/components/issues/issue-detail-widgets/relations";
|
||||
import type { TIssueRelationTypes } from "../../types";
|
||||
import type { TIssueRelationTypes } from "@plane/types";
|
||||
|
||||
export * from "./activity";
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
import { useQueryParams } from "@/hooks/use-query-params";
|
||||
import type { TPageNavigationPaneTab } from "@/plane-web/components/pages/navigation-pane";
|
||||
import type { INavigationPaneExtension } from "@/plane-web/types/pages/pane-extensions";
|
||||
import type { INavigationPaneExtension } from "@/components/pages/navigation-pane";
|
||||
import type { TPageInstance } from "@/store/pages/base-page";
|
||||
|
||||
export type TPageExtensionHookParams = {
|
||||
|
||||
@@ -1,9 +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 "./projects";
|
||||
export * from "./issue-types";
|
||||
export * from "./gantt-chart";
|
||||
@@ -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 "./issue-property-values.d";
|
||||
@@ -1,2 +0,0 @@
|
||||
export type TIssuePropertyValues = object;
|
||||
export type TIssuePropertyValueErrors = object;
|
||||
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
// CE re-exports the core navigation pane extension types directly
|
||||
// EE overrides this with specific extension data types
|
||||
export type {
|
||||
INavigationPaneExtension,
|
||||
INavigationPaneExtensionComponent,
|
||||
INavigationPaneExtensionProps,
|
||||
} from "@/components/pages/navigation-pane";
|
||||
@@ -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 "./projects";
|
||||
export * from "./project-activity";
|
||||
@@ -1,11 +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 { IPartialProject, IProject } from "@plane/types";
|
||||
|
||||
export type TPartialProject = IPartialProject;
|
||||
|
||||
export type TProject = TPartialProject & IProject;
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { observer } from "mobx-react";
|
||||
|
||||
import type { TProjectActivity } from "@/plane-web/types";
|
||||
import type { TProjectActivity } from "@plane/types";
|
||||
import { ActivityBlockComponent } from "./activity-block";
|
||||
import { iconsMap, messages } from "./helper";
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
StatePropertyIcon,
|
||||
} from "@plane/propel/icons";
|
||||
import { store } from "@/lib/store-context";
|
||||
import type { TProjectActivity } from "@/plane-web/types";
|
||||
import type { TProjectActivity } from "@plane/types";
|
||||
|
||||
type ActivityIconMap = {
|
||||
[key: string]: FC<{ className?: string }>;
|
||||
|
||||
@@ -19,7 +19,7 @@ import { cn, sortBySelectedFirst } from "@plane/utils";
|
||||
// hooks
|
||||
import { useDropdown } from "@/hooks/use-dropdown";
|
||||
// plane web imports
|
||||
import type { TProject } from "@/plane-web/types";
|
||||
import type { TProject } from "@plane/types";
|
||||
// local imports
|
||||
import { DropdownButton } from "../buttons";
|
||||
import { BUTTON_VARIANTS_WITH_TEXT } from "../constants";
|
||||
|
||||
@@ -16,7 +16,7 @@ import { EIssueLayoutTypes, EIssuesStoreType } from "@plane/types";
|
||||
// hooks
|
||||
import { useIssues } from "@/hooks/store/use-issues";
|
||||
// plane web imports
|
||||
import type { TProject } from "@/plane-web/types";
|
||||
import type { TProject } from "@plane/types";
|
||||
// local imports
|
||||
import { WorkItemsModal } from "../analytics/work-items/modal";
|
||||
import { WorkItemFiltersToggle } from "../work-item-filters/filters-toggle";
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useState } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
// plane imports
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import type { TIssue, TIssueServiceType } from "@plane/types";
|
||||
import type { TIssue, TIssueServiceType, TIssueRelationTypes } from "@plane/types";
|
||||
import { EIssueServiceType } from "@plane/types";
|
||||
import { Collapsible } from "@plane/ui";
|
||||
// components
|
||||
@@ -18,7 +18,6 @@ import { useIssueDetail } from "@/hooks/store/use-issue-detail";
|
||||
// Plane-web
|
||||
import { CreateUpdateEpicModal } from "@/plane-web/components/epics/epic-modal";
|
||||
import { useTimeLineRelationOptions } from "@/plane-web/components/relations";
|
||||
import type { TIssueRelationTypes } from "@/plane-web/types";
|
||||
// helper
|
||||
import { DeleteIssueModal } from "../../delete-issue-modal";
|
||||
import { RelationIssueList } from "../../relations/issue-list";
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import { CustomMenu } from "@plane/ui";
|
||||
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
|
||||
// Plane-web
|
||||
import { useTimeLineRelationOptions } from "@/plane-web/components/relations";
|
||||
import type { TIssueRelationTypes } from "@/plane-web/types";
|
||||
import type { TIssueRelationTypes } from "@plane/types";
|
||||
|
||||
type Props = {
|
||||
issueId: string;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import { observer } from "mobx-react";
|
||||
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
|
||||
// Plane-web
|
||||
import { getRelationActivityContent, useTimeLineRelationOptions } from "@/plane-web/components/relations";
|
||||
import type { TIssueRelationTypes } from "@/plane-web/types";
|
||||
import type { TIssueRelationTypes } from "@plane/types";
|
||||
//
|
||||
import { IssueActivityBlockComponent } from "./";
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import { useProject } from "@/hooks/store/use-project";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
// Plane web imports
|
||||
import { useTimeLineRelationOptions } from "@/plane-web/components/relations";
|
||||
import type { TIssueRelationTypes } from "@/plane-web/types";
|
||||
import type { TIssueRelationTypes } from "@plane/types";
|
||||
import type { TRelationObject } from "../issue-detail-widgets/relations";
|
||||
|
||||
type TIssueRelationSelect = {
|
||||
|
||||
@@ -9,9 +9,7 @@ import { createContext } from "react";
|
||||
import type { UseFormReset, UseFormWatch } from "react-hook-form";
|
||||
// plane imports
|
||||
import type { EditorRefApi } from "@plane/editor";
|
||||
import type { ISearchIssueResponse, TIssue } from "@plane/types";
|
||||
// plane web imports
|
||||
import type { TIssuePropertyValues, TIssuePropertyValueErrors } from "@/plane-web/types/issue-types";
|
||||
import type { ISearchIssueResponse, TIssue, TIssuePropertyValues, TIssuePropertyValueErrors } from "@plane/types";
|
||||
import type { TIssueFields } from "@/plane-web/components/issues/issue-modal";
|
||||
|
||||
export type TPropertyValuesValidationProps = {
|
||||
|
||||
@@ -21,7 +21,7 @@ import useIssuePeekOverviewRedirection from "@/hooks/use-issue-peek-overview-red
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
// plane web imports
|
||||
import { IssueIdentifier } from "@/plane-web/components/issues/issue-details/issue-identifier";
|
||||
import type { TIssueRelationTypes } from "@/plane-web/types";
|
||||
import type { TIssueRelationTypes } from "@plane/types";
|
||||
// local imports
|
||||
import { useRelationOperations } from "../issue-detail-widgets/relations/helper";
|
||||
import { RelationIssueProperty } from "./properties";
|
||||
|
||||
@@ -10,7 +10,7 @@ import { observer } from "mobx-react";
|
||||
import type { TIssue, TIssueServiceType } from "@plane/types";
|
||||
import { EIssueServiceType } from "@plane/types";
|
||||
// Plane-web imports
|
||||
import type { TIssueRelationTypes } from "@/plane-web/types";
|
||||
import type { TIssueRelationTypes } from "@plane/types";
|
||||
// local imports
|
||||
import { RelationIssueListItem } from "./issue-list-item";
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
// helpers
|
||||
import { getSidebarNavigationItemIcon } from "@/plane-web/components/workspace/sidebar/helper";
|
||||
// types
|
||||
import type { TPersonalNavigationItemKey } from "@/types/navigation-preferences";
|
||||
import type { TPersonalNavigationItemKey } from "@plane/types";
|
||||
|
||||
type TCustomizeNavigationDialogProps = {
|
||||
isOpen: boolean;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
import type { TPartialProject } from "@/plane-web/types";
|
||||
import type { TPartialProject } from "@plane/types";
|
||||
// plane propel imports
|
||||
import { Logo } from "@plane/propel/emoji-icon-picker";
|
||||
import { ChevronDownIcon } from "@plane/propel/icons";
|
||||
|
||||
@@ -8,7 +8,7 @@ import React from "react";
|
||||
// components
|
||||
import { Logo } from "@plane/propel/emoji-icon-picker";
|
||||
// plane imports
|
||||
import type { TPartialProject } from "@/plane-web/types";
|
||||
import type { TPartialProject } from "@plane/types";
|
||||
// local imports
|
||||
import { PowerKMenuBuilder } from "./builder";
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import useKeypress from "@/hooks/use-keypress";
|
||||
// plane web components
|
||||
import { CreateProjectForm } from "@/plane-web/components/projects/create/root";
|
||||
// plane web types
|
||||
import type { TProject } from "@/plane-web/types/projects";
|
||||
import type { TProject } from "@plane/types";
|
||||
// services
|
||||
import { FileService } from "@/services/file.service";
|
||||
const fileService = new FileService();
|
||||
|
||||
@@ -18,7 +18,7 @@ import { cn, projectIdentifierSanitizer, getTabIndex } from "@plane/utils";
|
||||
// plane utils
|
||||
// helpers
|
||||
// plane-web types
|
||||
import type { TProject } from "@/plane-web/types/projects";
|
||||
import type { TProject } from "@plane/types";
|
||||
|
||||
type Props = {
|
||||
setValue: UseFormSetValue<TProject>;
|
||||
|
||||
@@ -30,7 +30,7 @@ import { useProject } from "@/hooks/store/use-project";
|
||||
import { useUserPermissions } from "@/hooks/store/user";
|
||||
import { useProjectNavigationPreferences } from "@/hooks/use-navigation-preferences";
|
||||
// plane web imports
|
||||
import type { TProject } from "@/plane-web/types";
|
||||
import type { TProject } from "@plane/types";
|
||||
// local imports
|
||||
import { SidebarProjectsListItem } from "./projects-list-item";
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
import type { TIssueRelationTypes } from "../../ce/types";
|
||||
import type { TIssueRelationTypes } from "@plane/types";
|
||||
|
||||
export const REVERSE_RELATIONS: { [key in TIssueRelationTypes]: TIssueRelationTypes } = {
|
||||
blocked_by: "blocking",
|
||||
|
||||
@@ -15,13 +15,13 @@ import type {
|
||||
TWorkspaceNavigationItemState,
|
||||
TAppRailPreferences,
|
||||
TAppRailDisplayMode,
|
||||
} from "@/types/navigation-preferences";
|
||||
} from "@plane/types";
|
||||
import {
|
||||
DEFAULT_PERSONAL_PREFERENCES,
|
||||
DEFAULT_PROJECT_PREFERENCES,
|
||||
DEFAULT_WORKSPACE_PREFERENCES,
|
||||
DEFAULT_APP_RAIL_PREFERENCES,
|
||||
} from "@/types/navigation-preferences";
|
||||
} from "@plane/types";
|
||||
import { useWorkspace } from "./store/use-workspace";
|
||||
import useLocalStorage from "./use-local-storage";
|
||||
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
*/
|
||||
|
||||
import { API_BASE_URL } from "@plane/constants";
|
||||
import type { TIssueRelation, TIssue } from "@plane/types";
|
||||
// helpers
|
||||
// Plane-web
|
||||
import type { TIssueRelationTypes } from "@/plane-web/types";
|
||||
import type { TIssueRelation, TIssue, TIssueRelationTypes } from "@plane/types";
|
||||
// services
|
||||
import { APIService } from "@/services/api.service";
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {
|
||||
} from "@plane/types";
|
||||
// helpers
|
||||
// plane web types
|
||||
import type { TProject, TPartialProject } from "@/plane-web/types";
|
||||
import type { TProject, TPartialProject } from "@plane/types";
|
||||
// services
|
||||
import { APIService } from "@/services/api.service";
|
||||
|
||||
|
||||
@@ -8,12 +8,10 @@ import { uniq, get, set } from "lodash-es";
|
||||
import { action, computed, makeObservable, observable, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
// plane imports
|
||||
import type { TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, TIssue } from "@plane/types";
|
||||
import type { TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, TIssue, TIssueRelationTypes } from "@plane/types";
|
||||
// components
|
||||
import type { TRelationObject } from "@/components/issues/issue-detail-widgets/relations";
|
||||
// Plane-web
|
||||
import { REVERSE_RELATIONS } from "@/constants/gantt-chart";
|
||||
import type { TIssueRelationTypes } from "@/plane-web/types";
|
||||
// services
|
||||
import { IssueRelationService } from "@/services/issue";
|
||||
// types
|
||||
|
||||
@@ -13,6 +13,7 @@ import type {
|
||||
TIssueCommentReaction,
|
||||
TIssueLink,
|
||||
TIssueReaction,
|
||||
TIssueRelationTypes,
|
||||
TIssueServiceType,
|
||||
TWorkItemWidgets,
|
||||
} from "@plane/types";
|
||||
@@ -23,7 +24,6 @@ import type {
|
||||
IIssueActivityStoreActions,
|
||||
TActivityLoader,
|
||||
} from "@/plane-web/store/issue/issue-details/activity.store";
|
||||
import type { TIssueRelationTypes } from "@/plane-web/types";
|
||||
import type { IIssueRootStore } from "../root.store";
|
||||
import { IssueAttachmentStore } from "./attachment.store";
|
||||
import type { IIssueAttachmentStore, IIssueAttachmentStoreActions } from "./attachment.store";
|
||||
|
||||
@@ -12,7 +12,7 @@ import type { TFetchStatus, TLoader, TProjectAnalyticsCount, TProjectAnalyticsCo
|
||||
// helpers
|
||||
import { orderProjects, shouldFilterProject } from "@plane/utils";
|
||||
// services
|
||||
import type { TProject, TPartialProject } from "@/plane-web/types/projects";
|
||||
import type { TProject, TPartialProject } from "@plane/types";
|
||||
import { IssueLabelService, IssueService } from "@/services/issue";
|
||||
import { ProjectService, ProjectStateService, ProjectArchiveService } from "@/services/project";
|
||||
// store
|
||||
|
||||
@@ -31,8 +31,10 @@ export * from "./integration";
|
||||
export * from "./issues";
|
||||
export * from "./issues/base"; // TODO: Remove this after development and the refactor/mobx-store-issue branch is stable
|
||||
export * from "./issues/issue-identifier";
|
||||
export * from "./issues/issue-property-values";
|
||||
export * from "./layout";
|
||||
export * from "./module";
|
||||
export * from "./navigation-preferences";
|
||||
export * from "./page";
|
||||
export * from "./payment";
|
||||
export * from "./pragmatic";
|
||||
|
||||
+2
-1
@@ -4,4 +4,5 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
export type TIssueRelationTypes = "blocking" | "blocked_by" | "duplicate" | "relates_to";
|
||||
export type TIssuePropertyValues = Record<string, unknown>;
|
||||
export type TIssuePropertyValueErrors = Record<string, unknown>;
|
||||
-2
@@ -50,7 +50,6 @@ export interface TNavigationPreferences {
|
||||
projects: TProjectNavigationPreferences;
|
||||
}
|
||||
|
||||
// Default preferences
|
||||
export const DEFAULT_PERSONAL_PREFERENCES: TPersonalNavigationPreferences = {
|
||||
items: {
|
||||
stickies: { enabled: false, sort_order: 0 },
|
||||
@@ -69,7 +68,6 @@ export const DEFAULT_WORKSPACE_PREFERENCES: TWorkspaceNavigationPreferences = {
|
||||
items: {},
|
||||
};
|
||||
|
||||
// App Rail preferences
|
||||
export type TAppRailDisplayMode = "icon_only" | "icon_with_label";
|
||||
|
||||
export interface TAppRailPreferences {
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
import type { TProjectBaseActivity } from "@plane/types";
|
||||
import type { TProjectBaseActivity } from "../activity";
|
||||
|
||||
export type TProjectActivity = TProjectBaseActivity & {
|
||||
content: string;
|
||||
@@ -4,6 +4,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
export * from "./activity";
|
||||
export * from "./project_filters";
|
||||
export * from "./projects";
|
||||
export * from "./project_link";
|
||||
|
||||
Reference in New Issue
Block a user