diff --git a/.travis.yml b/.travis.yml index 69dce3108..ce3f94268 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,7 +86,7 @@ before_script: - sudo mkdir -p ./make/common/config/registry/ && sudo mv ./tests/reg_config.yml ./make/common/config/registry/config.yml script: - - cd src/portal && npm run test && cd ../.. + - cd src/portal && npm run lint && npm run lint:lib && npm run test && cd ../.. - sudo docker-compose -f ./make/docker-compose.test.yml up -d - make go_check - ./tests/pushimage.sh diff --git a/src/portal/angular.json b/src/portal/angular.json index 85fb18a6a..63e3fda46 100644 --- a/src/portal/angular.json +++ b/src/portal/angular.json @@ -3,7 +3,7 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "clarity-seed": { + "harbor-portal": { "root": "", "sourceRoot": "src", "projectType": "application", @@ -61,18 +61,18 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "clarity-seed:build" + "browserTarget": "harbor-portal:build" }, "configurations": { "production": { - "browserTarget": "clarity-seed:build:production" + "browserTarget": "harbor-portal:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "clarity-seed:build" + "browserTarget": "harbor-portal:build" } }, "test": { @@ -111,7 +111,7 @@ "tsConfig": [ "src/tsconfig.app.json", "src/tsconfig.spec.json", - "lib/src/tsconfig.json" + "lib/tsconfig.lib.json" ], "exclude": [ "**/node_modules/**" @@ -121,7 +121,7 @@ } } }, - "clarity-seed-e2e": { + "harbor-portal-e2e": { "root": "e2e", "sourceRoot": "e2e", "projectType": "application", @@ -130,7 +130,7 @@ "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "./protractor.config.js", - "devServerTarget": "clarity-seed:serve" + "devServerTarget": "harbor-portal:serve" } }, "lint": { @@ -164,7 +164,7 @@ "builder": "@angular-devkit/build-angular:karma", "options": { "main": "lib/src/test.ts", - "tsConfig": "lib/tsconfig.spec.json", + "tsConfig": "lib/tsconfig.lib.json", "karmaConfig": "lib/karma.conf.js" } }, @@ -182,7 +182,7 @@ } } }, - "defaultProject": "clarity-seed", + "defaultProject": "harbor-portal", "schematics": { "@schematics/angular:component": { "prefix": "app", diff --git a/src/portal/e2e/app.e2e-spec.ts b/src/portal/e2e/app.e2e-spec.ts index fd0e8d0b9..02388c458 100644 --- a/src/portal/e2e/app.e2e-spec.ts +++ b/src/portal/e2e/app.e2e-spec.ts @@ -13,7 +13,7 @@ // limitations under the License. import {ClaritySeedAppHome} from './app.po'; -fdescribe('clarity-seed app', function () { +fdescribe('harbor-portal app', function () { let expectedMsg: string = 'This is a Clarity seed application. This is the default page that loads for the application.'; diff --git a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts b/src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts index e2b7a9650..eb4a88dfc 100644 --- a/src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts +++ b/src/portal/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts @@ -36,8 +36,10 @@ export class ChartDetailSummaryComponent implements OnInit { ) {} ngOnInit(): void { - this.addCMD = `helm repo add --ca-file --cert-file --key-file --username --password ${this.repoURL}/chartrepo/${this.projectName}`; - this.installCMD = `helm install --ca-file --cert-file --key-file --username= --password= --version ${this.chartVersion} /${this.chartName}`; + this.addCMD = "helm repo add --ca-file --cert-file --key-file \ + --username --password ${this.repoURL}/chartrepo/${this.projectName}"; + this.installCMD = "helm install --ca-file --cert-file --key-file \ + --username= --password= --version ${this.chartVersion} /${this.chartName}"; this.verifyCMD = `helm verify --keyring ${this.chartName}-${this.chartVersion}.tgz`; } diff --git a/src/portal/lib/src/repository-gridview/repository-gridview.component.spec.ts b/src/portal/lib/src/repository-gridview/repository-gridview.component.spec.ts index 0ae28e6de..9b02e9fb8 100644 --- a/src/portal/lib/src/repository-gridview/repository-gridview.component.spec.ts +++ b/src/portal/lib/src/repository-gridview/repository-gridview.component.spec.ts @@ -140,7 +140,7 @@ describe('RepositoryComponentGridview (inline template)', () => { expect(compRepo).toBeTruthy(); }); - //Will fail after upgrade to angular 6. todo: need to fix it. + // Will fail after upgrade to angular 6. todo: need to fix it. xit('should load and render data', async(() => { fixtureRepo.whenStable().then(() => { fixtureRepo.detectChanges(); @@ -152,7 +152,7 @@ describe('RepositoryComponentGridview (inline template)', () => { }); })); - //Will fail after upgrade to angular 6. todo: need to fix it. + // Will fail after upgrade to angular 6. todo: need to fix it. xit('should filter data by keyword', async(() => { fixtureRepo.whenStable().then(() => { fixtureRepo.detectChanges(); diff --git a/src/portal/lib/src/repository-gridview/repository-gridview.component.ts b/src/portal/lib/src/repository-gridview/repository-gridview.component.ts index b66d502eb..941ddec95 100644 --- a/src/portal/lib/src/repository-gridview/repository-gridview.component.ts +++ b/src/portal/lib/src/repository-gridview/repository-gridview.component.ts @@ -10,8 +10,9 @@ import { OnChanges, SimpleChanges } from "@angular/core"; -import {Router} from "@angular/router"; -import {forkJoin} from "rxjs"; +import { Router } from "@angular/router"; +import { forkJoin } from "rxjs"; +import { finalize } from "rxjs/operators"; import {TranslateService} from "@ngx-translate/core"; import {Comparator, State} from "@clr/angular"; @@ -258,13 +259,16 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit { } confirmationDialogSet(summaryTitle: string, signature: string, - repoName: string, repoLists: RepositoryItem[], - summaryKey: string, button: ConfirmationButtons): void { + repoName: string, repoLists: RepositoryItem[], + summaryKey: string, button: ConfirmationButtons): void { this.translateService.get(summaryKey, { repoName: repoName, signedImages: signature, - }) + }).pipe(finalize(() => { + let hnd = setInterval(() => this.ref.markForCheck(), 100); + setTimeout(() => clearInterval(hnd), 5000); + })) .subscribe((res: string) => { summaryKey = res; let message = new ConfirmationMessage( @@ -276,11 +280,8 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit { button); this.confirmationDialog.open(message); - let hnd = setInterval(() => this.ref.markForCheck(), 100); - setTimeout(() => clearInterval(hnd), 5000); + }); - let hnd = setInterval(() => this.ref.markForCheck(), 100); - setTimeout(() => clearInterval(hnd), 5000); } containsLatestTag(repo: RepositoryItem): Promise { diff --git a/src/portal/lib/src/repository/repository.component.spec.ts b/src/portal/lib/src/repository/repository.component.spec.ts index 68fd86793..ce425938e 100644 --- a/src/portal/lib/src/repository/repository.component.spec.ts +++ b/src/portal/lib/src/repository/repository.component.spec.ts @@ -206,7 +206,7 @@ describe('RepositoryComponent (inline template)', () => { expect(compRepo).toBeTruthy(); }); - //fail after upgrade to angular 6. + // fail after upgrade to angular 6. xit('should load and render data', async(() => { fixture.detectChanges(); fixture.whenStable().then(() => { diff --git a/src/portal/lib/src/tag/tag.component.spec.ts b/src/portal/lib/src/tag/tag.component.spec.ts index df8217a1c..4f7fb5d7a 100644 --- a/src/portal/lib/src/tag/tag.component.spec.ts +++ b/src/portal/lib/src/tag/tag.component.spec.ts @@ -149,7 +149,7 @@ describe('TagComponent (inline template)', () => { expect(spy.calls.any).toBeTruthy(); })); - //fail after upgrade to angular 6. + // fail after upgrade to angular 6. xit('should load and render data', async(() => { fixture.detectChanges(); fixture.whenStable().then(() => { diff --git a/src/portal/package.json b/src/portal/package.json index 0ee5d9e8c..bda59bcd5 100644 --- a/src/portal/package.json +++ b/src/portal/package.json @@ -7,7 +7,7 @@ "start": "ng serve --aot --ssl true --ssl-key ssl/server.key --ssl-cert ssl/server.crt --host 0.0.0.0 --proxy-config proxy.config.json", "lint": "tslint \"src/**/*.ts\"", "lint:lib": "tslint \"lib/**/*.ts\" -e \"lib/dist/**/*\" ", - "test": "ng test", + "test": "ng test harbor-portal", "pree2e": "webdriver-manager update", "e2e": "protractor", "build": "ng build --aot", diff --git a/src/portal/tslint.json b/src/portal/tslint.json index 14eaa785e..9530f406e 100644 --- a/src/portal/tslint.json +++ b/src/portal/tslint.json @@ -71,8 +71,6 @@ "use-life-cycle-interface": true, "use-pipe-transform-interface": true, "component-class-suffix": true, - "directive-class-suffix": true, - "templates-use-public": true, - "invoke-injectable": true + "directive-class-suffix": true } }