chore: module and cycle bug fixes (#3435)

* chore: project active cycle improvement

* chore: cycle and module add existing mutation fix
This commit is contained in:
Anmol Singh Bhatia 2024-01-23 15:57:26 +05:30 committed by GitHub
parent f3ae57bc85
commit c6b756d918
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 26 deletions

View File

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

View File

@ -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",
},
];

View File

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

View File

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