From bb50df0dff4f03dcb4939b150c0e063d53f4ad8d Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:11:39 +0530 Subject: [PATCH] chore: bug fixes and improvement (#3434) * fix: peek overview issue delete bug * chore: create cycle workflow improvement * chore: project setting improvement --- web/components/cycles/modal.tsx | 11 +++++++++-- web/components/issues/delete-issue-modal.tsx | 5 ----- web/components/issues/peek-overview/view.tsx | 5 ++++- web/components/project/form.tsx | 8 ++++++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/web/components/cycles/modal.tsx b/web/components/cycles/modal.tsx index bfd30cdf6..fed6eefc2 100644 --- a/web/components/cycles/modal.tsx +++ b/web/components/cycles/modal.tsx @@ -5,10 +5,11 @@ import { CycleService } from "services/cycle.service"; // hooks import { useApplication, useCycle } from "hooks/store"; import useToast from "hooks/use-toast"; +import useLocalStorage from "hooks/use-local-storage"; // components import { CycleForm } from "components/cycles"; // types -import type { CycleDateCheckData, ICycle } from "@plane/types"; +import type { CycleDateCheckData, ICycle, TCycleView } from "@plane/types"; type CycleModalProps = { isOpen: boolean; @@ -33,6 +34,8 @@ export const CycleCreateUpdateModal: React.FC = (props) => { // toast alert const { setToastAlert } = useToast(); + const { setValue: setCycleTab } = useLocalStorage("cycle_tab", "active"); + const handleCreateCycle = async (payload: Partial) => { if (!workspaceSlug || !projectId) return; @@ -117,7 +120,11 @@ export const CycleCreateUpdateModal: React.FC = (props) => { if (isDateValid) { if (data) await handleUpdateCycle(data.id, payload); - else await handleCreateCycle(payload); + else { + await handleCreateCycle(payload).then(() => { + setCycleTab("all"); + }); + } handleClose(); } else setToastAlert({ diff --git a/web/components/issues/delete-issue-modal.tsx b/web/components/issues/delete-issue-modal.tsx index e2d4a4a00..a063980c0 100644 --- a/web/components/issues/delete-issue-modal.tsx +++ b/web/components/issues/delete-issue-modal.tsx @@ -47,11 +47,6 @@ export const DeleteIssueModal: React.FC = (props) => { if (onSubmit) await onSubmit() .then(() => { - setToastAlert({ - title: "Success", - type: "success", - message: "Issue deleted successfully", - }); onClose(); }) .catch(() => { diff --git a/web/components/issues/peek-overview/view.tsx b/web/components/issues/peek-overview/view.tsx index d422d91e0..a08671455 100644 --- a/web/components/issues/peek-overview/view.tsx +++ b/web/components/issues/peek-overview/view.tsx @@ -109,7 +109,10 @@ export const IssueView: FC = observer((props) => { {issue && !is_archived && ( toggleDeleteIssueModal(false)} + handleClose={() => { + toggleDeleteIssueModal(false); + removeRoutePeekId(); + }} data={issue} onSubmit={() => issueOperations.remove(workspaceSlug, projectId, issueId)} /> diff --git a/web/components/project/form.tsx b/web/components/project/form.tsx index cfcb87532..3badbb8bf 100644 --- a/web/components/project/form.tsx +++ b/web/components/project/form.tsx @@ -7,6 +7,8 @@ import useToast from "hooks/use-toast"; import EmojiIconPicker from "components/emoji-icon-picker"; import { ImagePickerPopover } from "components/core"; import { Button, CustomSelect, Input, TextArea } from "@plane/ui"; +// icons +import { Lock } from "lucide-react"; // types import { IProject, IWorkspace } from "@plane/types"; // helpers @@ -169,8 +171,10 @@ export const ProjectDetailsForm: FC = (props) => {
{watch("name")} - - {watch("identifier")} . {currentNetwork?.label} + {watch("identifier")} . + + {project.network === 0 && } + {currentNetwork?.label}