forked from github/plane
chore: draft issue layout and permission validation (#2982)
* chore: create draft issue option added in draft issue layout and permission validation added * chore: create draft issue option added in draft issue list layout and permission validation added
This commit is contained in:
parent
2cf847e8a7
commit
7b12d54d83
@ -224,7 +224,7 @@ export const BaseKanBanRoot: React.FC<IBaseKanBanLayout> = observer((props: IBas
|
||||
isDragStarted={isDragStarted}
|
||||
quickAddCallback={issueStore?.quickAddIssue}
|
||||
viewId={viewId}
|
||||
disableIssueCreation={!enableIssueCreation}
|
||||
disableIssueCreation={!enableIssueCreation || !isEditingAllowed}
|
||||
isReadOnly={!enableInlineEditing || !isEditingAllowed}
|
||||
currentStore={currentStore}
|
||||
addIssuesToView={addIssuesToView}
|
||||
|
@ -3,6 +3,7 @@ import { useRouter } from "next/router";
|
||||
// components
|
||||
import { CustomMenu } from "@plane/ui";
|
||||
import { CreateUpdateIssueModal } from "components/issues/modal";
|
||||
import { CreateUpdateDraftIssueModal } from "components/issues/draft-issue-modal";
|
||||
import { ExistingIssuesListModal } from "components/core";
|
||||
// lucide icons
|
||||
import { Minimize2, Maximize2, Circle, Plus } from "lucide-react";
|
||||
@ -51,6 +52,8 @@ export const HeaderGroupByCard: FC<IHeaderGroupByCard> = observer((props) => {
|
||||
const router = useRouter();
|
||||
const { workspaceSlug, projectId, moduleId, cycleId } = router.query;
|
||||
|
||||
const isDraftIssue = router.pathname.includes("draft-issue");
|
||||
|
||||
const { setToastAlert } = useToast();
|
||||
|
||||
const renderExistingIssueModal = moduleId || cycleId;
|
||||
@ -73,12 +76,21 @@ export const HeaderGroupByCard: FC<IHeaderGroupByCard> = observer((props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{isDraftIssue ? (
|
||||
<CreateUpdateDraftIssueModal
|
||||
isOpen={isOpen}
|
||||
handleClose={() => setIsOpen(false)}
|
||||
prePopulateData={issuePayload}
|
||||
fieldsToShow={["all"]}
|
||||
/>
|
||||
) : (
|
||||
<CreateUpdateIssueModal
|
||||
isOpen={isOpen}
|
||||
handleClose={() => setIsOpen(false)}
|
||||
prePopulateData={issuePayload}
|
||||
currentStore={currentStore}
|
||||
/>
|
||||
)}
|
||||
{renderExistingIssueModal && (
|
||||
<ExistingIssuesListModal
|
||||
isOpen={openExistingIssueListModal}
|
||||
|
@ -148,7 +148,7 @@ export const BaseListRoot = observer((props: IBaseListRoot) => {
|
||||
quickAddCallback={issueStore?.quickAddIssue}
|
||||
enableIssueQuickAdd={!!enableQuickAdd}
|
||||
isReadonly={!enableInlineEditing || !isEditingAllowed}
|
||||
disableIssueCreation={!enableIssueCreation}
|
||||
disableIssueCreation={!enableIssueCreation || !isEditingAllowed}
|
||||
currentStore={currentStore}
|
||||
addIssuesToView={addIssuesToView}
|
||||
/>
|
||||
|
@ -3,6 +3,7 @@ import { useRouter } from "next/router";
|
||||
// lucide icons
|
||||
import { CircleDashed, Plus } from "lucide-react";
|
||||
// components
|
||||
import { CreateUpdateDraftIssueModal } from "components/issues/draft-issue-modal";
|
||||
import { CreateUpdateIssueModal } from "components/issues/modal";
|
||||
import { ExistingIssuesListModal } from "components/core";
|
||||
import { CustomMenu } from "@plane/ui";
|
||||
@ -32,6 +33,8 @@ export const HeaderGroupByCard = observer(
|
||||
|
||||
const [openExistingIssueListModal, setOpenExistingIssueListModal] = React.useState(false);
|
||||
|
||||
const isDraftIssue = router.pathname.includes("draft-issue");
|
||||
|
||||
const { setToastAlert } = useToast();
|
||||
|
||||
const renderExistingIssueModal = moduleId || cycleId;
|
||||
@ -90,12 +93,21 @@ export const HeaderGroupByCard = observer(
|
||||
</div>
|
||||
))}
|
||||
|
||||
{isDraftIssue ? (
|
||||
<CreateUpdateDraftIssueModal
|
||||
isOpen={isOpen}
|
||||
handleClose={() => setIsOpen(false)}
|
||||
prePopulateData={issuePayload}
|
||||
fieldsToShow={["all"]}
|
||||
/>
|
||||
) : (
|
||||
<CreateUpdateIssueModal
|
||||
isOpen={isOpen}
|
||||
handleClose={() => setIsOpen(false)}
|
||||
currentStore={currentStore}
|
||||
prePopulateData={issuePayload}
|
||||
/>
|
||||
)}
|
||||
|
||||
{renderExistingIssueModal && (
|
||||
<ExistingIssuesListModal
|
||||
|
@ -36,7 +36,7 @@ export class ProjectDraftIssuesStore extends IssueBaseStore implements IProjectD
|
||||
//viewData
|
||||
viewFlags = {
|
||||
enableQuickAdd: false,
|
||||
enableIssueCreation: false,
|
||||
enableIssueCreation: true,
|
||||
enableInlineEditing: false,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user