[WEB-2121] fix: project issue creation (#5266)
* fix: project issue creation * fix: refactored
This commit is contained in:
parent
569b592711
commit
dd3df20319
1 changed files with 23 additions and 2 deletions
|
|
@ -1,6 +1,13 @@
|
|||
import { action, makeObservable, runInAction, } from "mobx";
|
||||
import { action, makeObservable, runInAction } from "mobx";
|
||||
// types
|
||||
import { TIssue, TLoader, ViewFlags, IssuePaginationOptions, TIssuesResponse, TBulkOperationsPayload } from "@plane/types";
|
||||
import {
|
||||
TIssue,
|
||||
TLoader,
|
||||
ViewFlags,
|
||||
IssuePaginationOptions,
|
||||
TIssuesResponse,
|
||||
TBulkOperationsPayload,
|
||||
} from "@plane/types";
|
||||
// helpers
|
||||
// base class
|
||||
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
|
||||
|
|
@ -44,6 +51,7 @@ export class ProjectIssues extends BaseIssuesStore implements IProjectIssues {
|
|||
enableIssueCreation: true,
|
||||
enableInlineEditing: true,
|
||||
};
|
||||
router;
|
||||
|
||||
// filter store
|
||||
issueFilterStore: IProjectIssuesFilter;
|
||||
|
|
@ -59,6 +67,7 @@ export class ProjectIssues extends BaseIssuesStore implements IProjectIssues {
|
|||
});
|
||||
// filter store
|
||||
this.issueFilterStore = issueFilterStore;
|
||||
this.router = _rootStore.rootStore.router;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -165,6 +174,18 @@ export class ProjectIssues extends BaseIssuesStore implements IProjectIssues {
|
|||
return await this.fetchIssues(workspaceSlug, projectId, loadType, this.paginationOptions, true);
|
||||
};
|
||||
|
||||
/**
|
||||
* Override inherited create issue, to update list only if user is on current project
|
||||
* @param workspaceSlug
|
||||
* @param projectId
|
||||
* @param data
|
||||
* @returns
|
||||
*/
|
||||
override createIssue = async (workspaceSlug: string, projectId: string, data: Partial<TIssue>) => {
|
||||
const response = await super.createIssue(workspaceSlug, projectId, data, "", projectId === this.router.projectId);
|
||||
return response;
|
||||
};
|
||||
|
||||
// Using aliased names as they cannot be overridden in other stores
|
||||
archiveBulkIssues = this.bulkArchiveIssues;
|
||||
quickAddIssue = this.issueQuickAdd;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue