@@ -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