From abe3cf9d6858c5e69225a5f20854ae25d9c3348e Mon Sep 17 00:00:00 2001 From: sriramveeraghanta Date: Fri, 1 Sep 2023 00:34:57 +0530 Subject: [PATCH] fix: build issues by commenting few parts --- .../issues/filters-render/index.tsx | 20 +++++++++---------- .../label/filter-label-block.tsx | 12 +++++------ .../issues/filters-render/label/index.tsx | 16 +++++++-------- .../priority/filter-priority-block.tsx | 12 +++++------ .../issues/filters-render/priority/index.tsx | 16 +++++++-------- .../state/filter-state-block.tsx | 12 +++++------ .../issues/filters-render/state/index.tsx | 16 +++++++-------- .../issues/navbar/issue-board-view.tsx | 2 -- .../issues/peek-overview/add-comment.tsx | 2 +- .../peek-overview/comment-detail-card.tsx | 2 +- .../peek-overview/full-screen-peek-view.tsx | 2 +- .../issues/peek-overview/header.tsx | 2 +- .../issues/peek-overview/issue-activity.tsx | 2 +- .../issues/peek-overview/issue-details.tsx | 2 +- .../issues/peek-overview/issue-properties.tsx | 2 +- .../issues/peek-overview/side-peek-view.tsx | 2 +- apps/space/lib/mobx/store-init.tsx | 10 +++++----- apps/space/pages/onboarding/index.tsx | 2 +- apps/space/store/issue_details.ts | 2 +- apps/space/store/issue_legacy.ts | 3 +-- apps/space/store/project.ts | 2 +- apps/space/store/root.ts | 2 +- apps/space/store/theme.ts | 2 +- apps/space/types/index.ts | 4 ---- apps/space/types/user.ts | 3 +++ 25 files changed, 74 insertions(+), 78 deletions(-) delete mode 100644 apps/space/types/index.ts diff --git a/apps/space/components/issues/filters-render/index.tsx b/apps/space/components/issues/filters-render/index.tsx index dcb6edf4b..d797d1506 100644 --- a/apps/space/components/issues/filters-render/index.tsx +++ b/apps/space/components/issues/filters-render/index.tsx @@ -16,25 +16,25 @@ const IssueFilter = observer(() => { const { workspace_slug, project_slug } = router.query as { workspace_slug: string; project_slug: string }; const clearAllFilters = () => { - router.replace( - store.issue.getURLDefinition(workspace_slug, project_slug, { - key: "all", - removeAll: true, - }) - ); + // router.replace( + // store.issue.getURLDefinition(workspace_slug, project_slug, { + // key: "all", + // removeAll: true, + // }) + // ); }; - if (store.issue.getIfFiltersIsEmpty()) return null; + // if (store.issue.getIfFiltersIsEmpty()) return null; return (
{/* state */} - {store.issue.checkIfFilterExistsForKey("state") && } + {/* {store.issue.checkIfFilterExistsForKey("state") && } */} {/* labels */} - {store.issue.checkIfFilterExistsForKey("label") && } + {/* {store.issue.checkIfFilterExistsForKey("label") && } */} {/* priority */} - {store.issue.checkIfFilterExistsForKey("priority") && } + {/* {store.issue.checkIfFilterExistsForKey("priority") && } */} {/* clear all filters */}
const { workspace_slug, project_slug } = router.query as { workspace_slug: string; project_slug: string }; const removeLabelFromFilter = () => { - router.replace( - store.issue.getURLDefinition(workspace_slug, project_slug, { - key: "label", - value: label?.id, - }) - ); + // router.replace( + // store.issue.getURLDefinition(workspace_slug, project_slug, { + // key: "label", + // value: label?.id, + // }) + // ); }; return ( diff --git a/apps/space/components/issues/filters-render/label/index.tsx b/apps/space/components/issues/filters-render/label/index.tsx index 083d7cde7..1d9a4f990 100644 --- a/apps/space/components/issues/filters-render/label/index.tsx +++ b/apps/space/components/issues/filters-render/label/index.tsx @@ -16,12 +16,12 @@ const IssueLabelFilter = observer(() => { const { workspace_slug, project_slug } = router.query as { workspace_slug: string; project_slug: string }; const clearLabelFilters = () => { - router.replace( - store.issue.getURLDefinition(workspace_slug, project_slug, { - key: "label", - removeAll: true, - }) - ); + // router.replace( + // store.issue.getURLDefinition(workspace_slug, project_slug, { + // key: "label", + // removeAll: true, + // }) + // ); }; return ( @@ -29,13 +29,13 @@ const IssueLabelFilter = observer(() => {
Labels
- {store?.issue?.labels && + {/* {store?.issue?.labels && store?.issue?.labels.map( (_label: IIssueLabel, _index: number) => store.issue.getUserSelectedFilter("label", _label.id) && ( ) - )} + )} */}
{ - router.replace( - store.issue.getURLDefinition(workspace_slug, project_slug, { - key: "priority", - value: priority?.key, - }) - ); + // router.replace( + // store.issue.getURLDefinition(workspace_slug, project_slug, { + // key: "priority", + // value: priority?.key, + // }) + // ); }; return ( diff --git a/apps/space/components/issues/filters-render/priority/index.tsx b/apps/space/components/issues/filters-render/priority/index.tsx index 85ca58bd1..100ba1761 100644 --- a/apps/space/components/issues/filters-render/priority/index.tsx +++ b/apps/space/components/issues/filters-render/priority/index.tsx @@ -17,12 +17,12 @@ const IssuePriorityFilter = observer(() => { const { workspace_slug, project_slug } = router.query as { workspace_slug: string; project_slug: string }; const clearPriorityFilters = () => { - router.replace( - store.issue.getURLDefinition(workspace_slug, project_slug, { - key: "priority", - removeAll: true, - }) - ); + // router.replace( + // store.issue.getURLDefinition(workspace_slug, project_slug, { + // key: "priority", + // removeAll: true, + // }) + // ); }; return ( @@ -30,12 +30,12 @@ const IssuePriorityFilter = observer(() => {
Priority
- {issuePriorityFilters.map( + {/* {issuePriorityFilters.map( (_priority: IIssuePriorityFilters, _index: number) => store.issue.getUserSelectedFilter("priority", _priority.key) && ( ) - )} + )} */}
const stateGroup = issueGroupFilter(state.group); const removeStateFromFilter = () => { - router.replace( - store.issue.getURLDefinition(workspace_slug, project_slug, { - key: "state", - value: state?.id, - }) - ); + // router.replace( + // store.issue.getURLDefinition(workspace_slug, project_slug, { + // key: "state", + // value: state?.id, + // }) + // ); }; if (stateGroup === null) return <>; diff --git a/apps/space/components/issues/filters-render/state/index.tsx b/apps/space/components/issues/filters-render/state/index.tsx index 8c678e58f..0198c5215 100644 --- a/apps/space/components/issues/filters-render/state/index.tsx +++ b/apps/space/components/issues/filters-render/state/index.tsx @@ -16,12 +16,12 @@ const IssueStateFilter = observer(() => { const { workspace_slug, project_slug } = router.query as { workspace_slug: string; project_slug: string }; const clearStateFilters = () => { - router.replace( - store.issue.getURLDefinition(workspace_slug, project_slug, { - key: "state", - removeAll: true, - }) - ); + // router.replace( + // store.issue.getURLDefinition(workspace_slug, project_slug, { + // key: "state", + // removeAll: true, + // }) + // ); }; return ( @@ -29,13 +29,13 @@ const IssueStateFilter = observer(() => {
State
- {store?.issue?.states && + {/* {store?.issue?.states && store?.issue?.states.map( (_state: IIssueState, _index: number) => store.issue.getUserSelectedFilter("state", _state.id) && ( ) - )} + )} */}
void; diff --git a/apps/space/components/issues/peek-overview/header.tsx b/apps/space/components/issues/peek-overview/header.tsx index b397f2b5b..12747c287 100644 --- a/apps/space/components/issues/peek-overview/header.tsx +++ b/apps/space/components/issues/peek-overview/header.tsx @@ -12,7 +12,7 @@ import { RootStore } from "store/root"; // lib import { useMobxStore } from "lib/mobx/store-provider"; // types -import { IIssue } from "types"; +import { IIssue } from "types/issue"; type Props = { handleClose: () => void; diff --git a/apps/space/components/issues/peek-overview/issue-activity.tsx b/apps/space/components/issues/peek-overview/issue-activity.tsx index e12d223f8..0cef85991 100644 --- a/apps/space/components/issues/peek-overview/issue-activity.tsx +++ b/apps/space/components/issues/peek-overview/issue-activity.tsx @@ -6,7 +6,7 @@ import { useMobxStore } from "lib/mobx/store-provider"; // components import { CommentCard, AddComment } from "components/issues/peek-overview"; // types -import { IIssue } from "types"; +import { IIssue } from "types/issue"; type Props = { issueDetails: IIssue; diff --git a/apps/space/components/issues/peek-overview/issue-details.tsx b/apps/space/components/issues/peek-overview/issue-details.tsx index ebdab3521..22bc14c7e 100644 --- a/apps/space/components/issues/peek-overview/issue-details.tsx +++ b/apps/space/components/issues/peek-overview/issue-details.tsx @@ -2,7 +2,7 @@ import { IssueReactions } from "components/issues/peek-overview"; import { TipTapEditor } from "components/tiptap"; import { useRouter } from "next/router"; // types -import { IIssue } from "types"; +import { IIssue } from "types/issue"; type Props = { issueDetails: IIssue; diff --git a/apps/space/components/issues/peek-overview/issue-properties.tsx b/apps/space/components/issues/peek-overview/issue-properties.tsx index d91defc84..2d454852a 100644 --- a/apps/space/components/issues/peek-overview/issue-properties.tsx +++ b/apps/space/components/issues/peek-overview/issue-properties.tsx @@ -7,7 +7,7 @@ import useToast from "hooks/use-toast"; import { Icon } from "components/ui"; import { copyTextToClipboard, addSpaceIfCamelCase } from "helpers/string.helper"; // types -import { IIssue } from "types"; +import { IIssue } from "types/issue"; // constants import { issueGroupFilter, issuePriorityFilter } from "constants/data"; import { useEffect } from "react"; diff --git a/apps/space/components/issues/peek-overview/side-peek-view.tsx b/apps/space/components/issues/peek-overview/side-peek-view.tsx index 067d78c20..bacf83420 100644 --- a/apps/space/components/issues/peek-overview/side-peek-view.tsx +++ b/apps/space/components/issues/peek-overview/side-peek-view.tsx @@ -8,7 +8,7 @@ import { } from "components/issues/peek-overview"; import { Loader } from "components/ui/loader"; -import { IIssue } from "types"; +import { IIssue } from "types/issue"; type Props = { handleClose: () => void; diff --git a/apps/space/lib/mobx/store-init.tsx b/apps/space/lib/mobx/store-init.tsx index 93d2006c0..1412a1015 100644 --- a/apps/space/lib/mobx/store-init.tsx +++ b/apps/space/lib/mobx/store-init.tsx @@ -20,11 +20,11 @@ const MobxStoreInit = () => { else localStorage.setItem("app_theme", _theme && _theme != "light" ? "dark" : "light"); }, [store?.theme]); - useEffect(() => { - store.issue.userSelectedLabels = labels || []; - store.issue.userSelectedPriorities = priorities || []; - store.issue.userSelectedStates = states || []; - }, [store.issue]); + // useEffect(() => { + // store.issue.userSelectedLabels = labels || []; + // store.issue.userSelectedPriorities = priorities || []; + // store.issue.userSelectedStates = states || []; + // }, [store.issue]); return <>; }; diff --git a/apps/space/pages/onboarding/index.tsx b/apps/space/pages/onboarding/index.tsx index b77639db0..10adb1d18 100644 --- a/apps/space/pages/onboarding/index.tsx +++ b/apps/space/pages/onboarding/index.tsx @@ -24,7 +24,7 @@ const OnBoardingPage = () => { const user = userStore?.currentUser; if (!user) { - userStore.getUserAsync(); + userStore.fetchCurrentUser(); } }, [userStore]); diff --git a/apps/space/store/issue_details.ts b/apps/space/store/issue_details.ts index 7c0f66413..59664033d 100644 --- a/apps/space/store/issue_details.ts +++ b/apps/space/store/issue_details.ts @@ -3,7 +3,7 @@ import { makeObservable, observable, action, runInAction } from "mobx"; import { RootStore } from "./root"; // services import IssueService from "services/issue.service"; -import { IIssue } from "types"; +import { IIssue } from "types/issue"; export type IPeekMode = "side" | "modal" | "full"; diff --git a/apps/space/store/issue_legacy.ts b/apps/space/store/issue_legacy.ts index 0bff689c6..a2cc2e306 100644 --- a/apps/space/store/issue_legacy.ts +++ b/apps/space/store/issue_legacy.ts @@ -3,8 +3,7 @@ import { observable, action, computed, makeObservable, runInAction, reaction } f // service import IssueService from "services/issue.service"; // types -import { IssueDetailType, TIssueBoardKeys } from "types/issue"; -import { IIssue, IIssueState, IIssueLabel } from "../types"; +import { IssueDetailType, TIssueBoardKeys, IIssueLabel, IIssueState, IIssue } from "types/issue"; export interface IIssueStore { currentIssueBoardView: TIssueBoardKeys | null; diff --git a/apps/space/store/project.ts b/apps/space/store/project.ts index 45ce06f72..ddd589f9a 100644 --- a/apps/space/store/project.ts +++ b/apps/space/store/project.ts @@ -3,7 +3,7 @@ import { observable, action, makeObservable, runInAction } from "mobx"; // service import ProjectService from "services/project.service"; // types -import { IWorkspace, IProject, IProjectSettings } from "../types"; +import { IWorkspace, IProject, IProjectSettings } from "types/project"; export interface IProjectStore { loader: boolean; diff --git a/apps/space/store/root.ts b/apps/space/store/root.ts index cf097a1c6..1d37053ff 100644 --- a/apps/space/store/root.ts +++ b/apps/space/store/root.ts @@ -7,7 +7,7 @@ import IssueStore, { IIssueStore } from "./issue"; import ProjectStore, { IProjectStore } from "./project"; import IssueDetailStore, { IIssueDetailStore } from "./issue_details"; // types -import { IThemeStore } from "../types"; +import { IThemeStore } from "types/theme"; enableStaticRendering(typeof window === "undefined"); diff --git a/apps/space/store/theme.ts b/apps/space/store/theme.ts index c12297398..1a6b9b2c2 100644 --- a/apps/space/store/theme.ts +++ b/apps/space/store/theme.ts @@ -1,7 +1,7 @@ // mobx import { observable, action, computed, makeObservable, runInAction } from "mobx"; // types -import { IThemeStore } from "../types"; +import { IThemeStore } from "types/theme"; class ThemeStore implements IThemeStore { theme: "light" | "dark" = "light"; diff --git a/apps/space/types/index.ts b/apps/space/types/index.ts deleted file mode 100644 index 5a0a51eda..000000000 --- a/apps/space/types/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./user"; -export * from "./theme"; -export * from "./project"; -export * from "./issue"; diff --git a/apps/space/types/user.ts b/apps/space/types/user.ts index e69de29bb..45b3f3b6e 100644 --- a/apps/space/types/user.ts +++ b/apps/space/types/user.ts @@ -0,0 +1,3 @@ +export interface IUser { + first_name: string; +}