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:
Lakhan Baheti 2023-12-18 14:59:25 +05:30 committed by GitHub
parent 37df0bcdd8
commit c9792da4a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 37 additions and 1 deletions

View File

@ -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;

View File

@ -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");

View File

@ -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);

View File

@ -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");

View File

@ -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);

View File

@ -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");

View File

@ -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");