+13
@@ -0,0 +1,13 @@
|
||||
<h1 mat-dialog-title>Edit Note</h1>
|
||||
<div>
|
||||
<form #formRef="ngForm" [formGroup]="noteForm">
|
||||
<mat-form-field>
|
||||
<textarea formControlName="note" matInput placeholder="Write a note ...."></textarea>
|
||||
</mat-form-field>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-raised-button mat-dialog-close>Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="noteForm.pristine"
|
||||
[mat-dialog-close]="{ editForm: noteForm }">Confirm</button>
|
||||
</mat-dialog-actions>
|
||||
</form>
|
||||
</div>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditNotesDialogComponent } from './edit-notes-dialog.component';
|
||||
|
||||
describe('EditNotesDialogComponent', () => {
|
||||
let component: EditNotesDialogComponent;
|
||||
let fixture: ComponentFixture<EditNotesDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditNotesDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditNotesDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-edit-notes-dialog',
|
||||
templateUrl: './edit-notes-dialog.component.html',
|
||||
styleUrls: ['./edit-notes-dialog.component.scss']
|
||||
})
|
||||
export class EditNotesDialogComponent implements OnInit {
|
||||
noteForm: FormGroup;
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<EditNotesDialogComponent>,
|
||||
private formBuilder: FormBuilder,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.createNoteForm();
|
||||
}
|
||||
|
||||
createNoteForm() {
|
||||
this.noteForm = this.formBuilder.group({
|
||||
'note': [this.data.noteContent, Validators.required]
|
||||
});
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<h1 mat-dialog-title>Unassign Staff</h1>
|
||||
<div mat-dialog-content>
|
||||
<p>Are you sure you want to unassign staff for this client ?</p>
|
||||
</div>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-raised-button mat-dialog-close>Cancel</button>
|
||||
<button mat-raised-button color="warn" [mat-dialog-close]="{ confirm: true }">Confirm</button>
|
||||
</mat-dialog-actions>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UnassignStaffDialogComponent } from './unassign-staff-dialog.component';
|
||||
|
||||
describe('UnassignStaffDialogComponent', () => {
|
||||
let component: UnassignStaffDialogComponent;
|
||||
let fixture: ComponentFixture<UnassignStaffDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UnassignStaffDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(UnassignStaffDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/** Angular Imports */
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
/**
|
||||
* Unassign staff dialog component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-unassign-staff-dialog',
|
||||
templateUrl: './unassign-staff-dialog.component.html',
|
||||
styleUrls: ['./unassign-staff-dialog.component.scss']
|
||||
})
|
||||
export class UnassignStaffDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<UnassignStaffDialogComponent>) { }
|
||||
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<h1 mat-dialog-title>Upload Client Documents</h1>
|
||||
<div>
|
||||
<form [formGroup]="uploadDocumentForm" fxLayout="column">
|
||||
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>File Name</mat-label>
|
||||
<input formControlName="fileName" required matInput />
|
||||
<mat-error *ngIf="uploadDocumentForm.controls.fileName.hasError('required')">
|
||||
File Name is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex *ngIf="!documentIdentifier">
|
||||
<mat-label>Description</mat-label>
|
||||
<input formControlName="description" matInput />
|
||||
</mat-form-field>
|
||||
|
||||
<input type="file" name="file" (change)="onFileSelect($event)" />
|
||||
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-raised-button mat-dialog-close>Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!uploadDocumentForm.valid" [mat-dialog-close]="uploadDocumentForm.value">Confirm</button>
|
||||
</mat-dialog-actions>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UploadDocumentDialogComponent } from './upload-document-dialog.component';
|
||||
|
||||
describe('UploadDocumentDialogComponent', () => {
|
||||
let component: UploadDocumentDialogComponent;
|
||||
let fixture: ComponentFixture<UploadDocumentDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UploadDocumentDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(UploadDocumentDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-upload-document-dialog',
|
||||
templateUrl: './upload-document-dialog.component.html',
|
||||
styleUrls: ['./upload-document-dialog.component.scss']
|
||||
})
|
||||
export class UploadDocumentDialogComponent implements OnInit {
|
||||
/** Upload Document form. */
|
||||
uploadDocumentForm: FormGroup;
|
||||
file: any;
|
||||
uploadDocumentData: any = [];
|
||||
documentIdentifier = false;
|
||||
constructor(public dialogRef: MatDialogRef<UploadDocumentDialogComponent>,
|
||||
private formBuilder: FormBuilder,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) {
|
||||
this.documentIdentifier = data.documentIdentifier;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.createUploadDocumentForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the upload Document form.
|
||||
*/
|
||||
createUploadDocumentForm() {
|
||||
this.uploadDocumentForm = this.formBuilder.group({
|
||||
'fileName': ['', Validators.required],
|
||||
'description': [''],
|
||||
'file': ['']
|
||||
});
|
||||
}
|
||||
onFileSelect(event: any) {
|
||||
if (event.target.files.length > 0) {
|
||||
const file = event.target.files[0];
|
||||
this.uploadDocumentForm.get('file').setValue(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user