Compare commits

...

2 Commits

Author SHA1 Message Date
Anmol Singh Bhatia
d021d38a98 chore: issue tooltip bug fix 2023-11-07 17:59:38 +05:30
Anmol Singh Bhatia
3d5cbaae2a chore: duplicate label alert added 2023-11-07 17:59:00 +05:30
2 changed files with 29 additions and 17 deletions

View File

@ -46,24 +46,25 @@ export const IssuePropertyDate: React.FC<IIssuePropertyDate> = observer((props)
disabled ? "cursor-not-allowed text-custom-text-200" : "cursor-pointer hover:bg-custom-background-80"
}`}
>
<Tooltip tooltipHeading={placeHolder} tooltipContent={value ?? "None"}>
<div className="overflow-hidden flex justify-center items-center gap-2">
<Calendar className="h-3 w-3" strokeWidth={2} />
{value && (
<>
<div className="overflow-hidden flex justify-center items-center gap-2">
<Calendar className="h-3 w-3" strokeWidth={2} />
{value && (
<>
<Tooltip tooltipHeading={placeHolder} tooltipContent={value ?? "None"}>
<div className="text-xs">{value}</div>
<div
className="flex-shrink-0 flex justify-center items-center"
onClick={() => {
if (onChange) onChange(null);
}}
>
<X className="h-2.5 w-2.5" strokeWidth={2} />
</div>
</>
)}
</div>
</Tooltip>
</Tooltip>
<div
className="flex-shrink-0 flex justify-center items-center"
onClick={() => {
if (onChange) onChange(null);
}}
>
<X className="h-2.5 w-2.5" strokeWidth={2} />
</div>
</>
)}
</div>
</Popover.Button>
<div className={`${open ? "fixed z-20 top-0 left-0 h-full w-full cursor-auto" : ""}`}>

View File

@ -9,6 +9,7 @@ import { Popover, Transition } from "@headlessui/react";
import { IssueLabelService } from "services/issue";
// hooks
import useUser from "hooks/use-user";
import useToast from "hooks/use-toast";
// ui
import { Input } from "@plane/ui";
import { IssueLabelSelect } from "../select";
@ -57,6 +58,8 @@ export const SidebarLabelSelect: React.FC<Props> = ({
defaultValues,
});
const { setToastAlert } = useToast();
const { user } = useUser();
const { data: issueLabels, mutate: issueLabelMutate } = useSWR<IIssueLabels[]>(
@ -79,6 +82,14 @@ export const SidebarLabelSelect: React.FC<Props> = ({
submitChanges({ labels: [...(issueDetails?.labels ?? []), res.id] });
setCreateLabelForm(false);
})
.catch((e) => {
console.log(e);
setToastAlert({
type: "error",
title: "Error!",
message: e.error ? e.error : "Something went wrong. Please try again.",
});
});
};