Skip to content

Commit 260c55b

Browse files
committed
fix: review comment
1 parent 900b83d commit 260c55b

File tree

2 files changed

+45
-23
lines changed

2 files changed

+45
-23
lines changed

src/components/bulkEdits/BulkEdits.tsx

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ class BulkEdits extends Component<BulkEditsProps, BulkEditsState> {
354354
/>
355355
</div>
356356
<div
357-
className="bulk-output-body cn-9 fs-13 p-20 dc__overflow-auto flexbox-col flex-grow-1"
357+
className="cn-9 fs-13 p-20 dc__overflow-auto flexbox-col flex-grow-1"
358358
data-testid="output-message"
359359
>
360360
{this.renderOutputContent()}
@@ -371,13 +371,25 @@ class BulkEdits extends Component<BulkEditsProps, BulkEditsState> {
371371
return <Progressing pageLoader />
372372
}
373373

374-
return outputResult ? (
375-
<div>
374+
if (!outputResult) {
375+
return (
376+
<GenericSectionErrorState
377+
useInfoIcon
378+
title="Nothing to show yet"
379+
subTitle="Enter a valid payload and click Run to see the operation result."
380+
description=""
381+
rootClassName="flex-grow-1"
382+
/>
383+
)
384+
}
385+
386+
return (
387+
<div className="bulk-output-body">
376388
{renderConfigMapOutput(outputResult.configMap)}
377389
{renderDeploymentTemplateOutput(outputResult.deploymentTemplate)}
378390
{renderSecretOutput(outputResult.secret)}
379391
</div>
380-
) : null
392+
)
381393
}
382394

383395
renderConfigMapImpObj = () => {
@@ -467,14 +479,24 @@ class BulkEdits extends Component<BulkEditsProps, BulkEditsState> {
467479
return <Progressing pageLoader />
468480
}
469481

470-
return impactedObjects ? (
471-
<div>
482+
if (!impactedObjects) {
483+
return (
484+
<GenericSectionErrorState
485+
useInfoIcon
486+
title="Nothing to show yet"
487+
subTitle="Enter a valid payload and click Show Impacted Objects to see which applications will be affected."
488+
description=""
489+
rootClassName="flex-grow-1"
490+
/>
491+
)
492+
}
493+
494+
return (
495+
<div className="bulk-output-body">
472496
{this.renderConfigMapImpObj()}
473497
{this.renderDeploymentTemplateImpObj()}
474498
{this.renderSecretImpObj()}
475499
</div>
476-
) : (
477-
''
478500
)
479501
}
480502

src/components/bulkEdits/bulkedit.utils.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const renderConfigMapOutput = (configMap) => {
5252
<div>
5353
#Message: <br />
5454
<br />
55-
{configMap?.message?.map((elm) => {
55+
{configMap.message?.map((elm) => {
5656
return (
5757
<>
5858
{elm}
@@ -67,11 +67,11 @@ export const renderConfigMapOutput = (configMap) => {
6767
#Failed Operations:
6868
<br />
6969
<br />
70-
{configMap?.failure == null ? (
70+
{configMap.failure == null ? (
7171
<>No Result Found</>
7272
) : (
7373
<>
74-
{configMap?.failure.map((elm) => {
74+
{configMap.failure.map((elm) => {
7575
return renderCmAndSecretResponseForOneApp(elm)
7676
})}
7777
</>
@@ -82,11 +82,11 @@ export const renderConfigMapOutput = (configMap) => {
8282
<div>
8383
#Successful Operations: <br />
8484
<br />
85-
{configMap?.successful == null ? (
85+
{configMap.successful == null ? (
8686
<>No Result Found</>
8787
) : (
8888
<>
89-
{configMap?.successful.map((elm) => {
89+
{configMap.successful.map((elm) => {
9090
return renderCmAndSecretResponseForOneApp(elm)
9191
})}
9292
</>
@@ -133,7 +133,7 @@ export const renderDeploymentTemplateOutput = (deploymentTemplate) => {
133133
<div>
134134
#Message: <br />
135135
<br />
136-
{deploymentTemplate?.message?.map((elm) => {
136+
{deploymentTemplate.message?.map((elm) => {
137137
return (
138138
<div>
139139
{elm}
@@ -148,11 +148,11 @@ export const renderDeploymentTemplateOutput = (deploymentTemplate) => {
148148
#Failed Operations:
149149
<br />
150150
<br />
151-
{deploymentTemplate?.failure === null ? (
151+
{deploymentTemplate.failure === null ? (
152152
<>No Result Found</>
153153
) : (
154154
<>
155-
{deploymentTemplate?.failure.map((elm) => {
155+
{deploymentTemplate.failure.map((elm) => {
156156
return renderDTResponseForOneApp(elm)
157157
})}
158158
</>
@@ -164,11 +164,11 @@ export const renderDeploymentTemplateOutput = (deploymentTemplate) => {
164164
<div>
165165
#Successful Operations: <br />
166166
<br />
167-
{deploymentTemplate?.successful == null ? (
167+
{deploymentTemplate.successful == null ? (
168168
<>No Result Found</>
169169
) : (
170170
<>
171-
{deploymentTemplate?.successful.map((elm) => {
171+
{deploymentTemplate.successful.map((elm) => {
172172
return renderDTResponseForOneApp(elm)
173173
})}
174174
</>
@@ -189,7 +189,7 @@ export const renderSecretOutput = (secret) => {
189189
<div>
190190
#Message: <br />
191191
<br />
192-
{secret?.message?.map((elm) => {
192+
{secret.message?.map((elm) => {
193193
return (
194194
<>
195195
{elm}
@@ -204,11 +204,11 @@ export const renderSecretOutput = (secret) => {
204204
#Failed Operations:
205205
<br />
206206
<br />
207-
{secret?.failure == null ? (
207+
{secret.failure == null ? (
208208
<>No Result Found</>
209209
) : (
210210
<>
211-
{secret?.failure.map((elm) => {
211+
{secret.failure.map((elm) => {
212212
return renderCmAndSecretResponseForOneApp(elm)
213213
})}
214214
</>
@@ -220,11 +220,11 @@ export const renderSecretOutput = (secret) => {
220220
<div>
221221
#Successful Operations: <br />
222222
<br />
223-
{secret?.successful == null ? (
223+
{secret.successful == null ? (
224224
<>No Result Found</>
225225
) : (
226226
<>
227-
{secret?.successful.map((elm) => {
227+
{secret.successful.map((elm) => {
228228
return renderCmAndSecretResponseForOneApp(elm)
229229
})}
230230
</>

0 commit comments

Comments
 (0)