File tree Expand file tree Collapse file tree
src/frontend/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,18 +14,15 @@ import { Link as RouterLink } from 'react-router-dom';
1414import { fullNamePipe } from '../utils/pipes' ;
1515import { ChangeRequestTypeTextPipe , ChangeRequestStatusTextPipe } from '../utils/enum-pipes' ;
1616
17- // Might not be the best way to do this. Open for suggestions.
1817const determineChangeRequestTypeView = ( cr : ChangeRequest ) => {
19- switch ( cr . type ) {
20- case ChangeRequestType . Activation : // could just be done in an if with && let me know your thoughts
21- case ChangeRequestType . StageGate :
22- return cr . status === ChangeRequestStatus . Implemented ? (
23- < ImplementedCardDetails cr = { cr } />
24- ) : (
25- < StageGateActivationCardDetails cr = { cr } />
26- ) ;
27- default :
28- return < StandardCardDetails cr = { cr as StandardChangeRequest } /> ;
18+ if ( cr . type === ChangeRequestType . Activation || cr . type === ChangeRequestType . StageGate ) {
19+ return cr . status === ChangeRequestStatus . Implemented ? (
20+ < ImplementedCardDetails cr = { cr } />
21+ ) : (
22+ < StageGateActivationCardDetails cr = { cr } />
23+ ) ;
24+ } else {
25+ return < StandardCardDetails cr = { cr as StandardChangeRequest } /> ;
2926 }
3027} ;
3128
You can’t perform that action at this time.
0 commit comments