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 parent
438a98334d
commit
5ea09df272
320 files changed
+2233
-2268
No files matched your search
@@ -1,12 +1,12 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
|
||||
import { ClientService } from '../client.service';
|
||||
import { Client } from '../client';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { ToasterService } from '../../core/toaster.service';
|
||||
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { Client } from '../client';
|
||||
import { ClientService } from '../client.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-client-detail',
|
||||
@@ -62,7 +62,7 @@ export class ClientDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
save() {
|
||||
this.ser.update(this.getItem()).subscribe(
|
||||
(result) => {
|
||||
() => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/clients');
|
||||
},
|
||||
@@ -74,7 +74,7 @@ export class ClientDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
delete() {
|
||||
this.ser.delete(this.item.id).subscribe(
|
||||
(result) => {
|
||||
() => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/clients');
|
||||
},
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot } from '@angular/router';
|
||||
import { Client } from './client';
|
||||
import { Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { Client } from './client';
|
||||
import { ClientService } from './client.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ClientListResolver implements Resolve<Client[]> {
|
||||
constructor(private ser: ClientService, private router: Router) {}
|
||||
constructor(private ser: ClientService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Client[]> {
|
||||
resolve(): Observable<Client[]> {
|
||||
return this.ser.list();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,16 @@
|
||||
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';
|
||||
|
||||
import { Client } from '../client';
|
||||
|
||||
/** 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 ClientListDataSource extends DataSource<Client> {
|
||||
constructor(private paginator: MatPaginator, private sort: MatSort, public data: Client[]) {
|
||||
super();
|
||||
@@ -17,9 +23,7 @@ export class ClientListDataSource extends DataSource<Client> {
|
||||
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]))),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -48,8 +52,3 @@ export class ClientListDataSource extends DataSource<Client> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 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);
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import { ClientListDataSource } from './client-list-datasource';
|
||||
import { Client } from '../client';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { Client } from '../client';
|
||||
|
||||
import { ClientListDataSource } from './client-list-datasource';
|
||||
|
||||
@Component({
|
||||
selector: 'app-client-list',
|
||||
templateUrl: './client-list.component.html',
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot } from '@angular/router';
|
||||
import { ClientService } from './client.service';
|
||||
import { Client } from './client';
|
||||
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { Client } from './client';
|
||||
import { ClientService } from './client.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ClientResolver implements Resolve<Client> {
|
||||
constructor(private ser: ClientService, private router: Router) {}
|
||||
constructor(private ser: ClientService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Client> {
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Client> {
|
||||
const id = route.paramMap.get('id');
|
||||
return this.ser.get(id);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { ClientListResolver } from './client-list-resolver.service';
|
||||
import { ClientResolver } from './client-resolver.service';
|
||||
import { ClientListComponent } from './client-list/client-list.component';
|
||||
import { ClientDetailComponent } from './client-detail/client-detail.component';
|
||||
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
|
||||
import { ClientDetailComponent } from './client-detail/client-detail.component';
|
||||
import { ClientListResolver } from './client-list-resolver.service';
|
||||
import { ClientListComponent } from './client-list/client-list.component';
|
||||
import { ClientResolver } from './client-resolver.service';
|
||||
|
||||
const clientRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CdkTableModule } from '@angular/cdk/table';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { ClientListComponent } from './client-list/client-list.component';
|
||||
import { ClientDetailComponent } from './client-detail/client-detail.component';
|
||||
import { ClientRoutingModule } from './client-routing.module';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
@@ -13,10 +12,12 @@ 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 { CdkTableModule } from '@angular/cdk/table';
|
||||
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import { ClientDetailComponent } from './client-detail/client-detail.component';
|
||||
import { ClientListComponent } from './client-list/client-list.component';
|
||||
import { ClientRoutingModule } from './client-routing.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
import { Client } from './client';
|
||||
|
||||
const httpOptions = {
|
||||
|
||||
Reference in new issue
Block a user