Skip to content

Commit 1f8d424

Browse files
update retrospective
1 parent 57e542a commit 1f8d424

2 files changed

Lines changed: 3 additions & 31 deletions

File tree

src/frontend/src/pages/GanttPage/GanttChart/GanttChartSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
RequestEventChange
1313
} from '../../../utils/gantt.utils';
1414
import { Box, Typography } from '@mui/material';
15-
import { RefObject, useCallback, useRef, useState } from 'react';
15+
import { MutableRefObject, useCallback, useRef, useState } from 'react';
1616
import GanttTaskBar from './GanttChartComponents/GanttTaskBar/GanttTaskBar';
1717
import GanttToolTip from './GanttChartComponents/GanttToolTip';
1818
import { ArcherContainer } from 'react-archer';
@@ -30,7 +30,7 @@ interface GanttChartSectionProps<T> {
3030
}
3131

3232
interface GanttTooltipLayerProps {
33-
updateRef: RefObject<(options: OnMouseOverOptions | undefined, y?: number) => void>;
33+
updateRef: MutableRefObject<(options: OnMouseOverOptions | undefined, y?: number) => void>;
3434
}
3535

3636
const GanttTooltipLayer: React.FC<GanttTooltipLayerProps> = ({ updateRef }) => {

src/frontend/src/pages/RetrospectivePage/Retrospective.tsx

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const RetrospectivePage = () => {
4141
const { isLoading: carsIsLoading, isError: carsIsError, data: cars, error: carsError } = useGetAllCars();
4242

4343
const [searchText, setSearchText] = useState<string>('');
44-
const [showWorkPackagesMap, setShowWorkPackagesMap] = useState<Map<string, boolean>>(new Map());
4544
const [collections, setCollections] = useState<GanttCollection<TeamPreview, WbsElementPreview | Task>[]>([]);
4645

4746
const {
@@ -187,7 +186,6 @@ const RetrospectivePage = () => {
187186
const resetHandler = () => {
188187
history.push(routes.RETROSPECTIVE);
189188
localStorage.removeItem('retro-gantt');
190-
showWorkPackagesMap.clear();
191189
};
192190

193191
/***************************************************** */
@@ -220,24 +218,6 @@ const RetrospectivePage = () => {
220218
)
221219
: add(Date.now(), { weeks: 15 });
222220

223-
const collapseHandler = () => {
224-
projects.forEach((project) => {
225-
setShowWorkPackagesMap((prev) => new Map(prev.set(project.id, false)));
226-
});
227-
};
228-
229-
const expandHandler = () => {
230-
projects.forEach((project) => {
231-
setShowWorkPackagesMap((prev) => new Map(prev.set(project.id, true)));
232-
});
233-
};
234-
235-
const elementId = (element: WbsElementPreview | Task) => (element as WbsElementPreview).id || (element as Task).taskId;
236-
237-
const toggleElementShowChildren = (element: WbsElementPreview | Task) => {
238-
setShowWorkPackagesMap((prev) => new Map(prev.set(elementId(element), !prev.get(elementId(element)))));
239-
};
240-
241221
const headerRight = (
242222
<Box sx={{ display: 'flex', gap: 1, justifyContent: 'flex-end', alignItems: 'center' }}>
243223
<GanttChartColorLegend />
@@ -254,8 +234,6 @@ const RetrospectivePage = () => {
254234
overdueHandler={overdueHandler}
255235
hideTasksHandler={hideTasksHandler}
256236
resetHandler={resetHandler}
257-
collapseHandler={collapseHandler}
258-
expandHandler={expandHandler}
259237
/>
260238
</Box>
261239
);
@@ -267,13 +245,7 @@ const RetrospectivePage = () => {
267245
chips={<SearchBar placeholder="Search Project by Name" searchText={searchText} setSearchText={setSearchText} />}
268246
headerRight={headerRight}
269247
>
270-
<GanttChart
271-
collections={collections}
272-
startDate={startDate}
273-
endDate={endDate}
274-
shouldShowChildren={(task) => !!showWorkPackagesMap.get(elementId(task.element))}
275-
onShowChildrenToggle={(task) => toggleElementShowChildren(task.element)}
276-
/>
248+
<GanttChart collections={collections} startDate={startDate} endDate={endDate} />
277249
</PageLayout>
278250
</>
279251
);

0 commit comments

Comments
 (0)