Fix: helm chart results style

1. Do not show chart results if chart is not enabled
2. Fix style in scroll of results page

Signed-off-by: Qian Deng <dengq@vmware.com>
This commit is contained in:
Qian Deng 2018-11-23 17:38:51 +08:00
parent 8ca917291e
commit d484025fa1
3 changed files with 19 additions and 8 deletions

View File

@ -6,11 +6,17 @@
<!-- spinner -->
<div class="spinner spinner-lg search-spinner" [hidden]="done">{{'SEARCH.IN_PROGRESS' | translate}}</div>
<div id="results">
<h2>{{'PROJECT.PROJECTS' | translate}}</h2>
<list-project-ro [projects]="searchResults.project"></list-project-ro>
<h2>{{'PROJECT_DETAIL.REPOSITORIES' | translate}}</h2>
<list-repository-ro [repositories]="searchResults.repository"></list-repository-ro>
<h2>{{'HELM_CHART.HELMCHARTS' | translate}}</h2>
<list-chart-version-ro [charts]="searchResults.Chart"></list-chart-version-ro>
<div class="project-results">
<h2>{{'PROJECT.PROJECTS' | translate}}</h2>
<list-project-ro [projects]="searchResults.project"></list-project-ro>
</div>
<div class="repo-results">
<h2>{{'PROJECT_DETAIL.REPOSITORIES' | translate}}</h2>
<list-repository-ro [repositories]="searchResults.repository"></list-repository-ro>
</div>
<div *ngIf="withHelmChart" class="chart-results">
<h2>{{'HELM_CHART.HELMCHARTS' | translate}}</h2>
<list-chart-version-ro [charts]="searchResults.Chart"></list-chart-version-ro>
</div>
</div>
</div>

View File

@ -18,6 +18,7 @@ import { GlobalSearchService } from './global-search.service';
import { SearchResults } from './search-results';
import { SearchTriggerService } from './search-trigger.service';
import { AppConfigService } from './../../app-config.service';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
@Component({
@ -49,7 +50,8 @@ export class SearchResultComponent implements OnInit, OnDestroy {
constructor(
private search: GlobalSearchService,
private msgHandler: MessageHandlerService,
private searchTrigger: SearchTriggerService) { }
private searchTrigger: SearchTriggerService,
private appConfigService: AppConfigService) { }
ngOnInit() {
this.searchSub = this.searchTrigger.searchTriggerChan$.subscribe(term => {
@ -143,4 +145,7 @@ export class SearchResultComponent implements OnInit, OnDestroy {
this.msgHandler.handleError(error);
});
}
get withHelmChart(): boolean {
return this.appConfigService.getConfig().with_chartmuseum;
}
}

View File

@ -68,5 +68,5 @@
#results {
overflow-y: auto;
max-height: 99%;
max-height: 85%;
}