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,8 +1,13 @@
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { merge, Observable, of as observableOf } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
/** Simple sort comparator for example ID/Name columns (for client-side sorting). */
|
||||
function compare(a, b, isAsc) {
|
||||
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
|
||||
}
|
||||
|
||||
export class BalanceSheetDataSource extends DataSource<any> {
|
||||
constructor(private paginator: MatPaginator, private sort: MatSort, public data: any[]) {
|
||||
@ -16,9 +21,7 @@ export class BalanceSheetDataSource extends DataSource<any> {
|
||||
this.paginator.length = this.data.length;
|
||||
|
||||
return merge(...dataMutations).pipe(
|
||||
map(() => {
|
||||
return this.getPagedData(this.getSortedData([...this.data]));
|
||||
}),
|
||||
map(() => this.getPagedData(this.getSortedData([...this.data]))),
|
||||
);
|
||||
}
|
||||
|
||||
@ -47,8 +50,3 @@ export class BalanceSheetDataSource extends DataSource<any> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** Simple sort comparator for example ID/Name columns (for client-side sorting). */
|
||||
function compare(a, b, isAsc) {
|
||||
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
|
||||
}
|
||||
|
||||
7
overlord/src/app/balance-sheet/balance-sheet-item.ts
Normal file
7
overlord/src/app/balance-sheet/balance-sheet-item.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export class BalanceSheetItem {
|
||||
name?: string;
|
||||
group?: string;
|
||||
amount?: number;
|
||||
subAmount?: number;
|
||||
order: number;
|
||||
}
|
||||
@ -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 { BalanceSheet } from './balance-sheet';
|
||||
import { BalanceSheetService } from './balance-sheet.service';
|
||||
|
||||
@ -10,7 +11,7 @@ import { BalanceSheetService } from './balance-sheet.service';
|
||||
export class BalanceSheetResolver implements Resolve<BalanceSheet> {
|
||||
constructor(private ser: BalanceSheetService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<BalanceSheet> {
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<BalanceSheet> {
|
||||
const date = route.paramMap.get('date');
|
||||
return this.ser.list(date);
|
||||
}
|
||||
|
||||
@ -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 { BalanceSheetResolver } from './balance-sheet-resolver.service';
|
||||
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
|
||||
import { BalanceSheetResolver } from './balance-sheet-resolver.service';
|
||||
import { BalanceSheetComponent } from './balance-sheet.component';
|
||||
|
||||
const balanceSheetRoutes: Routes = [
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import { BalanceSheetDataSource } from './balance-sheet-datasource';
|
||||
import { BalanceSheet } from './balance-sheet';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
|
||||
import { BalanceSheet } from './balance-sheet';
|
||||
import { BalanceSheetDataSource } from './balance-sheet-datasource';
|
||||
|
||||
@Component({
|
||||
selector: 'app-balance-sheet',
|
||||
|
||||
@ -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 { BalanceSheetRoutingModule } from './balance-sheet-routing.module';
|
||||
import { BalanceSheetComponent } from './balance-sheet.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 } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { BalanceSheet } from './balance-sheet';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
import { BalanceSheet } from './balance-sheet';
|
||||
|
||||
const url = '/api/balance-sheet';
|
||||
const serviceName = 'BalanceSheetService';
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
export class BalanceSheetItem {
|
||||
name?: string;
|
||||
group?: string;
|
||||
amount?: number;
|
||||
subAmount?: number;
|
||||
order: number;
|
||||
}
|
||||
import { BalanceSheetItem } from './balance-sheet-item';
|
||||
|
||||
export class BalanceSheet {
|
||||
date: string;
|
||||
body: BalanceSheetItem[];
|
||||
|
||||
Reference in New Issue
Block a user