forked from github/plane
fix: bug fixes & improvements (#3159)
* fix: on issue update updates_on not updating * fix: on project change cycle update * fix: update issue
This commit is contained in:
parent
37df0bcdd8
commit
c9792da4a1
@ -34,7 +34,7 @@ export const IssueCycleSelect: React.FC<IssueCycleSelectProps> = observer((props
|
||||
if (workspaceSlug && projectId) cycleStore.fetchCycles(workspaceSlug, projectId, "all");
|
||||
};
|
||||
|
||||
const cycles = cycleStore.projectCycles;
|
||||
const cycles = cycleStore.cycles?.[projectId]?.["all"] ?? [];
|
||||
|
||||
const selectedCycle = cycles ? cycles?.find((i) => i.id === value) : undefined;
|
||||
|
||||
|
@ -182,6 +182,12 @@ export class GlobalIssuesStore extends IssueBaseStore implements IGlobalIssuesSt
|
||||
|
||||
const response = await this.issueService.patchIssue(workspaceSlug, projectId, issueId, data);
|
||||
|
||||
runInAction(() => {
|
||||
_issues = { ...this.issues };
|
||||
_issues[workspaceViewId][issueId] = { ..._issues[workspaceViewId][issueId], ...response };
|
||||
this.issues = _issues;
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
this.fetchIssues(workspaceSlug, workspaceViewId, "mutation");
|
||||
|
@ -239,6 +239,12 @@ export class CycleIssuesStore extends IssueBaseStore implements ICycleIssuesStor
|
||||
|
||||
const response = await this.rootStore.projectIssues.updateIssue(workspaceSlug, projectId, issueId, data);
|
||||
|
||||
runInAction(() => {
|
||||
_issues = { ...this.issues };
|
||||
_issues[cycleId][issueId] = { ..._issues[cycleId][issueId], ...response };
|
||||
this.issues = _issues;
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
this.fetchIssues(workspaceSlug, projectId, "mutation", cycleId);
|
||||
|
@ -158,6 +158,12 @@ export class ProjectDraftIssuesStore extends IssueBaseStore implements IProjectD
|
||||
|
||||
const response = await this.issueDraftService.updateDraftIssue(workspaceSlug, projectId, issueId, data);
|
||||
|
||||
runInAction(() => {
|
||||
_issues = { ...this.issues };
|
||||
_issues[projectId][issueId] = { ..._issues[projectId][issueId], ...response };
|
||||
this.issues = _issues;
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
this.fetchIssues(workspaceSlug, projectId, "mutation");
|
||||
|
@ -231,6 +231,12 @@ export class ModuleIssuesStore extends IssueBaseStore implements IModuleIssuesSt
|
||||
|
||||
const response = await this.rootStore.projectIssues.updateIssue(workspaceSlug, projectId, issueId, data);
|
||||
|
||||
runInAction(() => {
|
||||
_issues = { ...this.issues };
|
||||
_issues[moduleId][issueId] = { ..._issues[moduleId][issueId], ...response };
|
||||
this.issues = _issues;
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
this.fetchIssues(workspaceSlug, projectId, "mutation", moduleId);
|
||||
|
@ -163,6 +163,12 @@ export class ViewIssuesStore extends IssueBaseStore implements IViewIssuesStore
|
||||
|
||||
const response = await this.issueService.patchIssue(workspaceSlug, projectId, issueId, data);
|
||||
|
||||
runInAction(() => {
|
||||
_issues = { ...this.issues };
|
||||
_issues[projectId][issueId] = { ..._issues[projectId][issueId], ...response };
|
||||
this.issues = _issues;
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
this.fetchIssues(workspaceSlug, projectId, "mutation");
|
||||
|
@ -163,6 +163,12 @@ export class ProjectIssuesStore extends IssueBaseStore implements IProjectIssues
|
||||
|
||||
const response = await this.issueService.patchIssue(workspaceSlug, projectId, issueId, data);
|
||||
|
||||
runInAction(() => {
|
||||
_issues = { ...this.issues };
|
||||
_issues[projectId][issueId] = { ..._issues[projectId][issueId], ...response };
|
||||
this.issues = _issues;
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
this.fetchIssues(workspaceSlug, projectId, "mutation");
|
||||
|
Loading…
Reference in New Issue
Block a user