forked from github/plane
chore: workspace level toggle (#1625)
This commit is contained in:
parent
f9c3f02d15
commit
ff6690afd2
@ -31,7 +31,7 @@ import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues";
|
|||||||
import { CreateUpdateViewModal } from "components/views";
|
import { CreateUpdateViewModal } from "components/views";
|
||||||
import { TransferIssues, TransferIssuesModal } from "components/cycles";
|
import { TransferIssues, TransferIssuesModal } from "components/cycles";
|
||||||
// ui
|
// ui
|
||||||
import { EmptyState, PrimaryButton, Spinner, Icon } from "components/ui";
|
import { EmptyState, PrimaryButton, Spinner, SecondaryButton } from "components/ui";
|
||||||
// icons
|
// icons
|
||||||
import { PlusIcon, TrashIcon } from "@heroicons/react/24/outline";
|
import { PlusIcon, TrashIcon } from "@heroicons/react/24/outline";
|
||||||
// images
|
// images
|
||||||
@ -601,6 +601,17 @@ export const IssuesView: React.FC<Props> = ({
|
|||||||
image={emptyIssue}
|
image={emptyIssue}
|
||||||
buttonText="New Issue"
|
buttonText="New Issue"
|
||||||
buttonIcon={<PlusIcon className="h-4 w-4" />}
|
buttonIcon={<PlusIcon className="h-4 w-4" />}
|
||||||
|
secondaryButton={
|
||||||
|
cycleId || moduleId ? (
|
||||||
|
<SecondaryButton
|
||||||
|
className="flex items-center gap-1.5"
|
||||||
|
onClick={openIssuesListModal}
|
||||||
|
>
|
||||||
|
<PlusIcon className="h-4 w-4" />
|
||||||
|
Add an existing issue
|
||||||
|
</SecondaryButton>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const e = new KeyboardEvent("keydown", {
|
const e = new KeyboardEvent("keydown", {
|
||||||
key: "c",
|
key: "c",
|
||||||
|
@ -33,6 +33,7 @@ type Props = {
|
|||||||
handleClose: () => void;
|
handleClose: () => void;
|
||||||
searchParams: Partial<TProjectIssuesSearchParams>;
|
searchParams: Partial<TProjectIssuesSearchParams>;
|
||||||
handleOnSubmit: (data: ISearchIssueResponse[]) => Promise<void>;
|
handleOnSubmit: (data: ISearchIssueResponse[]) => Promise<void>;
|
||||||
|
workspaceLevelToggle?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ExistingIssuesListModal: React.FC<Props> = ({
|
export const ExistingIssuesListModal: React.FC<Props> = ({
|
||||||
@ -40,6 +41,7 @@ export const ExistingIssuesListModal: React.FC<Props> = ({
|
|||||||
handleClose: onClose,
|
handleClose: onClose,
|
||||||
searchParams,
|
searchParams,
|
||||||
handleOnSubmit,
|
handleOnSubmit,
|
||||||
|
workspaceLevelToggle = false,
|
||||||
}) => {
|
}) => {
|
||||||
const [searchTerm, setSearchTerm] = useState("");
|
const [searchTerm, setSearchTerm] = useState("");
|
||||||
const [issues, setIssues] = useState<ISearchIssueResponse[]>([]);
|
const [issues, setIssues] = useState<ISearchIssueResponse[]>([]);
|
||||||
@ -194,6 +196,7 @@ export const ExistingIssuesListModal: React.FC<Props> = ({
|
|||||||
No issues selected
|
No issues selected
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
{workspaceLevelToggle && (
|
||||||
<Tooltip tooltipContent="Toggle workspace level search">
|
<Tooltip tooltipContent="Toggle workspace level search">
|
||||||
<div
|
<div
|
||||||
className={`flex-shrink-0 flex items-center gap-1 text-xs cursor-pointer ${
|
className={`flex-shrink-0 flex items-center gap-1 text-xs cursor-pointer ${
|
||||||
@ -213,6 +216,7 @@ export const ExistingIssuesListModal: React.FC<Props> = ({
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Combobox.Options static className="max-h-80 scroll-py-2 overflow-y-auto">
|
<Combobox.Options static className="max-h-80 scroll-py-2 overflow-y-auto">
|
||||||
|
@ -82,6 +82,7 @@ export const SidebarBlockedSelect: React.FC<Props> = ({
|
|||||||
handleClose={() => setIsBlockedModalOpen(false)}
|
handleClose={() => setIsBlockedModalOpen(false)}
|
||||||
searchParams={{ blocker_blocked_by: true, issue_id: issueId }}
|
searchParams={{ blocker_blocked_by: true, issue_id: issueId }}
|
||||||
handleOnSubmit={onSubmit}
|
handleOnSubmit={onSubmit}
|
||||||
|
workspaceLevelToggle
|
||||||
/>
|
/>
|
||||||
<div className="flex flex-wrap items-start py-2">
|
<div className="flex flex-wrap items-start py-2">
|
||||||
<div className="flex items-center gap-x-2 text-sm text-custom-text-200 sm:basis-1/2">
|
<div className="flex items-center gap-x-2 text-sm text-custom-text-200 sm:basis-1/2">
|
||||||
|
@ -82,6 +82,7 @@ export const SidebarBlockerSelect: React.FC<Props> = ({
|
|||||||
handleClose={() => setIsBlockerModalOpen(false)}
|
handleClose={() => setIsBlockerModalOpen(false)}
|
||||||
searchParams={{ blocker_blocked_by: true, issue_id: issueId }}
|
searchParams={{ blocker_blocked_by: true, issue_id: issueId }}
|
||||||
handleOnSubmit={onSubmit}
|
handleOnSubmit={onSubmit}
|
||||||
|
workspaceLevelToggle
|
||||||
/>
|
/>
|
||||||
<div className="flex flex-wrap items-start py-2">
|
<div className="flex flex-wrap items-start py-2">
|
||||||
<div className="flex items-center gap-x-2 text-sm text-custom-text-200 sm:basis-1/2">
|
<div className="flex items-center gap-x-2 text-sm text-custom-text-200 sm:basis-1/2">
|
||||||
|
@ -115,6 +115,7 @@ export const SubIssuesList: FC<Props> = ({ parentIssue, user, disabled = false }
|
|||||||
handleClose={() => setSubIssuesListModal(false)}
|
handleClose={() => setSubIssuesListModal(false)}
|
||||||
searchParams={{ sub_issue: true, issue_id: parentIssue?.id }}
|
searchParams={{ sub_issue: true, issue_id: parentIssue?.id }}
|
||||||
handleOnSubmit={addAsSubIssue}
|
handleOnSubmit={addAsSubIssue}
|
||||||
|
workspaceLevelToggle
|
||||||
/>
|
/>
|
||||||
{subIssuesResponse && subIssuesResponse.sub_issues.length > 0 ? (
|
{subIssuesResponse && subIssuesResponse.sub_issues.length > 0 ? (
|
||||||
<Disclosure defaultOpen={true}>
|
<Disclosure defaultOpen={true}>
|
||||||
|
@ -11,6 +11,7 @@ type Props = {
|
|||||||
image: any;
|
image: any;
|
||||||
buttonText?: string;
|
buttonText?: string;
|
||||||
buttonIcon?: any;
|
buttonIcon?: any;
|
||||||
|
secondaryButton?: React.ReactNode;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
isFullScreen?: boolean;
|
isFullScreen?: boolean;
|
||||||
};
|
};
|
||||||
@ -22,6 +23,7 @@ export const EmptyState: React.FC<Props> = ({
|
|||||||
onClick,
|
onClick,
|
||||||
buttonText,
|
buttonText,
|
||||||
buttonIcon,
|
buttonIcon,
|
||||||
|
secondaryButton,
|
||||||
isFullScreen = true,
|
isFullScreen = true,
|
||||||
}) => (
|
}) => (
|
||||||
<div
|
<div
|
||||||
@ -33,12 +35,15 @@ export const EmptyState: React.FC<Props> = ({
|
|||||||
<Image src={image} className="w-52 sm:w-60" alt={buttonText} />
|
<Image src={image} className="w-52 sm:w-60" alt={buttonText} />
|
||||||
<h6 className="text-xl font-semibold mt-6 sm:mt-8 mb-3">{title}</h6>
|
<h6 className="text-xl font-semibold mt-6 sm:mt-8 mb-3">{title}</h6>
|
||||||
<p className="text-custom-text-300 mb-7 sm:mb-8">{description}</p>
|
<p className="text-custom-text-300 mb-7 sm:mb-8">{description}</p>
|
||||||
|
<div className="flex items-center gap-4">
|
||||||
{buttonText && (
|
{buttonText && (
|
||||||
<PrimaryButton className="flex items-center gap-1.5" onClick={onClick}>
|
<PrimaryButton className="flex items-center gap-1.5" onClick={onClick}>
|
||||||
{buttonIcon}
|
{buttonIcon}
|
||||||
{buttonText}
|
{buttonText}
|
||||||
</PrimaryButton>
|
</PrimaryButton>
|
||||||
)}
|
)}
|
||||||
|
{secondaryButton}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user