From dd27186b86af8ce74813b9324a21adac1f1eadd0 Mon Sep 17 00:00:00 2001 From: blavenie Date: Fri, 21 Sep 2018 19:04:05 +0200 Subject: [PATCH] Fix TS Hint --- src/app/core/form/form.class.ts | 26 +++++++++---------- src/app/core/form/page.class.ts | 3 +-- src/app/core/table/table.class.ts | 2 +- .../referential/vessel/modal/modal-vessel.ts | 2 +- .../physicalgear/physicalgears.table.html | 2 +- src/app/trip/trips.page.ts | 18 +++++++------ 6 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/app/core/form/form.class.ts b/src/app/core/form/form.class.ts index ca31d42e5..ed6668cf8 100644 --- a/src/app/core/form/form.class.ts +++ b/src/app/core/form/form.class.ts @@ -11,39 +11,39 @@ export abstract class AppForm implements OnInit { private _enable: boolean = false; - public touchUi: boolean = false; - public mobile: boolean = false; - public error: string = null; + touchUi: boolean = false; + mobile: boolean = false; + error: string = null; @Input() - public debug: boolean = false; + debug: boolean = false; - public get value(): any { + get value(): any { return this.form.value; } - public set value(data: any) { + set value(data: any) { this.setValue(data); } - public get dirty(): boolean { + get dirty(): boolean { return this.form.dirty; } - public get invalid(): boolean { + get invalid(): boolean { return this.form.invalid; } - public get valid(): boolean { + get valid(): boolean { return this.form.valid; } - public get empty(): boolean { + get empty(): boolean { return !this.form.dirty && !this.form.touched; } - public get untouched(): boolean { + get untouched(): boolean { return this.form.untouched; } - public disable(opts?: { + disable(opts?: { onlySelf?: boolean; emitEvent?: boolean; }): void { @@ -51,7 +51,7 @@ export abstract class AppForm implements OnInit { this._enable = false; } - public enable(opts?: { + enable(opts?: { onlySelf?: boolean; emitEvent?: boolean; }): void { diff --git a/src/app/core/form/page.class.ts b/src/app/core/form/page.class.ts index 735342fbb..68c7d16d2 100644 --- a/src/app/core/form/page.class.ts +++ b/src/app/core/form/page.class.ts @@ -9,8 +9,7 @@ export abstract class AppTabPage{ private _forms: AppForm[]; private _tables: AppTable[]; - protected debug: boolean = false; - + debug: boolean = false; data: T; selectedTabIndex: number = 0; submitted: boolean = false; diff --git a/src/app/core/table/table.class.ts b/src/app/core/table/table.class.ts index b17235798..6fadcd283 100644 --- a/src/app/core/table/table.class.ts +++ b/src/app/core/table/table.class.ts @@ -50,7 +50,7 @@ export abstract class AppTable, F> implements OnInit, OnDest mobile: boolean; @Input() - public debug = false; + debug = false; @ViewChild(MatTable) table: MatSort; @ViewChild(MatPaginator) paginator: MatPaginator; diff --git a/src/app/referential/vessel/modal/modal-vessel.ts b/src/app/referential/vessel/modal/modal-vessel.ts index 8ad4daaa1..0943ccd93 100644 --- a/src/app/referential/vessel/modal/modal-vessel.ts +++ b/src/app/referential/vessel/modal/modal-vessel.ts @@ -13,7 +13,7 @@ export class VesselModal { loading: boolean = false; - @ViewChild('formVessel') private form: VesselForm; + @ViewChild('formVessel') form: VesselForm; constructor( private vesselService: VesselService, diff --git a/src/app/trip/physicalgear/physicalgears.table.html b/src/app/trip/physicalgear/physicalgears.table.html index 8462e98be..c2ca5c7ce 100644 --- a/src/app/trip/physicalgear/physicalgears.table.html +++ b/src/app/trip/physicalgear/physicalgears.table.html @@ -84,7 +84,7 @@ [class.mat-row-disabled]="!isDetailRow(row)" (click)="onRowClick($event, row)"> - +

{{meas}}

diff --git a/src/app/trip/trips.page.ts b/src/app/trip/trips.page.ts index 2dba64dd2..21175e0d3 100644 --- a/src/app/trip/trips.page.ts +++ b/src/app/trip/trips.page.ts @@ -6,12 +6,13 @@ import { AppTable, AppTableDataSource, AccountService } from "../core/core.modul import { TripValidatorService } from "./services/trip.validator"; import { TripService, TripFilter } from "./services/trip.service"; import { TripModal } from "./trip.modal"; -import { Trip, Referential, VesselFeatures, LocationLevelIds } from "./services/trip.model"; +import { Trip, Referential, VesselFeatures, LocationLevelIds, EntityUtils } from "./services/trip.model"; import { ModalController, Platform } from "@ionic/angular"; import { Router, ActivatedRoute } from "@angular/router"; import { Location } from '@angular/common'; import { FormGroup, FormBuilder } from "@angular/forms"; import { VesselService, ReferentialService, vesselFeaturesToString, referentialToString } from "../referential/referential.module"; +import { RESERVED_END_COLUMNS } from "../core/table/table.class"; @Component({ selector: 'page-trips', @@ -42,13 +43,14 @@ export class TripsPage extends AppTable implements OnInit, OnD ) { super(route, router, platform, location, modalCtrl, accountService, - ['select', 'id', - 'vessel', - 'departureLocation', - 'departureDateTime', - 'returnDateTime', - 'comments', - 'actions'], + RESERVED_END_COLUMNS + .concat([ + 'vessel', + 'departureLocation', + 'departureDateTime', + 'returnDateTime', + 'comments']) + .concat(RESERVED_END_COLUMNS), new AppTableDataSource(Trip, dataService, validatorService) ); this.i18nColumnPrefix = 'TRIP.';