diff --git a/src/portal/lib/src/app.module.ts b/src/portal/lib/src/app.module.ts index 2fb7010e2..c6e476eb9 100644 --- a/src/portal/lib/src/app.module.ts +++ b/src/portal/lib/src/app.module.ts @@ -13,7 +13,7 @@ import { HarborLibraryModule } from './harbor-library.module'; BrowserModule, FormsModule, HttpModule, - ClarityModule.forRoot(), + ClarityModule, HarborLibraryModule.forRoot() ], providers: [], diff --git a/src/portal/lib/src/harbor-library.module.ts b/src/portal/lib/src/harbor-library.module.ts index 44baa557c..2d1bda19b 100644 --- a/src/portal/lib/src/harbor-library.module.ts +++ b/src/portal/lib/src/harbor-library.module.ts @@ -27,7 +27,6 @@ import { OPERATION_DIRECTIVES } from './operation/index'; import { LABEL_DIRECTIVES } from "./label/index"; import { CREATE_EDIT_LABEL_DIRECTIVES } from "./create-edit-label/index"; import { LABEL_PIECE_DIRECTIVES } from "./label-piece/index"; -import { HELMCHART_DIRECTIVE } from "./helm-chart/index"; import { IMAGE_NAME_INPUT_DIRECTIVES } from "./image-name-input/index"; import { CRON_SCHEDULE_DIRECTIVES } from "./cron-schedule/index"; import { @@ -53,8 +52,6 @@ import { ProjectDefaultService, LabelService, LabelDefaultService, - HelmChartService, - HelmChartDefaultService, RetagService, RetagDefaultService, UserPermissionService, @@ -209,7 +206,6 @@ export function initConfig(translateInitializer: TranslateServiceInitializer, co HBR_GRIDVIEW_DIRECTIVES, REPOSITORY_GRIDVIEW_DIRECTIVES, OPERATION_DIRECTIVES, - HELMCHART_DIRECTIVE, IMAGE_NAME_INPUT_DIRECTIVES, CRON_SCHEDULE_DIRECTIVES ], @@ -237,9 +233,9 @@ export function initConfig(translateInitializer: TranslateServiceInitializer, co HBR_GRIDVIEW_DIRECTIVES, REPOSITORY_GRIDVIEW_DIRECTIVES, OPERATION_DIRECTIVES, - HELMCHART_DIRECTIVE, IMAGE_NAME_INPUT_DIRECTIVES, - CRON_SCHEDULE_DIRECTIVES + CRON_SCHEDULE_DIRECTIVES, + SharedModule ], providers: [] }) @@ -263,7 +259,6 @@ export class HarborLibraryModule { config.jobLogService || { provide: JobLogService, useClass: JobLogDefaultService }, config.projectPolicyService || { provide: ProjectService, useClass: ProjectDefaultService }, config.labelService || { provide: LabelService, useClass: LabelDefaultService }, - config.helmChartService || { provide: HelmChartService, useClass: HelmChartDefaultService }, config.userPermissionService || { provide: UserPermissionService, useClass: UserPermissionDefaultService }, config.gcApiRepository || {provide: GcApiRepository, useClass: GcApiDefaultRepository}, // Do initializing @@ -300,7 +295,6 @@ export class HarborLibraryModule { config.jobLogService || { provide: JobLogService, useClass: JobLogDefaultService }, config.projectPolicyService || { provide: ProjectService, useClass: ProjectDefaultService }, config.labelService || { provide: LabelService, useClass: LabelDefaultService }, - config.helmChartService || { provide: HelmChartService, useClass: HelmChartDefaultService }, config.userPermissionService || { provide: UserPermissionService, useClass: UserPermissionDefaultService }, config.gcApiRepository || {provide: GcApiRepository, useClass: GcApiDefaultRepository}, ChannelService, diff --git a/src/portal/lib/src/helm-chart/index.ts b/src/portal/lib/src/helm-chart/index.ts deleted file mode 100644 index 0b7eccedf..000000000 --- a/src/portal/lib/src/helm-chart/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Type } from '@angular/core'; -import { HelmChartComponent } from './helm-chart.component'; -import { ChartVersionComponent } from './versions/helm-chart-version.component'; -import { ChartDetailComponent } from './chart-detail/chart-detail.component'; -import { ChartDetailSummaryComponent } from './chart-detail/chart-detail-summary.component'; -import { ChartDetailDependencyComponent } from './chart-detail/chart-detail-dependency.component'; -import { ChartDetailValueComponent } from './chart-detail/chart-detail-value.component'; - -export * from "./helm-chart.component"; -export * from "./versions/helm-chart-version.component"; -export * from "./chart-detail/chart-detail.component"; -export * from "./chart-detail/chart-detail-summary.component"; -export * from "./chart-detail/chart-detail-dependency.component"; -export * from "./chart-detail/chart-detail-value.component"; - -export const HELMCHART_DIRECTIVE: Type[] = [ - HelmChartComponent, - ChartVersionComponent, - ChartDetailComponent, - ChartDetailSummaryComponent, - ChartDetailDependencyComponent, - ChartDetailValueComponent, -]; diff --git a/src/portal/lib/src/index.ts b/src/portal/lib/src/index.ts index 221df50f4..7ff1d2636 100644 --- a/src/portal/lib/src/index.ts +++ b/src/portal/lib/src/index.ts @@ -25,5 +25,4 @@ export * from './gridview/index'; export * from './repository-gridview/index'; export * from './operation/index'; export * from './_animations/index'; -export * from './helm-chart/index'; diff --git a/src/portal/lib/src/label/index.ts b/src/portal/lib/src/label/index.ts index a046d63b0..75f8e31db 100644 --- a/src/portal/lib/src/label/index.ts +++ b/src/portal/lib/src/label/index.ts @@ -1,12 +1,8 @@ import { Type } from '@angular/core'; import { LabelComponent} from "./label.component"; -import { LabelMarkerComponent } from './label-marker/label-marker.component'; import { LabelSignPostComponent } from './label-signpost/label-signpost.component'; -import { LabelFilterComponent } from './label-filter/label-filter.component'; export const LABEL_DIRECTIVES: Type[] = [ LabelComponent, - LabelMarkerComponent, LabelSignPostComponent, - LabelFilterComponent ]; diff --git a/src/portal/lib/src/service/index.ts b/src/portal/lib/src/service/index.ts index 1772c0054..2c22c3bd8 100644 --- a/src/portal/lib/src/service/index.ts +++ b/src/portal/lib/src/service/index.ts @@ -11,7 +11,6 @@ export * from "./configuration.service"; export * from "./job-log.service"; export * from "./project.service"; export * from "./label.service"; -export * from "./helm-chart.service"; export * from "./retag.service"; export * from "./permission.service"; export * from "./permission-static"; diff --git a/src/portal/lib/src/service/interface.ts b/src/portal/lib/src/service/interface.ts index 91c34601a..837b36d54 100644 --- a/src/portal/lib/src/service/interface.ts +++ b/src/portal/lib/src/service/interface.ts @@ -300,93 +300,6 @@ export interface ScrollPosition { sT: number; cH: number; } -export interface HelmChartSearchResultItem { - Name: string; - Score: number; - Chart: HelmChartVersion; -} -export interface HelmChartItem { - name: string; - total_versions: number; - latest_version: string; - created: string; - updated: string; - icon: string; - home: string; - deprecated?: boolean; - status?: string; - pulls?: number; - maintainer?: string; -} - -export interface HelmChartVersion { - name: string; - home: string; - sources: string[]; - version: string; - description: string; - keywords: string[]; - maintainers: HelmChartMaintainer[]; - engine: string; - icon: string; - appVersion: string; - apiVersion: string; - urls: string[]; - created: string; - digest: string; - labels: Label[]; - deprecated?: boolean; -} - -export interface HelmChartDetail { - metadata: HelmChartMetaData; - dependencies: HelmChartDependency[]; - values: any; - files: HelmchartFile; - security: HelmChartSecurity; - labels: Label[]; -} - -export interface HelmChartMetaData { - name: string; - home: string; - sources: string[]; - version: string; - description: string; - keywords: string[]; - maintainers: HelmChartMaintainer[]; - engine: string; - icon: string; - appVersion: string; - urls: string[]; - created?: string; - digest: string; -} - -export interface HelmChartMaintainer { - name: string; - email: string; -} - -export interface HelmChartDependency { - name: string; - version: string; - repository: string; -} - -export interface HelmchartFile { - "README.MD": string; - "values.yaml": string; -} - -export interface HelmChartSecurity { - signature: HelmChartSignature; -} - -export interface HelmChartSignature { - signed: boolean; - prov_file: string; -} /** * The manifest of image. diff --git a/src/portal/lib/src/shared/shared.const.ts b/src/portal/lib/src/shared/shared.const.ts index f180073ad..aed895e7c 100644 --- a/src/portal/lib/src/shared/shared.const.ts +++ b/src/portal/lib/src/shared/shared.const.ts @@ -94,7 +94,6 @@ export const LabelColor = [ export const RoleMapping = { 'projectAdmin': 'MEMBER.PROJECT_ADMIN', 'master': 'MEMBER.PROJECT_MASTER', 'developer': 'MEMBER.DEVELOPER', 'guest': 'MEMBER.GUEST' }; -export const DefaultHelmIcon = '/images/helm-gray.svg'; export enum Roles { PROJECT_ADMIN = 1, diff --git a/src/portal/src/app/base/global-search/search-results.ts b/src/portal/src/app/base/global-search/search-results.ts index ae9eae7b2..aea4f6763 100644 --- a/src/portal/src/app/base/global-search/search-results.ts +++ b/src/portal/src/app/base/global-search/search-results.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Project } from "../../project/project"; -import { Repository, HelmChartSearchResultItem } from "@harbor/ui"; +import { Repository } from "@harbor/ui"; +import { HelmChartSearchResultItem } from "../../project/helm-chart/helm-chart.interface.service"; export class SearchResults { constructor() { diff --git a/src/portal/src/app/harbor-routing.module.ts b/src/portal/src/app/harbor-routing.module.ts index 4ec78ac7e..166f58364 100644 --- a/src/portal/src/app/harbor-routing.module.ts +++ b/src/portal/src/app/harbor-routing.module.ts @@ -48,9 +48,9 @@ import { RobotAccountComponent } from './project/robot-account/robot-account.com import { ProjectLabelComponent } from "./project/project-label/project-label.component"; import { ProjectConfigComponent } from './project/project-config/project-config.component'; import { ProjectRoutingResolver } from './project/project-routing-resolver.service'; -import { ListChartsComponent } from './project/list-charts/list-charts.component'; -import { ListChartVersionsComponent } from './project/list-chart-versions/list-chart-versions.component'; -import { ChartDetailComponent } from './project/chart-detail/chart-detail.component'; +import { ListChartsComponent } from './project/helm-chart/list-charts.component'; +import { ListChartVersionsComponent } from './project/helm-chart/list-chart-versions/list-chart-versions.component'; +import { HelmChartDetailComponent } from './project/helm-chart/helm-chart-detail/chart-detail.component'; const harborRoutes: Routes = [ { path: '', redirectTo: 'harbor', pathMatch: 'full' }, @@ -134,7 +134,7 @@ const harborRoutes: Routes = [ }, { path: 'projects/:id/helm-charts/:chart/versions/:version', - component: ChartDetailComponent, + component: HelmChartDetailComponent, canActivate: [MemberGuard], resolve: { projectResolver: ProjectRoutingResolver diff --git a/src/portal/src/app/project/chart-detail/chart-detail.component.html b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail.component.html similarity index 100% rename from src/portal/src/app/project/chart-detail/chart-detail.component.html rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail.component.html diff --git a/src/portal/src/app/project/chart-detail/chart-detail.component.scss b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail.component.scss similarity index 100% rename from src/portal/src/app/project/chart-detail/chart-detail.component.scss rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail.component.scss diff --git a/src/portal/src/app/project/chart-detail/chart-detail.component.spec.ts b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail.component.spec.ts similarity index 58% rename from src/portal/src/app/project/chart-detail/chart-detail.component.spec.ts rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail.component.spec.ts index a0b481e57..d9bd3306c 100644 --- a/src/portal/src/app/project/chart-detail/chart-detail.component.spec.ts +++ b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { ChartDetailComponent } from './chart-detail.component'; +import { HelmChartDetailComponent } from './chart-detail.component'; describe('ChartDetailComponent', () => { - let component: ChartDetailComponent; - let fixture: ComponentFixture; + let component: HelmChartDetailComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChartDetailComponent ] + declarations: [ HelmChartDetailComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(ChartDetailComponent); + fixture = TestBed.createComponent(HelmChartDetailComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/portal/src/app/project/chart-detail/chart-detail.component.ts b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail.component.ts similarity index 84% rename from src/portal/src/app/project/chart-detail/chart-detail.component.ts rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail.component.ts index 5627cc64f..b3c1fe74d 100644 --- a/src/portal/src/app/project/chart-detail/chart-detail.component.ts +++ b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail.component.ts @@ -1,9 +1,9 @@ -import { RoleMapping } from './../../shared/shared.const'; +import { RoleMapping } from './../../../shared/shared.const'; import { ActivatedRoute, Router } from '@angular/router'; import { Component, OnInit } from "@angular/core"; -import { Project } from '../project'; -import { SessionService } from './../../shared/session.service'; -import { SessionUser } from './../../shared/session-user'; +import { Project } from '../../project'; +import { SessionService } from './../../../shared/session.service'; +import { SessionUser } from './../../../shared/session-user'; import {finalize} from "rxjs/operators"; @Component({ @@ -11,7 +11,7 @@ import {finalize} from "rxjs/operators"; templateUrl: "./chart-detail.component.html", styleUrls: ["./chart-detail.component.scss"] }) -export class ChartDetailComponent implements OnInit { +export class HelmChartDetailComponent implements OnInit { projectId: number | string; project: Project; diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-dependency.component.html b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.html similarity index 100% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail-dependency.component.html rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.html diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-dependency.component.scss b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.scss similarity index 100% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail-dependency.component.scss rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.scss diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-dependency.component.ts b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.ts similarity index 86% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail-dependency.component.ts rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.ts index 428e1a415..fdee57886 100644 --- a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-dependency.component.ts +++ b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.ts @@ -5,7 +5,7 @@ import { ChangeDetectionStrategy } from "@angular/core"; -import { HelmChartDependency } from "./../../service/interface"; +import { HelmChartDependency } from "./../../helm-chart.interface.service"; @Component({ selector: "hbr-chart-detail-dependency", diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.html similarity index 100% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.html diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.scss b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.scss similarity index 100% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.scss rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.scss diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.ts similarity index 88% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.ts index 020d71340..f355793bc 100644 --- a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts +++ b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.ts @@ -5,10 +5,9 @@ import { Input } from "@angular/core"; -import { HelmChartMetaData, HelmChartSecurity, Label } from "./../../service/interface"; -import { downloadFile } from './../../utils'; -import { HelmChartService } from "../../service/index"; -import { ErrorHandler } from "./../../error-handler/error-handler"; +import { HelmChartMetaData, HelmChartSecurity } from "./../../helm-chart.interface.service"; +import { downloadFile, Label, ErrorHandler } from '@harbor/ui'; +import { HelmChartService } from "../../helm-chart.service"; @Component({ selector: "hbr-chart-detail-summary", diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-value.component.html b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.html similarity index 100% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail-value.component.html rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.html diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-value.component.scss b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.scss similarity index 100% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail-value.component.scss rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.scss diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-value.component.ts b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.ts similarity index 100% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail-value.component.ts rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.ts diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail.component.html b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.html similarity index 100% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail.component.html rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.html diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail.component.scss b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.scss similarity index 90% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail.component.scss rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.scss index 26aa1c44b..895a48a22 100644 --- a/src/portal/lib/src/helm-chart/chart-detail/chart-detail.component.scss +++ b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.scss @@ -1,4 +1,4 @@ -@import "../../mixin"; +@import "./../../../../../../lib/src/mixin"; .title-container { display: flex; diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail.component.ts b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.ts similarity index 88% rename from src/portal/lib/src/helm-chart/chart-detail/chart-detail.component.ts rename to src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.ts index d2e6b5f99..52f2c0d4f 100644 --- a/src/portal/lib/src/helm-chart/chart-detail/chart-detail.component.ts +++ b/src/portal/src/app/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.ts @@ -1,4 +1,4 @@ -import { Project } from "./../../project-policy-config/project"; +import { downloadFile, SystemInfoService, SystemInfo, ErrorHandler } from "@harbor/ui"; import { Component, OnInit, @@ -7,10 +7,9 @@ import { ChangeDetectorRef } from "@angular/core"; -import { downloadFile } from "../../utils"; -import { SystemInfoService, HelmChartService } from "../../service/index"; -import { HelmChartDetail, SystemInfo } from "./../../service/interface"; -import { ErrorHandler } from "./../../error-handler/error-handler"; +import { Project } from "../../../project"; +import { HelmChartService } from "../../helm-chart.service"; +import { HelmChartDetail } from "../../helm-chart.interface.service"; import { finalize } from "rxjs/operators"; @Component({ @@ -40,7 +39,7 @@ export class ChartDetailComponent implements OnInit { private systemInfoService: SystemInfoService, private helmChartService: HelmChartService, private cdr: ChangeDetectorRef - ) {} + ) { } ngOnInit(): void { this.systemInfoService.getSystemInfo() diff --git a/src/portal/src/app/project/helm-chart/helm-chart.interface.service.ts b/src/portal/src/app/project/helm-chart/helm-chart.interface.service.ts new file mode 100644 index 000000000..a6d2996ce --- /dev/null +++ b/src/portal/src/app/project/helm-chart/helm-chart.interface.service.ts @@ -0,0 +1,91 @@ +import { Type } from '@angular/core'; + +import { Label } from '@harbor/ui'; + +export interface HelmChartSearchResultItem { + Name: string; + Score: number; + Chart: HelmChartVersion; +} +export interface HelmChartItem { + name: string; + total_versions: number; + latest_version: string; + created: string; + updated: string; + icon: string; + home: string; + deprecated?: boolean; + status?: string; + pulls?: number; + maintainer?: string; +} + +export interface HelmChartVersion { + name: string; + home: string; + sources: string[]; + version: string; + description: string; + keywords: string[]; + maintainers: HelmChartMaintainer[]; + engine: string; + icon: string; + appVersion: string; + apiVersion: string; + urls: string[]; + created: string; + digest: string; + labels: Label[]; + deprecated?: boolean; +} + +export interface HelmChartDetail { + metadata: HelmChartMetaData; + dependencies: HelmChartDependency[]; + values: any; + files: HelmchartFile; + security: HelmChartSecurity; + labels: Label[]; +} + +export interface HelmChartMetaData { + name: string; + home: string; + sources: string[]; + version: string; + description: string; + keywords: string[]; + maintainers: HelmChartMaintainer[]; + engine: string; + icon: string; + appVersion: string; + urls: string[]; + created?: string; + digest: string; +} + +export interface HelmChartMaintainer { + name: string; + email: string; +} + +export interface HelmChartDependency { + name: string; + version: string; + repository: string; +} + +export interface HelmchartFile { + "README.MD": string; + "values.yaml": string; +} + +export interface HelmChartSecurity { + signature: HelmChartSignature; +} + +export interface HelmChartSignature { + signed: boolean; + prov_file: string; +} diff --git a/src/portal/src/app/project/helm-chart/helm-chart.module.ts b/src/portal/src/app/project/helm-chart/helm-chart.module.ts new file mode 100644 index 000000000..56e751403 --- /dev/null +++ b/src/portal/src/app/project/helm-chart/helm-chart.module.ts @@ -0,0 +1,60 @@ +// Copyright Project Harbor Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { NgModule } from '@angular/core'; +import { LabelFilterComponent } from './label-filter/label-filter.component'; +import { LabelMarkerComponent } from './label-marker/label-marker.component'; +import { ListChartVersionsComponent } from './list-chart-versions/list-chart-versions.component'; +import { ChartVersionComponent } from './list-chart-versions/helm-chart-versions-detail/helm-chart-version.component'; +import { ListChartsComponent } from './list-charts.component'; +import { HelmChartComponent } from './list-charts-detail/helm-chart.component'; +import { ChartDetailDependencyComponent } from './helm-chart-detail/chart-detail/chart-detail-dependency.component'; +import { ChartDetailSummaryComponent } from './helm-chart-detail/chart-detail/chart-detail-summary.component'; +import { ChartDetailValueComponent } from './helm-chart-detail/chart-detail/chart-detail-value.component'; +import { ChartDetailComponent } from './helm-chart-detail/chart-detail/chart-detail.component'; +import { HelmChartDetailComponent } from './helm-chart-detail/chart-detail.component'; +import { SharedModule } from '../../shared/shared.module'; +import { HelmChartDefaultService, HelmChartService } from './helm-chart.service'; + +@NgModule({ + imports: [SharedModule], + declarations: [ + LabelFilterComponent, + LabelMarkerComponent, + ListChartVersionsComponent, + ChartVersionComponent, + ListChartsComponent, + HelmChartComponent, + ChartDetailDependencyComponent, + ChartDetailSummaryComponent, + ChartDetailValueComponent, + ChartDetailComponent, + HelmChartDetailComponent, + ], + providers: [ + { provide: HelmChartService, useClass: HelmChartDefaultService }], + exports: [ + LabelFilterComponent, + LabelMarkerComponent, + ListChartVersionsComponent, + ChartVersionComponent, + ListChartsComponent, + HelmChartComponent, + ChartDetailDependencyComponent, + ChartDetailSummaryComponent, + ChartDetailValueComponent, + ChartDetailComponent, + HelmChartDetailComponent + ] +}) +export class HelmChartModule { } diff --git a/src/portal/lib/src/service/helm-chart.service.ts b/src/portal/src/app/project/helm-chart/helm-chart.service.ts similarity index 96% rename from src/portal/lib/src/service/helm-chart.service.ts rename to src/portal/src/app/project/helm-chart/helm-chart.service.ts index 02bad80fa..21176fbd0 100644 --- a/src/portal/lib/src/service/helm-chart.service.ts +++ b/src/portal/src/app/project/helm-chart/helm-chart.service.ts @@ -5,10 +5,8 @@ import { Http, Response, ResponseContentType } from "@angular/http"; import { map, catchError } from "rxjs/operators"; import {HttpErrorResponse} from "@angular/common/http"; -import { RequestQueryParams } from "./RequestQueryParams"; -import { HelmChartItem, HelmChartVersion, HelmChartDetail } from "./interface"; -import { SERVICE_CONFIG, IServiceConfig } from "../service.config"; -import { HTTP_JSON_OPTIONS, HTTP_GET_OPTIONS } from "../utils"; +import { HelmChartItem, HelmChartVersion, HelmChartDetail } from "./helm-chart.interface.service"; +import { HTTP_JSON_OPTIONS, HTTP_GET_OPTIONS, SERVICE_CONFIG, IServiceConfig, RequestQueryParams } from "@harbor/ui"; /** diff --git a/src/portal/lib/src/label/label-filter/label-filter.component.html b/src/portal/src/app/project/helm-chart/label-filter/label-filter.component.html similarity index 100% rename from src/portal/lib/src/label/label-filter/label-filter.component.html rename to src/portal/src/app/project/helm-chart/label-filter/label-filter.component.html diff --git a/src/portal/lib/src/label/label-filter/label-filter.component.scss b/src/portal/src/app/project/helm-chart/label-filter/label-filter.component.scss similarity index 100% rename from src/portal/lib/src/label/label-filter/label-filter.component.scss rename to src/portal/src/app/project/helm-chart/label-filter/label-filter.component.scss diff --git a/src/portal/lib/src/label/label-filter/label-filter.component.ts b/src/portal/src/app/project/helm-chart/label-filter/label-filter.component.ts similarity index 92% rename from src/portal/lib/src/label/label-filter/label-filter.component.ts rename to src/portal/src/app/project/helm-chart/label-filter/label-filter.component.ts index 4fb3848a6..28adf7309 100644 --- a/src/portal/lib/src/label/label-filter/label-filter.component.ts +++ b/src/portal/src/app/project/helm-chart/label-filter/label-filter.component.ts @@ -3,9 +3,9 @@ import {ClrDatagridFilterInterface} from "@clr/angular"; import { fromEvent } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { Label, Tag } from './../../service/interface'; -import { HelmChartVersion } from '../../service/interface'; -import { ResourceType } from '../../shared/shared.const'; +import { Label, Tag } from '@harbor/ui'; +import { HelmChartVersion } from '../helm-chart.interface.service'; +import { ResourceType } from '../../../shared/shared.const'; @Component({ selector: "hbr-chart-version-label-filter", diff --git a/src/portal/lib/src/label/label-marker/label-marker.component.html b/src/portal/src/app/project/helm-chart/label-marker/label-marker.component.html similarity index 100% rename from src/portal/lib/src/label/label-marker/label-marker.component.html rename to src/portal/src/app/project/helm-chart/label-marker/label-marker.component.html diff --git a/src/portal/lib/src/label/label-marker/label-marker.component.scss b/src/portal/src/app/project/helm-chart/label-marker/label-marker.component.scss similarity index 100% rename from src/portal/lib/src/label/label-marker/label-marker.component.scss rename to src/portal/src/app/project/helm-chart/label-marker/label-marker.component.scss diff --git a/src/portal/lib/src/label/label-marker/label-marker.component.ts b/src/portal/src/app/project/helm-chart/label-marker/label-marker.component.ts similarity index 78% rename from src/portal/lib/src/label/label-marker/label-marker.component.ts rename to src/portal/src/app/project/helm-chart/label-marker/label-marker.component.ts index bfb931da0..d97ff3fb2 100644 --- a/src/portal/lib/src/label/label-marker/label-marker.component.ts +++ b/src/portal/src/app/project/helm-chart/label-marker/label-marker.component.ts @@ -2,11 +2,9 @@ import { Component, Input, Output, OnInit, EventEmitter, ChangeDetectorRef, View import { fromEvent, Subject } from 'rxjs'; import { debounceTime, finalize } from 'rxjs/operators'; -import { RepositoryItem, HelmChartVersion } from './../../service/interface'; -import {Label} from "../../service/interface"; -import { ResourceType } from '../../shared/shared.const'; -import { LabelService } from '../../service/label.service'; -import { ErrorHandler } from '../../error-handler/error-handler'; +import { HelmChartVersion } from '../helm-chart.interface.service'; +import { Label, LabelService, ErrorHandler } from '@harbor/ui'; +import { ResourceType } from '../../../shared/shared.const'; @Component({ selector: 'hbr-resource-label-marker', @@ -18,7 +16,7 @@ export class LabelMarkerComponent implements OnInit { @Input() labels: Label[] = []; @Input() projectName: string; - @Input() resource: RepositoryItem | HelmChartVersion; + @Input() resource: HelmChartVersion; @Input() resourceType: ResourceType; @Input() addLabelHeaders: string; @Output() changeEvt = new EventEmitter(); @@ -38,8 +36,8 @@ export class LabelMarkerComponent implements OnInit { this.sortedLabels = this.labels; this.refresh(); fromEvent(this.filterInputRef.nativeElement, 'keyup') - .pipe(debounceTime(500)) - .subscribe(() => this.refresh()); + .pipe(debounceTime(500)) + .subscribe(() => this.refresh()); this.labelChangeDebouncer.pipe(debounceTime(1000)).subscribe(() => this.changeEvt.emit()); } @@ -47,7 +45,7 @@ export class LabelMarkerComponent implements OnInit { constructor( private labelService: LabelService, private errorHandler: ErrorHandler, - private cdr: ChangeDetectorRef) {} + private cdr: ChangeDetectorRef) { } refresh() { this.loading = true; @@ -56,17 +54,17 @@ export class LabelMarkerComponent implements OnInit { this.projectName, this.resource.name, (this.resource as HelmChartVersion).version) - .pipe(finalize(() => { + .pipe(finalize(() => { this.loading = false; let hnd = setInterval(() => this.cdr.markForCheck(), 100); setTimeout(() => clearInterval(hnd), 2000); - })) - .subscribe( chartVersionLabels => { - for (let label of chartVersionLabels) { - this.markedMap.set(label.id, true); - } - this.sortedLabels = this.getSortedLabels(); - }); + })) + .subscribe(chartVersionLabels => { + for (let label of chartVersionLabels) { + this.markedMap.set(label.id, true); + } + this.sortedLabels = this.getSortedLabels(); + }); } } @@ -133,15 +131,15 @@ export class LabelMarkerComponent implements OnInit { } getSortedLabels(): Label[] { - return this.labels.filter( l => l.name.includes(this.labelFilter)) - .sort((a, b) => { - if (this.isMarked(a) && !this.isMarked(b)) { - return -1; - } else if (!this.isMarked(a) && this.isMarked(b)) { - return 1; - } else { - return a.name < b.name ? -1 : a.name > b.name ? 1 : 0; - } - }); + return this.labels.filter(l => l.name.includes(this.labelFilter)) + .sort((a, b) => { + if (this.isMarked(a) && !this.isMarked(b)) { + return -1; + } else if (!this.isMarked(a) && this.isMarked(b)) { + return 1; + } else { + return a.name < b.name ? -1 : a.name > b.name ? 1 : 0; + } + }); } } diff --git a/src/portal/lib/src/helm-chart/versions/helm-chart-version.component.html b/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.html similarity index 100% rename from src/portal/lib/src/helm-chart/versions/helm-chart-version.component.html rename to src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.html diff --git a/src/portal/lib/src/helm-chart/versions/helm-chart-version.component.scss b/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.scss similarity index 98% rename from src/portal/lib/src/helm-chart/versions/helm-chart-version.component.scss rename to src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.scss index 9e7c9e7b3..cc7b17808 100644 --- a/src/portal/lib/src/helm-chart/versions/helm-chart-version.component.scss +++ b/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.scss @@ -1,4 +1,4 @@ -@import "../../mixin"; +@import "../../../../../../lib/src/mixin"; .title-container { display: flex; diff --git a/src/portal/lib/src/helm-chart/versions/helm-chart-version.component.ts b/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.ts similarity index 91% rename from src/portal/lib/src/helm-chart/versions/helm-chart-version.component.ts rename to src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.ts index ba0a7462f..11679066d 100644 --- a/src/portal/lib/src/helm-chart/versions/helm-chart-version.component.ts +++ b/src/portal/src/app/project/helm-chart/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.ts @@ -12,28 +12,27 @@ import { Observable, forkJoin } from "rxjs"; import { finalize, map } from "rxjs/operators"; import { TranslateService } from "@ngx-translate/core"; -import { State } from "../../service/interface"; - -import { +import { State, SystemInfo, + Label, + ErrorHandler, + DEFAULT_PAGE_SIZE, + downloadFile, SystemInfoService, - HelmChartVersion, - HelmChartMaintainer, - LabelService -} from "./../../service/index"; -import { Label } from './../../service/interface'; -import { ErrorHandler } from "./../../error-handler/error-handler"; -import { DEFAULT_PAGE_SIZE, downloadFile } from "../../utils"; -import { OperationService } from "./../../operation/operation.service"; -import { HelmChartService } from "./../../service/helm-chart.service"; -import { UserPermissionService } from "../../service/permission.service"; -import { USERSTATICPERMISSION } from "../../service/permission-static"; -import { ConfirmationAcknowledgement, ConfirmationDialogComponent, ConfirmationMessage } from "./../../confirmation-dialog"; -import { + LabelService, OperateInfo, OperationState, - operateChanges -} from "./../../operation/operate"; + operateChanges, + OperationService, + UserPermissionService, + USERSTATICPERMISSION } from "@harbor/ui"; + +import { HelmChartVersion, HelmChartMaintainer } from "../../helm-chart.interface.service"; +import { HelmChartService } from "../../helm-chart.service"; +import { ConfirmationAcknowledgement } from "./../../../../shared/confirmation-dialog/confirmation-state-message"; +import { ConfirmationDialogComponent } from "./../../../../shared/confirmation-dialog/confirmation-dialog.component"; +import { ConfirmationMessage } from "./../../../../shared/confirmation-dialog/confirmation-message"; + import { ConfirmationButtons, ConfirmationTargets, @@ -41,7 +40,7 @@ import { DefaultHelmIcon, ResourceType, Roles -} from "../../shared/shared.const"; +} from "../../../../shared/shared.const"; @Component({ selector: "hbr-helm-chart-version", @@ -284,7 +283,7 @@ export class ChartVersionComponent implements OnInit { ConfirmationTargets.HELM_CHART_VERSION, ConfirmationButtons.DELETE_CANCEL ); - this.confirmationDialog.open(message); + this.confirmationDialog.openMessage(message); let hnd = setInterval(() => this.cdr.markForCheck(), 100); setTimeout(() => clearInterval(hnd), 2000); } diff --git a/src/portal/src/app/project/list-chart-versions/list-chart-versions.component.html b/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.html similarity index 100% rename from src/portal/src/app/project/list-chart-versions/list-chart-versions.component.html rename to src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.html diff --git a/src/portal/src/app/project/list-chart-versions/list-chart-versions.component.scss b/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.scss similarity index 100% rename from src/portal/src/app/project/list-chart-versions/list-chart-versions.component.scss rename to src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.scss diff --git a/src/portal/src/app/project/list-chart-versions/list-chart-versions.component.spec.ts b/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.spec.ts similarity index 100% rename from src/portal/src/app/project/list-chart-versions/list-chart-versions.component.spec.ts rename to src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.spec.ts diff --git a/src/portal/src/app/project/list-chart-versions/list-chart-versions.component.ts b/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.ts similarity index 89% rename from src/portal/src/app/project/list-chart-versions/list-chart-versions.component.ts rename to src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.ts index 79d17c86e..491304b3d 100644 --- a/src/portal/src/app/project/list-chart-versions/list-chart-versions.component.ts +++ b/src/portal/src/app/project/helm-chart/list-chart-versions/list-chart-versions.component.ts @@ -2,9 +2,9 @@ import { Router } from '@angular/router'; import { ActivatedRoute } from '@angular/router'; import { Component, OnInit } from '@angular/core'; -import { Project } from './../project'; -import { SessionUser } from './../../shared/session-user'; -import { SessionService } from './../../shared/session.service'; +import { Project } from './../../project'; +import { SessionUser } from './../../../shared/session-user'; +import { SessionService } from './../../../shared/session.service'; @Component({ selector: 'list-chart-version', diff --git a/src/portal/lib/src/helm-chart/helm-chart.component.html b/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.html similarity index 100% rename from src/portal/lib/src/helm-chart/helm-chart.component.html rename to src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.html diff --git a/src/portal/lib/src/helm-chart/helm-chart.component.scss b/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.scss similarity index 98% rename from src/portal/lib/src/helm-chart/helm-chart.component.scss rename to src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.scss index 5a321df9c..e0b5da743 100644 --- a/src/portal/lib/src/helm-chart/helm-chart.component.scss +++ b/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.scss @@ -1,4 +1,4 @@ -@import "../mixin"; +@import "../../../../../lib/src/mixin"; $size24:24px; $size60:60px; diff --git a/src/portal/lib/src/helm-chart/helm-chart.component.ts b/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.ts similarity index 89% rename from src/portal/lib/src/helm-chart/helm-chart.component.ts rename to src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.ts index a891eaccb..38d1aea0a 100644 --- a/src/portal/lib/src/helm-chart/helm-chart.component.ts +++ b/src/portal/src/app/project/helm-chart/list-charts-detail/helm-chart.component.ts @@ -10,29 +10,24 @@ import { } from "@angular/core"; import { NgForm } from '@angular/forms'; import { TranslateService } from "@ngx-translate/core"; -import { State } from "../service/interface"; +import { + State, ErrorHandler, SystemInfo, SystemInfoService, DEFAULT_PAGE_SIZE, downloadFile + , OperationService, UserPermissionService, USERSTATICPERMISSION, OperateInfo, OperationState, operateChanges +} from "@harbor/ui"; import { forkJoin, throwError, Observable } from "rxjs"; import { finalize, map, catchError } from "rxjs/operators"; -import { SystemInfo, SystemInfoService, HelmChartItem } from "../service/index"; -import { ErrorHandler } from "../error-handler/error-handler"; -import { DEFAULT_PAGE_SIZE, downloadFile } from "../utils"; -import { HelmChartService } from "../service/helm-chart.service"; -import { DefaultHelmIcon } from "../shared/shared.const"; -import { Roles } from './../shared/shared.const'; -import { OperationService } from "./../operation/operation.service"; -import { UserPermissionService } from "../service/permission.service"; -import { USERSTATICPERMISSION } from "../service/permission-static"; -import { - OperateInfo, - OperationState, - operateChanges -} from "./../operation/operate"; -import { ConfirmationAcknowledgement, ConfirmationDialogComponent, ConfirmationMessage } from "./../confirmation-dialog"; +import { HelmChartItem } from "../helm-chart.interface.service"; +import { HelmChartService } from "../helm-chart.service"; +import { DefaultHelmIcon, Roles } from "../../../shared/shared.const"; + +import { ConfirmationAcknowledgement } from "../../../shared/confirmation-dialog/confirmation-state-message"; +import { ConfirmationDialogComponent } from "../../../shared/confirmation-dialog/confirmation-dialog.component"; +import { ConfirmationMessage } from "../../../shared/confirmation-dialog/confirmation-message"; import { ConfirmationButtons, ConfirmationTargets, ConfirmationState, -} from "./../shared/shared.const"; +} from "../../../shared/shared.const"; @Component({ selector: "hbr-helm-chart", @@ -98,7 +93,7 @@ export class HelmChartComponent implements OnInit { // Get system info for tag views this.systemInfoService.getSystemInfo() .subscribe(systemInfo => (this.systemInfo = systemInfo) - , error => this.errorHandler.error(error)); + , error => this.errorHandler.error(error)); this.lastFilteredChartName = ""; this.refresh(); this.getHelmPermissionRule(this.projectId); @@ -263,7 +258,7 @@ export class HelmChartComponent implements OnInit { ConfirmationTargets.HELM_CHART, ConfirmationButtons.DELETE_CANCEL ); - this.confirmationDialog.open(message); + this.confirmationDialog.openMessage(message); } confirmDeletion(message: ConfirmationAcknowledgement) { diff --git a/src/portal/src/app/project/list-charts/list-charts.component.html b/src/portal/src/app/project/helm-chart/list-charts.component.html similarity index 100% rename from src/portal/src/app/project/list-charts/list-charts.component.html rename to src/portal/src/app/project/helm-chart/list-charts.component.html diff --git a/src/portal/src/app/project/list-charts/list-charts.component.scss b/src/portal/src/app/project/helm-chart/list-charts.component.scss similarity index 100% rename from src/portal/src/app/project/list-charts/list-charts.component.scss rename to src/portal/src/app/project/helm-chart/list-charts.component.scss diff --git a/src/portal/src/app/project/list-charts/list-charts.component.spec.ts b/src/portal/src/app/project/helm-chart/list-charts.component.spec.ts similarity index 100% rename from src/portal/src/app/project/list-charts/list-charts.component.spec.ts rename to src/portal/src/app/project/helm-chart/list-charts.component.spec.ts diff --git a/src/portal/src/app/project/list-charts/list-charts.component.ts b/src/portal/src/app/project/helm-chart/list-charts.component.ts similarity index 100% rename from src/portal/src/app/project/list-charts/list-charts.component.ts rename to src/portal/src/app/project/helm-chart/list-charts.component.ts diff --git a/src/portal/src/app/project/project.module.ts b/src/portal/src/app/project/project.module.ts index 96ef8aa88..2b3c7cb69 100644 --- a/src/portal/src/app/project/project.module.ts +++ b/src/portal/src/app/project/project.module.ts @@ -35,9 +35,7 @@ import { ProjectRoutingResolver } from './project-routing-resolver.service'; import { TargetExistsValidatorDirective } from '../shared/target-exists-directive'; import { ProjectLabelComponent } from "../project/project-label/project-label.component"; -import { ListChartsComponent } from './list-charts/list-charts.component'; -import { ListChartVersionsComponent } from './list-chart-versions/list-chart-versions.component'; -import { ChartDetailComponent } from './chart-detail/chart-detail.component'; +import { HelmChartModule } from './helm-chart/helm-chart.module'; import { RobotAccountComponent } from './robot-account/robot-account.component'; import { AddRobotComponent } from './robot-account/add-robot/add-robot.component'; @@ -47,7 +45,8 @@ import { AddRobotComponent } from './robot-account/add-robot/add-robot.component RepositoryModule, ReplicationModule, LogModule, - RouterModule + RouterModule, + HelmChartModule ], declarations: [ ProjectComponent, @@ -59,9 +58,6 @@ import { AddRobotComponent } from './robot-account/add-robot/add-robot.component TargetExistsValidatorDirective, ProjectLabelComponent, AddGroupComponent, - ListChartsComponent, - ListChartVersionsComponent, - ChartDetailComponent, RobotAccountComponent, AddRobotComponent ], diff --git a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts b/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts index 769e7cf72..39634c4cc 100644 --- a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts +++ b/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts @@ -58,6 +58,17 @@ export class ConfirmationDialogComponent implements OnDestroy { open(): void { this.opened = true; } + openMessage(msg: ConfirmationMessage): void { + this.dialogTitle = msg.title; + this.message = msg; + this.translate.get(this.dialogTitle).subscribe((res: string) => this.dialogTitle = res); + this.translate.get(msg.message, { 'param': msg.param }).subscribe((res: string) => { + this.dialogContent = res; + }); + // Open dialog + this.buttons = msg.buttons; + this.opened = true; + } close(): void { this.opened = false; diff --git a/src/portal/src/app/shared/list-chart-version-ro/list-chart-version-ro.component.ts b/src/portal/src/app/shared/list-chart-version-ro/list-chart-version-ro.component.ts index f8e545640..c611406ae 100644 --- a/src/portal/src/app/shared/list-chart-version-ro/list-chart-version-ro.component.ts +++ b/src/portal/src/app/shared/list-chart-version-ro/list-chart-version-ro.component.ts @@ -2,7 +2,7 @@ import { extractJson } from './../shared.utils'; import { Router } from '@angular/router'; import { Component, OnInit, Input } from '@angular/core'; -import { HelmChartSearchResultItem, HelmChartVersion, HelmChartMaintainer } from '@harbor/ui'; +import { HelmChartSearchResultItem, HelmChartVersion, HelmChartMaintainer } from '../../project/helm-chart/helm-chart.interface.service'; import { SearchTriggerService } from '../../base/global-search/search-trigger.service'; import { ProjectService } from '../../project/project.service'; diff --git a/src/portal/src/app/shared/route/auth-user-activate.service.ts b/src/portal/src/app/shared/route/auth-user-activate.service.ts index 212e96825..6fc06aa24 100644 --- a/src/portal/src/app/shared/route/auth-user-activate.service.ts +++ b/src/portal/src/app/shared/route/auth-user-activate.service.ts @@ -78,7 +78,7 @@ export class AuthCheckGuard implements CanActivate, CanActivateChild { if (this.isGuest(route, state)) { return observer.next(true); } - // Session retrieving failed.pipe(map redirect to sign-in + // Session retrieving failed then redirect to sign-in // no matter what status code is. // Please pay attention that route 'HARBOR_ROOT' and 'EMBEDDED_SIGN_IN' support anonymous user if (state.url !== CommonRoutes.HARBOR_ROOT && !state.url.startsWith(CommonRoutes.EMBEDDED_SIGN_IN)) { diff --git a/src/portal/src/app/shared/shared.const.ts b/src/portal/src/app/shared/shared.const.ts index 1bc2ddcf2..807b27691 100644 --- a/src/portal/src/app/shared/shared.const.ts +++ b/src/portal/src/app/shared/shared.const.ts @@ -44,7 +44,9 @@ export const enum ConfirmationTargets { TAG, CONFIG, CONFIG_ROUTE, - CONFIG_TAB + CONFIG_TAB, + HELM_CHART, + HELM_CHART_VERSION } export const enum ActionType { @@ -95,3 +97,9 @@ export enum Roles { GUEST = 3, OTHER = 0, } +export const DefaultHelmIcon = '/images/helm-gray.svg'; +export enum ResourceType { + REPOSITORY = 1, + CHART_VERSION = 2, + REPOSITORY_TAG = 3, +} diff --git a/src/portal/src/app/user/user.component.scss b/src/portal/src/app/user/user.component.scss index cfed7b09a..e1d94b136 100644 --- a/src/portal/src/app/user/user.component.scss +++ b/src/portal/src/app/user/user.component.scss @@ -37,8 +37,13 @@ visibility: hidden !important; } .rightPos { - position: absolute; - right: 20px; - height:32px; + position: absolute; + right: 20px; + height:32px; z-index: 100; +} +::ng-deep harbor-user{ + >div{ + position: relative; + } } \ No newline at end of file