feat (clients): add client's address page

fixes: #258
This commit is contained in:
Jivjyot Singh
2019-12-01 23:20:51 +03:00
committed by Abhay Chawla
parent 636ccb74b0
commit d18097107a
13 changed files with 259 additions and 4 deletions
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { ClientsService } from '../clients.service';
/**
* Client Address Field Configuration resolver.
*/
@Injectable()
export class ClientAddressFieldConfigurationResolver implements Resolve<Object> {
/**
* @param {ClientsService} ClientsService Clients service.
*/
constructor(private clientsService: ClientsService) { }
/**
* Returns the Client Address Field Configuration.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.clientsService.getAddressFieldConfiguration();
}
}
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { ClientsService } from '../clients.service';
/**
* Client Address Field Configuration resolver.
*/
@Injectable()
export class ClientAddressTemplateResolver implements Resolve<Object> {
/**
* @param {ClientsService} ClientsService Clients service.
*/
constructor(private clientsService: ClientsService) { }
/**
* Returns the Client Address Field Configuration.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.clientsService.getClientAddressTemplate();
}
}
@@ -0,0 +1,31 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { ClientsService } from '../clients.service';
/**
* Client Address data resolver.
*/
@Injectable()
export class ClientAddressResolver implements Resolve<Object> {
/**
* @param {ClientsService} ClientsService Clients service.
*/
constructor(private clientsService: ClientsService) { }
/**
* Returns the Client Address data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const clientId = route.parent.paramMap.get('clientId');
return this.clientsService.getClientAddressData(clientId);
}
}