@@ -33,6 +33,7 @@ import { HolidaysComponent } from './holidays/holidays.component';
|
||||
import { EditEmployeeComponent } from './employees/edit-employee/edit-employee.component';
|
||||
import { CreateTellerComponent } from './tellers/create-teller/create-teller.component';
|
||||
import { EditTellerComponent } from './tellers/edit-teller/edit-teller.component';
|
||||
import { ViewCashierComponent } from './tellers/view-cashier/view-cashier.component';
|
||||
|
||||
/** Custom Resolvers */
|
||||
import { LoanProvisioningCriteriaResolver } from './loan-provisioning-criteria/loan-provisioning-criteria.resolver';
|
||||
@@ -56,6 +57,7 @@ import { EditOfficeComponent } from './offices/edit-office/edit-office.component
|
||||
import { AdhocQueryTemplateResolver } from './adhoc-query/adhoc-query-template.resolver';
|
||||
import { ViewLoanProvisioningCriteriaComponent } from './loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component';
|
||||
import { LoanProvisioningCriteriasResolver } from './loan-provisioning-criteria/loan-provisioning-criterias.resolver';
|
||||
import { CashierResolver } from './tellers/cashier.resolver';
|
||||
|
||||
/** Organization Routes */
|
||||
const routes: Routes = [
|
||||
@@ -255,6 +257,20 @@ const routes: Routes = [
|
||||
teller: TellerResolver,
|
||||
offices: OfficesResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'cashiers',
|
||||
data: { title: extract('View Cashiers'), breadcrumb: 'View Cashiers', routeParamBreadcrumb: false },
|
||||
children: [
|
||||
{
|
||||
path: ':id',
|
||||
component: ViewCashierComponent,
|
||||
data: { title: extract('View Cashier'), breadcrumb: 'View Cashier', routeParamBreadcrumb: 'id' },
|
||||
resolve: {
|
||||
cashier: CashierResolver
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -361,6 +377,7 @@ const routes: Routes = [
|
||||
EditOfficeResolver,
|
||||
AdhocQueryTemplateResolver,
|
||||
LoanProvisioningCriteriasResolver,
|
||||
CashierResolver
|
||||
]
|
||||
})
|
||||
export class OrganizationRoutingModule { }
|
||||
|
||||
@@ -33,6 +33,7 @@ import { EditEmployeeComponent } from './employees/edit-employee/edit-employee.c
|
||||
import { CreateTellerComponent } from './tellers/create-teller/create-teller.component';
|
||||
import { EditTellerComponent } from './tellers/edit-teller/edit-teller.component';
|
||||
import { ViewLoanProvisioningCriteriaComponent } from './loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component';
|
||||
import { ViewCashierComponent } from './tellers/view-cashier/view-cashier.component';
|
||||
|
||||
/**
|
||||
* Organization Module
|
||||
@@ -72,6 +73,7 @@ import { ViewLoanProvisioningCriteriaComponent } from './loan-provisioning-crite
|
||||
CreateTellerComponent,
|
||||
EditTellerComponent,
|
||||
ViewLoanProvisioningCriteriaComponent,
|
||||
ViewCashierComponent,
|
||||
]
|
||||
})
|
||||
export class OrganizationModule { }
|
||||
|
||||
@@ -176,6 +176,16 @@ export class OrganizationService {
|
||||
return this.http.get(`/tellers/${tellerId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Cashier data.
|
||||
* @param {string} tellerId Teller ID of teller.
|
||||
* @param {string} cashierId Cashier ID of cashier
|
||||
* @returns {Observable<any>} Cashier data.
|
||||
*/
|
||||
getCashier(tellerId: string, cashierId: string): Observable<any> {
|
||||
return this.http.get(`/tellers/${tellerId}/cashiers/${cashierId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} tellerId Teller ID of teller to be deleted.
|
||||
* @returns {Observable<any>}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { OrganizationService } from 'app/organization/organization.service';
|
||||
|
||||
/**
|
||||
* Cashier data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class CashierResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {OrganizationService} organizationService Organization service.
|
||||
*/
|
||||
constructor(private organizationService: OrganizationService) {}
|
||||
|
||||
/**
|
||||
* Returns the cashier data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const cashierId = route.paramMap.get('id');
|
||||
const tellerId = route.parent.paramMap.get('id');
|
||||
return this.organizationService.getCashier(tellerId, cashierId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,7 +47,7 @@
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef> Actions </th>
|
||||
<td mat-cell *matCellDef="let teller" (click)="$event.stopPropagation()">
|
||||
<button mat-button color="primary">
|
||||
<button mat-button color="primary" [routerLink]="[teller.id,'cashiers']">
|
||||
<fa-icon icon="eye"></fa-icon> View Cashiers
|
||||
</button>
|
||||
</td>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
|
||||
<button mat-raised-button color="primary">
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
Edit
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
|
||||
<mat-card>
|
||||
|
||||
<mat-card-content>
|
||||
|
||||
<div fxLayout="row wrap" class="content">
|
||||
|
||||
<div fxFlex="50%" class="header">
|
||||
Name
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
{{ cashierData.staffName}}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="header">
|
||||
Teller
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
{{ cashierData.tellerName }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="header" *ngIf="cashierData.description !== ''">
|
||||
Description
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" *ngIf="cashierData.description !== ''">
|
||||
{{ cashierData.description }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="header">
|
||||
Start Date
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
{{ cashierData.startDate | date }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="header">
|
||||
End Date
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
{{ cashierData.endDate | date }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="header">
|
||||
Full Day?
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
{{ cashierData.isFullDay }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
.container {
|
||||
max-width: 37rem;
|
||||
|
||||
.content {
|
||||
div {
|
||||
margin: 1rem 0;
|
||||
word-wrap: break-word;
|
||||
|
||||
&.header {
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ViewCashierComponent } from './view-cashier.component';
|
||||
|
||||
describe('ViewCashierComponent', () => {
|
||||
let component: ViewCashierComponent;
|
||||
let fixture: ComponentFixture<ViewCashierComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewCashierComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ViewCashierComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,28 @@
|
||||
/** Angular Imports. */
|
||||
import { Component } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
/**
|
||||
* View Cashier component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-view-cashier',
|
||||
templateUrl: './view-cashier.component.html',
|
||||
styleUrls: ['./view-cashier.component.scss']
|
||||
})
|
||||
export class ViewCashierComponent {
|
||||
|
||||
/** Cashier data. */
|
||||
cashierData: any;
|
||||
|
||||
/**
|
||||
* Get cashier data from `Resolver`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.route.data.subscribe((data: { cashier: any }) => {
|
||||
this.cashierData = data.cashier;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user