forked from github/plane
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:
parent
f3ae57bc85
commit
c6b756d918
@ -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>
|
||||
|
@ -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",
|
||||
},
|
||||
];
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user