[WEB-4630] fix: mutation issue for scope epics in timeline view #3827

This commit is contained in:
Vamsi Krishna
2025-08-04 17:26:34 +05:30
committed by GitHub
parent 2f0438d876
commit babbcfe667
2 changed files with 12 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import set from "lodash/set";
import { action, autorun, makeObservable, observable } from "mobx";
// Store
import { computedFn } from "mobx-utils";
import { EGanttBlockType, TGanttBlockGroup } from "@plane/types";
import { RootStore } from "@/plane-web/store/root.store";
import { BaseTimeLineStore, IBaseTimelineStore } from "@/plane-web/store/timeline/base-timeline.store";
@@ -43,14 +44,19 @@ export class GroupedTimeLineStore extends BaseTimeLineStore implements IBaseTime
this.setBlockIds(flattenedBlockIds);
};
getGroupedBlockIds = (): TGanttBlockGroup[] => {
getGroupedBlockIds = computedFn((): TGanttBlockGroup[] => {
const groupBlockIds: TGanttBlockGroup[] = this.blockGroups.map((group) => ({
type: group,
blockIds: [],
count: 0,
}));
Object.entries(this.blocksMap).forEach(([blockId, block]) => {
if (!this.blockIds) return groupBlockIds;
this.blockIds.forEach((blockId) => {
const block = this.blocksMap[blockId];
if (!block) return;
const type = block.meta?.type as EGanttBlockType;
if (type) {
const group = groupBlockIds.find((group) => group.type === type);
@@ -66,5 +72,5 @@ export class GroupedTimeLineStore extends BaseTimeLineStore implements IBaseTime
});
return groupBlockIds;
};
});
}

View File

@@ -29,6 +29,9 @@ export const Logo: FC<Props> = (props) => {
// destructuring the logo object
const { in_use, emoji, icon } = logo;
// if no in_use value, return empty fragment
if (!in_use) return <></>;
// derived values
const value = in_use === "emoji" ? emoji?.value : icon?.name;
const color = icon?.color;