|
|
|
@@ -561,7 +561,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
|
|
|
|
this.addIssue(response, shouldUpdateList);
|
|
|
|
|
|
|
|
|
|
// If shouldUpdateList is true, call fetchParentStats
|
|
|
|
|
shouldUpdateList && (await this.fetchParentStats(workspaceSlug, projectId));
|
|
|
|
|
if (shouldUpdateList) await this.fetchParentStats(workspaceSlug, projectId);
|
|
|
|
|
|
|
|
|
|
updatePersistentLayer(response.id);
|
|
|
|
|
|
|
|
|
@@ -675,6 +675,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
|
|
|
|
|
|
|
|
|
// Male API call
|
|
|
|
|
await this.issueService.deleteIssue(workspaceSlug, projectId, issueId);
|
|
|
|
|
|
|
|
|
|
// Remove from Respective issue Id list
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
this.removeIssueFromList(issueId);
|
|
|
|
@@ -682,7 +683,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
|
|
|
|
// call fetch Parent stats
|
|
|
|
|
this.fetchParentStats(workspaceSlug, projectId);
|
|
|
|
|
// Remove issue from main issue Map store
|
|
|
|
|
this.rootIssueStore.issues.removeIssue(issueId);
|
|
|
|
|
this.removeIssuesRecursively(issueId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@@ -757,7 +758,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
issueIds.forEach((issueId) => {
|
|
|
|
|
this.removeIssueFromList(issueId);
|
|
|
|
|
this.rootIssueStore.issues.removeIssue(issueId);
|
|
|
|
|
this.removeIssuesRecursively(issueId);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return response;
|
|
|
|
@@ -932,7 +933,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
|
|
|
|
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
// If cycle Id is the current cycle Id, then, remove issue from list of issueIds
|
|
|
|
|
this.cycleId === cycleId && this.removeIssueFromList(issueId);
|
|
|
|
|
if (this.cycleId === cycleId) this.removeIssueFromList(issueId);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// update Issue cycle Id to null by calling current store's update Issue, without making an API call
|
|
|
|
@@ -1062,7 +1063,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
|
|
|
|
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
// if module Id is the current Module Id, then, add issue to list of issueIds
|
|
|
|
|
this.moduleId === moduleId && issueIds.forEach((issueId) => this.addIssueToList(issueId));
|
|
|
|
|
if (this.moduleId === moduleId) issueIds.forEach((issueId) => this.addIssueToList(issueId));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// For Each issue update module Ids by calling current store's update Issue, without making an API call
|
|
|
|
@@ -1090,7 +1091,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
|
|
|
|
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
// if module Id is the current Module Id, then remove issue from list of issueIds
|
|
|
|
|
this.moduleId === moduleId && issueIds.forEach((issueId) => this.removeIssueFromList(issueId));
|
|
|
|
|
if (this.moduleId === moduleId) issueIds.forEach((issueId) => this.removeIssueFromList(issueId));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// For Each issue update module Ids by calling current store's update Issue, without making an API call
|
|
|
|
@@ -1163,7 +1164,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
|
|
|
|
// remove the new issue id to the module issues
|
|
|
|
|
removeModuleIds.forEach((moduleId) => {
|
|
|
|
|
// If module Id is equal to current module Id, them remove Issue from List
|
|
|
|
|
this.moduleId === moduleId && this.removeIssueFromList(issueId);
|
|
|
|
|
if (this.moduleId === moduleId) this.removeIssueFromList(issueId);
|
|
|
|
|
currentModuleIds = pull(currentModuleIds, moduleId);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@@ -1259,6 +1260,12 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
|
|
|
|
*/
|
|
|
|
|
removeIssueFromList(issueId: string) {
|
|
|
|
|
const issue = this.rootIssueStore.issues.getIssueById(issueId);
|
|
|
|
|
const subIssueIds = this.rootIssueStore.rootStore.issue.issueDetail.subIssues.subIssuesByIssueId(issueId);
|
|
|
|
|
if (subIssueIds) {
|
|
|
|
|
subIssueIds.forEach((subIssueId) => {
|
|
|
|
|
this.removeIssueFromList(subIssueId);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.updateIssueList(undefined, issue, EIssueGroupedAction.DELETE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2036,4 +2043,14 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
|
|
|
|
subGroupId
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
removeIssuesRecursively = (issueId: string) => {
|
|
|
|
|
// get sub issues by issue id
|
|
|
|
|
const subIssues = this.rootIssueStore.rootStore.issue.issueDetail.subIssues.subIssuesByIssueId(issueId);
|
|
|
|
|
if (subIssues) {
|
|
|
|
|
subIssues.forEach((subIssueId) => this.removeIssuesRecursively(subIssueId));
|
|
|
|
|
}
|
|
|
|
|
// remove issue
|
|
|
|
|
this.rootIssueStore.issues.removeIssue(issueId);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|