fix: bug fixes (#1394)

* fix: multi level dropdown fix

* style: spreadsheet view add issue button

* fix: spreadsheet view sub-issue label mutation
This commit is contained in:
Anmol Singh Bhatia 2023-06-26 14:24:52 +05:30 committed by GitHub
parent 06ce89a03a
commit 1a48fdd142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 12 deletions

View File

@ -127,7 +127,11 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
user user
) )
.then(() => { .then(() => {
mutate(fetchKey); if (issue.parent) {
mutate(SUB_ISSUES(issue.parent as string));
} else {
mutate(fetchKey);
}
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);

View File

@ -75,16 +75,21 @@ export const SpreadsheetView: React.FC<Props> = ({
userAuth={userAuth} userAuth={userAuth}
/> />
))} ))}
<button <div
className="flex items-center gap-1.5 pl-7 py-2.5 text-sm text-brand-secondary hover:text-brand-base hover:bg-brand-surface-2 border-b border-brand-base w-full min-w-max" className="relative group grid auto-rows-[minmax(44px,1fr)] hover:rounded-sm hover:bg-brand-surface-2 border-b border-brand-base w-full min-w-max"
onClick={() => { style={{ gridTemplateColumns }}
const e = new KeyboardEvent("keydown", { key: "c" });
document.dispatchEvent(e);
}}
> >
<PlusIcon className="h-4 w-4" /> <button
Add Issue className="flex gap-1.5 items-center pl-7 py-2.5 text-sm sticky left-0 z-[1] text-brand-secondary bg-brand-base group-hover:text-brand-base group-hover:bg-brand-surface-2 border-brand-base w-full"
</button> onClick={() => {
const e = new KeyboardEvent("keydown", { key: "c" });
document.dispatchEvent(e);
}}
>
<PlusIcon className="h-4 w-4" />
Add Issue
</button>
</div>
</div> </div>
) : ( ) : (
<Spinner /> <Spinner />

View File

@ -3,7 +3,7 @@ import { Fragment, useState } from "react";
// headless ui // headless ui
import { Menu, Transition } from "@headlessui/react"; import { Menu, Transition } from "@headlessui/react";
// icons // icons
import { ChevronDownIcon } from "@heroicons/react/24/outline"; import { CheckIcon, ChevronDownIcon } from "@heroicons/react/24/outline";
import { ChevronRightIcon, ChevronLeftIcon } from "@heroicons/react/20/solid"; import { ChevronRightIcon, ChevronLeftIcon } from "@heroicons/react/20/solid";
type MultiLevelDropdownProps = { type MultiLevelDropdownProps = {
@ -127,9 +127,14 @@ export const MultiLevelDropdown: React.FC<MultiLevelDropdownProps> = ({
}} }}
className={`${ className={`${
child.selected ? "bg-brand-surface-2" : "" child.selected ? "bg-brand-surface-2" : ""
} flex w-full items-center whitespace-nowrap break-words rounded px-1 py-1.5 text-left capitalize text-brand-secondary hover:bg-brand-surface-2`} } flex w-full items-center justify-between whitespace-nowrap break-words rounded px-1 py-1.5 text-left capitalize text-brand-secondary hover:bg-brand-surface-2`}
> >
{child.label} {child.label}
<CheckIcon
className={`h-3.5 w-3.5 opacity-0 ${
child.selected ? "opacity-100" : ""
}`}
/>
</button> </button>
))} ))}
</div> </div>