@@ -3,13 +3,15 @@ import { grey } from '@mui/material/colors';
33import { ArrowDropDownIcon } from '@mui/x-date-pickers' ;
44import { useHistory } from 'react-router-dom' ;
55import {
6+ GanttDesignReviewStatusColorPipe ,
67 GanttTask ,
78 isHighlightedChangeOnGanttTask ,
89 RequestEventChange ,
10+ transformDesignReviewToGanttTask ,
911 transformWorkPackageToGanttTask
1012} from '../../../../utils/gantt.utils' ;
1113import { routes } from '../../../../utils/routes' ;
12- import { wbsPipe } from 'shared' ;
14+ import { addWeeksToDate , DesignReview , wbsPipe } from 'shared' ;
1315import {
1416 ganttTaskBarBackgroundStyles ,
1517 ganttTaskBarContainerStyles ,
@@ -19,6 +21,7 @@ import {
1921} from './GanttTaskBarDisplayStyles' ;
2022import { CSSProperties } from 'react' ;
2123import { ArcherElement } from 'react-archer' ;
24+ import { datePipe } from '../../../../utils/pipes' ;
2225
2326interface GanttTaskBarDisplayProps {
2427 days : Date [ ] ;
@@ -87,6 +90,20 @@ const GanttTaskBarDisplay = ({
8790 } ;
8891 } ;
8992
93+ const ganttTaskBarDesignReviewOverlayStyles = ( designReview : DesignReview ) : CSSProperties => {
94+ return {
95+ gridColumnStart : getStartCol ( designReview . dateScheduled ) ,
96+ gridColumnEnd : getEndCol ( addWeeksToDate ( designReview . dateScheduled , 1 ) ) ,
97+ height : '2rem' ,
98+ border : `1px solid ${ theme . palette . divider } ` ,
99+ borderRadius : '0.25rem' ,
100+ backgroundColor : GanttDesignReviewStatusColorPipe ( designReview . status ) ,
101+ cursor : 'pointer' ,
102+ gridRow : 1 ,
103+ zIndex : 2
104+ } ;
105+ } ;
106+
90107 const highlightedChangeBoxStyles = ( highlightedChange : RequestEventChange ) : CSSProperties => {
91108 return {
92109 paddingTop : '2px' ,
@@ -159,6 +176,24 @@ const GanttTaskBarDisplay = ({
159176 />
160177 ) ;
161178 } ) }
179+ { task . designReviews . map ( ( designReview ) => {
180+ return (
181+ < div
182+ style = { ganttTaskBarDesignReviewOverlayStyles ( designReview ) }
183+ onMouseOver = { ( e ) => handleOnMouseOver ( e , transformDesignReviewToGanttTask ( designReview ) ) }
184+ onMouseLeave = { handleOnMouseLeave }
185+ onClick = { ( ) => history . push ( `${ routes . CALENDAR } /${ designReview . designReviewId } ` ) }
186+ >
187+ < Typography
188+ variant = "body1"
189+ sx = { taskNameContainerStyles ( task ) }
190+ onClick = { ( ) => history . push ( `${ routes . CALENDAR } /${ designReview . designReviewId } ` ) }
191+ >
192+ { datePipe ( designReview . dateScheduled , false ) }
193+ </ Typography >
194+ </ div >
195+ ) ;
196+ } ) }
162197 { highlightedChange && isHighlightedChangeOnGanttTask ( highlightedChange , task ) && (
163198 < div id = "proposedChange" style = { highlightedChangeBoxStyles ( highlightedChange ) } >
164199 < Typography
0 commit comments