@@ -59,7 +59,7 @@ class CostOverviewsBase extends React.Component<CostOverviewProps, any> {
59
59
const { groupBy, intl, report, title } = this . props ;
60
60
61
61
let showWidget = false ;
62
- for ( const groupById of widget . cluster . showWidgetOnGroupBy ) {
62
+ for ( const groupById of widget . showWidgetOnGroupBy ) {
63
63
if ( groupById === groupBy || ( groupById === tagPrefix && groupBy && groupBy . indexOf ( tagPrefix ) !== - 1 ) ) {
64
64
showWidget = true ;
65
65
break ;
@@ -210,8 +210,8 @@ class CostOverviewsBase extends React.Component<CostOverviewProps, any> {
210
210
const { groupBy, intl } = this . props ;
211
211
212
212
let showWidget = false ;
213
- if ( widget . pvc . showWidgetOnGroupBy ) {
214
- for ( const groupById of widget . pvc . showWidgetOnGroupBy ) {
213
+ if ( widget . showWidgetOnGroupBy ) {
214
+ for ( const groupById of widget . showWidgetOnGroupBy ) {
215
215
if ( groupById === groupBy ) {
216
216
showWidget = true ;
217
217
break ;
@@ -242,20 +242,23 @@ class CostOverviewsBase extends React.Component<CostOverviewProps, any> {
242
242
const groupByCostCategory = getGroupByCostCategory ( query ) ;
243
243
const groupByOrg = getGroupByOrgValue ( query ) ;
244
244
const groupByTag = getGroupByTagKey ( query ) ;
245
+
245
246
let showWidget = false ;
247
+ let showPlatformCosts = false ;
246
248
247
- if ( widget . reportSummary . showWidgetOnGroupBy ) {
248
- for ( const groupById of widget . reportSummary . showWidgetOnGroupBy ) {
249
+ if ( widget . showWidgetOnGroupBy ) {
250
+ for ( const groupById of widget . showWidgetOnGroupBy ) {
249
251
if ( groupById === groupBy || groupByCostCategory || groupByOrg || groupByTag ) {
250
252
showWidget = true ;
251
253
break ;
252
254
}
253
255
}
254
256
}
255
- if ( ! showWidget && widget . reportSummary . showWidgetOnPlatformCategory ) {
256
- for ( const categoryId of widget . reportSummary . showWidgetOnPlatformCategory ) {
257
+ if ( ! showWidget && widget . showWidgetOnPlatformCategory ) {
258
+ for ( const categoryId of widget . showWidgetOnPlatformCategory ) {
257
259
if ( isPlatformCosts && categoryId === platformCategoryKey ) {
258
260
showWidget = true ;
261
+ showPlatformCosts = true ;
259
262
break ;
260
263
}
261
264
}
@@ -267,7 +270,7 @@ class CostOverviewsBase extends React.Component<CostOverviewProps, any> {
267
270
costDistribution = { ! isVolumeWidget ? costDistribution : undefined }
268
271
costType = { ! isVolumeWidget ? costType : undefined }
269
272
currency = { currency }
270
- isPlatformCosts = { isPlatformCosts }
273
+ isPlatformCosts = { showPlatformCosts }
271
274
reportGroupBy = { widget . reportSummary . reportGroupBy }
272
275
reportPathsType = { widget . reportPathsType }
273
276
reportType = { widget . reportType }
@@ -285,8 +288,8 @@ class CostOverviewsBase extends React.Component<CostOverviewProps, any> {
285
288
286
289
let showWidget = false ;
287
290
288
- if ( widget . volume . showWidgetOnGroupBy ) {
289
- for ( const groupById of widget . volume . showWidgetOnGroupBy ) {
291
+ if ( widget . showWidgetOnGroupBy ) {
292
+ for ( const groupById of widget . showWidgetOnGroupBy ) {
290
293
if ( groupById === groupBy || ( groupById === tagPrefix && groupBy && groupBy . indexOf ( tagPrefix ) !== - 1 ) ) {
291
294
showWidget = true ;
292
295
break ;
0 commit comments