@@ -51,6 +51,11 @@ const PhaseDot = styled.span`
51
51
}
52
52
` ;
53
53
54
+ const NoPhaseText = styled . span `
55
+ margin-left: 12px;
56
+ margin-right: 12px;
57
+ ` ;
58
+
54
59
const StatusSummaryRow = ( { reportResult, testPlanVersion } ) => {
55
60
const [ bulkUpdateTestPlanReportStatusMutation ] = useMutation (
56
61
BULK_UPDATE_TEST_PLAN_REPORT_STATUS_MUTATION
@@ -114,63 +119,69 @@ const StatusSummaryRow = ({ reportResult, testPlanVersion }) => {
114
119
< tr >
115
120
< th >
116
121
{ testPlanVersion . title }
117
- < PhaseText className = { phase . toLowerCase ( ) } >
118
- { phase }
119
- </ PhaseText >
122
+ { Object . entries ( reportResult ) . length > 0 && (
123
+ < PhaseText className = { phase . toLowerCase ( ) } >
124
+ { phase }
125
+ </ PhaseText >
126
+ ) }
120
127
</ th >
121
128
< td >
122
- < Dropdown className = "change-phase" >
123
- < Dropdown . Toggle
124
- id = { nextId ( ) }
125
- ref = { dropdownUpdateReportStatusButtonRef }
126
- variant = "secondary"
127
- aria-label = { `Change test plan phase for ${ testPlanVersion . title } ` }
128
- >
129
- < PhaseDot className = { phase . toLowerCase ( ) } />
130
- { phase }
131
- </ Dropdown . Toggle >
132
- < Dropdown . Menu role = "menu" >
133
- < Dropdown . Item
134
- role = "menuitem"
135
- disabled = { phase === 'Draft' }
136
- onClick = { async ( ) => {
137
- await bulkUpdateReportStatus (
138
- testPlanReports . map ( i => i . id ) ,
139
- 'DRAFT'
140
- ) ;
141
- } }
142
- >
143
- < PhaseDot className = "draft" />
144
- Draft
145
- </ Dropdown . Item >
146
- < Dropdown . Item
147
- role = "menuitem"
148
- disabled = { phase === 'Candidate' }
149
- onClick = { async ( ) => {
150
- await bulkUpdateReportStatus (
151
- testPlanReports . map ( i => i . id ) ,
152
- 'CANDIDATE'
153
- ) ;
154
- } }
155
- >
156
- < PhaseDot className = "candidate" />
157
- Candidate
158
- </ Dropdown . Item >
159
- < Dropdown . Item
160
- role = "menuitem"
161
- disabled = { phase === 'Recommended' }
162
- onClick = { async ( ) => {
163
- await bulkUpdateReportStatus (
164
- testPlanReports . map ( i => i . id ) ,
165
- 'RECOMMENDED'
166
- ) ;
167
- } }
129
+ { ( Object . entries ( reportResult ) . length <= 0 && (
130
+ < NoPhaseText > Not tested</ NoPhaseText >
131
+ ) ) || (
132
+ < Dropdown className = "change-phase" >
133
+ < Dropdown . Toggle
134
+ id = { nextId ( ) }
135
+ ref = { dropdownUpdateReportStatusButtonRef }
136
+ variant = "secondary"
137
+ aria-label = { `Change test plan phase for ${ testPlanVersion . title } ` }
168
138
>
169
- < PhaseDot className = "recommended" />
170
- Recommended
171
- </ Dropdown . Item >
172
- </ Dropdown . Menu >
173
- </ Dropdown >
139
+ < PhaseDot className = { phase . toLowerCase ( ) } />
140
+ { phase }
141
+ </ Dropdown . Toggle >
142
+ < Dropdown . Menu role = "menu" >
143
+ < Dropdown . Item
144
+ role = "menuitem"
145
+ disabled = { phase === 'Draft' }
146
+ onClick = { async ( ) => {
147
+ await bulkUpdateReportStatus (
148
+ testPlanReports . map ( i => i . id ) ,
149
+ 'DRAFT'
150
+ ) ;
151
+ } }
152
+ >
153
+ < PhaseDot className = "draft" />
154
+ Draft
155
+ </ Dropdown . Item >
156
+ < Dropdown . Item
157
+ role = "menuitem"
158
+ disabled = { phase === 'Candidate' }
159
+ onClick = { async ( ) => {
160
+ await bulkUpdateReportStatus (
161
+ testPlanReports . map ( i => i . id ) ,
162
+ 'CANDIDATE'
163
+ ) ;
164
+ } }
165
+ >
166
+ < PhaseDot className = "candidate" />
167
+ Candidate
168
+ </ Dropdown . Item >
169
+ < Dropdown . Item
170
+ role = "menuitem"
171
+ disabled = { phase === 'Recommended' }
172
+ onClick = { async ( ) => {
173
+ await bulkUpdateReportStatus (
174
+ testPlanReports . map ( i => i . id ) ,
175
+ 'RECOMMENDED'
176
+ ) ;
177
+ } }
178
+ >
179
+ < PhaseDot className = "recommended" />
180
+ Recommended
181
+ </ Dropdown . Item >
182
+ </ Dropdown . Menu >
183
+ </ Dropdown >
184
+ ) }
174
185
</ td >
175
186
</ tr >
176
187
0 commit comments