diff --git a/web/components/cycles/active-cycle-details.tsx b/web/components/cycles/active-cycle-details.tsx index e5cd91e25..df12f835d 100644 --- a/web/components/cycles/active-cycle-details.tsx +++ b/web/components/cycles/active-cycle-details.tsx @@ -250,10 +250,11 @@ export const ActiveCycleDetails: React.FC = observer((props - - - View Cycle - + + View Cycle diff --git a/web/constants/cycle.ts b/web/constants/cycle.ts index da8d07b2b..406fc7303 100644 --- a/web/constants/cycle.ts +++ b/web/constants/cycle.ts @@ -104,13 +104,13 @@ export const CYCLE_STATE_GROUPS_DETAILS = [ color: "#FFC53D", }, { - key: "cancelled_issues", - title: "Cancelled", + key: "completed_issues", + title: "Completed", color: "#d687ff", }, { - key: "completed_issues", - title: "Completed", + key: "cancelled_issues", + title: "Cancelled", color: "#ef4444", }, ]; diff --git a/web/store/issue/cycle/issue.store.ts b/web/store/issue/cycle/issue.store.ts index 479fa4bf0..5519aa045 100644 --- a/web/store/issue/cycle/issue.store.ts +++ b/web/store/issue/cycle/issue.store.ts @@ -182,13 +182,6 @@ export class CycleIssues extends IssueHelperStore implements ICycleIssues { const response = await this.rootIssueStore.projectIssues.createIssue(workspaceSlug, projectId, data); await this.addIssueToCycle(workspaceSlug, projectId, cycleId, [response.id]); - runInAction(() => { - update(this.issues, cycleId, (cycleIssueIds) => { - if (!cycleIssueIds) return [response.id]; - else return concat(cycleIssueIds, [response.id]); - }); - }); - return response; } catch (error) { throw error; @@ -272,8 +265,11 @@ export class CycleIssues extends IssueHelperStore implements ICycleIssues { issues: issueIds, }); - issueIds.map((issueId) => { - this.rootIssueStore.issues.updateIssue(issueId, { cycle_id: cycleId }); + runInAction(() => { + update(this.issues, cycleId, (cycleIssueIds) => { + if (!cycleIssueIds) return [...issueIds]; + else return concat(cycleIssueIds, [...issueIds]); + }); }); return issueToCycle; diff --git a/web/store/issue/module/issue.store.ts b/web/store/issue/module/issue.store.ts index 580373416..4a51bdc0a 100644 --- a/web/store/issue/module/issue.store.ts +++ b/web/store/issue/module/issue.store.ts @@ -175,13 +175,6 @@ export class ModuleIssues extends IssueHelperStore implements IModuleIssues { const response = await this.rootIssueStore.projectIssues.createIssue(workspaceSlug, projectId, data); await this.addIssueToModule(workspaceSlug, projectId, moduleId, [response.id]); - runInAction(() => { - update(this.issues, moduleId, (moduleIssueIds) => { - if (!moduleIssueIds) return [response.id]; - else return concat(moduleIssueIds, [response.id]); - }); - }); - return response; } catch (error) { throw error; @@ -264,8 +257,11 @@ export class ModuleIssues extends IssueHelperStore implements IModuleIssues { issues: issueIds, }); - issueIds.map((issueId) => { - this.rootIssueStore.issues.updateIssue(issueId, { module_id: moduleId }); + runInAction(() => { + update(this.issues, moduleId, (moduleIssueIds) => { + if (!moduleIssueIds) return [...issueIds]; + else return concat(moduleIssueIds, [...issueIds]); + }); }); return issueToModule;