diff --git a/apps/app/components/core/issues-view.tsx b/apps/app/components/core/issues-view.tsx index 4754a88e1..826ff516d 100644 --- a/apps/app/components/core/issues-view.tsx +++ b/apps/app/components/core/issues-view.tsx @@ -31,7 +31,7 @@ import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues"; import { CreateUpdateViewModal } from "components/views"; import { TransferIssues, TransferIssuesModal } from "components/cycles"; // ui -import { EmptyState, PrimaryButton, Spinner, Icon } from "components/ui"; +import { EmptyState, PrimaryButton, Spinner, SecondaryButton } from "components/ui"; // icons import { PlusIcon, TrashIcon } from "@heroicons/react/24/outline"; // images @@ -601,6 +601,17 @@ export const IssuesView: React.FC = ({ image={emptyIssue} buttonText="New Issue" buttonIcon={} + secondaryButton={ + cycleId || moduleId ? ( + + + Add an existing issue + + ) : null + } onClick={() => { const e = new KeyboardEvent("keydown", { key: "c", diff --git a/apps/app/components/core/modals/existing-issues-list-modal.tsx b/apps/app/components/core/modals/existing-issues-list-modal.tsx index f4231fee0..897e094af 100644 --- a/apps/app/components/core/modals/existing-issues-list-modal.tsx +++ b/apps/app/components/core/modals/existing-issues-list-modal.tsx @@ -33,6 +33,7 @@ type Props = { handleClose: () => void; searchParams: Partial; handleOnSubmit: (data: ISearchIssueResponse[]) => Promise; + workspaceLevelToggle?: boolean; }; export const ExistingIssuesListModal: React.FC = ({ @@ -40,6 +41,7 @@ export const ExistingIssuesListModal: React.FC = ({ handleClose: onClose, searchParams, handleOnSubmit, + workspaceLevelToggle = false, }) => { const [searchTerm, setSearchTerm] = useState(""); const [issues, setIssues] = useState([]); @@ -194,25 +196,27 @@ export const ExistingIssuesListModal: React.FC = ({ No issues selected )} - -
- setIsWorkspaceLevel((prevData) => !prevData)} - /> - -
-
+ setIsWorkspaceLevel((prevData) => !prevData)} + /> + + + + )} diff --git a/apps/app/components/issues/sidebar-select/blocked.tsx b/apps/app/components/issues/sidebar-select/blocked.tsx index 315140ea9..76373700c 100644 --- a/apps/app/components/issues/sidebar-select/blocked.tsx +++ b/apps/app/components/issues/sidebar-select/blocked.tsx @@ -82,6 +82,7 @@ export const SidebarBlockedSelect: React.FC = ({ handleClose={() => setIsBlockedModalOpen(false)} searchParams={{ blocker_blocked_by: true, issue_id: issueId }} handleOnSubmit={onSubmit} + workspaceLevelToggle />
diff --git a/apps/app/components/issues/sidebar-select/blocker.tsx b/apps/app/components/issues/sidebar-select/blocker.tsx index 7ec664700..c25adc49e 100644 --- a/apps/app/components/issues/sidebar-select/blocker.tsx +++ b/apps/app/components/issues/sidebar-select/blocker.tsx @@ -82,6 +82,7 @@ export const SidebarBlockerSelect: React.FC = ({ handleClose={() => setIsBlockerModalOpen(false)} searchParams={{ blocker_blocked_by: true, issue_id: issueId }} handleOnSubmit={onSubmit} + workspaceLevelToggle />
diff --git a/apps/app/components/issues/sub-issues-list.tsx b/apps/app/components/issues/sub-issues-list.tsx index 9c85ef546..7d526d661 100644 --- a/apps/app/components/issues/sub-issues-list.tsx +++ b/apps/app/components/issues/sub-issues-list.tsx @@ -115,6 +115,7 @@ export const SubIssuesList: FC = ({ parentIssue, user, disabled = false } handleClose={() => setSubIssuesListModal(false)} searchParams={{ sub_issue: true, issue_id: parentIssue?.id }} handleOnSubmit={addAsSubIssue} + workspaceLevelToggle /> {subIssuesResponse && subIssuesResponse.sub_issues.length > 0 ? ( diff --git a/apps/app/components/ui/empty-state.tsx b/apps/app/components/ui/empty-state.tsx index 5af3bf548..a13e59679 100644 --- a/apps/app/components/ui/empty-state.tsx +++ b/apps/app/components/ui/empty-state.tsx @@ -11,6 +11,7 @@ type Props = { image: any; buttonText?: string; buttonIcon?: any; + secondaryButton?: React.ReactNode; onClick?: () => void; isFullScreen?: boolean; }; @@ -22,6 +23,7 @@ export const EmptyState: React.FC = ({ onClick, buttonText, buttonIcon, + secondaryButton, isFullScreen = true, }) => (
= ({ {buttonText}
{title}

{description}

- {buttonText && ( - - {buttonIcon} - {buttonText} - - )} +
+ {buttonText && ( + + {buttonIcon} + {buttonText} + + )} + {secondaryButton} +
);