Blacked and isorted the python files
Prettied and eslinted the typescript/html files
This commit is contained in:
@ -5,26 +5,58 @@
|
||||
</mat-card-title-group>
|
||||
<mat-card-content>
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<div fxLayout="row" fxLayoutAlign="space-around start" fxLayout.lt-md="column" fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Name</mat-label>
|
||||
<input matInput #nameElement placeholder="Name" formControlName="name" (keyup.enter)="save()">
|
||||
<input
|
||||
matInput
|
||||
#nameElement
|
||||
placeholder="Name"
|
||||
formControlName="name"
|
||||
(keyup.enter)="save()"
|
||||
/>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="space-around start" fxLayout.lt-md="column" fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Rate</mat-label>
|
||||
<input matInput type="number" placeholder="Rate" formControlName="rate" class="right-align">
|
||||
<input
|
||||
matInput
|
||||
type="number"
|
||||
placeholder="Rate"
|
||||
formControlName="rate"
|
||||
class="right-align"
|
||||
/>
|
||||
<span matSuffix>%</span>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</form>
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<button mat-raised-button [disabled]="item.isFixture" color="primary" (click)="save()">Save</button>
|
||||
<button mat-raised-button [disabled]="item.isFixture" color="warn" (click)="confirmDelete()" *ngIf="!!item.id">Delete</button>
|
||||
<button mat-raised-button [disabled]="item.isFixture" color="primary" (click)="save()">
|
||||
Save
|
||||
</button>
|
||||
<button
|
||||
mat-raised-button
|
||||
[disabled]="item.isFixture"
|
||||
color="warn"
|
||||
(click)="confirmDelete()"
|
||||
*ngIf="!!item.id"
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {TaxDetailComponent} from './tax-detail.component';
|
||||
import { TaxDetailComponent } from './tax-detail.component';
|
||||
|
||||
describe('TaxDetailComponent', () => {
|
||||
let component: TaxDetailComponent;
|
||||
@ -8,9 +8,8 @@ describe('TaxDetailComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [TaxDetailComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [TaxDetailComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core';
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { MatDialog} from '@angular/material/dialog';
|
||||
|
||||
import { TaxService } from '../tax.service';
|
||||
import { Tax } from '../../core/tax';
|
||||
import { ToasterService } from '../../core/toaster.service';
|
||||
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
|
||||
import { TaxService } from '../tax.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-tax-detail',
|
||||
templateUrl: './tax-detail.component.html',
|
||||
styleUrls: ['./tax-detail.component.css']
|
||||
styleUrls: ['./tax-detail.component.css'],
|
||||
})
|
||||
export class TaxDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement: ElementRef;
|
||||
@ -24,7 +24,7 @@ export class TaxDetailComponent implements OnInit, AfterViewInit {
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: TaxService
|
||||
private ser: TaxService,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
@ -32,22 +32,21 @@ export class TaxDetailComponent implements OnInit, AfterViewInit {
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
name: '',
|
||||
rate: ''
|
||||
rate: '',
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { item: Tax }) => {
|
||||
this.showItem(data.item);
|
||||
});
|
||||
this.route.data.subscribe((data: { item: Tax }) => {
|
||||
this.showItem(data.item);
|
||||
});
|
||||
}
|
||||
|
||||
showItem(item: Tax) {
|
||||
this.item = item;
|
||||
this.form.setValue({
|
||||
name: this.item.name || '',
|
||||
rate: this.item.rate || ''
|
||||
rate: this.item.rate || '',
|
||||
});
|
||||
}
|
||||
|
||||
@ -58,35 +57,33 @@ export class TaxDetailComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
save() {
|
||||
this.ser.saveOrUpdate(this.getItem())
|
||||
.subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/taxes');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error.error);
|
||||
}
|
||||
);
|
||||
this.ser.saveOrUpdate(this.getItem()).subscribe(
|
||||
() => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/taxes');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error.error);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
delete() {
|
||||
this.ser.delete(this.item.id)
|
||||
.subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/taxes');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error.error);
|
||||
}
|
||||
);
|
||||
this.ser.delete(this.item.id).subscribe(
|
||||
() => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/taxes');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error.error);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
confirmDelete(): void {
|
||||
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
|
||||
width: '250px',
|
||||
data: {title: 'Delete Tax?', content: 'Are you sure? This cannot be undone.'}
|
||||
data: { title: 'Delete Tax?', content: 'Are you sure? This cannot be undone.' },
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe((result: boolean) => {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import {inject, TestBed} from '@angular/core/testing';
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {TaxListResolver} from './tax-list-resolver.service';
|
||||
import { TaxListResolver } from './tax-list-resolver.service';
|
||||
|
||||
describe('TaxListResolverService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [TaxListResolver]
|
||||
providers: [TaxListResolver],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router';
|
||||
import {Tax} from '../core/tax';
|
||||
import {Observable} from 'rxjs/internal/Observable';
|
||||
import {TaxService} from './tax.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { Tax } from '../core/tax';
|
||||
|
||||
import { TaxService } from './tax.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TaxListResolver implements Resolve<Tax[]> {
|
||||
constructor(private ser: TaxService) {}
|
||||
|
||||
constructor(private ser: TaxService, private router: Router) {
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Tax[]> {
|
||||
resolve(): Observable<Tax[]> {
|
||||
return this.ser.list();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { DataSource} from '@angular/cdk/collections';
|
||||
import { Observable, of as observableOf} from 'rxjs';
|
||||
import { Tax} from '../../core/tax';
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
|
||||
import { Tax } from '../../core/tax';
|
||||
|
||||
export class TaxListDataSource extends DataSource<Tax> {
|
||||
|
||||
constructor(public data: Tax[]) {
|
||||
super();
|
||||
}
|
||||
@ -12,6 +12,5 @@ export class TaxListDataSource extends DataSource<Tax> {
|
||||
return observableOf(this.data);
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
|
||||
@ -8,27 +8,28 @@
|
||||
</mat-card-title-group>
|
||||
<mat-card-content>
|
||||
<mat-table #table [dataSource]="dataSource" aria-label="Elements">
|
||||
|
||||
<!-- Name Column -->
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><a [routerLink]="['/taxes', row.id]">{{row.name}}</a></mat-cell>
|
||||
</ng-container>
|
||||
<mat-cell *matCellDef="let row"
|
||||
><a [routerLink]="['/taxes', row.id]">{{ row.name }}</a></mat-cell
|
||||
>
|
||||
</ng-container>
|
||||
|
||||
<!-- Rate Column -->
|
||||
<ng-container matColumnDef="rate">
|
||||
<mat-header-cell *matHeaderCellDef>Rate</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.rate | percent:'1.2-2'}}</mat-cell>
|
||||
<mat-cell *matCellDef="let row">{{ row.rate | percent: '1.2-2' }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Name Column -->
|
||||
<ng-container matColumnDef="isFixture">
|
||||
<mat-header-cell *matHeaderCellDef>Is Fixture?</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.isFixture}}</mat-cell>
|
||||
<mat-cell *matCellDef="let row">{{ row.isFixture }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||
</mat-table>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing';
|
||||
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {TaxListComponent} from './tax-list.component';
|
||||
import { TaxListComponent } from './tax-list.component';
|
||||
|
||||
describe('TaxListComponent', () => {
|
||||
let component: TaxListComponent;
|
||||
@ -8,9 +8,8 @@ describe('TaxListComponent', () => {
|
||||
|
||||
beforeEach(fakeAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [TaxListComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [TaxListComponent],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(TaxListComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { TaxListDataSource } from './tax-list-datasource';
|
||||
import { Tax } from '../../core/tax';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { Tax } from '../../core/tax';
|
||||
|
||||
import { TaxListDataSource } from './tax-list-datasource';
|
||||
|
||||
@Component({
|
||||
selector: 'app-tax-list',
|
||||
templateUrl: './tax-list.component.html',
|
||||
styleUrls: ['./tax-list.component.css']
|
||||
styleUrls: ['./tax-list.component.css'],
|
||||
})
|
||||
export class TaxListComponent implements OnInit {
|
||||
dataSource: TaxListDataSource;
|
||||
@ -14,14 +16,12 @@ export class TaxListComponent implements OnInit {
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'rate', 'isFixture'];
|
||||
|
||||
constructor(private route: ActivatedRoute) {
|
||||
}
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { list: Tax[] }) => {
|
||||
this.list = data.list;
|
||||
});
|
||||
this.route.data.subscribe((data: { list: Tax[] }) => {
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new TaxListDataSource(this.list);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import {inject, TestBed} from '@angular/core/testing';
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {TaxResolver} from './tax-resolver.service';
|
||||
import { TaxResolver } from './tax-resolver.service';
|
||||
|
||||
describe('TaxResolver', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [TaxResolver]
|
||||
providers: [TaxResolver],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router';
|
||||
import {TaxService} from './tax.service';
|
||||
import {Tax} from '../core/tax';
|
||||
import {Observable} from 'rxjs/internal/Observable';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { Tax } from '../core/tax';
|
||||
|
||||
import { TaxService } from './tax.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TaxResolver implements Resolve<Tax> {
|
||||
constructor(private ser: TaxService) {}
|
||||
|
||||
constructor(private ser: TaxService, private router: Router) {
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Tax> {
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Tax> {
|
||||
const id = route.paramMap.get('id');
|
||||
return this.ser.get(id);
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import {inject, TestBed} from '@angular/core/testing';
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {TaxService} from './tax.service';
|
||||
import { TaxService } from './tax.service';
|
||||
|
||||
describe('TaxService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [TaxService]
|
||||
providers: [TaxService],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,64 +1,66 @@
|
||||
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 { Tax } from '../core/tax';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({'Content-Type': 'application/json'})
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
const url = '/api/taxes';
|
||||
const serviceName = 'TaxService';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TaxService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {
|
||||
}
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
get(id: string): Observable<Tax> {
|
||||
const getUrl: string = (id === null) ? url : `${url}/${id}`;
|
||||
return <Observable<Tax>>this.http.get<Tax>(getUrl)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get id=${id}`))
|
||||
);
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
return <Observable<Tax>>(
|
||||
this.http.get<Tax>(getUrl).pipe(catchError(this.log.handleError(serviceName, `get id=${id}`)))
|
||||
);
|
||||
}
|
||||
|
||||
list(): Observable<Tax[]> {
|
||||
return <Observable<Tax[]>>this.http.get<Tax[]>(`${url}/list`)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'list'))
|
||||
);
|
||||
return <Observable<Tax[]>>(
|
||||
this.http
|
||||
.get<Tax[]>(`${url}/list`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list')))
|
||||
);
|
||||
}
|
||||
|
||||
save(tax: Tax): Observable<Tax> {
|
||||
return <Observable<Tax>>this.http.post<Tax>(url, tax, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'save'))
|
||||
);
|
||||
return <Observable<Tax>>(
|
||||
this.http
|
||||
.post<Tax>(url, tax, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'save')))
|
||||
);
|
||||
}
|
||||
|
||||
update(tax: Tax): Observable<Tax> {
|
||||
return <Observable<Tax>>this.http.put<Tax>(`${url}/${tax.id}`, tax, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'update'))
|
||||
);
|
||||
return <Observable<Tax>>(
|
||||
this.http
|
||||
.put<Tax>(`${url}/${tax.id}`, tax, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'update')))
|
||||
);
|
||||
}
|
||||
|
||||
saveOrUpdate(tax: Tax): Observable<Tax> {
|
||||
if (!tax.id) {
|
||||
return this.save(tax);
|
||||
} else {
|
||||
return this.update(tax);
|
||||
}
|
||||
return this.update(tax);
|
||||
}
|
||||
|
||||
delete(id: string): Observable<Tax> {
|
||||
return <Observable<Tax>>this.http.delete<Tax>(`${url}/${id}`, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'delete'))
|
||||
);
|
||||
return <Observable<Tax>>(
|
||||
this.http
|
||||
.delete<Tax>(`${url}/${id}`, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'delete')))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import {TaxesRoutingModule} from './taxes-routing.module';
|
||||
import { TaxesRoutingModule } from './taxes-routing.module';
|
||||
|
||||
describe('TaxesRoutingModule', () => {
|
||||
let taxesRoutingModule: TaxesRoutingModule;
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
import {TaxListResolver} from './tax-list-resolver.service';
|
||||
import {TaxResolver} from './tax-resolver.service';
|
||||
import {TaxListComponent} from './tax-list/tax-list.component';
|
||||
import {TaxDetailComponent} from './tax-detail/tax-detail.component';
|
||||
import {AuthGuard} from '../auth/auth-guard.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
|
||||
import { TaxDetailComponent } from './tax-detail/tax-detail.component';
|
||||
import { TaxListResolver } from './tax-list-resolver.service';
|
||||
import { TaxListComponent } from './tax-list/tax-list.component';
|
||||
import { TaxResolver } from './tax-resolver.service';
|
||||
|
||||
const taxesRoutes: Routes = [
|
||||
{
|
||||
@ -13,49 +15,39 @@ const taxesRoutes: Routes = [
|
||||
component: TaxListComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
permission: 'Taxes'
|
||||
permission: 'Taxes',
|
||||
},
|
||||
resolve: {
|
||||
list: TaxListResolver
|
||||
}
|
||||
list: TaxListResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
component: TaxDetailComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
permission: 'Taxes'
|
||||
permission: 'Taxes',
|
||||
},
|
||||
resolve: {
|
||||
item: TaxResolver
|
||||
}
|
||||
item: TaxResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: TaxDetailComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
permission: 'Taxes'
|
||||
permission: 'Taxes',
|
||||
},
|
||||
resolve: {
|
||||
item: TaxResolver
|
||||
}
|
||||
}
|
||||
item: TaxResolver,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild(taxesRoutes)
|
||||
|
||||
],
|
||||
exports: [
|
||||
RouterModule
|
||||
],
|
||||
providers: [
|
||||
TaxListResolver,
|
||||
TaxResolver
|
||||
]
|
||||
imports: [CommonModule, RouterModule.forChild(taxesRoutes)],
|
||||
exports: [RouterModule],
|
||||
providers: [TaxListResolver, TaxResolver],
|
||||
})
|
||||
export class TaxesRoutingModule {
|
||||
}
|
||||
export class TaxesRoutingModule {}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import {TaxesModule} from './taxes.module';
|
||||
import { TaxesModule } from './taxes.module';
|
||||
|
||||
describe('TaxesModule', () => {
|
||||
let taxesModule: TaxesModule;
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
|
||||
import {TaxListComponent} from './tax-list/tax-list.component';
|
||||
import {TaxDetailComponent} from './tax-detail/tax-detail.component';
|
||||
import {TaxesRoutingModule} from './taxes-routing.module';
|
||||
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 { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import {CdkTableModule} from '@angular/cdk/table';
|
||||
import {ReactiveFormsModule} from '@angular/forms';
|
||||
import {FlexLayoutModule} from '@angular/flex-layout';
|
||||
|
||||
import { TaxDetailComponent } from './tax-detail/tax-detail.component';
|
||||
import { TaxListComponent } from './tax-list/tax-list.component';
|
||||
import { TaxesRoutingModule } from './taxes-routing.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@ -26,12 +26,8 @@ import {FlexLayoutModule} from '@angular/flex-layout';
|
||||
MatProgressSpinnerModule,
|
||||
MatTableModule,
|
||||
ReactiveFormsModule,
|
||||
TaxesRoutingModule
|
||||
TaxesRoutingModule,
|
||||
],
|
||||
declarations: [
|
||||
TaxListComponent,
|
||||
TaxDetailComponent
|
||||
]
|
||||
declarations: [TaxListComponent, TaxDetailComponent],
|
||||
})
|
||||
export class TaxesModule {
|
||||
}
|
||||
export class TaxesModule {}
|
||||
|
||||
Reference in New Issue
Block a user