mirror of
https://github.com/makeplane/plane.git
synced 2026-07-14 06:25:58 +02:00
[WEB-4630] fix: mutation issue for scope epics in timeline view #3827
This commit is contained in:
@@ -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;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user