mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: resolved issue creation error in layouts while group_by and sub_group_by filters applied in quick add (#4761)
This commit is contained in:
parent
346bc2afe2
commit
59376ee3da
@ -7,7 +7,14 @@ import set from "lodash/set";
|
||||
import uniq from "lodash/uniq";
|
||||
import update from "lodash/update";
|
||||
// types
|
||||
import { TIssue, TLoader, IssuePaginationOptions, TIssuesResponse, ViewFlags, TBulkOperationsPayload } from "@plane/types";
|
||||
import {
|
||||
TIssue,
|
||||
TLoader,
|
||||
IssuePaginationOptions,
|
||||
TIssuesResponse,
|
||||
ViewFlags,
|
||||
TBulkOperationsPayload,
|
||||
} from "@plane/types";
|
||||
import { IIssueRootStore } from "../root.store";
|
||||
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
|
||||
import { ICycleIssuesFilter } from "./filter.store";
|
||||
@ -391,9 +398,13 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
|
||||
this.rootIssueStore.issues.removeIssue(data.id);
|
||||
});
|
||||
|
||||
if (data.module_ids && data.module_ids.length > 0) {
|
||||
await this.changeModulesInIssue(workspaceSlug, projectId, response.id, data.module_ids, []);
|
||||
const currentModuleIds =
|
||||
data.module_ids && data.module_ids.length > 0 ? data.module_ids.filter((moduleId) => moduleId != "None") : [];
|
||||
|
||||
if (currentModuleIds.length > 0) {
|
||||
await this.changeModulesInIssue(workspaceSlug, projectId, response.id, currentModuleIds, []);
|
||||
}
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
|
@ -680,12 +680,20 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
this.rootIssueStore.issues.removeIssue(data.id);
|
||||
});
|
||||
|
||||
if (data.cycle_id && data.cycle_id !== "" && !this.cycleId) {
|
||||
await this.addCycleToIssue(workspaceSlug, projectId, data.cycle_id, response.id);
|
||||
const currentCycleId = data.cycle_id !== "" && data.cycle_id === "None" ? undefined : data.cycle_id;
|
||||
const currentModuleIds =
|
||||
data.module_ids && data.module_ids.length > 0 ? data.module_ids.filter((moduleId) => moduleId != "None") : [];
|
||||
|
||||
const promiseRequests = [];
|
||||
if (currentCycleId) {
|
||||
promiseRequests.push(this.addCycleToIssue(workspaceSlug, projectId, currentCycleId, response.id));
|
||||
}
|
||||
if (currentModuleIds.length > 0) {
|
||||
promiseRequests.push(this.changeModulesInIssue(workspaceSlug, projectId, response.id, currentModuleIds, []));
|
||||
}
|
||||
|
||||
if (data.module_ids && data.module_ids.length > 0 && !this.moduleId) {
|
||||
await this.changeModulesInIssue(workspaceSlug, projectId, response.id, data.module_ids, []);
|
||||
if (promiseRequests && promiseRequests.length > 0) {
|
||||
await Promise.all(promiseRequests);
|
||||
}
|
||||
|
||||
return response;
|
||||
|
@ -234,9 +234,12 @@ export class ModuleIssues extends BaseIssuesStore implements IModuleIssues {
|
||||
this.rootIssueStore.issues.removeIssue(data.id);
|
||||
});
|
||||
|
||||
if (data.cycle_id && data.cycle_id !== "") {
|
||||
await this.addCycleToIssue(workspaceSlug, projectId, data.cycle_id, response.id);
|
||||
const currentCycleId = data.cycle_id !== "" && data.cycle_id === "None" ? undefined : data.cycle_id;
|
||||
|
||||
if (currentCycleId) {
|
||||
await this.addCycleToIssue(workspaceSlug, projectId, currentCycleId, response.id);
|
||||
}
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
|
Loading…
Reference in New Issue
Block a user