Skip to content

Commit

Permalink
Fix TS Hint
Browse files Browse the repository at this point in the history
  • Loading branch information
blavenie committed Sep 21, 2018
1 parent 2bb5eef commit dd27186
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 26 deletions.
26 changes: 13 additions & 13 deletions src/app/core/form/form.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,47 @@ export abstract class AppForm<T> 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 {
this.form && this.form.disable(opts);
this._enable = false;
}

public enable(opts?: {
enable(opts?: {
onlySelf?: boolean;
emitEvent?: boolean;
}): void {
Expand Down
3 changes: 1 addition & 2 deletions src/app/core/form/page.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export abstract class AppTabPage<T, F = any>{
private _forms: AppForm<any>[];
private _tables: AppTable<any, any>[];

protected debug: boolean = false;

debug: boolean = false;
data: T;
selectedTabIndex: number = 0;
submitted: boolean = false;
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/table/table.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export abstract class AppTable<T extends Entity<T>, F> implements OnInit, OnDest
mobile: boolean;

@Input()
public debug = false;
debug = false;

@ViewChild(MatTable) table: MatSort;
@ViewChild(MatPaginator) paginator: MatPaginator;
Expand Down
2 changes: 1 addition & 1 deletion src/app/referential/vessel/modal/modal-vessel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class VesselModal {

loading: boolean = false;

@ViewChild('formVessel') private form: VesselForm;
@ViewChild('formVessel') form: VesselForm;

constructor(
private vesselService: VesselService,
Expand Down
2 changes: 1 addition & 1 deletion src/app/trip/physicalgear/physicalgears.table.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
[class.mat-row-disabled]="!isDetailRow(row)" (click)="onRowClick($event, row)"></mat-row>
</mat-table>

<ion-text *ngIf="selectedRow && _debug">
<ion-text *ngIf="selectedRow && debug">
<p *ngFor="let meas of detailMeasurements | async">
{{meas}}
</p>
Expand Down
18 changes: 10 additions & 8 deletions src/app/trip/trips.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -42,13 +43,14 @@ export class TripsPage extends AppTable<Trip, TripFilter> 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, TripFilter>(Trip, dataService, validatorService)
);
this.i18nColumnPrefix = 'TRIP.';
Expand Down

0 comments on commit dd27186

Please sign in to comment.