Skip to content

Commit

Permalink
fix: merge conflicts resolved from preview
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryan610 committed Dec 17, 2024
2 parents 22912f6 + ede4aad commit f29c789
Show file tree
Hide file tree
Showing 158 changed files with 1,917 additions and 587 deletions.
5 changes: 5 additions & 0 deletions packages/constants/src/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ export enum EServerGroupByToFilterOptions {
"project_id" = "project",
"created_by" = "created_by",
}

export enum EIssueServiceType {
ISSUES = "issues",
EPICS = "epics",
}
2 changes: 2 additions & 0 deletions packages/types/src/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ export enum EFileAssetType {
USER_COVER = "USER_COVER",
WORKSPACE_LOGO = "WORKSPACE_LOGO",
TEAM_SPACE_DESCRIPTION = "TEAM_SPACE_DESCRIPTION",
INITIATIVE_DESCRIPTION = "INITIATIVE_DESCRIPTION",
PROJECT_DESCRIPTION = "PROJECT_DESCRIPTION",
}
6 changes: 6 additions & 0 deletions packages/types/src/issues/issue.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { EIssueServiceType } from "@plane/constants";
import { TIssuePriorities } from "../issues";
import { TIssueAttachment } from "./issue_attachment";
import { TIssueLink } from "./issue_link";
Expand Down Expand Up @@ -39,6 +40,7 @@ export type TBaseIssue = {
updated_by: string;

is_draft: boolean;
is_epic?: boolean;
};

export type IssueRelation = {
Expand Down Expand Up @@ -121,3 +123,7 @@ export type TIssueDetailWidget =
| "relations"
| "links"
| "attachments";

export type TIssueServiceType =
| EIssueServiceType.ISSUES
| EIssueServiceType.EPICS;
1 change: 1 addition & 0 deletions packages/types/src/project/projects.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export type TProjectIssuesSearchParams = {
issue_id?: string;
workspace_search: boolean;
target_date?: string;
epic?: boolean;
};

export interface ISearchIssueResponse {
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/modals/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export enum EModalWidth {
XXXXL = "sm:max-w-4xl",
VXL = "sm:max-w-5xl",
VIXL = "sm:max-w-6xl",
VIIXL = "sm:max-w-7xl",
}
3 changes: 2 additions & 1 deletion web/app/[workspaceSlug]/(projects)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"use client";

import { CommandPalette } from "@/components/command-palette";
import { WorkspaceAuthWrapper } from "@/layouts/auth-layout";
import { AuthenticationWrapper } from "@/lib/wrappers";
// plane web components
import { WorkspaceAuthWrapper } from "@/plane-web/layouts/workspace-wrapper";
import { AppSidebar } from "./sidebar";

export default function WorkspaceLayout({ children }: { children: React.ReactNode }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import { ReactNode } from "react";
// layouts
import { ProjectAuthWrapper } from "@/layouts/auth-layout";
// plane web layouts
import { ProjectAuthWrapper } from "@/plane-web/layouts/project-wrapper";

const ProjectDetailLayout = ({ children }: { children: ReactNode }) => (
<ProjectAuthWrapper>{children}</ProjectAuthWrapper>
Expand Down
1 change: 1 addition & 0 deletions web/ce/components/epics/epic-modal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./modal";
19 changes: 19 additions & 0 deletions web/ce/components/epics/epic-modal/modal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use client";
import React, { FC } from "react";
import { TIssue } from "@plane/types";

export interface EpicModalProps {
data?: Partial<TIssue>;
isOpen: boolean;
onClose: () => void;
beforeFormSubmit?: () => Promise<void>;
onSubmit?: (res: TIssue) => Promise<void>;
fetchIssueDetails?: boolean;
primaryButtonText?: {
default: string;
loading: string;
};
isProjectSelectionDisabled?: boolean;
}

export const CreateUpdateEpicModal: FC<EpicModalProps> = (props) => <></>;
1 change: 1 addition & 0 deletions web/ce/components/epics/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./epic-modal";
10 changes: 9 additions & 1 deletion web/ce/components/gantt-chart/dependency/dependency-paths.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
export const TimelineDependencyPaths = () => <></>;
import { FC } from "react";

type Props = {
isEpic?: boolean;
};
export const TimelineDependencyPaths: FC<Props> = (props) => {
const { isEpic = false } = props;
return <></>;
};
3 changes: 3 additions & 0 deletions web/ce/components/issue-types/values/update.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { TIssueServiceType } from "@plane/types";

export type TIssueAdditionalPropertyValuesUpdateProps = {
issueId: string;
issueTypeId: string;
projectId: string;
workspaceSlug: string;
isDisabled: boolean;
issueServiceType?: TIssueServiceType;
};

export const IssueAdditionalPropertyValuesUpdate: React.FC<TIssueAdditionalPropertyValuesUpdateProps> = () => <></>;
1 change: 1 addition & 0 deletions web/ce/hooks/use-debounced-duplicate-issues.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { TDeDupeIssue } from "@plane/types";

export const useDebouncedDuplicateIssues = (
workspaceSlug: string | undefined,
workspaceId: string | undefined,
projectId: string | undefined,
formData: { name: string | undefined; description_html?: string | undefined; issueId?: string | undefined }
Expand Down
15 changes: 15 additions & 0 deletions web/ce/layouts/project-wrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { FC } from "react";
import { observer } from "mobx-react";
// layouts
import { ProjectAuthWrapper as CoreProjectAuthWrapper } from "@/layouts/auth-layout";

export type IProjectAuthWrapper = {
children: React.ReactNode;
};

export const ProjectAuthWrapper: FC<IProjectAuthWrapper> = observer((props) => {
// props
const { children } = props;

return <CoreProjectAuthWrapper>{children}</CoreProjectAuthWrapper>;
});
15 changes: 15 additions & 0 deletions web/ce/layouts/workspace-wrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { FC } from "react";
import { observer } from "mobx-react";
// layouts
import { WorkspaceAuthWrapper as CoreWorkspaceAuthWrapper } from "@/layouts/auth-layout";

export type IWorkspaceAuthWrapper = {
children: React.ReactNode;
};

export const WorkspaceAuthWrapper: FC<IWorkspaceAuthWrapper> = observer((props) => {
// props
const { children } = props;

return <CoreWorkspaceAuthWrapper>{children}</CoreWorkspaceAuthWrapper>;
});
15 changes: 15 additions & 0 deletions web/ce/store/issue/epic/filter.store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { IProjectIssuesFilter, ProjectIssuesFilter } from "@/store/issue/project";
import { IIssueRootStore } from "@/store/issue/root.store";

// @ts-nocheck - This class will never be used, extending similar class to avoid type errors
export type IProjectEpicsFilter = IProjectIssuesFilter;

// @ts-nocheck - This class will never be used, extending similar class to avoid type errors
export class ProjectEpicsFilter extends ProjectIssuesFilter implements IProjectEpicsFilter {
constructor(_rootStore: IIssueRootStore) {
super(_rootStore);

// root store
this.rootIssueStore = _rootStore;
}
}
2 changes: 2 additions & 0 deletions web/ce/store/issue/epic/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./filter.store";
export * from "./issue.store";
14 changes: 14 additions & 0 deletions web/ce/store/issue/epic/issue.store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { IProjectIssues, ProjectIssues } from "@/store/issue/project";
import { IIssueRootStore } from "@/store/issue/root.store";
import { IProjectEpicsFilter } from "./filter.store";

// @ts-nocheck - This class will never be used, extending similar class to avoid type errors

export type IProjectEpics = IProjectIssues;

// @ts-nocheck - This class will never be used, extending similar class to avoid type errors
export class ProjectEpics extends ProjectIssues implements IProjectEpics {
constructor(_rootStore: IIssueRootStore, issueFilterStore: IProjectEpicsFilter) {
super(_rootStore, issueFilterStore);
}
}
40 changes: 27 additions & 13 deletions web/ce/store/issue/issue-details/activity.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import uniq from "lodash/uniq";
import update from "lodash/update";
import { action, makeObservable, observable, runInAction } from "mobx";
import { computedFn } from "mobx-utils";
import { TIssueActivityComment, TIssueActivity, TIssueActivityMap, TIssueActivityIdMap } from "@plane/types";
import { EIssueServiceType } from "@plane/constants";
import {
TIssueActivityComment,
TIssueActivity,
TIssueActivityMap,
TIssueActivityIdMap,
TIssueServiceType,
} from "@plane/types";
// plane web constants
import { EActivityFilterType } from "@/plane-web/constants/issues";
// services
Expand All @@ -29,28 +36,32 @@ export interface IIssueActivityStoreActions {

export interface IIssueActivityStore extends IIssueActivityStoreActions {
// observables
sortOrder: 'asc' | 'desc'
sortOrder: "asc" | "desc";
loader: TActivityLoader;
activities: TIssueActivityIdMap;
activityMap: TIssueActivityMap;
// helper methods
getActivitiesByIssueId: (issueId: string) => string[] | undefined;
getActivityById: (activityId: string) => TIssueActivity | undefined;
getActivityCommentByIssueId: (issueId: string) => TIssueActivityComment[] | undefined;
toggleSortOrder: ()=>void;
toggleSortOrder: () => void;
}

export class IssueActivityStore implements IIssueActivityStore {
// observables
sortOrder: "asc" | "desc" = 'asc';
sortOrder: "asc" | "desc" = "asc";
loader: TActivityLoader = "fetch";
activities: TIssueActivityIdMap = {};
activityMap: TIssueActivityMap = {};

// services
serviceType;
issueActivityService;

constructor(protected store: CoreRootStore) {
constructor(
protected store: CoreRootStore,
serviceType: TIssueServiceType = EIssueServiceType.ISSUES
) {
makeObservable(this, {
// observables
sortOrder: observable.ref,
Expand All @@ -59,10 +70,11 @@ export class IssueActivityStore implements IIssueActivityStore {
activityMap: observable,
// actions
fetchActivities: action,
toggleSortOrder: action
toggleSortOrder: action,
});
this.serviceType = serviceType;
// services
this.issueActivityService = new IssueActivityService();
this.issueActivityService = new IssueActivityService(this.serviceType);
}

// helper methods
Expand All @@ -81,8 +93,10 @@ export class IssueActivityStore implements IIssueActivityStore {

let activityComments: TIssueActivityComment[] = [];

const currentStore = this.serviceType === EIssueServiceType.EPICS ? this.store.epic : this.store.issue;

const activities = this.getActivitiesByIssueId(issueId) || [];
const comments = this.store.issue.issueDetail.comment.getCommentsByIssueId(issueId) || [];
const comments = currentStore.issueDetail.comment.getCommentsByIssueId(issueId) || [];

activities.forEach((activityId) => {
const activity = this.getActivityById(activityId);
Expand All @@ -95,7 +109,7 @@ export class IssueActivityStore implements IIssueActivityStore {
});

comments.forEach((commentId) => {
const comment = this.store.issue.issueDetail.comment.getCommentById(commentId);
const comment = currentStore.issueDetail.comment.getCommentById(commentId);
if (!comment) return;
activityComments.push({
id: comment.id,
Expand All @@ -104,14 +118,14 @@ export class IssueActivityStore implements IIssueActivityStore {
});
});

activityComments = orderBy(activityComments, (e)=>new Date(e.created_at || 0), this.sortOrder);
activityComments = orderBy(activityComments, (e) => new Date(e.created_at || 0), this.sortOrder);

return activityComments;
});

toggleSortOrder = ()=>{
this.sortOrder = this.sortOrder === 'asc' ? 'desc' : 'asc';
}
toggleSortOrder = () => {
this.sortOrder = this.sortOrder === "asc" ? "desc" : "asc";
};

// actions
public async fetchActivities(
Expand Down
51 changes: 51 additions & 0 deletions web/core/components/common/activity/activity-block.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"use client";

import { FC, ReactNode } from "react";
import { Network } from "lucide-react";
// hooks
import { Tooltip } from "@plane/ui";
import { renderFormattedTime, renderFormattedDate, calculateTimeAgo } from "@/helpers/date-time.helper";
import { usePlatformOS } from "@/hooks/use-platform-os";
import { TProjectActivity } from "@/plane-web/types";
import { User } from "./user";

type TActivityBlockComponent = {
icon?: ReactNode;
activity: TProjectActivity;
ends: "top" | "bottom" | undefined;
children: ReactNode;
customUserName?: string;
};

export const ActivityBlockComponent: FC<TActivityBlockComponent> = (props) => {
const { icon, activity, ends, children, customUserName } = props;
// hooks
const { isMobile } = usePlatformOS();

if (!activity) return <></>;
return (
<div
className={`relative flex items-center gap-3 text-xs ${
ends === "top" ? `pb-2` : ends === "bottom" ? `pt-2` : `py-2`
}`}
>
<div className="absolute left-[13px] top-0 bottom-0 w-0.5 bg-custom-background-80" aria-hidden />
<div className="flex-shrink-0 ring-6 w-7 h-7 rounded-full overflow-hidden flex justify-center items-center z-[4] bg-custom-background-80 text-custom-text-200">
{icon ? icon : <Network className="w-3.5 h-3.5" />}
</div>
<div className="w-full truncate text-custom-text-200">
<User activity={activity} customUserName={customUserName} /> {children}
<div className="mt-1">
<Tooltip
isMobile={isMobile}
tooltipContent={`${renderFormattedDate(activity.created_at)}, ${renderFormattedTime(activity.created_at)}`}
>
<span className="whitespace-nowrap text-custom-text-350 font-medium">
{calculateTimeAgo(activity.created_at)}
</span>
</Tooltip>
</div>
</div>
</div>
);
};
30 changes: 30 additions & 0 deletions web/core/components/common/activity/activity-item.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use client";

import { FC } from "react";
import { observer } from "mobx-react";

import { TProjectActivity } from "@/plane-web/types";
import { ActivityBlockComponent } from "./activity-block";
import { iconsMap, messages } from "./helper";

type TActivityItem = {
activity: TProjectActivity;
showProject?: boolean;
ends?: "top" | "bottom" | undefined;
};

export const ActivityItem: FC<TActivityItem> = observer((props) => {
const { activity, showProject = true, ends } = props;

if (!activity) return null;

const activityType = activity.field;
const { message, customUserName } = messages(activity);
const icon = iconsMap[activityType] || iconsMap.default;

return (
<ActivityBlockComponent icon={icon} activity={activity} ends={ends} customUserName={customUserName}>
<>{message}</>
</ActivityBlockComponent>
);
});
Loading

0 comments on commit f29c789

Please sign in to comment.