mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 05:49:40 +02:00
fix: build errors
This commit is contained in:
@@ -40,10 +40,12 @@ export interface IIssueActivityStore extends IIssueActivityStoreActions {
|
||||
loader: TActivityLoader;
|
||||
activities: TIssueActivityIdMap;
|
||||
activityMap: TIssueActivityMap;
|
||||
sortOrder: TSORT_ORDER;
|
||||
// helper methods
|
||||
getActivitiesByIssueId: (issueId: string) => string[] | undefined;
|
||||
getActivityById: (activityId: string) => TIssueActivity | undefined;
|
||||
getActivityCommentByIssueId: (issueId: string, sortOrder: TSORT_ORDER) => TIssueActivityComment[] | undefined;
|
||||
toggleSortOrder: () => void;
|
||||
}
|
||||
|
||||
export class IssueActivityStore implements IIssueActivityStore {
|
||||
@@ -51,7 +53,7 @@ export class IssueActivityStore implements IIssueActivityStore {
|
||||
loader: TActivityLoader = "fetch";
|
||||
activities: TIssueActivityIdMap = {};
|
||||
activityMap: TIssueActivityMap = {};
|
||||
|
||||
sortOrder: TSORT_ORDER = TSORT_ORDER.ASC;
|
||||
// services
|
||||
serviceType;
|
||||
issueActivityService;
|
||||
@@ -73,6 +75,14 @@ export class IssueActivityStore implements IIssueActivityStore {
|
||||
this.issueActivityService = new IssueActivityService(this.serviceType);
|
||||
}
|
||||
|
||||
toggleSortOrder = () => {
|
||||
if (this.sortOrder === TSORT_ORDER.ASC) {
|
||||
this.sortOrder = TSORT_ORDER.DESC;
|
||||
} else {
|
||||
this.sortOrder = TSORT_ORDER.ASC;
|
||||
}
|
||||
};
|
||||
|
||||
// helper methods
|
||||
getActivitiesByIssueId = (issueId: string) => {
|
||||
if (!issueId) return undefined;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { FC } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { EIssueServiceType } from "@plane/constants";
|
||||
|
||||
import { TSORT_ORDER } from "@/constants/common";
|
||||
// hooks
|
||||
import { useIssueDetail } from "@/hooks/store";
|
||||
// plane web components
|
||||
@@ -33,7 +35,7 @@ export const IssueActivityCommentRoot: FC<TIssueActivityCommentRoot> = observer(
|
||||
comment: {},
|
||||
} = useIssueDetail(EIssueServiceType.EPICS);
|
||||
|
||||
const activityComments = getActivityCommentByIssueId(issueId);
|
||||
const activityComments = getActivityCommentByIssueId(issueId, TSORT_ORDER.DESC);
|
||||
|
||||
if (!activityComments || (activityComments && activityComments.length <= 0)) return <></>;
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ import { TOAST_TYPE, setToast } from "@plane/ui";
|
||||
// components
|
||||
import { IssueCommentCreate } from "@/components/issues";
|
||||
import { IssueActivityCommentRoot } from "@/components/issues/issue-detail";
|
||||
// constants
|
||||
import { TSORT_ORDER } from "@/constants/common";
|
||||
// hooks
|
||||
import { useIssueDetail, useProject, useUser, useUserPermissions } from "@/hooks/store";
|
||||
// plane web components
|
||||
@@ -184,6 +186,7 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
||||
activityOperations={activityOperations}
|
||||
showAccessSpecifier={!!project.anchor}
|
||||
disabled={disabled}
|
||||
sortOrder={TSORT_ORDER.ASC}
|
||||
/>
|
||||
{!disabled && (
|
||||
<IssueCommentCreate
|
||||
|
||||
@@ -2,6 +2,7 @@ import { FC } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { EIssueServiceType } from "@plane/constants";
|
||||
import { TActivityOperations } from "@/components/issues";
|
||||
import { TSORT_ORDER } from "@/constants/common";
|
||||
// hooks
|
||||
import { useIssueDetail } from "@/hooks/store";
|
||||
// plane web components
|
||||
@@ -32,7 +33,7 @@ export const EpicActivityCommentRoot: FC<TIssueActivityCommentRoot> = observer((
|
||||
comment: {},
|
||||
} = useIssueDetail(EIssueServiceType.EPICS);
|
||||
|
||||
const activityComments = getActivityCommentByIssueId(issueId);
|
||||
const activityComments = getActivityCommentByIssueId(issueId, TSORT_ORDER.ASC);
|
||||
|
||||
if (!activityComments || (activityComments && activityComments.length <= 0)) return <></>;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { observer } from "mobx-react";
|
||||
import { EIssueServiceType } from "@plane/constants";
|
||||
// components
|
||||
import { TActivityOperations } from "@/components/issues";
|
||||
import { TSORT_ORDER } from "@/constants/common";
|
||||
// hooks
|
||||
import { useIssueDetail } from "@/hooks/store";
|
||||
// plane web constants
|
||||
@@ -26,7 +27,7 @@ export const EpicCommentActivityRoot: FC<TEpicCommentActivityRoot> = observer((p
|
||||
comment: {},
|
||||
} = useIssueDetail(EIssueServiceType.EPICS);
|
||||
|
||||
const activityComments = getActivityCommentByIssueId(issueId);
|
||||
const activityComments = getActivityCommentByIssueId(issueId, TSORT_ORDER.ASC);
|
||||
|
||||
if (!activityComments || (activityComments && activityComments.length <= 0)) return <></>;
|
||||
|
||||
|
||||
1
web/ee/components/home/header.tsx
Normal file
1
web/ee/components/home/header.tsx
Normal file
@@ -0,0 +1 @@
|
||||
export const HomePageHeader = () => <></>;
|
||||
@@ -6,8 +6,8 @@ import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
import { Activity } from "lucide-react";
|
||||
import { InfoFillIcon, Tabs, UpdatesIcon } from "@plane/ui";
|
||||
|
||||
import { ActivitySortRoot } from "@/components/issues";
|
||||
import { TSORT_ORDER } from "@/constants/common";
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// hooks
|
||||
import { useProject, useWorkspace } from "@/hooks/store";
|
||||
@@ -33,7 +33,7 @@ export const ProjectDetailsSidebar: FC<TEpicDetailsSidebarProps> = observer((pro
|
||||
// router
|
||||
const { workspaceSlug } = useParams();
|
||||
// states
|
||||
const [sortOrder, setSortOrder] = React.useState<"asc" | "desc">("desc");
|
||||
const [sortOrder, setSortOrder] = React.useState<TSORT_ORDER>(TSORT_ORDER.DESC);
|
||||
// store hooks
|
||||
const { updateProject } = useProject();
|
||||
const { features } = useProjectAdvanced();
|
||||
@@ -41,7 +41,7 @@ export const ProjectDetailsSidebar: FC<TEpicDetailsSidebarProps> = observer((pro
|
||||
const { isWorkspaceFeatureEnabled } = useWorkspaceFeatures();
|
||||
|
||||
// handler
|
||||
const toggleSortOrder = () => setSortOrder(sortOrder === "asc" ? "desc" : "asc");
|
||||
const toggleSortOrder = () => setSortOrder(sortOrder === TSORT_ORDER.ASC ? TSORT_ORDER.DESC : TSORT_ORDER.ASC);
|
||||
// derived
|
||||
const isProjectUpdatesEnabled =
|
||||
features &&
|
||||
|
||||
@@ -3,6 +3,7 @@ import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
import { Plus } from "lucide-react";
|
||||
import { ActivitySortRoot } from "@/components/issues";
|
||||
import { TSORT_ORDER } from "@/constants/common";
|
||||
import { useProjectUpdates } from "@/plane-web/hooks/store/projects/use-project-updates";
|
||||
import { TProjectUpdate } from "@/plane-web/types";
|
||||
import { UpdateBlock } from "./block";
|
||||
@@ -15,14 +16,14 @@ export const ProjectUpdates = observer(() => {
|
||||
const { workspaceSlug, projectId } = useParams();
|
||||
// state
|
||||
const [showInput, setShowInput] = useState(false);
|
||||
const [sortOrder, setSortOrder] = useState<"asc" | "desc">("desc");
|
||||
const [sortOrder, setSortOrder] = useState<TSORT_ORDER>(TSORT_ORDER.DESC);
|
||||
// hooks
|
||||
const { getUpdatesByProjectId, loader } = useProjectUpdates();
|
||||
const { handleUpdateOperations } = useUpdates(workspaceSlug.toString(), projectId.toString());
|
||||
|
||||
// handler
|
||||
const toggleSortOrder = () => {
|
||||
setSortOrder(sortOrder === "asc" ? "desc" : "asc");
|
||||
setSortOrder(sortOrder === TSORT_ORDER.ASC ? TSORT_ORDER.DESC : TSORT_ORDER.ASC);
|
||||
};
|
||||
|
||||
// derived
|
||||
|
||||
@@ -9,6 +9,8 @@ import { Loader } from "@plane/ui";
|
||||
// components
|
||||
import { ActivityBlockComponent } from "@/components/common/activity/activity-block";
|
||||
import { ActivitySortRoot } from "@/components/issues";
|
||||
// constants
|
||||
import { TSORT_ORDER } from "@/constants/common";
|
||||
// plane web constants
|
||||
import { TEAM_UPDATES_HELPER_MAP } from "@/plane-web/constants/teams";
|
||||
// plane web helpers
|
||||
@@ -63,7 +65,7 @@ export const TeamsOverviewSidebarActivity: FC<TTeamActivityProps> = observer((pr
|
||||
<span className="flex items-center gap-2">
|
||||
{teamActivitiesLoader === "mutation" ? <Spinner size={12} className="animate-spin" /> : null}
|
||||
<ActivitySortRoot
|
||||
sortOrder={teamActivitySortOrder}
|
||||
sortOrder={teamActivitySortOrder as TSORT_ORDER} //TODO: fix this by changing store types.
|
||||
toggleSort={() => toggleTeamActivitySortOrder(teamId)}
|
||||
className="py-1"
|
||||
iconClassName="size-3"
|
||||
|
||||
@@ -10,6 +10,8 @@ import { EFileAssetType } from "@plane/types/src/enums";
|
||||
import { setToast, TOAST_TYPE } from "@plane/ui";
|
||||
// components
|
||||
import { ActivitySortRoot } from "@/components/issues";
|
||||
// constants
|
||||
import { TSORT_ORDER } from "@/constants/common";
|
||||
// plane web imports
|
||||
import { useTeamUpdates } from "@/plane-web/hooks/store/teams/use-team-updates";
|
||||
import { TTeamComment } from "@/plane-web/types";
|
||||
@@ -138,7 +140,7 @@ export const TeamsOverviewSidebarComments: FC<TTeamSidebarCommentsRootProps> = o
|
||||
<Spinner size={12} className="animate-spin" />
|
||||
) : null}
|
||||
<ActivitySortRoot
|
||||
sortOrder={teamCommentsSortOrder}
|
||||
sortOrder={teamCommentsSortOrder as TSORT_ORDER} //TODO: fix this by changing store types.
|
||||
toggleSort={() => toggleTeamCommentsSortOrder(teamId)}
|
||||
className="py-1"
|
||||
iconClassName="size-3"
|
||||
|
||||
@@ -5,3 +5,4 @@ export * from "./issues";
|
||||
export * from "./project";
|
||||
export * from "./user-permissions";
|
||||
export * from "./workspace";
|
||||
export * from "./page";
|
||||
|
||||
Reference in New Issue
Block a user