Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

chore: module and cycle bug fixes (#3435)

Anmol Singh Bhatiac6b756d918f3
diff --git a/web/components/cycles/active-cycle-details.tsx b/web/components/cycles/active-cycle-details.tsx
index e5cd91e25a..df12f835d6 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<IActiveCycleDetails> = observer((props
</div>
</div>
- <Link href={`/${workspaceSlug}/projects/${projectId}/cycles/${activeCycle.id}`}>
- <span className="w-full rounded-md bg-custom-primary px-4 py-2 text-center text-sm font-medium text-white hover:bg-custom-primary/90">
- View Cycle
- </span>
+ <Link
+ href={`/${workspaceSlug}/projects/${projectId}/cycles/${activeCycle.id}`}
+ className="w-min text-nowrap rounded-md bg-custom-primary px-4 py-2 text-center text-sm font-medium text-white hover:bg-custom-primary/90"
+ >
+ View Cycle
</Link>
</div>
</div>
diff --git a/web/constants/cycle.ts b/web/constants/cycle.ts
index da8d07b2b5..406fc73032 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 479fa4bf01..5519aa045b 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 580373416c..4a51bdc0a2 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;