feat: client signature actions (#1120)

Fixes: #1119
This commit is contained in:
Karan Takalkar
2020-07-16 17:08:22 +05:30
committed by GitHub
parent d7f33a97b2
commit 9e859afe09
16 changed files with 325 additions and 5 deletions
@@ -0,0 +1,15 @@
<h1 mat-dialog-title>Delete Client Signature</h1>
<div *ngIf="signatureId" mat-dialog-content>
<p>Are you sure you want to delete this clients signature ?</p>
</div>
<div *ngIf="!signatureId" mat-dialog-content>
<p>Client Signature is not provided.</p>
</div>
<mat-dialog-actions align="end">
<button mat-raised-button mat-dialog-close>Cancel</button>
<button mat-raised-button *ngIf="signatureId" color="warn" [mat-dialog-close]="{ delete: true, id: signatureId }">Confirm</button>
<button mat-raised-button *ngIf="!signatureId" color="primary" [mat-dialog-close]="{ upload: true }">Upload</button>
</mat-dialog-actions>
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DeleteSignatureDialogComponent } from './delete-signature-dialog.component';
describe('DeleteSignatureDialogComponent', () => {
let component: DeleteSignatureDialogComponent;
let fixture: ComponentFixture<DeleteSignatureDialogComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DeleteSignatureDialogComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DeleteSignatureDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,28 @@
/** Angular Imports */
import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
/**
* Delete signature dialog component.
*/
@Component({
selector: 'mifosx-delete-signature-dialog',
templateUrl: './delete-signature-dialog.component.html',
styleUrls: ['./delete-signature-dialog.component.scss']
})
export class DeleteSignatureDialogComponent {
/** Id of client signature in documents */
signatureId: any;
/**
* @param {MatDialogRef} dialogRef Component reference to dialog.
* @param {any} data Documents data
*/
constructor(public dialogRef: MatDialogRef<DeleteSignatureDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any[]) {
const signature = this.data.find((document: any) => document.name === 'clientSignature') || {};
this.signatureId = signature.id;
}
}