mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-16 12:41:22 +01:00
fix helm chart did not get global label
The root cause is helm chart does not get glboal labels Signed-off-by: Meina Zhou <meinaz@vmware.com>
This commit is contained in:
parent
f2a9e8ae9b
commit
073cacd9b3
@ -54,7 +54,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<clr-dropdown-menu clrPosition="bottom-left" *clrIfOpen>
|
<clr-dropdown-menu clrPosition="bottom-left" *clrIfOpen>
|
||||||
<hbr-resource-label-marker
|
<hbr-resource-label-marker
|
||||||
[labels]="projectLabels"
|
[labels]="labels"
|
||||||
[projectName]="projectName"
|
[projectName]="projectName"
|
||||||
[resource]="selectedRows[0]"
|
[resource]="selectedRows[0]"
|
||||||
[resourceType]="resourceType"
|
[resourceType]="resourceType"
|
||||||
@ -74,7 +74,7 @@
|
|||||||
{{'REPOSITORY.LABELS' | translate}}
|
{{'REPOSITORY.LABELS' | translate}}
|
||||||
<clr-dg-filter [clrDgFilter]="labelFilter">
|
<clr-dg-filter [clrDgFilter]="labelFilter">
|
||||||
<hbr-chart-version-label-filter #labelFilter class="label-filter"
|
<hbr-chart-version-label-filter #labelFilter class="label-filter"
|
||||||
[labels]="projectLabels"
|
[labels]="labels"
|
||||||
[resourceType]="resourceType">
|
[resourceType]="resourceType">
|
||||||
</hbr-chart-version-label-filter>
|
</hbr-chart-version-label-filter>
|
||||||
</clr-dg-filter>
|
</clr-dg-filter>
|
||||||
|
@ -65,7 +65,7 @@ export class ChartVersionComponent implements OnInit {
|
|||||||
chartVersions: HelmChartVersion[] = [];
|
chartVersions: HelmChartVersion[] = [];
|
||||||
systemInfo: SystemInfo;
|
systemInfo: SystemInfo;
|
||||||
selectedRows: HelmChartVersion[] = [];
|
selectedRows: HelmChartVersion[] = [];
|
||||||
projectLabels: Label[] = [];
|
labels: Label[] = [];
|
||||||
loading = true;
|
loading = true;
|
||||||
resourceType = ResourceType.CHART_VERSION;
|
resourceType = ResourceType.CHART_VERSION;
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ export class ChartVersionComponent implements OnInit {
|
|||||||
.then(systemInfo => (this.systemInfo = systemInfo))
|
.then(systemInfo => (this.systemInfo = systemInfo))
|
||||||
.catch(error => this.errorHandler.error(error));
|
.catch(error => this.errorHandler.error(error));
|
||||||
this.refresh();
|
this.refresh();
|
||||||
this.getProjectLabels();
|
this.getLabels();
|
||||||
this.lastFilteredVersionName = "";
|
this.lastFilteredVersionName = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,12 +114,12 @@ export class ChartVersionComponent implements OnInit {
|
|||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
getProjectLabels() {
|
getLabels() {
|
||||||
this.resrouceLabelService.getProjectLabels(this.projectId).subscribe(
|
forkJoin(this.resrouceLabelService.getLabels("g"), this.resrouceLabelService.getProjectLabels(this.projectId))
|
||||||
(labels: Label[]) => {
|
.subscribe(
|
||||||
this.projectLabels = labels;
|
(labels) => {
|
||||||
}
|
this.labels = [].concat(...labels);
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Inject, Injectable } from "@angular/core";
|
import { Inject, Injectable } from "@angular/core";
|
||||||
import { Http } from "@angular/http";
|
import { Http } from "@angular/http";
|
||||||
import { Observable} from "rxjs";
|
import { Observable} from "rxjs";
|
||||||
import { map } from "rxjs/operators";
|
import { map, catchError} from "rxjs/operators";
|
||||||
|
|
||||||
import { RequestQueryParams } from "./RequestQueryParams";
|
import { RequestQueryParams } from "./RequestQueryParams";
|
||||||
import { Label } from "./interface";
|
import { Label } from "./interface";
|
||||||
@ -33,7 +33,7 @@ export abstract class LabelService {
|
|||||||
projectId?: number,
|
projectId?: number,
|
||||||
name?: string,
|
name?: string,
|
||||||
queryParams?: RequestQueryParams
|
queryParams?: RequestQueryParams
|
||||||
): Observable<Label[]> | Promise<Label[]>;
|
): Observable<Label[]>;
|
||||||
|
|
||||||
abstract createLabel(
|
abstract createLabel(
|
||||||
label: Label
|
label: Label
|
||||||
@ -149,7 +149,7 @@ export class LabelDefaultService extends LabelService {
|
|||||||
projectId?: number,
|
projectId?: number,
|
||||||
name?: string,
|
name?: string,
|
||||||
queryParams?: RequestQueryParams
|
queryParams?: RequestQueryParams
|
||||||
): Observable<Label[]> | Promise<Label[]> {
|
): Observable<Label[]> {
|
||||||
if (!queryParams) {
|
if (!queryParams) {
|
||||||
queryParams = new RequestQueryParams();
|
queryParams = new RequestQueryParams();
|
||||||
}
|
}
|
||||||
@ -164,9 +164,8 @@ export class LabelDefaultService extends LabelService {
|
|||||||
}
|
}
|
||||||
return this.http
|
return this.http
|
||||||
.get(this.labelUrl, buildHttpRequestOptions(queryParams))
|
.get(this.labelUrl, buildHttpRequestOptions(queryParams))
|
||||||
.toPromise()
|
.pipe(map(response => response.json()))
|
||||||
.then(response => response.json())
|
.pipe(catchError(error => Promise.reject(error)));
|
||||||
.catch(error => Promise.reject(error));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
createLabel(label: Label): Observable<any> | Promise<any> | any {
|
createLabel(label: Label): Observable<any> | Promise<any> | any {
|
||||||
|
Loading…
Reference in New Issue
Block a user