diff --git a/web/components/core/views/all-views.tsx b/web/components/core/views/all-views.tsx index 79d5d6b11..eb54ccb2a 100644 --- a/web/components/core/views/all-views.tsx +++ b/web/components/core/views/all-views.tsx @@ -53,6 +53,7 @@ type Props = { handleOnDragEnd: (result: DropResult) => Promise; openIssuesListModal: (() => void) | null; removeIssue: ((bridgeId: string, issueId: string) => void) | null; + disableAddIssueOption?: boolean; trashBox: boolean; setTrashBox: React.Dispatch>; viewProps: IIssueViewProps; @@ -68,6 +69,7 @@ export const AllViews: React.FC = ({ handleOnDragEnd, openIssuesListModal, removeIssue, + disableAddIssueOption = false, trashBox, setTrashBox, viewProps, @@ -127,6 +129,7 @@ export const AllViews: React.FC = ({ openIssuesListModal={cycleId || moduleId ? openIssuesListModal : null} removeIssue={removeIssue} disableUserActions={disableUserActions} + disableAddIssueOption={disableAddIssueOption} user={user} userAuth={memberRole} viewProps={viewProps} @@ -135,6 +138,7 @@ export const AllViews: React.FC = ({ void; disableUserActions: boolean; + disableAddIssueOption?: boolean; dragDisabled: boolean; handleIssueAction: (issue: IIssue, action: "copy" | "delete" | "edit") => void; handleTrashBox: (isDragging: boolean) => void; @@ -24,6 +25,7 @@ type Props = { export const AllBoards: React.FC = ({ addIssueToGroup, disableUserActions, + disableAddIssueOption = false, dragDisabled, handleIssueAction, handleTrashBox, @@ -52,6 +54,7 @@ export const AllBoards: React.FC = ({ addIssueToGroup={() => addIssueToGroup(singleGroup)} currentState={currentState} disableUserActions={disableUserActions} + disableAddIssueOption={disableAddIssueOption} dragDisabled={dragDisabled} groupTitle={singleGroup} handleIssueAction={handleIssueAction} diff --git a/web/components/core/views/board-view/single-board.tsx b/web/components/core/views/board-view/single-board.tsx index 52e8c27c7..7ba70c97b 100644 --- a/web/components/core/views/board-view/single-board.tsx +++ b/web/components/core/views/board-view/single-board.tsx @@ -20,6 +20,7 @@ type Props = { addIssueToGroup: () => void; currentState?: IState | null; disableUserActions: boolean; + disableAddIssueOption?: boolean; dragDisabled: boolean; groupTitle: string; handleIssueAction: (issue: IIssue, action: "copy" | "delete" | "edit") => void; @@ -36,6 +37,7 @@ export const SingleBoard: React.FC = ({ currentState, groupTitle, disableUserActions, + disableAddIssueOption = false, dragDisabled, handleIssueAction, handleTrashBox, @@ -53,8 +55,6 @@ export const SingleBoard: React.FC = ({ const router = useRouter(); const { cycleId, moduleId } = router.query; - const isSubscribedIssues = router.pathname.includes("subscribed"); - const type = cycleId ? "cycle" : moduleId ? "module" : "issue"; // Check if it has at least 4 tickets since it is enough to accommodate the Calendar height @@ -72,7 +72,7 @@ export const SingleBoard: React.FC = ({ isCollapsed={isCollapsed} setIsCollapsed={setIsCollapsed} disableUserActions={disableUserActions} - disableAddIssue={isSubscribedIssues} + disableAddIssue={disableAddIssueOption} viewProps={viewProps} /> {isCollapsed && ( @@ -154,7 +154,7 @@ export const SingleBoard: React.FC = ({ {selectedGroup !== "created_by" && (
{type === "issue" - ? !isSubscribedIssues && ( + ? !disableAddIssueOption && (