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,9 +1,15 @@
|
||||
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 { LedgerItem } from './ledger';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { LedgerItem } from './ledger-item';
|
||||
|
||||
/** 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 LedgerDataSource extends DataSource<LedgerItem> {
|
||||
constructor(private paginator: MatPaginator, private sort: MatSort, public data: LedgerItem[]) {
|
||||
@ -17,9 +23,7 @@ export class LedgerDataSource extends DataSource<LedgerItem> {
|
||||
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]))),
|
||||
);
|
||||
}
|
||||
|
||||
@ -50,8 +54,3 @@ export class LedgerDataSource extends DataSource<LedgerItem> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 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);
|
||||
}
|
||||
|
||||
12
overlord/src/app/ledger/ledger-item.ts
Normal file
12
overlord/src/app/ledger/ledger-item.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export class LedgerItem {
|
||||
date: string;
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
narration: string;
|
||||
debit: number;
|
||||
credit: number;
|
||||
running: number;
|
||||
posted: boolean;
|
||||
url: string;
|
||||
}
|
||||
@ -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 { Ledger } from './ledger';
|
||||
import { LedgerService } from './ledger.service';
|
||||
|
||||
@ -10,7 +11,7 @@ import { LedgerService } from './ledger.service';
|
||||
export class LedgerResolver implements Resolve<Ledger> {
|
||||
constructor(private ser: LedgerService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Ledger> {
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Ledger> {
|
||||
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 { LedgerResolver } from './ledger-resolver.service';
|
||||
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
|
||||
import { LedgerResolver } from './ledger-resolver.service';
|
||||
import { LedgerComponent } from './ledger.component';
|
||||
|
||||
const ledgerRoutes: Routes = [
|
||||
|
||||
@ -4,16 +4,18 @@ import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { debounceTime, distinctUntilChanged, map, startWith, switchMap } from 'rxjs/operators';
|
||||
import * as moment from 'moment';
|
||||
import { LedgerDataSource } from './ledger-datasource';
|
||||
import { Ledger } from './ledger';
|
||||
|
||||
import { Account } from '../core/account';
|
||||
import { LedgerService } from './ledger.service';
|
||||
import { AccountService } from '../core/account.service';
|
||||
import { ToCsvService } from '../shared/to-csv.service';
|
||||
|
||||
import { Ledger } from './ledger';
|
||||
import { LedgerDataSource } from './ledger-datasource';
|
||||
import { LedgerService } from './ledger.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-ledger',
|
||||
templateUrl: './ledger.component.html',
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { A11yModule } from '@angular/cdk/a11y';
|
||||
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 { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
@ -18,14 +23,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 { ReactiveFormsModule } from '@angular/forms';
|
||||
import { CdkTableModule } from '@angular/cdk/table';
|
||||
|
||||
import { LedgerRoutingModule } from './ledger-routing.module';
|
||||
import { LedgerComponent } from './ledger.component';
|
||||
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
import { A11yModule } from '@angular/cdk/a11y';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
|
||||
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 { Ledger } from './ledger';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
import { Ledger } from './ledger';
|
||||
|
||||
const url = '/api/ledger';
|
||||
const serviceName = 'LedgerService';
|
||||
|
||||
@ -1,17 +1,6 @@
|
||||
import { Account } from '../core/account';
|
||||
|
||||
export class LedgerItem {
|
||||
date: string;
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
narration: string;
|
||||
debit: number;
|
||||
credit: number;
|
||||
running: number;
|
||||
posted: boolean;
|
||||
url: string;
|
||||
}
|
||||
import { LedgerItem } from './ledger-item';
|
||||
|
||||
export class Ledger {
|
||||
startDate: string;
|
||||
|
||||
Reference in New Issue
Block a user