chore: workspace profile issues, kanabn DND upgrade, implemented filters in plaen deploy (#2991)
This commit is contained in:
parent
e6eef7eb0b
commit
a4d7b2423e
43 changed files with 1117 additions and 483 deletions
|
|
@ -1,4 +1,6 @@
|
|||
import { memo } from "react";
|
||||
import { Draggable } from "@hello-pangea/dnd";
|
||||
import isEqual from "lodash/isEqual";
|
||||
// components
|
||||
import { KanBanProperties } from "./properties";
|
||||
// ui
|
||||
|
|
@ -21,7 +23,7 @@ interface IssueBlockProps {
|
|||
isReadOnly: boolean;
|
||||
}
|
||||
|
||||
export const KanbanIssueBlock: React.FC<IssueBlockProps> = (props) => {
|
||||
export const KanBanIssueMemoBlock: React.FC<IssueBlockProps> = (props) => {
|
||||
const {
|
||||
sub_group_id,
|
||||
columnId,
|
||||
|
|
@ -63,30 +65,36 @@ export const KanbanIssueBlock: React.FC<IssueBlockProps> = (props) => {
|
|||
{...provided.draggableProps}
|
||||
{...provided.dragHandleProps}
|
||||
ref={provided.innerRef}
|
||||
onClick={handleIssuePeekOverview}
|
||||
>
|
||||
{issue.tempId !== undefined && (
|
||||
<div className="absolute top-0 left-0 w-full h-full animate-pulse bg-custom-background-100/20 z-[99999]" />
|
||||
)}
|
||||
<div className="absolute top-3 right-3 hidden group-hover/kanban-block:block">
|
||||
{quickActions(
|
||||
!sub_group_id && sub_group_id === "null" ? null : sub_group_id,
|
||||
!columnId && columnId === "null" ? null : columnId,
|
||||
issue
|
||||
)}
|
||||
</div>
|
||||
<div
|
||||
className={`text-sm rounded py-2 px-3 shadow-custom-shadow-2xs space-y-2 border-[0.5px] border-custom-border-200 transition-all bg-custom-background-100 ${
|
||||
isDragDisabled ? "" : "hover:cursor-grab"
|
||||
} ${snapshot.isDragging ? `border-custom-primary-100` : `border-transparent`}`}
|
||||
>
|
||||
{displayProperties && displayProperties?.key && (
|
||||
<div className="text-xs line-clamp-1 text-custom-text-300">
|
||||
{issue.project_detail.identifier}-{issue.sequence_id}
|
||||
<div className="relative">
|
||||
<div className="text-xs line-clamp-1 text-custom-text-300">
|
||||
{issue.project_detail.identifier}-{issue.sequence_id}
|
||||
</div>
|
||||
<div className="absolute -top-1 right-0 hidden group-hover/kanban-block:block">
|
||||
{quickActions(
|
||||
!sub_group_id && sub_group_id === "null" ? null : sub_group_id,
|
||||
!columnId && columnId === "null" ? null : columnId,
|
||||
issue
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<Tooltip tooltipHeading="Title" tooltipContent={issue.name}>
|
||||
<div className="line-clamp-2 text-sm font-medium text-custom-text-100">{issue.name}</div>
|
||||
<div
|
||||
className="line-clamp-2 text-sm font-medium text-custom-text-100"
|
||||
onClick={handleIssuePeekOverview}
|
||||
>
|
||||
{issue.name}
|
||||
</div>
|
||||
</Tooltip>
|
||||
<div>
|
||||
<KanBanProperties
|
||||
|
|
@ -106,3 +114,10 @@ export const KanbanIssueBlock: React.FC<IssueBlockProps> = (props) => {
|
|||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const validateMemo = (prevProps: IssueBlockProps, nextProps: IssueBlockProps) => {
|
||||
if (prevProps.issue != nextProps.issue) return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
export const KanbanIssueBlock = memo(KanBanIssueMemoBlock, validateMemo);
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||
if (handleSubmit) {
|
||||
await handleSubmit(res);
|
||||
} else {
|
||||
currentIssueStore.fetchIssues(workspaceSlug, dataIdToUpdate, "mutation", viewId);
|
||||
if (viewId) currentIssueStore.fetchIssues(workspaceSlug, dataIdToUpdate, "mutation", viewId);
|
||||
|
||||
if (payload.cycle && payload.cycle !== "") await addIssueToCycle(res, payload.cycle);
|
||||
if (payload.module && payload.module !== "") await addIssueToModule(res, payload.module);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ interface IProfileIssuesPage {
|
|||
}
|
||||
|
||||
export const ProfileIssuesPage = observer((props: IProfileIssuesPage) => {
|
||||
const { type } = props;
|
||||
|
||||
const router = useRouter();
|
||||
const { workspaceSlug, userId } = router.query as {
|
||||
workspaceSlug: string;
|
||||
|
|
@ -28,11 +30,11 @@ export const ProfileIssuesPage = observer((props: IProfileIssuesPage) => {
|
|||
}: RootStore = useMobxStore();
|
||||
|
||||
useSWR(
|
||||
workspaceSlug && userId ? `CURRENT_WORKSPACE_PROFILE_ISSUES_${workspaceSlug}_${userId}_${props.type}` : null,
|
||||
workspaceSlug && userId ? `CURRENT_WORKSPACE_PROFILE_ISSUES_${workspaceSlug}_${userId}_${type}` : null,
|
||||
async () => {
|
||||
if (workspaceSlug && userId) {
|
||||
await fetchFilters(workspaceSlug);
|
||||
await fetchIssues(workspaceSlug, userId, getIssues ? "mutation" : "init-loader", props.type);
|
||||
await fetchIssues(workspaceSlug, userId, getIssues ? "mutation" : "init-loader", type);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { ReactElement } from "react";
|
||||
import { observer } from "mobx-react-lite";
|
||||
// layouts
|
||||
import { AppLayout } from "layouts/app-layout";
|
||||
import { ProfileAuthWrapper } from "layouts/user-profile-layout";
|
||||
|
|
@ -9,7 +8,7 @@ import { UserProfileHeader } from "components/headers";
|
|||
import { NextPageWithLayout } from "types/app";
|
||||
import { ProfileIssuesPage } from "components/profile/profile-issues";
|
||||
|
||||
const ProfileAssignedIssuesPage: NextPageWithLayout = observer(() => <ProfileIssuesPage type="assigned" />);
|
||||
const ProfileAssignedIssuesPage: NextPageWithLayout = () => <ProfileIssuesPage type="assigned" />;
|
||||
|
||||
ProfileAssignedIssuesPage.getLayout = function getLayout(page: ReactElement) {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -118,8 +118,6 @@ export class KanBanHelpers implements IKanBanHelpers {
|
|||
|
||||
const [removed] = sourceIssues.splice(source.index, 1);
|
||||
|
||||
console.log("removed", removed);
|
||||
|
||||
if (removed) {
|
||||
if (viewId) store?.removeIssue(workspaceSlug, projectId, removed, viewId);
|
||||
else store?.removeIssue(workspaceSlug, projectId, removed);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ export interface IProfileIssuesStore {
|
|||
workspaceSlug: string,
|
||||
userId: string,
|
||||
loadType: TLoader,
|
||||
_?: string,
|
||||
type?: "assigned" | "created" | "subscribed"
|
||||
) => Promise<IIssueResponse>;
|
||||
createIssue: (workspaceSlug: string, userId: string, data: Partial<IIssue>) => Promise<IIssue | undefined>;
|
||||
|
|
@ -151,7 +150,6 @@ export class ProfileIssuesStore extends IssueBaseStore implements IProfileIssues
|
|||
workspaceSlug: string,
|
||||
userId: string,
|
||||
loadType: TLoader = "init-loader",
|
||||
_?: string,
|
||||
type?: "assigned" | "created" | "subscribed"
|
||||
) => {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue