Feature: Lazy loading

Lazy loaded everything
TODO: The cash flow module when clicking on sub-links, it reloads the whole page, it needs to be diagnosed and fixed, this problem also exists in the other modules
TODO: Rename folders and modules such as account to accounts to match the url
This commit is contained in:
Amritanshu
2019-06-12 19:34:50 +05:30
parent fea48e1a3e
commit 72044476a8
184 changed files with 786 additions and 664 deletions

View File

@ -1,6 +1,6 @@
import {DataSource} from '@angular/cdk/collections';
import {Observable} from 'rxjs';
import {Inventory, Journal} from '../journal/voucher';
import {Inventory, Journal} from '../core/voucher';
export class IssueDataSource extends DataSource<Inventory> {

View File

@ -4,8 +4,8 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import {FormBuilder, FormGroup} from '@angular/forms';
import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators';
import {Observable, of as observableOf} from 'rxjs';
import {Batch} from '../journal/voucher';
import {BatchService} from '../purchase-return/batch.service';
import {Batch} from '../core/voucher';
import {BatchService} from '../core/batch.service';
@Component({
selector: 'app-issue-dialog',

View File

@ -1,11 +1,11 @@
import {Injectable} from '@angular/core';
import {HttpClient, HttpParams} from '@angular/common/http';
import {ErrorLoggerService} from '../core/error-logger.service';
import {catchError} from 'rxjs/operators';
import {Observable} from 'rxjs/internal/Observable';
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ErrorLoggerService } from '../core/error-logger.service';
import { catchError } from 'rxjs/operators';
import { Observable } from 'rxjs/internal/Observable';
const url = '/api/IssueGrid';
const serviceName = 'BatchService';
const url = '/api/issue-grid';
const serviceName = 'IssueGridService';
@Injectable({
providedIn: 'root'

View File

@ -1,8 +1,8 @@
import {Injectable} from '@angular/core';
import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router';
import {Observable} from 'rxjs/internal/Observable';
import {Voucher} from '../journal/voucher';
import {VoucherService} from '../journal/voucher.service';
import {Voucher} from '../core/voucher';
import {VoucherService} from '../core/voucher.service';
@Injectable({
providedIn: 'root'

View File

@ -8,7 +8,7 @@ import {CostCentreListResolver} from '../cost-centre/cost-centre-list-resolver.s
const issueRoutes: Routes = [
{
path: 'Issue',
path: '',
component: IssueComponent,
canActivate: [AuthGuard],
data: {
@ -21,7 +21,7 @@ const issueRoutes: Routes = [
runGuardsAndResolvers: 'always'
},
{
path: 'Issue/:id',
path: ':id',
component: IssueComponent,
canActivate: [AuthGuard],
data: {

View File

@ -6,16 +6,16 @@ import {ActivatedRoute, Router} from '@angular/router';
import {BehaviorSubject, Observable, of as observableOf} from 'rxjs';
import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators';
import {IssueDataSource} from './issue-datasource';
import {VoucherService} from '../journal/voucher.service';
import {Batch, Inventory, Journal, Voucher} from '../journal/voucher';
import {VoucherService} from '../core/voucher.service';
import {Batch, Inventory, Journal, Voucher} from '../core/voucher';
import * as moment from 'moment';
import {AuthService} from '../auth/auth.service';
import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component';
import {ToasterService} from '../core/toaster.service';
import {IssueDialogComponent} from './issue-dialog.component';
import {BatchService} from '../purchase-return/batch.service';
import {BatchService} from '../core/batch.service';
import {IssueGridService} from './issue-grid.service';
import {CostCentre} from '../cost-centre/cost-centre';
import {CostCentre} from '../core/cost-centre';
import {IssueGridDataSource} from './issue-grid-datasource';
import {Hotkey, HotkeysService} from "angular2-hotkeys";
@ -228,7 +228,7 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
(result) => {
this.loadVoucher(result);
this.toaster.show('Success', '');
this.router.navigate(['/Issue', result.id]);
this.router.navigate(['/issue', result.id]);
},
(error) => {
this.toaster.show('Danger', error.error);
@ -237,7 +237,7 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
}
newVoucher() {
this.router.navigate(['/Issue']);
this.router.navigate(['/issue']);
}
getVoucher(): Voucher {
@ -254,7 +254,7 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
.subscribe(
(result) => {
this.toaster.show('Success', '');
this.router.navigate(['/Issue'], {replaceUrl: true});
this.router.navigate(['/issue'], {replaceUrl: true});
},
(error) => {
this.toaster.show('Danger', error.error);
@ -315,7 +315,7 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
}
goToVoucher(id: string) {
this.router.navigate(['/Issue', id]);
this.router.navigate(['/issue', id]);
}
}