diff --git a/app/components/account/browse/account-list/account-list.component.ts b/app/components/account/browse/account-list/account-list.component.ts index 29c279a969..bd6fe6cac1 100644 --- a/app/components/account/browse/account-list/account-list.component.ts +++ b/app/components/account/browse/account-list/account-list.component.ts @@ -1,16 +1,13 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, forwardRef } from "@angular/core"; -import { ActivatedRoute } from "@angular/router"; -import { List } from "immutable"; -import { Observable, Subscription } from "rxjs"; - import { Filter, FilterMatcher, autobind } from "@batch-flask/core"; import { ListBaseComponent } from "@batch-flask/core/list"; import { LoadingStatus } from "@batch-flask/ui/loading"; import { QuickListItemStatus } from "@batch-flask/ui/quick-list"; -import { SidebarManager } from "@batch-flask/ui/sidebar"; import { BatchAccountCommands } from "app/components/account/action"; import { AccountResource } from "app/models"; import { AccountService, SubscriptionService } from "app/services"; +import { List } from "immutable"; +import { Observable, Subscription } from "rxjs"; import { flatMap, shareReplay } from "rxjs/operators"; @Component({ @@ -36,8 +33,6 @@ export class AccountListComponent extends ListBaseComponent implements OnDestroy constructor( public commands: BatchAccountCommands, private accountService: AccountService, - activatedRoute: ActivatedRoute, - sidebarManager: SidebarManager, changeDetector: ChangeDetectorRef, private subscriptionService: SubscriptionService) { super(changeDetector); diff --git a/app/components/pool/action/add/pool-create-basic-dialog.component.ts b/app/components/pool/action/add/pool-create-basic-dialog.component.ts index ebe0b30aa2..7d692d7d8a 100644 --- a/app/components/pool/action/add/pool-create-basic-dialog.component.ts +++ b/app/components/pool/action/add/pool-create-basic-dialog.component.ts @@ -9,7 +9,7 @@ import { SidebarRef } from "@batch-flask/ui/sidebar"; import { Certificate, NodeFillType, Pool } from "app/models"; import { PoolCreateDto } from "app/models/dtos"; import { CreatePoolModel, PoolOsSources, createPoolToData, poolToFormModel } from "app/models/forms"; -import { AccountService, CertificateService, PoolService, PricingService, VmSizeService } from "app/services"; +import { AccountService, CertificateService, PoolService, PricingService } from "app/services"; import { Constants, NumberUtils } from "app/utils"; @Component({ @@ -40,7 +40,6 @@ export class PoolCreateBasicDialogComponent extends DynamicForm=6.0.0" }, "devDependencies": { - "@ngtools/webpack": "^6.1.3", + "@ngtools/webpack": "^6.1.5", "@types/bunyan": "^1.8.0", "@types/chart.js": "^2.7.28", "@types/chokidar": "^1.7.5", @@ -84,7 +84,6 @@ "devtron": "^1.4.0", "electron": "^2.0.7", "electron-builder": "^20.27.1", - "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.11", "fork-ts-checker-webpack-plugin": "^0.4.8", "html-webpack-plugin": "^3.2.0", @@ -119,27 +118,27 @@ "tslint": "^5.11.0", "typescript": "^3.0.1", "url-loader": "^1.0.1", - "webpack": "^4.16.5", + "webpack": "^4.17.2", "webpack-cli": "^3.1.0", - "webpack-dev-server": "^3.1.5", + "webpack-dev-server": "^3.1.7", "webpack-inline-manifest-plugin": "^4.0.1", "webpack-merge": "^4.1.4", "yesno": "^0.0.1" }, "dependencies": { - "@angular/animations": "6.1.2", - "@angular/cdk": "^6.4.3", - "@angular/common": "6.1.2", - "@angular/compiler": "6.1.2", - "@angular/compiler-cli": "6.1.2", - "@angular/core": "6.1.2", - "@angular/forms": "6.1.2", - "@angular/http": "6.1.2", - "@angular/material": "^6.4.3", - "@angular/platform-browser": "6.1.2", - "@angular/platform-browser-dynamic": "6.1.2", - "@angular/platform-server": "6.1.2", - "@angular/router": "6.1.2", + "@angular/animations": "6.1.6", + "@angular/cdk": "^6.4.7", + "@angular/common": "6.1.6", + "@angular/compiler": "6.1.6", + "@angular/compiler-cli": "6.1.6", + "@angular/core": "6.1.6", + "@angular/forms": "6.1.6", + "@angular/http": "6.1.6", + "@angular/material": "^6.4.7", + "@angular/platform-browser": "6.1.6", + "@angular/platform-browser-dynamic": "6.1.6", + "@angular/platform-server": "6.1.6", + "@angular/router": "6.1.6", "@tweenjs/tween.js": "^17.1.1", "azure-storage": "^2.10.1", "bunyan": "^1.8.4", diff --git a/src/@batch-flask/ui/form/form-page/form-page.component.ts b/src/@batch-flask/ui/form/form-page/form-page.component.ts index 582eee7ef4..df5ed4657c 100644 --- a/src/@batch-flask/ui/form/form-page/form-page.component.ts +++ b/src/@batch-flask/ui/form/form-page/form-page.component.ts @@ -1,8 +1,8 @@ import { - Component, ContentChildren, EventEmitter, Inject, Input, Output, QueryList, - TemplateRef, ViewChild, forwardRef, + AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, + Component, ContentChildren, EventEmitter, Inject, + Input, Output, QueryList, TemplateRef, ViewChild, forwardRef, } from "@angular/core"; - import { AbstractControl } from "@angular/forms"; import { ComplexFormComponent } from "../complex-form"; import { FormSectionComponent } from "../form-section"; @@ -16,8 +16,9 @@ export interface FocusableElement { @Component({ selector: "bl-form-page", templateUrl: "form-page.html", + changeDetection: ChangeDetectionStrategy.OnPush, }) -export class FormPageComponent { +export class FormPageComponent implements AfterViewInit { /** * Title of the page. It will be shown when this page is the current page of a form. */ @@ -52,8 +53,16 @@ export class FormPageComponent { public openedWith: FocusableElement; // tslint:disable-next-line:no-forward-ref - constructor( @Inject(forwardRef(() => ComplexFormComponent)) private form: ComplexFormComponent) { } + constructor( + @Inject(forwardRef(() => ComplexFormComponent)) private form: ComplexFormComponent, + private changeDetector: ChangeDetectorRef) { + } + public ngAfterViewInit() { + this.sections.changes.subscribe(() => { + this.changeDetector.markForCheck(); + }); + } /** * Open the given page. It will push on top of the page stack. * @param picker If opening from a picker @@ -70,7 +79,7 @@ export class FormPageComponent { return !this.formGroup || this.formGroup.valid; } - public trackByFn(index, section: FormSectionComponent) { - return index; + public trackByFn(_, section: FormSectionComponent) { + return section.title; } } diff --git a/src/@batch-flask/ui/form/form-section/form-section.component.ts b/src/@batch-flask/ui/form/form-section/form-section.component.ts index 94a6510585..677020a6f6 100644 --- a/src/@batch-flask/ui/form/form-section/form-section.component.ts +++ b/src/@batch-flask/ui/form/form-section/form-section.component.ts @@ -1,16 +1,14 @@ -import { Component, Input, TemplateRef, ViewChild } from "@angular/core"; +import { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewChild } from "@angular/core"; @Component({ selector: "bl-form-section", templateUrl: "form-section.html", + changeDetection: ChangeDetectionStrategy.OnPush, }) export class FormSectionComponent { - @Input() - public title: string; + @Input() public title: string; - @Input() - public subtitle: string; + @Input() public subtitle: string; - @ViewChild(TemplateRef) - public content: TemplateRef; + @ViewChild(TemplateRef) public content: TemplateRef; }