- {myIssues ? (
- <>
- {myIssues.length > 0 ? (
-
-
- {({ open }) => (
-
-
-
-
-
-
+
+
+
+
Properties
+
+ {Object.keys(properties).map((key) => (
+
-
-
My Issues
-
{myIssues.length}
-
-
-
-
-
-
- {myIssues.map((issue: IIssue) => (
-
+ onClick={() => setProperties(key as keyof Properties)}
+ >
+ {replaceUnderscoreIfSnakeCase(key)}
+
))}
-
-
-
- )}
-
-
- ) : (
-
-
-
- Use C shortcut
- to create a new issue
-
- }
- Icon={PlusIcon}
- action={() => {
- const e = new KeyboardEvent("keydown", {
- key: "c",
- });
- document.dispatchEvent(e);
- }}
- />
-
-
- )}
- >
- ) : (
-
-
+
+
+
+
+ >
+ )}
+
+
{
+ const e = new KeyboardEvent("keydown", {
+ key: "c",
+ });
+
+ document.dispatchEvent(e);
+ }}
+ />
- )}
-
-
+ }
+ >
+
+ {myIssues ? (
+ <>
+ {myIssues.length > 0 ? (
+
+
+ {({ open }) => (
+
+
+
+
+
+
+
+
My Issues
+
{myIssues.length}
+
+
+
+
+
+
+ {myIssues.map((issue: IIssue) => (
+ handleDeleteIssue(issue)}
+ />
+ ))}
+
+
+
+
+ )}
+
+
+ ) : (
+
+
+
+ Use C shortcut
+ to create a new issue
+
+ }
+ Icon={PlusIcon}
+ action={() => {
+ const e = new KeyboardEvent("keydown", {
+ key: "c",
+ });
+ document.dispatchEvent(e);
+ }}
+ />
+
+
+ )}
+ >
+ ) : (
+
+
+
+ )}
+
+
+ >
);
};
diff --git a/apps/app/pages/[workspaceSlug]/me/profile.tsx b/apps/app/pages/[workspaceSlug]/me/profile.tsx
index 43ec74018..a9517d46d 100644
--- a/apps/app/pages/[workspaceSlug]/me/profile.tsx
+++ b/apps/app/pages/[workspaceSlug]/me/profile.tsx
@@ -3,8 +3,29 @@ import React, { useEffect, useState } from "react";
import Link from "next/link";
import Image from "next/image";
import { useRouter } from "next/router";
+
import useSWR from "swr";
+
+// react-hook-form
import { useForm } from "react-hook-form";
+// lib
+import { requiredAuth } from "lib/auth";
+// services
+import projectService from "services/project.service";
+// hooks
+import useUser from "hooks/use-user";
+import useToast from "hooks/use-toast";
+// layouts
+import AppLayout from "layouts/app-layout";
+// services
+import userService from "services/user.service";
+import workspaceService from "services/workspace.service";
+// components
+import { ImageUploadModal } from "components/core";
+// ui
+import { Button, Input, Spinner } from "components/ui";
+import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
+// icons
import {
ChevronRightIcon,
ClipboardDocumentListIcon,
@@ -14,30 +35,11 @@ import {
UserPlusIcon,
XMarkIcon,
} from "@heroicons/react/24/outline";
-import type { NextPage, NextPageContext } from "next";
-
-// hooks
-import type { IIssue, IUser } from "types";
-import useUser from "hooks/use-user";
-import useToast from "hooks/use-toast";
-// lib
-import { requiredAuth } from "lib/auth";
-// services
-import projectService from "services/project.service";
-// layouts
-import AppLayout from "layouts/app-layout";
-// constants
-import { USER_ISSUE, USER_WORKSPACE_INVITATIONS, PROJECTS_LIST } from "constants/fetch-keys";
-// services
-import userService from "services/user.service";
-import workspaceService from "services/workspace.service";
-// components
-import { ImageUploadModal } from "components/common/image-upload-modal";
-// ui
-import { Button, Input, Spinner } from "components/ui";
-import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
-// icons
// types
+import type { NextPage, NextPageContext } from "next";
+import type { IIssue, IUser } from "types";
+// fetch-keys
+import { USER_ISSUE, USER_WORKSPACE_INVITATIONS, PROJECTS_LIST } from "constants/fetch-keys";
const defaultValues: Partial
= {
avatar: "",
diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx
index d8851371f..a3f8acb8f 100644
--- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx
+++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx
@@ -11,13 +11,9 @@ import AppLayout from "layouts/app-layout";
// contexts
import { IssueViewContextProvider } from "contexts/issue-view.context";
// components
-import CyclesListView from "components/project/cycles/list-view";
-import CyclesBoardView from "components/project/cycles/board-view";
import { CreateUpdateIssueModal } from "components/issues";
-import ConfirmIssueDeletion from "components/project/issues/confirm-issue-deletion";
-import ExistingIssuesListModal from "components/common/existing-issues-list-modal";
+import { ExistingIssuesListModal, IssuesFilterView, IssuesView } from "components/core";
import CycleDetailSidebar from "components/project/cycles/cycle-detail-sidebar";
-import View from "components/core/view";
// services
import issuesServices from "services/issues.service";
import cycleServices from "services/cycles.service";
@@ -36,15 +32,14 @@ import {
CYCLE_ISSUES,
CYCLE_LIST,
PROJECT_ISSUES_LIST,
- PROJECT_MEMBERS,
PROJECT_DETAILS,
+ CYCLE_DETAILS,
} from "constants/fetch-keys";
const SingleCycle: React.FC = (props) => {
const [isIssueModalOpen, setIsIssueModalOpen] = useState(false);
const [selectedIssues, setSelectedIssues] = useState();
const [cycleIssuesListModal, setCycleIssuesListModal] = useState(false);
- const [deleteIssue, setDeleteIssue] = useState(undefined);
const [cycleSidebar, setCycleSidebar] = useState(true);
const [preloadedData, setPreloadedData] = useState<
@@ -77,6 +72,18 @@ const SingleCycle: React.FC = (props) => {
: null
);
+ const { data: cycleDetails } = useSWR(
+ cycleId ? CYCLE_DETAILS(cycleId as string) : null,
+ workspaceSlug && projectId && cycleId
+ ? () =>
+ cycleServices.getCycleDetails(
+ workspaceSlug as string,
+ projectId as string,
+ cycleId as string
+ )
+ : null
+ );
+
const { data: cycleIssues } = useSWR(
workspaceSlug && projectId && cycleId ? CYCLE_ISSUES(cycleId as string) : null,
workspaceSlug && projectId && cycleId
@@ -95,19 +102,6 @@ const SingleCycle: React.FC = (props) => {
cycle: cycleId as string,
}));
- const { data: members } = useSWR(
- workspaceSlug && projectId ? PROJECT_MEMBERS(workspaceSlug as string) : null,
- workspaceSlug && projectId
- ? () => projectService.projectMembers(workspaceSlug as string, projectId as string)
- : null,
- {
- onErrorRetry(err, _, __, revalidate, revalidateOpts) {
- if (err?.status === 403) return;
- setTimeout(() => revalidate(revalidateOpts), 5000);
- },
- }
- );
-
const openCreateIssueModal = (
issue?: IIssue,
actionType: "create" | "edit" | "delete" = "create"
@@ -138,30 +132,6 @@ const SingleCycle: React.FC = (props) => {
});
};
- const removeIssueFromCycle = (bridgeId: string) => {
- if (!workspaceSlug || !projectId) return;
-
- mutate(
- CYCLE_ISSUES(cycleId as string),
- (prevData) => prevData?.filter((p) => p.id !== bridgeId),
- false
- );
-
- issuesServices
- .removeIssueFromCycle(
- workspaceSlug as string,
- projectId as string,
- cycleId as string,
- bridgeId
- )
- .then((res) => {
- console.log(res);
- })
- .catch((e) => {
- console.log(e);
- });
- };
-
return (
= (props) => {
issues={issues?.results.filter((i) => !i.issue_cycle) ?? []}
handleOnSubmit={handleAddIssuesToCycle}
/>
- setDeleteIssue(undefined)}
- isOpen={!!deleteIssue}
- data={issues?.results.find((issue) => issue.id === deleteIssue)}
- />
@@ -200,7 +165,7 @@ const SingleCycle: React.FC = (props) => {
label={
<>
- {cycles?.find((c) => c.id === cycleId)?.name}
+ {cycleDetails?.name}
>
}
className="ml-1.5"
@@ -221,7 +186,7 @@ const SingleCycle: React.FC = (props) => {
-
+
= (props) => {
{cycleIssuesArray ? (
cycleIssuesArray.length > 0 ? (
-
-
) : (
@@ -270,13 +224,13 @@ const SingleCycle: React.FC = (props) => {
title="Create a new issue"
description="Click to create a new issue inside the cycle."
Icon={PlusIcon}
- action={() => openCreateIssueModal()}
+ action={openCreateIssueModal}
/>
openIssuesListModal()}
+ action={openIssuesListModal}
/>
@@ -287,7 +241,7 @@ const SingleCycle: React.FC = (props) => {
)}