mirror of
https://github.com/makeplane/plane.git
synced 2025-12-25 16:19:43 +01:00
[WEB-3868] fix: issue detail widget modals #6933
This commit is contained in:
committed by
GitHub
parent
608da1465c
commit
48557cb670
@@ -12,16 +12,18 @@ import { IssueLinkCreateUpdateModal } from "../issue-detail/links/create-update-
|
||||
// helpers
|
||||
import { useLinkOperations } from "./links/helper";
|
||||
import { useSubIssueOperations } from "./sub-issues/helper";
|
||||
import { TWorkItemWidgets } from ".";
|
||||
|
||||
type Props = {
|
||||
workspaceSlug: string;
|
||||
projectId: string;
|
||||
issueId: string;
|
||||
issueServiceType: TIssueServiceType;
|
||||
hideWidgets?: TWorkItemWidgets[];
|
||||
};
|
||||
|
||||
export const IssueDetailWidgetModals: FC<Props> = observer((props) => {
|
||||
const { workspaceSlug, projectId, issueId, issueServiceType } = props;
|
||||
const { workspaceSlug, projectId, issueId, issueServiceType, hideWidgets } = props;
|
||||
// store hooks
|
||||
const {
|
||||
isIssueLinkModalOpen,
|
||||
@@ -134,21 +136,27 @@ export const IssueDetailWidgetModals: FC<Props> = observer((props) => {
|
||||
|
||||
// render conditions
|
||||
const shouldRenderExistingIssuesModal =
|
||||
!hideWidgets?.includes("sub-work-items") &&
|
||||
issueCrudOperationState?.existing?.toggle &&
|
||||
issueCrudOperationState?.existing?.parentIssueId &&
|
||||
isSubIssuesModalOpen;
|
||||
|
||||
const shouldRenderCreateUpdateModal =
|
||||
issueCrudOperationState?.create?.toggle && issueCrudOperationState?.create?.parentIssueId && isCreateIssueModalOpen;
|
||||
!hideWidgets?.includes("sub-work-items") &&
|
||||
issueCrudOperationState?.create?.toggle &&
|
||||
issueCrudOperationState?.create?.parentIssueId &&
|
||||
isCreateIssueModalOpen;
|
||||
|
||||
return (
|
||||
<>
|
||||
<IssueLinkCreateUpdateModal
|
||||
isModalOpen={isIssueLinkModalOpen}
|
||||
handleOnClose={handleIssueLinkModalOnClose}
|
||||
linkOperations={handleLinkOperations}
|
||||
issueServiceType={issueServiceType}
|
||||
/>
|
||||
{!hideWidgets?.includes("links") && (
|
||||
<IssueLinkCreateUpdateModal
|
||||
isModalOpen={isIssueLinkModalOpen}
|
||||
handleOnClose={handleIssueLinkModalOnClose}
|
||||
linkOperations={handleLinkOperations}
|
||||
issueServiceType={issueServiceType}
|
||||
/>
|
||||
)}
|
||||
|
||||
{shouldRenderCreateUpdateModal && (
|
||||
<CreateUpdateIssueModal
|
||||
@@ -171,15 +179,17 @@ export const IssueDetailWidgetModals: FC<Props> = observer((props) => {
|
||||
/>
|
||||
)}
|
||||
|
||||
<ExistingIssuesListModal
|
||||
workspaceSlug={workspaceSlug}
|
||||
projectId={projectId}
|
||||
isOpen={isRelationModalOpen?.issueId === issueId && isRelationModalOpen?.relationType === relationKey}
|
||||
handleClose={handleRelationOnClose}
|
||||
searchParams={{ issue_relation: true, issue_id: issueId }}
|
||||
handleOnSubmit={handleExistingIssueModalOnSubmit}
|
||||
workspaceLevelToggle
|
||||
/>
|
||||
{!hideWidgets?.includes("relations") && (
|
||||
<ExistingIssuesListModal
|
||||
workspaceSlug={workspaceSlug}
|
||||
projectId={projectId}
|
||||
isOpen={isRelationModalOpen?.issueId === issueId && isRelationModalOpen?.relationType === relationKey}
|
||||
handleClose={handleRelationOnClose}
|
||||
searchParams={{ issue_relation: true, issue_id: issueId }}
|
||||
handleOnSubmit={handleExistingIssueModalOnSubmit}
|
||||
workspaceLevelToggle
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -59,6 +59,7 @@ export const IssueDetailWidgets: FC<Props> = (props) => {
|
||||
projectId={projectId}
|
||||
issueId={issueId}
|
||||
issueServiceType={issueServiceType}
|
||||
hideWidgets={hideWidgets}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user