forked from github/plane
fix: create more toggle fixes in create issue modal (#3355)
* fix: create more issue bugfixes * fix: removing all warning
This commit is contained in:
parent
a679b42200
commit
7ff91fdb82
@ -56,6 +56,7 @@ export const CoreEditorExtensions = (
|
||||
code: false,
|
||||
codeBlock: false,
|
||||
horizontalRule: false,
|
||||
blockquote: false,
|
||||
dropcursor: {
|
||||
color: "rgba(var(--color-text-100))",
|
||||
width: 2,
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { isAtStartOfNode } from "@tiptap/core";
|
||||
import Blockquote from "@tiptap/extension-blockquote";
|
||||
|
||||
export const CustomQuoteExtension = Blockquote.extend({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
Enter: ({ editor }) => {
|
||||
Enter: () => {
|
||||
const { $from, $to, $head } = this.editor.state.selection;
|
||||
const parent = $head.node(-1);
|
||||
|
||||
|
@ -43,22 +43,23 @@ function absoluteRect(node: Element) {
|
||||
}
|
||||
|
||||
function nodeDOMAtCoords(coords: { x: number; y: number }) {
|
||||
return document.elementsFromPoint(coords.x, coords.y).find((elem: Element) => {
|
||||
return (
|
||||
elem.parentElement?.matches?.(".ProseMirror") ||
|
||||
elem.matches(
|
||||
[
|
||||
"li",
|
||||
"p:not(:first-child)",
|
||||
"pre",
|
||||
"blockquote",
|
||||
"h1, h2, h3",
|
||||
"[data-type=horizontalRule]",
|
||||
".tableWrapper",
|
||||
].join(", ")
|
||||
)
|
||||
return document
|
||||
.elementsFromPoint(coords.x, coords.y)
|
||||
.find(
|
||||
(elem: Element) =>
|
||||
elem.parentElement?.matches?.(".ProseMirror") ||
|
||||
elem.matches(
|
||||
[
|
||||
"li",
|
||||
"p:not(:first-child)",
|
||||
"pre",
|
||||
"blockquote",
|
||||
"h1, h2, h3",
|
||||
"[data-type=horizontalRule]",
|
||||
".tableWrapper",
|
||||
].join(", ")
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function nodePosAtDOM(node: Element, view: EditorView) {
|
||||
|
@ -35,9 +35,9 @@ export const CircularProgressIndicator: React.FC<ICircularProgressIndicator> = (
|
||||
width="45.2227"
|
||||
height="45.2227"
|
||||
filterUnits="userSpaceOnUse"
|
||||
color-interpolation-filters="sRGB"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feGaussianBlur in="BackgroundImageFix" stdDeviation="2" />
|
||||
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_377_19141" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_377_19141" result="shape" />
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { MouseEvent } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import useSWR from "swr";
|
||||
// hooks
|
||||
@ -69,15 +68,13 @@ interface IActiveCycleDetails {
|
||||
}
|
||||
|
||||
export const ActiveCycleDetails: React.FC<IActiveCycleDetails> = observer((props) => {
|
||||
// router
|
||||
const router = useRouter();
|
||||
// props
|
||||
const { workspaceSlug, projectId } = props;
|
||||
|
||||
// store hooks
|
||||
const {
|
||||
issues: { issues, fetchActiveCycleIssues },
|
||||
issueMap,
|
||||
} = useIssues(EIssuesStoreType.CYCLE);
|
||||
// store hooks
|
||||
const {
|
||||
commandPalette: { toggleCreateCycleModal },
|
||||
} = useApplication();
|
||||
|
@ -31,7 +31,12 @@ export const CyclesList: FC<ICyclesList> = observer((props) => {
|
||||
<div className="flex h-full w-full justify-between">
|
||||
<div className="flex h-full w-full flex-col overflow-y-auto">
|
||||
{cycleIds.map((cycleId) => (
|
||||
<CyclesListItem cycleId={cycleId} workspaceSlug={workspaceSlug} projectId={projectId} />
|
||||
<CyclesListItem
|
||||
key={cycleId}
|
||||
cycleId={cycleId}
|
||||
workspaceSlug={workspaceSlug}
|
||||
projectId={projectId}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<CyclePeekOverview
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { useState, useRef } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { Draggable } from "@hello-pangea/dnd";
|
||||
import { MoreHorizontal } from "lucide-react";
|
||||
@ -21,8 +20,6 @@ type Props = {
|
||||
|
||||
export const CalendarIssueBlocks: React.FC<Props> = observer((props) => {
|
||||
const { issues, issueIdList, quickActions, showAllIssues = false } = props;
|
||||
// router
|
||||
const router = useRouter();
|
||||
// hooks
|
||||
const {
|
||||
router: { workspaceSlug, projectId },
|
||||
|
@ -40,7 +40,6 @@ export const HeaderGroupByCard: FC<IHeaderGroupByCard> = observer((props) => {
|
||||
handleKanbanFilters,
|
||||
issuePayload,
|
||||
disableIssueCreation,
|
||||
currentStore,
|
||||
addIssuesToView,
|
||||
} = props;
|
||||
const verticalAlignPosition = sub_group_by ? false : kanbanFilters?.group_by.includes(column_id);
|
||||
|
@ -55,7 +55,6 @@ export const KanbanGroup = (props: IKanbanGroup) => {
|
||||
disableIssueCreation,
|
||||
quickAddCallback,
|
||||
viewId,
|
||||
groupByVisibilityToggle,
|
||||
} = props;
|
||||
// hooks
|
||||
const projectState = useProjectState();
|
||||
|
@ -4,7 +4,7 @@ import { useForm } from "react-hook-form";
|
||||
import { PlusIcon } from "lucide-react";
|
||||
import { observer } from "mobx-react-lite";
|
||||
// hooks
|
||||
import { useProject, useWorkspace } from "hooks/store";
|
||||
import { useProject } from "hooks/store";
|
||||
import useToast from "hooks/use-toast";
|
||||
import useKeypress from "hooks/use-keypress";
|
||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||
|
@ -67,7 +67,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
ellipsis
|
||||
>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
handleCopyIssueLink();
|
||||
}}
|
||||
>
|
||||
@ -77,7 +77,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setIssueToEdit(issue);
|
||||
setCreateUpdateIssueModal(true);
|
||||
}}
|
||||
@ -88,7 +88,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setCreateUpdateIssueModal(true);
|
||||
}}
|
||||
>
|
||||
@ -98,7 +98,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setDeleteIssueModal(true);
|
||||
}}
|
||||
>
|
||||
|
@ -48,7 +48,7 @@ export const ArchivedIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
||||
ellipsis
|
||||
>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
handleCopyIssueLink();
|
||||
}}
|
||||
>
|
||||
@ -58,7 +58,7 @@ export const ArchivedIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setDeleteIssueModal(true);
|
||||
}}
|
||||
>
|
||||
|
@ -67,7 +67,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
ellipsis
|
||||
>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
handleCopyIssueLink();
|
||||
}}
|
||||
>
|
||||
@ -77,7 +77,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setIssueToEdit({
|
||||
...issue,
|
||||
cycle: cycleId?.toString() ?? null,
|
||||
@ -91,7 +91,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
handleRemoveFromView && handleRemoveFromView();
|
||||
}}
|
||||
>
|
||||
@ -101,7 +101,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setCreateUpdateIssueModal(true);
|
||||
}}
|
||||
>
|
||||
@ -111,7 +111,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setDeleteIssueModal(true);
|
||||
}}
|
||||
>
|
||||
|
@ -67,7 +67,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
ellipsis
|
||||
>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
handleCopyIssueLink();
|
||||
}}
|
||||
>
|
||||
@ -77,7 +77,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setIssueToEdit({ ...issue, module: moduleId?.toString() ?? null });
|
||||
setCreateUpdateIssueModal(true);
|
||||
}}
|
||||
@ -88,7 +88,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
handleRemoveFromView && handleRemoveFromView();
|
||||
}}
|
||||
>
|
||||
@ -98,7 +98,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setCreateUpdateIssueModal(true);
|
||||
}}
|
||||
>
|
||||
|
@ -76,7 +76,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
||||
ellipsis
|
||||
>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
handleCopyIssueLink();
|
||||
}}
|
||||
>
|
||||
@ -88,7 +88,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
||||
{isEditingAllowed && (
|
||||
<>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setIssueToEdit(issue);
|
||||
setCreateUpdateIssueModal(true);
|
||||
}}
|
||||
@ -99,7 +99,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setCreateUpdateIssueModal(true);
|
||||
}}
|
||||
>
|
||||
@ -109,7 +109,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
||||
</div>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
setDeleteIssueModal(true);
|
||||
}}
|
||||
>
|
||||
|
@ -66,7 +66,7 @@ export const AllIssueLayoutRoot: React.FC<Props> = observer((props) => {
|
||||
};
|
||||
|
||||
const issueIds = (groupedIssueIds ?? []) as TUnGroupedIssues;
|
||||
const issuesArray = issueIds?.filter((id) => id && issueMap?.[id]).map((id) => issueMap?.[id]);
|
||||
const issuesArray = issueIds?.filter((id: string) => id && issueMap?.[id]).map((id: string) => issueMap?.[id]);
|
||||
|
||||
const issueActions = useMemo(
|
||||
() => ({
|
||||
|
@ -1,14 +1,20 @@
|
||||
import { IIssueDisplayProperties, TIssue, TIssueMap } from "@plane/types";
|
||||
import { SPREADSHEET_PROPERTY_DETAILS, SPREADSHEET_PROPERTY_LIST } from "constants/spreadsheet";
|
||||
import { WithDisplayPropertiesHOC } from "../properties/with-display-properties-HOC";
|
||||
import { Tooltip } from "@plane/ui";
|
||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||
import { useIssueDetail, useProject } from "hooks/store";
|
||||
import { useRef, useState } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
||||
import { EIssueActions } from "../types";
|
||||
import { observer } from "mobx-react-lite";
|
||||
// icons
|
||||
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
||||
// constants
|
||||
import { SPREADSHEET_PROPERTY_DETAILS, SPREADSHEET_PROPERTY_LIST } from "constants/spreadsheet";
|
||||
// components
|
||||
import { WithDisplayPropertiesHOC } from "../properties/with-display-properties-HOC";
|
||||
// ui
|
||||
import { Tooltip } from "@plane/ui";
|
||||
// hooks
|
||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||
import { useIssueDetail, useProject } from "hooks/store";
|
||||
// types
|
||||
import { IIssueDisplayProperties, TIssue } from "@plane/types";
|
||||
import { EIssueActions } from "../types";
|
||||
|
||||
interface Props {
|
||||
displayProperties: IIssueDisplayProperties;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { useEffect, useState, useRef } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { PlusIcon } from "lucide-react";
|
||||
@ -56,10 +55,6 @@ const Inputs = (props: any) => {
|
||||
|
||||
export const SpreadsheetQuickAddIssueForm: React.FC<Props> = observer((props) => {
|
||||
const { formKey, prePopulatedData, quickAddCallback, viewId } = props;
|
||||
|
||||
// router
|
||||
const router = useRouter();
|
||||
const { workspaceSlug, projectId } = router.query;
|
||||
// store hooks
|
||||
const { currentWorkspace } = useWorkspace();
|
||||
const { currentProjectDetails } = useProject();
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import React, { useEffect, useRef } from "react";
|
||||
import { observer } from "mobx-react-lite";
|
||||
// components
|
||||
import { Spinner } from "@plane/ui";
|
||||
@ -9,7 +9,6 @@ import { EIssueActions } from "../types";
|
||||
import { useProject } from "hooks/store";
|
||||
import { SpreadsheetHeader } from "./spreadsheet-header";
|
||||
import { SpreadsheetIssueRow } from "./issue-row";
|
||||
import { WithDisplayPropertiesHOC } from "../properties/with-display-properties-HOC";
|
||||
|
||||
type Props = {
|
||||
displayProperties: IIssueDisplayProperties;
|
||||
|
@ -14,6 +14,8 @@ import type { TIssue } from "@plane/types";
|
||||
export interface DraftIssueProps {
|
||||
changesMade: Partial<TIssue> | null;
|
||||
data?: Partial<TIssue>;
|
||||
isCreateMoreToggleEnabled: boolean;
|
||||
onCreateMoreToggleChange: (value: boolean) => void;
|
||||
onChange: (formData: Partial<TIssue> | null) => void;
|
||||
onClose: (saveDraftIssueInLocalStorage?: boolean) => void;
|
||||
onSubmit: (formData: Partial<TIssue>) => Promise<void>;
|
||||
@ -23,7 +25,16 @@ export interface DraftIssueProps {
|
||||
const issueDraftService = new IssueDraftService();
|
||||
|
||||
export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
|
||||
const { changesMade, data, onChange, onClose, onSubmit, projectId } = props;
|
||||
const {
|
||||
changesMade,
|
||||
data,
|
||||
onChange,
|
||||
onClose,
|
||||
onSubmit,
|
||||
projectId,
|
||||
isCreateMoreToggleEnabled,
|
||||
onCreateMoreToggleChange,
|
||||
} = props;
|
||||
// states
|
||||
const [issueDiscardModal, setIssueDiscardModal] = useState(false);
|
||||
// router
|
||||
@ -76,7 +87,15 @@ export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
|
||||
onClose(false);
|
||||
}}
|
||||
/>
|
||||
<IssueFormRoot data={data} onChange={onChange} onClose={handleClose} onSubmit={onSubmit} projectId={projectId} />
|
||||
<IssueFormRoot
|
||||
isCreateMoreToggleEnabled={isCreateMoreToggleEnabled}
|
||||
onCreateMoreToggleChange={onCreateMoreToggleChange}
|
||||
data={data}
|
||||
onChange={onChange}
|
||||
onClose={handleClose}
|
||||
onSubmit={onSubmit}
|
||||
projectId={projectId}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
});
|
||||
|
@ -51,6 +51,8 @@ const defaultValues: Partial<TIssue> = {
|
||||
|
||||
export interface IssueFormProps {
|
||||
data?: Partial<TIssue>;
|
||||
isCreateMoreToggleEnabled: boolean;
|
||||
onCreateMoreToggleChange: (value: boolean) => void;
|
||||
onChange?: (formData: Partial<TIssue> | null) => void;
|
||||
onClose: () => void;
|
||||
onSubmit: (values: Partial<TIssue>) => Promise<void>;
|
||||
@ -62,14 +64,15 @@ const aiService = new AIService();
|
||||
const fileService = new FileService();
|
||||
|
||||
export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
||||
const { data, onChange, onClose, onSubmit, projectId } = props;
|
||||
const { data, onChange, onClose, onSubmit, projectId, isCreateMoreToggleEnabled, onCreateMoreToggleChange } = props;
|
||||
console.log("onCreateMoreToggleChange", typeof onCreateMoreToggleChange);
|
||||
// states
|
||||
const [labelModal, setLabelModal] = useState(false);
|
||||
const [parentIssueListModalOpen, setParentIssueListModalOpen] = useState(false);
|
||||
const [selectedParentIssue, setSelectedParentIssue] = useState<ISearchIssueResponse | null>(null);
|
||||
const [gptAssistantModal, setGptAssistantModal] = useState(false);
|
||||
const [iAmFeelingLucky, setIAmFeelingLucky] = useState(false);
|
||||
const [createMore, setCreateMore] = useState(false);
|
||||
|
||||
// refs
|
||||
const editorRef = useRef<any>(null);
|
||||
// router
|
||||
@ -276,7 +279,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
||||
/>
|
||||
<div className="relative">
|
||||
<div className="absolute bottom-3.5 right-3.5 z-10 border-0.5 flex items-center gap-2">
|
||||
{issueName && issueName.trim() !== "" && (
|
||||
{issueName && issueName.trim() !== "" && envConfig?.has_openai_configured && (
|
||||
<button
|
||||
type="button"
|
||||
className={`flex items-center gap-1 rounded px-1.5 py-1 text-xs bg-custom-background-80 ${
|
||||
@ -593,14 +596,14 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
||||
<div className="-mx-5 mt-5 flex items-center justify-between gap-2 border-t border-custom-border-100 px-5 pt-5">
|
||||
<div
|
||||
className="flex cursor-default items-center gap-1.5"
|
||||
onClick={() => setCreateMore((prevData) => !prevData)}
|
||||
onClick={() => onCreateMoreToggleChange(!isCreateMoreToggleEnabled)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter") setCreateMore((prevData) => !prevData);
|
||||
if (e.key === "Enter") onCreateMoreToggleChange(!isCreateMoreToggleEnabled);
|
||||
}}
|
||||
tabIndex={16}
|
||||
>
|
||||
<div className="flex cursor-pointer items-center justify-center">
|
||||
<ToggleSwitch value={createMore} onChange={() => {}} size="sm" />
|
||||
<ToggleSwitch value={isCreateMoreToggleEnabled} onChange={() => {}} size="sm" />
|
||||
</div>
|
||||
<span className="text-xs">Create more</span>
|
||||
</div>
|
||||
|
@ -26,6 +26,7 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
||||
const { data, isOpen, onClose, onSubmit, withDraftIssueWrapper = true } = props;
|
||||
// states
|
||||
const [changesMade, setChangesMade] = useState<Partial<TIssue> | null>(null);
|
||||
const [createMore, setCreateMore] = useState(false);
|
||||
// router
|
||||
const router = useRouter();
|
||||
const { workspaceSlug, projectId } = router.query;
|
||||
@ -45,13 +46,15 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
||||
// local storage
|
||||
const { setValue: setLocalStorageDraftIssue } = useLocalStorage<any>("draftedIssue", {});
|
||||
|
||||
const handleCreateMoreToggleChange = (value: boolean) => {
|
||||
setCreateMore(value);
|
||||
};
|
||||
|
||||
const handleClose = (saveDraftIssueInLocalStorage?: boolean) => {
|
||||
if (changesMade && saveDraftIssueInLocalStorage) {
|
||||
const draftIssue = JSON.stringify(changesMade);
|
||||
|
||||
setLocalStorageDraftIssue(draftIssue);
|
||||
}
|
||||
|
||||
onClose();
|
||||
};
|
||||
|
||||
@ -65,7 +68,7 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
||||
title: "Success!",
|
||||
message: "Issue created successfully.",
|
||||
});
|
||||
handleClose();
|
||||
!createMore && handleClose();
|
||||
return res;
|
||||
})
|
||||
.catch(() => {
|
||||
@ -169,11 +172,15 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
||||
onClose={handleClose}
|
||||
onSubmit={handleFormSubmit}
|
||||
projectId={selectedProjectId}
|
||||
isCreateMoreToggleEnabled={createMore}
|
||||
onCreateMoreToggleChange={handleCreateMoreToggleChange}
|
||||
/>
|
||||
) : (
|
||||
<IssueFormRoot
|
||||
data={data}
|
||||
onClose={() => handleClose(false)}
|
||||
isCreateMoreToggleEnabled={createMore}
|
||||
onCreateMoreToggleChange={handleCreateMoreToggleChange}
|
||||
onSubmit={handleFormSubmit}
|
||||
projectId={selectedProjectId}
|
||||
/>
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { FC, useMemo } from "react";
|
||||
import { FC } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { CalendarDays, Signal, Tag, Triangle, LayoutPanelTop } from "lucide-react";
|
||||
// hooks
|
||||
import { useIssueDetail, useProject, useUser } from "hooks/store";
|
||||
import { useProject, useUser } from "hooks/store";
|
||||
// ui icons
|
||||
import { DiceIcon, DoubleCircleIcon, UserGroupIcon, ContrastIcon } from "@plane/ui";
|
||||
import { IssueLinkRoot, IssueCycleSelect, IssueModuleSelect, IssueParentSelect, IssueLabel } from "components/issues";
|
||||
@ -13,7 +13,7 @@ import { CustomDatePicker } from "components/ui";
|
||||
// types
|
||||
import { TIssue, TIssuePriorities } from "@plane/types";
|
||||
// constants
|
||||
import { EUserProjectRoles } from "constants/project";
|
||||
// import { EUserProjectRoles } from "constants/project";
|
||||
|
||||
interface IPeekOverviewProperties {
|
||||
issue: TIssue;
|
||||
@ -29,14 +29,13 @@ export const PeekOverviewProperties: FC<IPeekOverviewProperties> = observer((pro
|
||||
const {
|
||||
membership: { currentProjectRole },
|
||||
} = useUser();
|
||||
const { currentUser } = useUser();
|
||||
const { getProjectById } = useProject();
|
||||
// router
|
||||
const router = useRouter();
|
||||
const { workspaceSlug, projectId } = router.query;
|
||||
|
||||
const uneditable = currentProjectRole ? [5, 10].includes(currentProjectRole) : false;
|
||||
const isAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
|
||||
// const isAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
|
||||
|
||||
const handleState = (_state: string) => {
|
||||
issueUpdate({ ...issue, state_id: _state });
|
||||
|
@ -2,6 +2,8 @@ import { FC, useRef, useState } from "react";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { MoveRight, MoveDiagonal, Bell, Link2, Trash2 } from "lucide-react";
|
||||
// hooks
|
||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||
// store hooks
|
||||
import { useIssueDetail, useUser } from "hooks/store";
|
||||
// components
|
||||
import {
|
||||
@ -15,8 +17,7 @@ import {
|
||||
// ui
|
||||
import { Button, CenterPanelIcon, CustomSelect, FullScreenPanelIcon, SidePanelIcon, Spinner } from "@plane/ui";
|
||||
// types
|
||||
import { TIssue, IIssueLink, ILinkDetails } from "@plane/types";
|
||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||
import { TIssue } from "@plane/types";
|
||||
|
||||
interface IIssueView {
|
||||
workspaceSlug: string;
|
||||
|
@ -98,7 +98,7 @@ export const CreateProjectModal: FC<Props> = observer((props) => {
|
||||
const currentNetwork = NETWORK_CHOICES.find((n) => n.key === watch("network"));
|
||||
|
||||
if (currentWorkspaceRole && isOpen)
|
||||
if (currentWorkspaceRole <= EUserWorkspaceRoles.MEMBER) return <IsGuestCondition onClose={onClose} />;
|
||||
if (currentWorkspaceRole < EUserWorkspaceRoles.MEMBER) return <IsGuestCondition onClose={onClose} />;
|
||||
|
||||
const handleClose = () => {
|
||||
onClose();
|
||||
|
@ -44,7 +44,7 @@ export const WorkspaceSidebarMenu = observer(() => {
|
||||
// router
|
||||
const router = useRouter();
|
||||
const { workspaceSlug } = router.query;
|
||||
|
||||
// computed
|
||||
const isAuthorizedUser = !!currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER;
|
||||
|
||||
return (
|
||||
@ -76,7 +76,6 @@ export const WorkspaceSidebarMenu = observer(() => {
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
<NotificationPopover />
|
||||
</div>
|
||||
);
|
||||
|
@ -47,7 +47,7 @@ export const AppProvider: FC<IAppProvider> = observer((props) => {
|
||||
<InstanceLayout>
|
||||
<StoreWrapper>
|
||||
<CrispWrapper user={currentUser}>
|
||||
{/* <PosthogWrapper
|
||||
<PosthogWrapper
|
||||
user={currentUser}
|
||||
workspaceRole={currentWorkspaceRole}
|
||||
projectRole={currentProjectRole}
|
||||
@ -55,8 +55,7 @@ export const AppProvider: FC<IAppProvider> = observer((props) => {
|
||||
posthogHost={envConfig?.posthog_host || null}
|
||||
>
|
||||
<SWRConfig value={SWR_CONFIG}>{children}</SWRConfig>
|
||||
</PosthogWrapper> */}
|
||||
<SWRConfig value={SWR_CONFIG}>{children}</SWRConfig>
|
||||
</PosthogWrapper>
|
||||
</CrispWrapper>
|
||||
</StoreWrapper>
|
||||
</InstanceLayout>
|
||||
|
@ -6,7 +6,7 @@ import { Controller, useForm } from "react-hook-form";
|
||||
import { Sparkle } from "lucide-react";
|
||||
import debounce from "lodash/debounce";
|
||||
// hooks
|
||||
import { useApplication, useIssues, useUser } from "hooks/store";
|
||||
import { useApplication, useUser } from "hooks/store";
|
||||
import useToast from "hooks/use-toast";
|
||||
import useReloadConfirmations from "hooks/use-reload-confirmation";
|
||||
// services
|
||||
@ -33,7 +33,6 @@ import { IPage, TIssue } from "@plane/types";
|
||||
import { PAGE_DETAILS, PROJECT_ISSUES_LIST } from "constants/fetch-keys";
|
||||
// constants
|
||||
import { EUserProjectRoles } from "constants/project";
|
||||
import { EIssuesStoreType } from "constants/issue";
|
||||
|
||||
// services
|
||||
const fileService = new FileService();
|
||||
@ -50,9 +49,6 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
|
||||
const router = useRouter();
|
||||
const { workspaceSlug, projectId, pageId } = router.query;
|
||||
// store hooks
|
||||
const {
|
||||
issues: { updateIssue },
|
||||
} = useIssues(EIssuesStoreType.PROJECT);
|
||||
const {
|
||||
config: { envConfig },
|
||||
} = useApplication();
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import useSWR from "swr";
|
||||
@ -28,7 +28,7 @@ const WebhookDetailsPage: NextPageWithLayout = observer(() => {
|
||||
const {
|
||||
membership: { currentWorkspaceRole },
|
||||
} = useUser();
|
||||
const { currentWebhook, clearSecretKey, fetchWebhookById, updateWebhook } = useWebhook();
|
||||
const { currentWebhook, fetchWebhookById, updateWebhook } = useWebhook();
|
||||
// toast
|
||||
const { setToastAlert } = useToast();
|
||||
|
||||
|
@ -2795,7 +2795,7 @@
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react@*", "@types/react@^18.2.42":
|
||||
"@types/react@*", "@types/react@18.2.42", "@types/react@^18.2.42":
|
||||
version "18.2.42"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.42.tgz#6f6b11a904f6d96dda3c2920328a97011a00aba7"
|
||||
integrity sha512-c1zEr96MjakLYus/wPnuWDo1/zErfdU9rNsIGmE+NV71nx88FG9Ttgo5dqorXTu/LImX2f63WBP986gJkMPNbA==
|
||||
|
Loading…
Reference in New Issue
Block a user