From 8ae9c3f15a55d3cb6ed98fce6c77ce4272b40b87 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Tue, 20 Dec 2022 20:20:45 +0530 Subject: [PATCH] fix: blocked issues, style: issue details sidebar --- .../cycles/cycle-issues-list-modal.tsx | 8 +- .../project/cycles/stats-view/single-stat.tsx | 21 ++-- .../create-update-issue-modal/index.tsx | 2 +- .../issue-detail-sidebar/index.tsx | 5 +- .../issue-detail-sidebar/select-assignee.tsx | 2 +- .../issue-detail-sidebar/select-blocked.tsx | 97 ++++++++++++++----- .../issue-detail-sidebar/select-blocker.tsx | 18 ++-- .../issue-detail-sidebar/select-priority.tsx | 19 +++- .../project/issues/list-view/index.tsx | 56 ++++------- apps/app/constants/global.tsx | 16 ++- apps/app/lib/services/issues.service.ts | 2 +- apps/app/pages/invitations.tsx | 42 +------- .../projects/[projectId]/cycles/[cycleId].tsx | 2 +- .../projects/[projectId]/issues/[issueId].tsx | 12 ++- .../projects/[projectId]/issues/index.tsx | 2 +- 15 files changed, 163 insertions(+), 141 deletions(-) diff --git a/apps/app/components/project/cycles/cycle-issues-list-modal.tsx b/apps/app/components/project/cycles/cycle-issues-list-modal.tsx index 74595d326..54e526d8b 100644 --- a/apps/app/components/project/cycles/cycle-issues-list-modal.tsx +++ b/apps/app/components/project/cycles/cycle-issues-list-modal.tsx @@ -28,7 +28,7 @@ type Props = { }; type FormInput = { - issue: string[]; + issues: string[]; }; const CycleIssuesListModal: React.FC = ({ @@ -56,12 +56,12 @@ const CycleIssuesListModal: React.FC = ({ formState: { isSubmitting }, } = useForm({ defaultValues: { - issue: [], + issues: [], }, }); const handleAddToCycle: SubmitHandler = (data) => { - if (!data.issue || data.issue.length === 0) { + if (!data.issues || data.issues.length === 0) { setToastAlert({ title: "Error", type: "error", @@ -120,7 +120,7 @@ const CycleIssuesListModal: React.FC = ({
(
diff --git a/apps/app/components/project/cycles/stats-view/single-stat.tsx b/apps/app/components/project/cycles/stats-view/single-stat.tsx index e3795e83c..dba327e3b 100644 --- a/apps/app/components/project/cycles/stats-view/single-stat.tsx +++ b/apps/app/components/project/cycles/stats-view/single-stat.tsx @@ -63,7 +63,7 @@ const SingleStat: React.FC = ({ cycle, handleEditCycle, handleDeleteCycle return ( <> -
+
@@ -74,7 +74,15 @@ const SingleStat: React.FC = ({ cycle, handleEditCycle, handleDeleteCycle
- + endDate + ? "text-red-500 border-red-500" + : "text-green-500 border-green-500" + }`} + > {today < startDate ? "Not started" : today > endDate ? "Over" : "Active"}
@@ -86,20 +94,19 @@ const SingleStat: React.FC = ({ cycle, handleEditCycle, handleDeleteCycle
- -
+
Cycle dates
-
+
{renderShortNumericDateFormat(startDate)} - {renderShortNumericDateFormat(endDate)}
Created by
-
+
{cycle.owned_by.avatar && cycle.owned_by.avatar !== "" ? ( = ({ cycle, handleEditCycle, handleDeleteCycle Active members
-
+
- - -
- -
-
- - + Edit + + { + handleDeleteIssue(issue.id); + }} + > + Delete permanently + +
); diff --git a/apps/app/constants/global.tsx b/apps/app/constants/global.tsx index fcdae5cf9..2ce33c542 100644 --- a/apps/app/constants/global.tsx +++ b/apps/app/constants/global.tsx @@ -1,12 +1,18 @@ -export const getPriorityIcon = (priority: string) => { +export const getPriorityIcon = (priority: string, className: string) => { switch (priority) { case "urgent": - return signal_cellular_alt; + return error; case "high": - return signal_cellular_alt_2_bar; + return signal_cellular_alt; case "medium": - return signal_cellular_alt_1_bar; + return ( + signal_cellular_alt_2_bar + ); + case "low": + return ( + signal_cellular_alt_1_bar + ); default: - return N/A; + return null; } }; diff --git a/apps/app/lib/services/issues.service.ts b/apps/app/lib/services/issues.service.ts index 107c48c2a..75874bb0c 100644 --- a/apps/app/lib/services/issues.service.ts +++ b/apps/app/lib/services/issues.service.ts @@ -92,7 +92,7 @@ class ProjectIssuesServices extends APIService { projectId: string, cycleId: string, data: { - issue: string[]; + issues: string[]; } ) { return this.post(CYCLE_DETAIL(workspaceSlug, projectId, cycleId), data) diff --git a/apps/app/pages/invitations.tsx b/apps/app/pages/invitations.tsx index 2c3970dd6..8cb03d099 100644 --- a/apps/app/pages/invitations.tsx +++ b/apps/app/pages/invitations.tsx @@ -90,47 +90,7 @@ const OnBoard: NextPage = () => {
{invitations && workspaces ? ( invitations.length > 0 ? ( -
-
-

Join your workspaces

-
- {invitations.map((item) => ( -
-
-

- {item.workspace.name} -

-

invited by {item.workspace.owner.first_name}

-
-
-
- { - handleInvitation( - item, - invitationsRespond.includes(item.id) ? "withdraw" : "accepted" - ); - }} - type="checkbox" - className="h-4 w-4 rounded border-gray-300 text-theme focus:ring-indigo-500" - /> - -
-
-
- ))} -
-
+

Workspace Invitations

Select invites that you want to accept. diff --git a/apps/app/pages/projects/[projectId]/cycles/[cycleId].tsx b/apps/app/pages/projects/[projectId]/cycles/[cycleId].tsx index 256602571..509f892c0 100644 --- a/apps/app/pages/projects/[projectId]/cycles/[cycleId].tsx +++ b/apps/app/pages/projects/[projectId]/cycles/[cycleId].tsx @@ -176,7 +176,7 @@ const SingleCycle: React.FC = () => { .then((res) => { issuesServices .addIssueToCycle(activeWorkspace.slug, activeProject.id, destination.droppableId, { - issue: [result.draggableId.split(",")[1]], + issues: [result.draggableId.split(",")[1]], }) .then((res) => { console.log(res); diff --git a/apps/app/pages/projects/[projectId]/issues/[issueId].tsx b/apps/app/pages/projects/[projectId]/issues/[issueId].tsx index e41d9734b..5da9e6d1a 100644 --- a/apps/app/pages/projects/[projectId]/issues/[issueId].tsx +++ b/apps/app/pages/projects/[projectId]/issues/[issueId].tsx @@ -34,7 +34,7 @@ import ConfirmIssueDeletion from "components/project/issues/confirm-issue-deleti import IssueDetailSidebar from "components/project/issues/issue-detail/issue-detail-sidebar"; import IssueActivitySection from "components/project/issues/issue-detail/activity"; // ui -import { Spinner, TextArea, HeaderButton, Breadcrumbs, BreadcrumbItem } from "ui"; +import { Spinner, TextArea, HeaderButton, Breadcrumbs, BreadcrumbItem, CustomMenu } from "ui"; // icons import { ChevronLeftIcon, @@ -215,6 +215,8 @@ const IssueDetail: NextPage = () => { } }; + console.log("Issue detail", issueDetail); + return ( { leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - -

+ +