diff --git a/apps/app/components/core/board-view/all-boards.tsx b/apps/app/components/core/board-view/all-boards.tsx index 3e67e86b5d8..711fb7336af 100644 --- a/apps/app/components/core/board-view/all-boards.tsx +++ b/apps/app/components/core/board-view/all-boards.tsx @@ -2,11 +2,12 @@ import useProjectIssuesView from "hooks/use-issues-view"; // components import { SingleBoard } from "components/core/board-view/single-board"; +// icons +import { getStateGroupIcon } from "components/icons"; // helpers import { addSpaceIfCamelCase } from "helpers/string.helper"; // types import { ICurrentUserResponse, IIssue, IState, UserAuth } from "types"; -import { getStateGroupIcon } from "components/icons"; type Props = { type: "issue" | "cycle" | "module"; diff --git a/apps/app/components/core/board-view/board-header.tsx b/apps/app/components/core/board-view/board-header.tsx index 6fa8f68f3a3..a5df7a4269d 100644 --- a/apps/app/components/core/board-view/board-header.tsx +++ b/apps/app/components/core/board-view/board-header.tsx @@ -166,7 +166,7 @@ export const BoardHeader: React.FC = ({ )} - {!isCompleted && ( + {!isCompleted && selectedGroup !== "created_by" && ( - ) : ( - !isCompleted && ( - - - Add Issue - - } - position="left" - noBorder + {selectedGroup !== "created_by" && ( +
+ {type === "issue" ? ( + + ) : ( + !isCompleted && ( + + + Add Issue + + } + position="left" + noBorder + > + + Create new - )} - - ) - )} -
+ {openIssuesListModal && ( + + Add an existing issue + + )} +
+ ) + )} + + )} )} diff --git a/apps/app/components/core/existing-issues-list-modal.tsx b/apps/app/components/core/existing-issues-list-modal.tsx index 8ef6132ae6f..fe6f1e1b452 100644 --- a/apps/app/components/core/existing-issues-list-modal.tsx +++ b/apps/app/components/core/existing-issues-list-modal.tsx @@ -72,9 +72,9 @@ export const ExistingIssuesListModal: React.FC = ({ const onSubmit: SubmitHandler = async (data) => { if (!data.issues || data.issues.length === 0) { setToastAlert({ - title: "Error", type: "error", - message: "Please select atleast one issue", + title: "Error!", + message: "Please select at least one issue.", }); return; diff --git a/apps/app/components/core/issues-view.tsx b/apps/app/components/core/issues-view.tsx index bfa6b9f4644..b90439b9d83 100644 --- a/apps/app/components/core/issues-view.tsx +++ b/apps/app/components/core/issues-view.tsx @@ -276,15 +276,24 @@ export const IssuesView: React.FC = ({ handleDeleteIssue, params, states, + user, ] ); const addIssueToState = useCallback( (groupTitle: string) => { setCreateIssueModal(true); + + let preloadedValue: string | string[] = groupTitle; + + if (selectedGroup === "labels") { + if (groupTitle === "None") preloadedValue = []; + else preloadedValue = [groupTitle]; + } + if (selectedGroup) setPreloadedData({ - [selectedGroup]: groupTitle, + [selectedGroup]: preloadedValue, actionType: "createIssue", }); else setPreloadedData({ actionType: "createIssue" }); diff --git a/apps/app/components/issues/select/label.tsx b/apps/app/components/issues/select/label.tsx index a7ada113325..e99eecc160f 100644 --- a/apps/app/components/issues/select/label.tsx +++ b/apps/app/components/issues/select/label.tsx @@ -6,6 +6,10 @@ import useSWR from "swr"; // headless ui import { Combobox, Transition } from "@headlessui/react"; +// services +import issuesServices from "services/issues.service"; +// ui +import { IssueLabelsList } from "components/ui"; // icons import { CheckIcon, @@ -14,13 +18,10 @@ import { RectangleGroupIcon, TagIcon, } from "@heroicons/react/24/outline"; -// services -import issuesServices from "services/issues.service"; // types import type { IIssueLabels } from "types"; // fetch-keys import { PROJECT_ISSUE_LABELS } from "constants/fetch-keys"; -import { IssueLabelsList } from "components/ui"; type Props = { setIsOpen: React.Dispatch>;