feat: add view standing instruction details (#1137)

Fixes: #1136
This commit is contained in:
Muskan Khedia
2020-07-18 20:58:04 +05:30
committed by GitHub
parent 8a360025f8
commit 521c61d1f3
10 changed files with 344 additions and 2 deletions
@@ -0,0 +1,122 @@
<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>&nbsp;&nbsp;
Edit
</button>
<button mat-raised-button color="primary">
View Transactions History
</button>
</div>
<div class="container">
<mat-card>
<mat-card-content>
<div fxLayout="row wrap" fxLayout.lt-md="column">
<h2 class="mat-h2" fxFlexFill>{{ standingInstructionsData.name }}</h2>
<mat-divider [inset]="true"></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Applicant:</span>
<span fxFlex="60%">{{ standingInstructionsData.fromClient.displayName }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Type:</span>
<span fxFlex="60%">{{ standingInstructionsData.transferType.value }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Priority:</span>
<span fxFlex="60%">{{ standingInstructionsData.priority.value }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Status:</span>
<span fxFlex="60%">{{ standingInstructionsData.status.value }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">From Account Type:</span>
<span fxFlex="60%">{{ standingInstructionsData.fromAccountType.value }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">From Account:</span>
<span fxFlex="60%">{{ standingInstructionsData.fromAccount.productName }} - {{ standingInstructionsData.fromAccount.accountNo }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Destination:</span>
<span fxFlex="60%">
<span *ngIf="allowclientedit"> Within Bank </span>
<span *ngIf="!allowclientedit"> Own Account </span>
</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">To Office:</span>
<span fxFlex="60%">{{ standingInstructionsData.toOffice.name }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Beneficiary:</span>
<span fxFlex="60%">{{ standingInstructionsData.toClient.displayName }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">To Account Type:</span>
<span fxFlex="60%">{{ standingInstructionsData.toAccountType.value }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">To Account:</span>
<span fxFlex="60%">{{ standingInstructionsData.toAccount.productName }} - {{standingInstructionsData.toAccount.accountNo}}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Standing Instruction Type:</span>
<span fxFlex="60%">{{ standingInstructionsData.instructionType.value }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Amount:</span>
<span fxFlex="60%">{{ standingInstructionsData.amount }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Validity:</span>
<span fxFlex="60%">{{ standingInstructionsData.validFrom | date }} - {{ standingInstructionsData.validTill | date }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Recurrence type:</span>
<span fxFlex="60%">{{ standingInstructionsData.recurrenceType.value }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Interval:</span>
<span fxFlex="60%">{{ standingInstructionsData.recurrenceInterval }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Recurrence Frequency:</span>
<span fxFlex="60%">{{ standingInstructionsData.recurrenceFrequency.value }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">On Month Day:</span>
<span fxFlex="60%">{{ standingInstructionsData.recurrenceOnMonthDay | date }}</span>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
@@ -0,0 +1,20 @@
.mat-elevation-z1 {
margin: 1em 0 1.5em 0;
}
h2, h3, h4 {
margin: 0;
font-weight: 500;
}
span {
margin: 0.5em 0;
}
.margin-t {
margin-top: 1em;
}
mat-divider {
margin: 0 0 1em 0;
}
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ViewStandingInstructionsComponent } from './view-standing-instructions.component';
describe('ViewStandingInstructionsComponent', () => {
let component: ViewStandingInstructionsComponent;
let fixture: ComponentFixture<ViewStandingInstructionsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewStandingInstructionsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ViewStandingInstructionsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'mifosx-view-standing-instructions',
templateUrl: './view-standing-instructions.component.html',
styleUrls: ['./view-standing-instructions.component.scss']
})
export class ViewStandingInstructionsComponent {
/** Standing Instructions Data */
standingInstructionsData: any;
/** Allow Client Edit */
allowclientedit = false;
/**
* Retrieves the standing instructions data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
this.route.data.subscribe((data: { standingInstructionsData: any}) => {
this.standingInstructionsData = data.standingInstructionsData;
if (this.standingInstructionsData.fromClient.id === this.standingInstructionsData.toClient.id) {
this.allowclientedit = false;
}
});
}
}