Commit 8d9a18b5 authored by AllForNothing's avatar AllForNothing
Browse files

Update UI package to latest version


Signed-off-by: default avatarAllForNothing <sshijun@vmware.com>
parent 18f41bad
......@@ -29,10 +29,10 @@ export class RegistryConfigComponent implements OnInit {
@Input() hasAdminRole: boolean = false;
@ViewChild("systemSettings", {static: false}) systemSettings: SystemSettingsComponent;
@ViewChild("vulnerabilityConfig", {static: false}) vulnerabilityCfg: VulnerabilityConfigComponent;
@ViewChild("gc", {static: false}) gc: GcComponent;
@ViewChild("cfgConfirmationDialog", {static: false}) confirmationDlg: ConfirmationDialogComponent;
@ViewChild("systemSettings") systemSettings: SystemSettingsComponent;
@ViewChild("vulnerabilityConfig") vulnerabilityCfg: VulnerabilityConfigComponent;
@ViewChild("gc") gc: GcComponent;
@ViewChild("cfgConfirmationDialog") confirmationDlg: ConfirmationDialogComponent;
constructor(
private configService: ConfigurationService,
......
......@@ -22,7 +22,7 @@ export class ReplicationConfigComponent {
@Input() showSubTitle: boolean = false;
@ViewChild("replicationConfigFrom", { static: false }) replicationConfigForm: NgForm;
@ViewChild("replicationConfigFrom") replicationConfigForm: NgForm;
get editable(): boolean {
return this.replicationConfig &&
......
......@@ -6,7 +6,7 @@
.clr-form-horizontal {
.clr-form-control {
& >.clr-control-label {
width: 10rem;
width: 12rem;
}
}
.flex-direction-column {
......
......@@ -66,9 +66,9 @@ export class SystemSettingsComponent implements OnChanges, OnInit {
@Input() hasCAFile: boolean = false;
@Input() withAdmiral = false;
@ViewChild("systemConfigFrom", {static: false}) systemSettingsForm: NgForm;
@ViewChild("cfgConfirmationDialog", {static: false}) confirmationDlg: ConfirmationDialogComponent;
@ViewChild('dateInput', {static: false}) dateInput: ElementRef;
@ViewChild("systemConfigFrom") systemSettingsForm: NgForm;
@ViewChild("cfgConfirmationDialog") confirmationDlg: ConfirmationDialogComponent;
@ViewChild('dateInput') dateInput: ElementRef;
get editable(): boolean {
return this.systemSettings &&
......
import { ComponentFixture, TestBed, async, fakeAsync, tick, ComponentFixtureAutoDetect } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync, fakeAsync, tick, ComponentFixtureAutoDetect } from '@angular/core/testing';
import { VulnerabilityConfigComponent } from "./vulnerability-config.component";
import { ScanAllRepoService } from "./scanAll.service";
import { of } from "rxjs";
......@@ -75,7 +75,7 @@ let fakedErrorHandler = {
};
describe('VulnerabilityConfigComponent', () => {
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
SharedModule,
......
......@@ -24,7 +24,7 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy {
openState: boolean = false;
getLabelCurrent: string;
@ViewChild(CronScheduleComponent, {static: false})
@ViewChild(CronScheduleComponent)
CronScheduleComponent: CronScheduleComponent;
gettingMetrics: boolean;
private _scanningMetrics: ScanningMetrics;
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { HarborLibraryModule } from '../../harbor-library.module';
import { ConfirmationDialogComponent } from './confirmation-dialog.component';
import { IServiceConfig, SERVICE_CONFIG } from '../../entities/service.config';
......@@ -24,7 +24,7 @@ describe('ConfirmationDialogComponent', () => {
ConfirmationTargets.CONFIG
);
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
HarborLibraryModule,
......
<clr-modal [(clrModalOpen)]="createEditDestinationOpened" [clrModalStaticBackdrop]="staticBackdrop" [clrModalClosable]="closable">
<h3 class="modal-title">{{modalTitle}}</h3>
<hbr-inline-alert class="modal-title" (confirmEvt)="confirmCancel($event)"></hbr-inline-alert>
<div class="modal-body overflow-visible">
<hbr-inline-alert class="modal-title" (confirmEvt)="confirmCancel($event)"></hbr-inline-alert>
<div class="alert alert-warning" *ngIf="!editable">
<div class="alert-item static">
<span class="alert-text">
......
import {
ComponentFixture,
TestBed,
async
TestBed, waitForAsync,
} from "@angular/core/testing";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { SharedModule } from "../../utils/shared/shared.module";
import { FilterComponent } from "../filter/filter.component";
import { CreateEditEndpointComponent } from "./create-edit-endpoint.component";
import { InlineAlertComponent } from "../inline-alert/inline-alert.component";
import { ErrorHandler } from "../../utils/error-handler/error-handler";
......@@ -20,7 +16,6 @@ import {
import { IServiceConfig, SERVICE_CONFIG } from "../../entities/service.config";
import { of } from "rxjs";
import { HttpClient } from "@angular/common/http";
import { HttpClientTestingModule } from "@angular/common/http/testing";
import { CURRENT_BASE_HREF } from "../../utils/utils";
import { AppConfigService } from '../../../app/services/app-config.service';
......@@ -280,7 +275,7 @@ describe("CreateEditEndpointComponent (inline template)", () => {
};
}
};
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [SharedModule, NoopAnimationsModule],
declarations: [
......@@ -320,14 +315,14 @@ describe("CreateEditEndpointComponent (inline template)", () => {
expect(comp).toBeTruthy();
});
it("should get endpoint be called", async(() => {
it("should get endpoint be called", waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(spy.calls.any()).toBeTruthy();
});
}));
it("should get adapterInfo", async(() => {
it("should get adapterInfo", waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
......@@ -335,7 +330,7 @@ describe("CreateEditEndpointComponent (inline template)", () => {
});
}));
it("should get endpoint and open modal", async(() => {
it("should get endpoint and open modal", waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
......
......@@ -60,13 +60,13 @@ export class CreateEditEndpointComponent
selectedType: string;
initVal: Endpoint;
targetForm: NgForm;
@ViewChild("targetForm", {static: false}) currentForm: NgForm;
@ViewChild("targetForm") currentForm: NgForm;
targetEndpoint;
testOngoing: boolean;
onGoing: boolean;
endpointId: number | string;
@ViewChild(InlineAlertComponent, {static: false}) inlineAlert: InlineAlertComponent;
@ViewChild(InlineAlertComponent) inlineAlert: InlineAlertComponent;
@Output() reload = new EventEmitter<boolean>();
......
import { ComponentFixture, TestBed, async } from "@angular/core/testing";
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { SharedModule } from "../../utils/shared/shared.module";
......@@ -36,7 +36,7 @@ describe("CreateEditLabelComponent (inline template)", () => {
let spy: jasmine.Spy;
let spyOne: jasmine.Spy;
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [SharedModule, NoopAnimationsModule],
declarations: [
......@@ -76,7 +76,7 @@ describe("CreateEditLabelComponent (inline template)", () => {
expect(comp).toBeTruthy();
});
it("should get label and open modal", async(() => {
it("should get label and open modal", waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
......
import { ComponentFixture, TestBed, async } from "@angular/core/testing";
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
import { By } from "@angular/platform-browser";
import { DebugElement } from "@angular/core";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
......@@ -226,7 +226,7 @@ describe("CreateEditRuleComponent (inline template)", () => {
targetBaseEndpoint: CURRENT_BASE_HREF + "/registries/testing"
};
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [SharedModule, NoopAnimationsModule, RouterTestingModule],
declarations: [
......@@ -285,7 +285,7 @@ describe("CreateEditRuleComponent (inline template)", () => {
fixture.detectChanges();
});
it("Should open creation modal and load endpoints", async(() => {
it("Should open creation modal and load endpoints", waitForAsync(() => {
fixture.detectChanges();
compCreate.openCreateEditRule();
fixture.whenStable().then(() => {
......@@ -300,7 +300,7 @@ describe("CreateEditRuleComponent (inline template)", () => {
});
}));
it("Should open modal to edit replication rule", async(() => {
it("Should open modal to edit replication rule", waitForAsync(() => {
fixture.detectChanges();
compCreate.openCreateEditRule(mockRule.id);
fixture.whenStable().then(() => {
......
import { ComponentFixture, TestBed, async, fakeAsync, tick } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync, fakeAsync, tick } from '@angular/core/testing';
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { SharedModule } from "../../utils/shared/shared.module";
import { ErrorHandler } from "../../utils/error-handler/error-handler";
......@@ -56,7 +56,7 @@ describe("FilterLabelComponent", () => {
return null;
}
};
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [SharedModule, NoopAnimationsModule, RouterTestingModule],
declarations: [
......
......@@ -42,8 +42,8 @@
<clr-dg-cell>{{t.creation_time | date: 'short'}}</clr-dg-cell>
</clr-dg-row>
<clr-dg-footer>
<span *ngIf="pagination.totalItems">{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'DESTINATION.OF' | translate}}</span>
{{pagination.totalItems}} {{'DESTINATION.ITEMS' | translate}}
<span *ngIf="targets?.length">{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'DESTINATION.OF' | translate}}</span>
{{targets?.length}} {{'DESTINATION.ITEMS' | translate}}
<clr-dg-pagination #pagination [clrDgPageSize]="15"></clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid>
......
import { ComponentFixture, TestBed, async } from "@angular/core/testing";
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
import { By } from "@angular/platform-browser";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { DebugElement } from "@angular/core";
......@@ -337,7 +337,7 @@ describe("EndpointComponent (inline template)", () => {
let spyAdapter: jasmine.Spy;
let spyOnRules: jasmine.Spy;
let spyOne: jasmine.Spy;
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [SharedModule, NoopAnimationsModule, HttpClientTestingModule],
declarations: [
......@@ -390,7 +390,7 @@ describe("EndpointComponent (inline template)", () => {
expect(config.systemInfoEndpoint).toEqual(CURRENT_BASE_HREF + "/endpoints/testing");
});
it("should open create endpoint modal", async(() => {
it("should open create endpoint modal", waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
......@@ -400,7 +400,7 @@ describe("EndpointComponent (inline template)", () => {
});
}));
it("should filter endpoints by keyword", async(() => {
it("should filter endpoints by keyword", waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
......@@ -410,7 +410,7 @@ describe("EndpointComponent (inline template)", () => {
});
}));
it("should render data", async(() => {
it("should render data", waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
......@@ -423,7 +423,7 @@ describe("EndpointComponent (inline template)", () => {
});
}));
it("should open creation endpoint", async(() => {
it("should open creation endpoint", waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
let de: DebugElement = fixture.debugElement.query(By.css("btn-link"));
......@@ -436,7 +436,7 @@ describe("EndpointComponent (inline template)", () => {
});
}));
it("should open to edit existing endpoint", async(() => {
it("should open to edit existing endpoint", waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
let de: DebugElement = fixture.debugElement.query(
......
......@@ -53,10 +53,10 @@ import { OperationService } from "../operation/operation.service";
changeDetection: ChangeDetectionStrategy.OnPush
})
export class EndpointComponent implements OnInit, OnDestroy {
@ViewChild(CreateEditEndpointComponent, {static: false})
@ViewChild(CreateEditEndpointComponent)
createEditEndpointComponent: CreateEditEndpointComponent;
@ViewChild("confirmationDialog", {static: false})
@ViewChild("confirmationDialog")
confirmationDialogComponent: ConfirmationDialogComponent;
targets: Endpoint[];
......
import { async, ComponentFixture, TestBed } from "@angular/core/testing";
import { waitForAsync, ComponentFixture, TestBed } from "@angular/core/testing";
import { SharedModule } from "../../utils/shared/shared.module";
import { ImageNameInputComponent } from "./image-name-input.component";
import { ErrorHandler } from "../../utils/error-handler/error-handler";
......@@ -32,7 +32,7 @@ describe("ImageNameInputComponent (inline template)", () => {
projectBaseEndpoint: CURRENT_BASE_HREF + "/projects/testing"
};
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
SharedModule
......@@ -58,7 +58,7 @@ describe("ImageNameInputComponent (inline template)", () => {
spy = spyOn(projectService, "listProjects").and.returnValues(of(new HttpResponse({ body: mockProjects })));
});
it("should load data", async(() => {
it("should load data", waitForAsync(() => {
expect(spy.calls.any).toBeTruthy();
}));
});
......@@ -30,8 +30,8 @@
<clr-dg-cell>{{label.creation_time | date: 'short'}}</clr-dg-cell>
</clr-dg-row>
<clr-dg-footer>
<span *ngIf="pagination.totalItems">{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'DESTINATION.OF' | translate}}</span>
{{pagination.totalItems}} {{'DESTINATION.ITEMS' | translate}}
<span *ngIf="targets?.length">{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'DESTINATION.OF' | translate}}</span>
{{targets?.length}} {{'DESTINATION.ITEMS' | translate}}
<clr-dg-pagination #pagination [clrDgPageSize]="15"></clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid>
......
import {Label} from "../../services/interface";
import {LabelComponent} from "./label.component";
import {async, ComponentFixture, TestBed} from "@angular/core/testing";
import {LabelDefaultService, LabelService} from "../../services/label.service";
import {SharedModule} from "../../utils/shared/shared.module";
import {NoopAnimationsModule} from "@angular/platform-browser/animations";
import {FilterComponent} from "../filter/filter.component";
import {ConfirmationDialogComponent} from "../confirmation-dialog/confirmation-dialog.component";
import {CreateEditLabelComponent} from "../create-edit-label/create-edit-label.component";
import {LabelPieceComponent} from "../label-piece/label-piece.component";
import {InlineAlertComponent} from "../inline-alert/inline-alert.component";
import {ErrorHandler} from "../../utils/error-handler/error-handler";
import {IServiceConfig, SERVICE_CONFIG} from "../../entities/service.config";
import { Label } from "../../services";
import { LabelComponent } from "./label.component";
import { waitForAsync, ComponentFixture, TestBed } from "@angular/core/testing";
import { LabelDefaultService, LabelService } from "../../services";
import { SharedModule } from "../../utils/shared/shared.module";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { FilterComponent } from "../filter/filter.component";
import { ConfirmationDialogComponent } from "../confirmation-dialog";
import { CreateEditLabelComponent } from "../create-edit-label/create-edit-label.component";
import { LabelPieceComponent } from "../label-piece/label-piece.component";
import { InlineAlertComponent } from "../inline-alert/inline-alert.component";
import { ErrorHandler } from "../../utils/error-handler";
import { IServiceConfig, SERVICE_CONFIG } from "../../entities/service.config";
import { OperationService } from "../operation/operation.service";
import { of } from "rxjs";
import { CURRENT_BASE_HREF } from "../../utils/utils";
......@@ -42,15 +41,15 @@ describe('LabelComponent (inline template)', () => {
];
let mockOneData: Label = {
color: "#9b0d54",
creation_time: "",
description: "",
id: 1,
name: "label0-g",
project_id: 0,
scope: "g",
update_time: "",
};
color: "#9b0d54",
creation_time: "",
description: "",
id: 1,
name: "label0-g",
project_id: 0,
scope: "g",
update_time: "",
};
let comp: LabelComponent;
let fixture: ComponentFixture<LabelComponent>;
......@@ -64,7 +63,7 @@ describe('LabelComponent (inline template)', () => {
systemInfoEndpoint: CURRENT_BASE_HREF + '/label/testing'
};
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
SharedModule,
......@@ -80,9 +79,9 @@ describe('LabelComponent (inline template)', () => {
],
providers: [
ErrorHandler,
{ provide: SERVICE_CONFIG, useValue: config },
{provide: SERVICE_CONFIG, useValue: config},
{provide: LabelService, useClass: LabelDefaultService},
{ provide: OperationService }
{provide: OperationService}
]
});
}));
......@@ -103,7 +102,7 @@ describe('LabelComponent (inline template)', () => {
expect(spy.calls.any()).toBeTruthy();
});
it('should open create label modal', async(() => {
it('should open create label modal', waitForAsync(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
......@@ -112,23 +111,4 @@ describe('LabelComponent (inline template)', () => {
expect(comp.targets[0].name).toEqual('label0-g');
});
}));
/*it('should open to edit existing label', async() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
let de: DebugElement = fixture.debugElement.query(del => del.classes['active']);
expect(de).toBeTruthy();
fixture.detectChanges();
click(de);
fixture.detectChanges();
let deInput: DebugElement = fixture.debugElement.query(By.css['input']);
expect(deInput).toBeTruthy();
let elInput: HTMLElement = deInput.nativeElement;
expect(elInput).toBeTruthy();
expect(elInput.textContent).toEqual('label1-g');
})
})*/
});
......@@ -56,9 +56,9 @@ export class LabelComponent implements OnInit {
@Input() hasUpdateLabelPermission: boolean;
@Input() hasDeleteLabelPermission: boolean;
@ViewChild(CreateEditLabelComponent, {static: false})
@ViewChild(CreateEditLabelComponent)
createEditLabel: CreateEditLabelComponent;
@ViewChild("confirmationDialog", {static: false})
@ViewChild("confirmationDialog")
confirmationDialogComponent: ConfirmationDialogComponent;
constructor(private labelService: LabelService,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment