mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: bug fixes and ui improvement (#2250)
This commit is contained in:
parent
0e96eddb57
commit
de7a672b79
@ -149,6 +149,10 @@ export const SingleCycleList: React.FC<TSingleStatProps> = ({
|
|||||||
color: group.color,
|
color: group.color,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const completedIssues = cycle.completed_issues + cycle.cancelled_issues;
|
||||||
|
|
||||||
|
const percentage = cycle.total_issues > 0 ? (completedIssues / cycle.total_issues) * 100 : 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="flex flex-col text-xs hover:bg-custom-background-80">
|
<div className="flex flex-col text-xs hover:bg-custom-background-80">
|
||||||
@ -307,7 +311,7 @@ export const SingleCycleList: React.FC<TSingleStatProps> = ({
|
|||||||
) : cycleStatus === "completed" ? (
|
) : cycleStatus === "completed" ? (
|
||||||
<span className="flex gap-1">
|
<span className="flex gap-1">
|
||||||
<RadialProgressBar progress={100} />
|
<RadialProgressBar progress={100} />
|
||||||
<span>{100} %</span>
|
<span>{Math.round(percentage)} %</span>
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<span className="flex gap-1">
|
<span className="flex gap-1">
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import React from "react";
|
import React, { useRef, useState } from "react";
|
||||||
|
|
||||||
|
//hook
|
||||||
|
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||||
// ui
|
// ui
|
||||||
import { CustomMenu } from "components/ui";
|
import { CustomMenu } from "components/ui";
|
||||||
// types
|
// types
|
||||||
import { IIssueLabels } from "types";
|
import { IIssueLabels } from "types";
|
||||||
//icons
|
//icons
|
||||||
import { RectangleGroupIcon, PencilIcon } from "@heroicons/react/24/outline";
|
import { PencilIcon } from "@heroicons/react/24/outline";
|
||||||
import { Component, X } from "lucide-react";
|
import { Component, X } from "lucide-react";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@ -20,9 +22,14 @@ export const SingleLabel: React.FC<Props> = ({
|
|||||||
addLabelToGroup,
|
addLabelToGroup,
|
||||||
editLabel,
|
editLabel,
|
||||||
handleLabelDelete,
|
handleLabelDelete,
|
||||||
}) => (
|
}) => {
|
||||||
<div className="gap-2 space-y-3 divide-y divide-custom-border-200 rounded border border-custom-border-200 bg-custom-background-100 px-4 py-2.5">
|
const [isMenuActive, setIsMenuActive] = useState(false);
|
||||||
<div className="group flex items-center justify-between">
|
const actionSectionRef = useRef<HTMLDivElement | null>(null);
|
||||||
|
|
||||||
|
useOutsideClickDetector(actionSectionRef, () => setIsMenuActive(false));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative group flex items-center justify-between gap-2 space-y-3 rounded border border-custom-border-200 bg-custom-background-100 px-4 py-2.5">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<span
|
<span
|
||||||
className="h-3.5 w-3.5 flex-shrink-0 rounded-full"
|
className="h-3.5 w-3.5 flex-shrink-0 rounded-full"
|
||||||
@ -32,11 +39,15 @@ export const SingleLabel: React.FC<Props> = ({
|
|||||||
/>
|
/>
|
||||||
<h6 className="text-sm">{label.name}</h6>
|
<h6 className="text-sm">{label.name}</h6>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-3.5 pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100">
|
<div
|
||||||
<div className="h-4 w-4">
|
ref={actionSectionRef}
|
||||||
|
className={`absolute -top-0.5 right-3 flex items-start gap-3.5 pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 ${
|
||||||
|
isMenuActive ? "opacity-100" : ""
|
||||||
|
}`}
|
||||||
|
>
|
||||||
<CustomMenu
|
<CustomMenu
|
||||||
customButton={
|
customButton={
|
||||||
<div className="h-4 w-4">
|
<div className="h-4 w-4" onClick={() => setIsMenuActive(!isMenuActive)}>
|
||||||
<Component className="h-4 w-4 leading-4 text-custom-sidebar-text-400 flex-shrink-0" />
|
<Component className="h-4 w-4 leading-4 text-custom-sidebar-text-400 flex-shrink-0" />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@ -54,14 +65,15 @@ export const SingleLabel: React.FC<Props> = ({
|
|||||||
</span>
|
</span>
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
</CustomMenu>
|
</CustomMenu>
|
||||||
</div>
|
<div className="py-0.5">
|
||||||
|
<button
|
||||||
<div className="flex items-center">
|
className="flex h-4 w-4 items-center justify-start gap-2"
|
||||||
<button className="flex items-center justify-start gap-2" onClick={handleLabelDelete}>
|
onClick={handleLabelDelete}
|
||||||
<X className="h-[18px] w-[18px] text-custom-sidebar-text-400 flex-shrink-0" />
|
>
|
||||||
|
<X className="h-4 w-4 text-custom-sidebar-text-400 flex-shrink-0" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
@ -253,6 +253,7 @@ const Profile: NextPage = () => {
|
|||||||
placeholder="Enter your first name"
|
placeholder="Enter your first name"
|
||||||
className="!px-3 !py-2 rounded-md font-medium"
|
className="!px-3 !py-2 rounded-md font-medium"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
|
maxLength={24}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -266,6 +267,7 @@ const Profile: NextPage = () => {
|
|||||||
placeholder="Enter your last name"
|
placeholder="Enter your last name"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
className="!px-3 !py-2 rounded-md font-medium"
|
className="!px-3 !py-2 rounded-md font-medium"
|
||||||
|
maxLength={24}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -337,10 +337,10 @@ const WorkspaceSettings: NextPage = () => {
|
|||||||
<Disclosure.Panel>
|
<Disclosure.Panel>
|
||||||
<div className="flex flex-col gap-8">
|
<div className="flex flex-col gap-8">
|
||||||
<span className="text-sm tracking-tight">
|
<span className="text-sm tracking-tight">
|
||||||
The danger zone of the project delete page is a critical area that
|
The danger zone of the workspace delete page is a critical area that
|
||||||
requires careful consideration and attention. When deleting a project, all
|
requires careful consideration and attention. When deleting a workspace,
|
||||||
of the data and resources within that project will be permanently removed
|
all of the data and resources within that workspace will be permanently
|
||||||
and cannot be recovered.
|
removed and cannot be recovered.
|
||||||
</span>
|
</span>
|
||||||
<div>
|
<div>
|
||||||
<DangerButton
|
<DangerButton
|
||||||
@ -348,7 +348,7 @@ const WorkspaceSettings: NextPage = () => {
|
|||||||
className="!text-sm"
|
className="!text-sm"
|
||||||
outline
|
outline
|
||||||
>
|
>
|
||||||
Delete my project
|
Delete my workspace
|
||||||
</DangerButton>
|
</DangerButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user