forked from github/plane
fix: cycle and module sidebar mutation fix (#3521)
* fix: cycle and module sidebar mutation * fix: cycle and module calendar drag n drop fix
This commit is contained in:
parent
3a4c893368
commit
2c67aced15
@ -587,6 +587,7 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{cycleDetails && cycleDetails.distribution && (
|
||||||
<div className="relative h-40 w-80">
|
<div className="relative h-40 w-80">
|
||||||
<ProgressChart
|
<ProgressChart
|
||||||
distribution={cycleDetails.distribution?.completion_chart ?? {}}
|
distribution={cycleDetails.distribution?.completion_chart ?? {}}
|
||||||
@ -595,6 +596,7 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
totalIssues={cycleDetails.total_issues}
|
totalIssues={cycleDetails.total_issues}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
|
@ -61,7 +61,8 @@ export const BaseCalendarRoot = observer((props: IBaseCalendarRoot) => {
|
|||||||
projectId?.toString(),
|
projectId?.toString(),
|
||||||
issueStore,
|
issueStore,
|
||||||
issueMap,
|
issueMap,
|
||||||
groupedIssueIds
|
groupedIssueIds,
|
||||||
|
viewId
|
||||||
).catch((err) => {
|
).catch((err) => {
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
|
@ -200,6 +200,7 @@ export class CycleIssues extends IssueHelperStore implements ICycleIssues {
|
|||||||
if (!cycleId) throw new Error("Cycle Id is required");
|
if (!cycleId) throw new Error("Cycle Id is required");
|
||||||
|
|
||||||
const response = await this.rootIssueStore.projectIssues.updateIssue(workspaceSlug, projectId, issueId, data);
|
const response = await this.rootIssueStore.projectIssues.updateIssue(workspaceSlug, projectId, issueId, data);
|
||||||
|
this.rootIssueStore.rootStore.cycle.fetchCycleDetails(workspaceSlug, projectId, cycleId);
|
||||||
return response;
|
return response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.fetchIssues(workspaceSlug, projectId, "mutation", cycleId);
|
this.fetchIssues(workspaceSlug, projectId, "mutation", cycleId);
|
||||||
@ -267,9 +268,7 @@ export class CycleIssues extends IssueHelperStore implements ICycleIssues {
|
|||||||
});
|
});
|
||||||
|
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
update(this.issues, cycleId, (cycleIssueIds = []) => {
|
update(this.issues, cycleId, (cycleIssueIds = []) => uniq(concat(cycleIssueIds, issueIds)));
|
||||||
return uniq(concat(cycleIssueIds, issueIds));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
issueIds.forEach((issueId) => {
|
issueIds.forEach((issueId) => {
|
||||||
this.rootStore.issues.updateIssue(issueId, { cycle_id: cycleId });
|
this.rootStore.issues.updateIssue(issueId, { cycle_id: cycleId });
|
||||||
|
@ -205,6 +205,7 @@ export class ModuleIssues extends IssueHelperStore implements IModuleIssues {
|
|||||||
if (!moduleId) throw new Error("Module Id is required");
|
if (!moduleId) throw new Error("Module Id is required");
|
||||||
|
|
||||||
const response = await this.rootIssueStore.projectIssues.updateIssue(workspaceSlug, projectId, issueId, data);
|
const response = await this.rootIssueStore.projectIssues.updateIssue(workspaceSlug, projectId, issueId, data);
|
||||||
|
this.rootIssueStore.rootStore.module.fetchModuleDetails(workspaceSlug, projectId, moduleId);
|
||||||
return response;
|
return response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.fetchIssues(workspaceSlug, projectId, "mutation", moduleId);
|
this.fetchIssues(workspaceSlug, projectId, "mutation", moduleId);
|
||||||
|
@ -38,6 +38,8 @@ export interface IIssueRootStore {
|
|||||||
members: string[] | undefined;
|
members: string[] | undefined;
|
||||||
projects: string[] | undefined;
|
projects: string[] | undefined;
|
||||||
|
|
||||||
|
rootStore: RootStore;
|
||||||
|
|
||||||
issues: IIssueStore;
|
issues: IIssueStore;
|
||||||
|
|
||||||
state: IStateStore;
|
state: IStateStore;
|
||||||
@ -87,6 +89,8 @@ export class IssueRootStore implements IIssueRootStore {
|
|||||||
members: string[] | undefined = undefined;
|
members: string[] | undefined = undefined;
|
||||||
projects: string[] | undefined = undefined;
|
projects: string[] | undefined = undefined;
|
||||||
|
|
||||||
|
rootStore: RootStore;
|
||||||
|
|
||||||
issues: IIssueStore;
|
issues: IIssueStore;
|
||||||
|
|
||||||
state: IStateStore;
|
state: IStateStore;
|
||||||
@ -136,6 +140,8 @@ export class IssueRootStore implements IIssueRootStore {
|
|||||||
projects: observable,
|
projects: observable,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.rootStore = rootStore;
|
||||||
|
|
||||||
autorun(() => {
|
autorun(() => {
|
||||||
if (rootStore.user.currentUser?.id) this.currentUserId = rootStore.user.currentUser?.id;
|
if (rootStore.user.currentUser?.id) this.currentUserId = rootStore.user.currentUser?.id;
|
||||||
if (rootStore.app.router.workspaceSlug) this.workspaceSlug = rootStore.app.router.workspaceSlug;
|
if (rootStore.app.router.workspaceSlug) this.workspaceSlug = rootStore.app.router.workspaceSlug;
|
||||||
|
Loading…
Reference in New Issue
Block a user