Prettied, Linted and updated angular.json according to the latest schematic of Angular CLI.
Now all that is needed is to make it ready for strict compiling. Removed eslint-plugin-prettier as it is not recommended and causes errors for both eslint and prettier Bumped to v8.0.0
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { CashFlowItem } from './cash-flow';
|
||||
|
||||
import { CashFlowItem } from './cash-flow-item';
|
||||
|
||||
export class CashFlowDataSource extends DataSource<CashFlowItem> {
|
||||
constructor(private data: CashFlowItem[]) {
|
||||
|
||||
9
overlord/src/app/cash-flow/cash-flow-item.ts
Normal file
9
overlord/src/app/cash-flow/cash-flow-item.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export class CashFlowItem {
|
||||
name: string;
|
||||
url: [];
|
||||
amount: number;
|
||||
|
||||
constructor(name: string) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { CashFlow } from './cash-flow';
|
||||
import { CashFlowService } from './cash-flow.service';
|
||||
|
||||
@ -10,7 +11,7 @@ import { CashFlowService } from './cash-flow.service';
|
||||
export class CashFlowResolver implements Resolve<CashFlow> {
|
||||
constructor(private ser: CashFlowService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<CashFlow> {
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<CashFlow> {
|
||||
const id = route.paramMap.get('id');
|
||||
const startDate = route.queryParamMap.get('startDate') || null;
|
||||
const finishDate = route.queryParamMap.get('finishDate') || null;
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { CashFlowResolver } from './cash-flow-resolver.service';
|
||||
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
|
||||
import { CashFlowResolver } from './cash-flow-resolver.service';
|
||||
import { CashFlowComponent } from './cash-flow.component';
|
||||
|
||||
const cashFlowRoutes: Routes = [
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { CashFlowDataSource } from './cash-flow-datasource';
|
||||
import { CashFlow } from './cash-flow';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
|
||||
import { CashFlow } from './cash-flow';
|
||||
import { CashFlowDataSource } from './cash-flow-datasource';
|
||||
|
||||
@Component({
|
||||
selector: 'app-cash-flow',
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CdkTableModule } from '@angular/cdk/table';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
@ -16,13 +20,11 @@ import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { CdkTableModule } from '@angular/cdk/table';
|
||||
|
||||
import { CashFlowRoutingModule } from './cash-flow-routing.module';
|
||||
import { CashFlowComponent } from './cash-flow.component';
|
||||
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
export const MY_FORMATS = {
|
||||
parse: {
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { CashFlow } from './cash-flow';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
import { CashFlow } from './cash-flow';
|
||||
|
||||
const url = '/api/cash-flow';
|
||||
const serviceName = 'CashFlowService';
|
||||
@ -26,7 +24,14 @@ export class CashFlowService {
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
const listUrl = id === null ? (startDate || finishDate ? `${url}/data` : url) : `${url}/${id}`;
|
||||
let listUrl = '';
|
||||
if (id !== null) {
|
||||
listUrl = `${url}/${id}`;
|
||||
} else if (startDate || finishDate) {
|
||||
listUrl = `${url}/data`;
|
||||
} else {
|
||||
listUrl = url;
|
||||
}
|
||||
return <Observable<CashFlow>>(
|
||||
this.http
|
||||
.get<CashFlow>(listUrl, options)
|
||||
|
||||
@ -1,12 +1,4 @@
|
||||
export class CashFlowItem {
|
||||
name: string;
|
||||
url: [];
|
||||
amount: number;
|
||||
|
||||
constructor(name: string) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
import { CashFlowItem } from './cash-flow-item';
|
||||
|
||||
export class CashFlow {
|
||||
startDate: string;
|
||||
@ -17,6 +9,7 @@ export class CashFlow {
|
||||
financing: CashFlowItem[];
|
||||
details: CashFlowItem[];
|
||||
};
|
||||
|
||||
footer?: CashFlowItem[];
|
||||
|
||||
static Data(value): CashFlowItem[] {
|
||||
|
||||
Reference in New Issue
Block a user