55
66import { User , WorkPackageStage } from 'shared' ;
77import { fullNamePipe } from '../../../utils/pipes' ;
8- import PageBlock from '../../../layouts/PageBlock' ;
9- import { FormControl , FormLabel , Grid , MenuItem , TextField } from '@mui/material' ;
8+ import { FormControl , FormLabel , Grid , MenuItem , TextField , Typography } from '@mui/material' ;
109import ReactHookTextField from '../../../components/ReactHookTextField' ;
1110import { Control , Controller , FieldErrorsImpl } from 'react-hook-form' ;
1211import { DatePicker } from '@mui/x-date-pickers' ;
1312import NERAutocomplete from '../../../components/NERAutocomplete' ;
1413import { WorkPackageEditFormPayload } from './WorkPackageEditContainer' ;
14+ import ChangeRequestDropdown from '../../../components/ChangeRequestDropdown' ;
15+ import { Box } from '@mui/system' ;
1516
1617interface Props {
1718 lead ?: string ;
@@ -24,7 +25,7 @@ interface Props {
2425 errors : Partial < FieldErrorsImpl < WorkPackageEditFormPayload > > ;
2526}
2627
27- const WorkPackageEditDetails : React . FC < Props > = ( {
28+ const WorkPackageFormDetails : React . FC < Props > = ( {
2829 lead,
2930 manager,
3031 setManager,
@@ -45,7 +46,7 @@ const WorkPackageEditDetails: React.FC<Props> = ({
4546
4647 const StageSelect = ( ) => (
4748 < FormControl fullWidth >
48- < FormLabel > Stage Select </ FormLabel >
49+ < FormLabel > Work Package Stage </ FormLabel >
4950 < Controller
5051 name = "stage"
5152 control = { control }
@@ -64,9 +65,12 @@ const WorkPackageEditDetails: React.FC<Props> = ({
6465 ) ;
6566
6667 return (
67- < PageBlock title = "Work Package Details" >
68- < Grid container xs = { 12 } >
69- < Grid item xs = { 12 } md = { 5 } sx = { { mt : 2 , mr : 2 } } >
68+ < Box >
69+ < Typography variant = "h5" sx = { { marginBottom : '10px' , color : 'white' } } >
70+ Project Details
71+ </ Typography >
72+ < Grid container spacing = { 1 } xs = { 12 } >
73+ < Grid item xs = { 12 } md = { 4 } >
7074 < FormControl fullWidth >
7175 < FormLabel > Work Package Name</ FormLabel >
7276 < ReactHookTextField
@@ -77,7 +81,13 @@ const WorkPackageEditDetails: React.FC<Props> = ({
7781 />
7882 </ FormControl >
7983 </ Grid >
80- < Grid item xs = { 12 } md = { 2 } sx = { { mt : 2 , mr : 2 } } >
84+ < Grid item xs = { 12 } md = { 3 } >
85+ < ChangeRequestDropdown control = { control } name = "crId" errors = { errors } changeHeight = { 56 } />
86+ </ Grid >
87+ < Grid item xs = { 12 } md = { 3 } >
88+ < StageSelect />
89+ </ Grid >
90+ < Grid item xs = { 12 } md = { 2 } >
8191 < FormControl fullWidth sx = { { overflow : 'hidden' } } >
8292 < FormLabel sx = { { whiteSpace : 'noWrap' } } > Start Date (YYYY-MM-DD)</ FormLabel >
8393 < Controller
@@ -99,10 +109,7 @@ const WorkPackageEditDetails: React.FC<Props> = ({
99109 />
100110 </ FormControl >
101111 </ Grid >
102- < Grid item xs = { 12 } md = { 2 } sx = { { mt : 2 , mr : 2 } } >
103- < StageSelect />
104- </ Grid >
105- < Grid item xs = { 12 } md = { 2 } sx = { { mt : 2 , mr : 2 } } >
112+ < Grid item xs = { 12 } md = { 2 } >
106113 < FormControl fullWidth >
107114 < FormLabel > Duration</ FormLabel >
108115 < ReactHookTextField
@@ -114,10 +121,10 @@ const WorkPackageEditDetails: React.FC<Props> = ({
114121 />
115122 </ FormControl >
116123 </ Grid >
117- < Grid item xs = { 12 } md = { 6 } sx = { { mt : 1 } } >
124+ < Grid item xs = { 12 } md = { 5 } >
118125 < FormLabel > Project Lead</ FormLabel >
119126 < NERAutocomplete
120- sx = { { mt : 1 , width : '90 %' } }
127+ sx = { { width : '100 %' } }
121128 id = "project-lead-autocomplete"
122129 onChange = { ( _event , value ) => setLead ( value ?. id ) }
123130 options = { usersForProjectLead . map ( userToOption ) }
@@ -126,10 +133,10 @@ const WorkPackageEditDetails: React.FC<Props> = ({
126133 value = { userToOption ( usersForProjectLead . find ( ( user ) => user . userId . toString ( ) === lead ) ) }
127134 />
128135 </ Grid >
129- < Grid item xs = { 12 } md = { 6 } sx = { { mt : 1 } } >
136+ < Grid item xs = { 12 } md = { 5 } >
130137 < FormLabel > Project Manager</ FormLabel >
131138 < NERAutocomplete
132- sx = { { mt : 1 , width : '90 %' } }
139+ sx = { { width : '100 %' } }
133140 id = "project-manager-autocomplete"
134141 onChange = { ( _event , value ) => setManager ( value ?. id ) }
135142 options = { usersForProjectManager . map ( userToOption ) }
@@ -139,8 +146,8 @@ const WorkPackageEditDetails: React.FC<Props> = ({
139146 />
140147 </ Grid >
141148 </ Grid >
142- </ PageBlock >
149+ </ Box >
143150 ) ;
144151} ;
145152
146- export default WorkPackageEditDetails ;
153+ export default WorkPackageFormDetails ;
0 commit comments