mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-22 23:51:27 +01:00
Merge pull request #6397 from ninjadq/fix_helm_chart_api_in_ui
Fix: helmchart api change caused problems
This commit is contained in:
commit
42fe0ec30a
@ -113,26 +113,6 @@ export class HelmChartDefaultService extends HelmChartService {
|
||||
return res.json() || [];
|
||||
}
|
||||
|
||||
private extractHelmItems(res: Response) {
|
||||
if (res.text() === "") {
|
||||
return [];
|
||||
}
|
||||
let charts = res.json();
|
||||
if (charts) {
|
||||
return charts.map( chart => {
|
||||
return {
|
||||
name: chart.Name,
|
||||
total_versions: chart.total_versions,
|
||||
latest_version: chart.latest_version,
|
||||
created: chart.Created,
|
||||
icon: chart.Icon,
|
||||
home: chart.Home};
|
||||
});
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
private handleErrorObservable(error: HttpErrorResponse) {
|
||||
return observableThrowError(error.message || error);
|
||||
}
|
||||
@ -147,7 +127,7 @@ export class HelmChartDefaultService extends HelmChartService {
|
||||
return this.http
|
||||
.get(`${this.config.helmChartEndpoint}/${projectName}/charts`, HTTP_GET_OPTIONS)
|
||||
.pipe(
|
||||
map(response => this.extractHelmItems(response),
|
||||
map(response => this.extractData(response),
|
||||
catchError(error => this.handleErrorObservable(error))
|
||||
));
|
||||
}
|
||||
|
@ -306,12 +306,13 @@ export interface HelmChartItem {
|
||||
total_versions: number;
|
||||
latest_version: string;
|
||||
created: string;
|
||||
updated: string;
|
||||
icon: string;
|
||||
home: string;
|
||||
deprecated?: boolean;
|
||||
status?: string;
|
||||
pulls?: number;
|
||||
maintainer?: string;
|
||||
deprecated?: boolean;
|
||||
}
|
||||
|
||||
export interface HelmChartVersion {
|
||||
|
Loading…
Reference in New Issue
Block a user