chore: bug fixes and improvement (#3434)

* fix: peek overview issue delete bug

* chore: create cycle workflow improvement

* chore: project setting improvement
This commit is contained in:
Anmol Singh Bhatia 2024-01-23 13:11:39 +05:30 committed by GitHub
parent 2986769f28
commit bb50df0dff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 10 deletions

View File

@ -5,10 +5,11 @@ import { CycleService } from "services/cycle.service";
// hooks // hooks
import { useApplication, useCycle } from "hooks/store"; import { useApplication, useCycle } from "hooks/store";
import useToast from "hooks/use-toast"; import useToast from "hooks/use-toast";
import useLocalStorage from "hooks/use-local-storage";
// components // components
import { CycleForm } from "components/cycles"; import { CycleForm } from "components/cycles";
// types // types
import type { CycleDateCheckData, ICycle } from "@plane/types"; import type { CycleDateCheckData, ICycle, TCycleView } from "@plane/types";
type CycleModalProps = { type CycleModalProps = {
isOpen: boolean; isOpen: boolean;
@ -33,6 +34,8 @@ export const CycleCreateUpdateModal: React.FC<CycleModalProps> = (props) => {
// toast alert // toast alert
const { setToastAlert } = useToast(); const { setToastAlert } = useToast();
const { setValue: setCycleTab } = useLocalStorage<TCycleView>("cycle_tab", "active");
const handleCreateCycle = async (payload: Partial<ICycle>) => { const handleCreateCycle = async (payload: Partial<ICycle>) => {
if (!workspaceSlug || !projectId) return; if (!workspaceSlug || !projectId) return;
@ -117,7 +120,11 @@ export const CycleCreateUpdateModal: React.FC<CycleModalProps> = (props) => {
if (isDateValid) { if (isDateValid) {
if (data) await handleUpdateCycle(data.id, payload); if (data) await handleUpdateCycle(data.id, payload);
else await handleCreateCycle(payload); else {
await handleCreateCycle(payload).then(() => {
setCycleTab("all");
});
}
handleClose(); handleClose();
} else } else
setToastAlert({ setToastAlert({

View File

@ -47,11 +47,6 @@ export const DeleteIssueModal: React.FC<Props> = (props) => {
if (onSubmit) if (onSubmit)
await onSubmit() await onSubmit()
.then(() => { .then(() => {
setToastAlert({
title: "Success",
type: "success",
message: "Issue deleted successfully",
});
onClose(); onClose();
}) })
.catch(() => { .catch(() => {

View File

@ -109,7 +109,10 @@ export const IssueView: FC<IIssueView> = observer((props) => {
{issue && !is_archived && ( {issue && !is_archived && (
<DeleteIssueModal <DeleteIssueModal
isOpen={isDeleteIssueModalOpen} isOpen={isDeleteIssueModalOpen}
handleClose={() => toggleDeleteIssueModal(false)} handleClose={() => {
toggleDeleteIssueModal(false);
removeRoutePeekId();
}}
data={issue} data={issue}
onSubmit={() => issueOperations.remove(workspaceSlug, projectId, issueId)} onSubmit={() => issueOperations.remove(workspaceSlug, projectId, issueId)}
/> />

View File

@ -7,6 +7,8 @@ import useToast from "hooks/use-toast";
import EmojiIconPicker from "components/emoji-icon-picker"; import EmojiIconPicker from "components/emoji-icon-picker";
import { ImagePickerPopover } from "components/core"; import { ImagePickerPopover } from "components/core";
import { Button, CustomSelect, Input, TextArea } from "@plane/ui"; import { Button, CustomSelect, Input, TextArea } from "@plane/ui";
// icons
import { Lock } from "lucide-react";
// types // types
import { IProject, IWorkspace } from "@plane/types"; import { IProject, IWorkspace } from "@plane/types";
// helpers // helpers
@ -169,8 +171,10 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
<div className="flex flex-col gap-1 truncate text-white"> <div className="flex flex-col gap-1 truncate text-white">
<span className="truncate text-lg font-semibold">{watch("name")}</span> <span className="truncate text-lg font-semibold">{watch("name")}</span>
<span className="flex items-center gap-2 text-sm"> <span className="flex items-center gap-2 text-sm">
<span> <span>{watch("identifier")} .</span>
{watch("identifier")} . {currentNetwork?.label} <span className="flex items-center gap-1.5">
{project.network === 0 && <Lock className="h-2.5 w-2.5 text-white " />}
{currentNetwork?.label}
</span> </span>
</span> </span>
</div> </div>