From f8b6d8c0b8a59c461c9676e640a39bd83170341d Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Fri, 22 Sep 2023 18:23:48 +0530 Subject: [PATCH] fix: bug fixes and ui improvement --- web/components/cycles/single-cycle-list.tsx | 6 +- web/components/labels/single-label.tsx | 78 +++++++++++-------- .../[workspaceSlug]/me/profile/index.tsx | 2 + web/pages/[workspaceSlug]/settings/index.tsx | 10 +-- 4 files changed, 57 insertions(+), 39 deletions(-) diff --git a/web/components/cycles/single-cycle-list.tsx b/web/components/cycles/single-cycle-list.tsx index ec01da9e760..a4c21128aa8 100644 --- a/web/components/cycles/single-cycle-list.tsx +++ b/web/components/cycles/single-cycle-list.tsx @@ -149,6 +149,10 @@ export const SingleCycleList: React.FC = ({ color: group.color, })); + const completedIssues = cycle.completed_issues + cycle.cancelled_issues; + + const percentage = cycle.total_issues > 0 ? (completedIssues / cycle.total_issues) * 100 : 0; + return (
@@ -307,7 +311,7 @@ export const SingleCycleList: React.FC = ({ ) : cycleStatus === "completed" ? ( - {100} % + {Math.round(percentage)} % ) : ( diff --git a/web/components/labels/single-label.tsx b/web/components/labels/single-label.tsx index be981e510d1..c163a37351b 100644 --- a/web/components/labels/single-label.tsx +++ b/web/components/labels/single-label.tsx @@ -1,11 +1,13 @@ -import React from "react"; +import React, { useRef, useState } from "react"; +//hook +import useOutsideClickDetector from "hooks/use-outside-click-detector"; // ui import { CustomMenu } from "components/ui"; // types import { IIssueLabels } from "types"; //icons -import { RectangleGroupIcon, PencilIcon } from "@heroicons/react/24/outline"; +import { PencilIcon } from "@heroicons/react/24/outline"; import { Component, X } from "lucide-react"; type Props = { @@ -20,9 +22,14 @@ export const SingleLabel: React.FC = ({ addLabelToGroup, editLabel, handleLabelDelete, -}) => ( -
-
+}) => { + const [isMenuActive, setIsMenuActive] = useState(false); + const actionSectionRef = useRef(null); + + useOutsideClickDetector(actionSectionRef, () => setIsMenuActive(false)); + + return ( +
= ({ />
{label.name}
-
-
- - -
- } +
+ setIsMenuActive(!isMenuActive)}> + +
+ } + > + addLabelToGroup(label)}> + + + Convert to group + + + editLabel(label)}> + + + Edit label + + + +
+
- -
-
-
-); + ); +}; diff --git a/web/pages/[workspaceSlug]/me/profile/index.tsx b/web/pages/[workspaceSlug]/me/profile/index.tsx index c536c384a45..40ba8ecf3aa 100644 --- a/web/pages/[workspaceSlug]/me/profile/index.tsx +++ b/web/pages/[workspaceSlug]/me/profile/index.tsx @@ -253,6 +253,7 @@ const Profile: NextPage = () => { placeholder="Enter your first name" className="!px-3 !py-2 rounded-md font-medium" autoComplete="off" + maxLength={24} />
@@ -266,6 +267,7 @@ const Profile: NextPage = () => { placeholder="Enter your last name" autoComplete="off" className="!px-3 !py-2 rounded-md font-medium" + maxLength={24} />
diff --git a/web/pages/[workspaceSlug]/settings/index.tsx b/web/pages/[workspaceSlug]/settings/index.tsx index 4f576aa0aed..7d0d8b1b6ba 100644 --- a/web/pages/[workspaceSlug]/settings/index.tsx +++ b/web/pages/[workspaceSlug]/settings/index.tsx @@ -337,10 +337,10 @@ const WorkspaceSettings: NextPage = () => {
- The danger zone of the project delete page is a critical area that - requires careful consideration and attention. When deleting a project, all - of the data and resources within that project will be permanently removed - and cannot be recovered. + The danger zone of the workspace delete page is a critical area that + requires careful consideration and attention. When deleting a workspace, + all of the data and resources within that workspace will be permanently + removed and cannot be recovered.
{ className="!text-sm" outline > - Delete my project + Delete my workspace