File tree Expand file tree Collapse file tree
src/app/shared/search/search-charts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ <h2 class="m-0 text-break">{{'search.filters.applied.charts.' + ((configuration
77 </ div >
88 < button class ="btn btn-outline-secondary " data-test ="search-charts-toggle "
99 ngbTooltip ="{{'search.sidebar.show.hide.charts.tooltip' | translate}} "
10- (click) ="toggleChart() " *ngIf ="showChartsToggle ">
10+ (click) ="toggleChart() " *ngIf ="showChartsToggle && hasValidCharts ">
1111 < i class ="fa fa-chart-line mr-2 "> </ i > {{"search.filters.applied.charts.show.hide" | translate}}</ button >
1212 </ div >
1313 < div *ngIf ="!collapseChart && selectedFilter " @shrinkInOut data-test ="search-charts ">
Original file line number Diff line number Diff line change @@ -69,6 +69,24 @@ export class SearchChartsComponent implements OnInit {
6969 */
7070 isPlatformBrowser : boolean ;
7171
72+ /**
73+ * Array with charts visibility
74+ */
75+ chartsVisibilityList$ : Observable < boolean [ ] > = of ( [ true ] ) ;
76+
77+ /**
78+ *
79+ * @param cdr
80+ * @param searchService
81+ * @param platformId
82+ * @param searchConfigService
83+ */
84+
85+ /**
86+ * Prop that provides the boolean value for an existing valid chart (true if at least one valid chart is found)
87+ */
88+ hasValidCharts = false ;
89+
7290 constructor (
7391 private cdr : ChangeDetectorRef ,
7492 private searchService : SearchService ,
@@ -89,6 +107,7 @@ export class SearchChartsComponent implements OnInit {
89107 this . selectedFilter = this . selectedFilter
90108 ? this . selectedFilter
91109 : rd . hasSucceeded && hasValues ? rd . payload [ 0 ] : null ;
110+ this . hasValidCharts = hasValues ;
92111 this . cdr . detectChanges ( ) ;
93112 } )
94113 ) ;
You can’t perform that action at this time.
0 commit comments