mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 22:09:12 +02:00
[WEB-3988] fix: work item conversion mutation and modal title (#3100)
* fix: work item conversion mutation and modal title * chore: code refactor
This commit is contained in:
committed by
GitHub
parent
56bb47e785
commit
6437fcb0bc
@@ -393,7 +393,7 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
|
||||
onCreateMoreToggleChange: handleCreateMoreToggleChange,
|
||||
isDraft: isDraft,
|
||||
moveToIssue: moveToIssue,
|
||||
modalTitle: modalTitle,
|
||||
modalTitle: isConversionOperation ? "Turn this epic into a work item" : modalTitle,
|
||||
primaryButtonText: primaryButtonText,
|
||||
isDuplicateModalOpen: isDuplicateModalOpen,
|
||||
handleDuplicateIssueModal: handleDuplicateIssueModal,
|
||||
|
||||
@@ -252,6 +252,7 @@ export const CreateUpdateEpicModalBase: React.FC<IssuesModalProps> = observer((p
|
||||
projectId: activeProjectId,
|
||||
primaryButtonText: primaryButtonText,
|
||||
isProjectSelectionDisabled: isProjectSelectionDisabled,
|
||||
modalTitle: isConversionOperation ? "Turn this work item into an epic" : undefined,
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -57,6 +57,7 @@ export interface EpicFormProps {
|
||||
loading: string;
|
||||
};
|
||||
isProjectSelectionDisabled?: boolean;
|
||||
modalTitle?: string;
|
||||
}
|
||||
|
||||
export const EpicFormRoot: FC<EpicFormProps> = observer((props) => {
|
||||
@@ -72,6 +73,7 @@ export const EpicFormRoot: FC<EpicFormProps> = observer((props) => {
|
||||
default: `${data?.id ? "Update" : "Save"}`,
|
||||
loading: `${data?.id ? "Updating" : "Saving"}`,
|
||||
},
|
||||
modalTitle = `${data?.id ? "Update epic" : "Create epic"}`,
|
||||
} = props;
|
||||
|
||||
// states
|
||||
@@ -277,9 +279,7 @@ export const EpicFormRoot: FC<EpicFormProps> = observer((props) => {
|
||||
className="flex flex-col w-full"
|
||||
>
|
||||
<div className="p-5 rounded-t-lg bg-custom-background-100">
|
||||
<h3 className="text-xl font-medium text-custom-text-200 pb-2">
|
||||
{data?.id ? "Update epic" : "Create epic"}
|
||||
</h3>
|
||||
<h3 className="text-xl font-medium text-custom-text-200 pb-2">{modalTitle}</h3>
|
||||
<div className="flex items-center justify-between pt-2 pb-4">
|
||||
<div className="flex items-center gap-x-1">
|
||||
<IssueProjectSelect control={control} disabled handleFormChange={handleFormChange} />
|
||||
|
||||
@@ -728,6 +728,15 @@ export class IssueTypes implements IIssueTypesStore {
|
||||
if (convertTo === EWorkItemConversionType.WORK_ITEM) {
|
||||
this.rootStore.issue.projectEpics.removeIssueFromList(workItemId);
|
||||
this.rootStore.issue.projectIssues.addIssueToList(workItemId);
|
||||
|
||||
const initiativeIdFromRouter = this.rootStore.router.query.initiativeId;
|
||||
if (initiativeIdFromRouter) {
|
||||
this.rootStore.initiativeStore.epics.removeEpicFromInitiative(
|
||||
workspaceSlug,
|
||||
initiativeIdFromRouter?.toString(),
|
||||
workItemId
|
||||
);
|
||||
}
|
||||
// update is_epic to false
|
||||
this.rootStore.issue.issues.updateIssue(workItemId, { is_epic: false });
|
||||
} else if (convertTo === EWorkItemConversionType.EPIC) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { clsx, type ClassValue } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "";
|
||||
export const PI_BASE_URL = process.env.NEXT_PUBLIC_PI_BASE_URL || "https://dev.plane-pi.plane.town/";
|
||||
export const PI_BASE_URL = process.env.NEXT_PUBLIC_PI_BASE_URL || "https://dev.plane-pi.plane.town";
|
||||
|
||||
export const ADMIN_BASE_URL = process.env.NEXT_PUBLIC_ADMIN_BASE_URL || "";
|
||||
export const ADMIN_BASE_PATH = process.env.NEXT_PUBLIC_ADMIN_BASE_PATH || "";
|
||||
|
||||
Reference in New Issue
Block a user