Add datatable step when exist entity datatable checks (#1633)
Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
cafe8fa73d
commit
3a3d96222e
@@ -13,7 +13,7 @@ import { ClientsService } from '../../clients.service';
|
|||||||
export class DocumentsTabComponent implements OnInit {
|
export class DocumentsTabComponent implements OnInit {
|
||||||
entityDocuments: any;
|
entityDocuments: any;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
entityType: string = 'clients';
|
entityType = 'clients';
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private clientsService: ClientsService,
|
private clientsService: ClientsService,
|
||||||
|
|||||||
@@ -22,24 +22,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="existsClientsToFilter">
|
<div [hidden]="!existsClientsToFilter">
|
||||||
<table mat-table [dataSource]="dataSource" matSort>
|
<table mat-table [dataSource]="dataSource" matSort>
|
||||||
|
|
||||||
<!-- Name Column -->
|
<!-- Name Column -->
|
||||||
<ng-container matColumnDef="name">
|
<ng-container matColumnDef="entityName">
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="entityName"> Name </th>
|
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
|
||||||
<td mat-cell *matCellDef="let row"> {{row.entityName}} </td>
|
<td mat-cell *matCellDef="let row"> {{row.entityName}} </td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Account no Column -->
|
<!-- Account no Column -->
|
||||||
<ng-container matColumnDef="clientNo">
|
<ng-container matColumnDef="entityAccountNo">
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="entityAccountNo"> Account No. </th>
|
<th mat-header-cell *matHeaderCellDef mat-sort-header> Account No. </th>
|
||||||
<td mat-cell *matCellDef="let row"> {{row.entityAccountNo}} </td>
|
<td mat-cell *matCellDef="let row"> {{row.entityAccountNo}} </td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- External ID Column -->
|
<!-- External ID Column -->
|
||||||
<ng-container matColumnDef="externalId">
|
<ng-container matColumnDef="entityExternalId">
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="entityExternalId"> External Id </th>
|
<th mat-header-cell *matHeaderCellDef mat-sort-header> External Id </th>
|
||||||
<td mat-cell *matCellDef="let row">
|
<td mat-cell *matCellDef="let row">
|
||||||
<mifosx-external-identifier externalId="{{row.entityExternalId}}"></mifosx-external-identifier>
|
<mifosx-external-identifier externalId="{{row.entityExternalId}}"></mifosx-external-identifier>
|
||||||
</td>
|
</td>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
<!-- Status Column -->
|
<!-- Status Column -->
|
||||||
<ng-container matColumnDef="status">
|
<ng-container matColumnDef="status">
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="entityStatus.value"> Status </th>
|
<th mat-header-cell *matHeaderCellDef> Status </th>
|
||||||
<td mat-cell *matCellDef="let row">
|
<td mat-cell *matCellDef="let row">
|
||||||
<div [ngClass]="row.entityStatus.code | statusLookup">
|
<div [ngClass]="row.entityStatus.code | statusLookup">
|
||||||
<fa-icon icon="stop"></fa-icon>
|
<fa-icon icon="stop"></fa-icon>
|
||||||
@@ -59,14 +59,14 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Color Column -->
|
<!-- Color Column -->
|
||||||
<ng-container matColumnDef="office">
|
<ng-container matColumnDef="parentName">
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="officeName"> Office Name </th>
|
<th mat-header-cell *matHeaderCellDef mat-sort-header> Office Name </th>
|
||||||
<td mat-cell *matCellDef="let row"> {{row.parentName}} </td>
|
<td mat-cell *matCellDef="let row"> {{row.parentName}} </td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- ID Column -->
|
<!-- ID Column -->
|
||||||
<ng-container matColumnDef="staff">
|
<ng-container matColumnDef="staffName">
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="staffName"> Staff Name </th>
|
<th mat-header-cell *matHeaderCellDef mat-sort-header> Staff Name </th>
|
||||||
<td mat-cell *matCellDef="let row"> {{row.staffName}} </td>
|
<td mat-cell *matCellDef="let row"> {{row.staffName}} </td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@@ -75,11 +75,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<mat-paginator *ngIf="moreClientsToFilter" [pageSize]="50" [pageSizeOptions]="[10, 25, 50, 100]"
|
<mat-paginator [hidden]="!moreClientsToFilter" [pageSize]="50" [pageSizeOptions]="[50, 100]"
|
||||||
showFirstLastButtons></mat-paginator>
|
showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert" *ngIf="notExistsClientsToFilter">
|
<div class="alert" [hidden]="!notExistsClientsToFilter">
|
||||||
<div class="message">
|
<div class="message">
|
||||||
<i class="fa fa-exclamation-circle alert-check"></i>
|
<i class="fa fa-exclamation-circle alert-check"></i>
|
||||||
No client was found
|
No client was found
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { environment } from 'environments/environment';
|
|||||||
export class ClientsComponent implements OnInit {
|
export class ClientsComponent implements OnInit {
|
||||||
@ViewChild('showClosedAccounts', { static: true }) showClosedAccounts: MatCheckbox;
|
@ViewChild('showClosedAccounts', { static: true }) showClosedAccounts: MatCheckbox;
|
||||||
|
|
||||||
displayedColumns = ['name', 'clientNo', 'externalId', 'status', 'office', 'staff'];
|
displayedColumns = ['entityName', 'entityAccountNo', 'entityExternalId', 'status', 'parentName', 'staffName'];
|
||||||
dataSource: MatTableDataSource<any>;
|
dataSource: MatTableDataSource<any>;
|
||||||
|
|
||||||
existsClientsToFilter = false;
|
existsClientsToFilter = false;
|
||||||
@@ -55,6 +55,8 @@ export class ClientsComponent implements OnInit {
|
|||||||
private getClients(value: string) {
|
private getClients(value: string) {
|
||||||
this.searchService.getSearchResults(value, 'clients').subscribe((data: any) => {
|
this.searchService.getSearchResults(value, 'clients').subscribe((data: any) => {
|
||||||
this.dataSource = new MatTableDataSource(data);
|
this.dataSource = new MatTableDataSource(data);
|
||||||
|
this.dataSource.paginator = this.paginator;
|
||||||
|
this.dataSource.sort = this.sort;
|
||||||
this.existsClientsToFilter = (data.length > 0);
|
this.existsClientsToFilter = (data.length > 0);
|
||||||
this.notExistsClientsToFilter = !this.existsClientsToFilter;
|
this.notExistsClientsToFilter = !this.existsClientsToFilter;
|
||||||
this.moreClientsToFilter = (data.length > 50);
|
this.moreClientsToFilter = (data.length > 50);
|
||||||
|
|||||||
@@ -1,39 +1,7 @@
|
|||||||
<div class="tab-container mat-typography">
|
<mifosx-entity-notes-tab [entityId]="entityId"
|
||||||
|
[entityNotes]="entityNotes"
|
||||||
<h3>Notes</h3>
|
[callbackAdd]="addNote"
|
||||||
|
[callbackEdit]="editNote"
|
||||||
<form #formRef="ngForm" [formGroup]="noteForm" fxLayout="row" fxLayoutAlign="start baseline" fxLayoutGap="20px"
|
[callbackDelete]="deleteNote"
|
||||||
(ngSubmit)="addNote()">
|
>
|
||||||
|
</mifosx-entity-notes-tab>
|
||||||
<mat-form-field fxFlex="calc(90%-20px)">
|
|
||||||
<textarea formControlName="note" matInput placeholder="Write a note ...."></textarea>
|
|
||||||
</mat-form-field>
|
|
||||||
|
|
||||||
<button mat-raised-button fxFlex color="primary" *mifosxHasPermission="'CREATE_GROUPNOTE'" [disabled]="!noteForm.valid">
|
|
||||||
<fa-icon icon="plus"></fa-icon> Add
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<mat-list>
|
|
||||||
|
|
||||||
<mat-list-item *ngFor="let groupNote of groupNotes; let i=index;">
|
|
||||||
<fa-icon icon="sticky-note" matListIcon></fa-icon>
|
|
||||||
<h3 matLine>{{groupNote.note}} </h3>
|
|
||||||
<p matLine>
|
|
||||||
<span>Created by: {{groupNote.createdByUsername}}</span><br />
|
|
||||||
<span>Date: {{groupNote.createdOn | dateFormat}}</span>
|
|
||||||
</p>
|
|
||||||
<div fxLayout="row" fxLayoutAlign="flex-start">
|
|
||||||
<button mat-button color="primary" (click)="editNote(groupNote.id,groupNote.note,i)">
|
|
||||||
<fa-icon icon="edit"></fa-icon>
|
|
||||||
</button>
|
|
||||||
<button mat-button color="warn" (click)="deleteNote(groupNote.id,i)">
|
|
||||||
<fa-icon icon="trash"></fa-icon>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</mat-list-item>
|
|
||||||
|
|
||||||
</mat-list>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
.tab-container {
|
|
||||||
padding: 1%;
|
|
||||||
margin: 1%;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
mat-list {
|
|
||||||
padding-top: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
mat-list-item {
|
|
||||||
margin-block: 20px;
|
|
||||||
&:hover{
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
/** Angular Imports */
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
|
||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { AuthenticationService } from '../../../core/authentication/authentication.service';
|
import { AuthenticationService } from '../../../core/authentication/authentication.service';
|
||||||
import { GroupsService } from '../../groups.service';
|
import { GroupsService } from '../../groups.service';
|
||||||
|
|
||||||
/** Custom Dialogs */
|
/** Custom Dialogs */
|
||||||
import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component';
|
|
||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
|
||||||
|
|
||||||
/** Custom Models */
|
|
||||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
|
||||||
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Groups Notes Tab Component.
|
* Groups Notes Tab Component.
|
||||||
@@ -26,113 +18,66 @@ import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
|||||||
})
|
})
|
||||||
export class NotesTabComponent implements OnInit {
|
export class NotesTabComponent implements OnInit {
|
||||||
|
|
||||||
/** Group Notes */
|
/** Group ID */
|
||||||
groupNotes: any;
|
entityId: string;
|
||||||
/** Group Id */
|
/** Username */
|
||||||
groupId: string;
|
|
||||||
/** User Name */
|
|
||||||
username: string;
|
username: string;
|
||||||
/** Note form */
|
/** Client Notes */
|
||||||
noteForm: FormGroup;
|
entityNotes: any;
|
||||||
|
|
||||||
/** Note Form Reference */
|
|
||||||
@ViewChild('formRef', { static: true }) formRef: any;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches notes data from `resolve`
|
* Fetches notes data from `resolve`
|
||||||
* @param {Activated Route} route Activated Route.
|
* @param {Activated Route} route Activated Route.
|
||||||
* @param {FormBuilder} formBuilder FormBuilder
|
|
||||||
* @param {GroupsService} groupsService Groups Service
|
* @param {GroupsService} groupsService Groups Service
|
||||||
* @param {MatDialog} dialog MatDialog
|
|
||||||
* @param {AuthenticationService} authenticationService Authentication Service.
|
* @param {AuthenticationService} authenticationService Authentication Service.
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private formBuilder: FormBuilder,
|
|
||||||
private authenticationService: AuthenticationService,
|
private authenticationService: AuthenticationService,
|
||||||
private groupsService: GroupsService,
|
private groupsService: GroupsService) {
|
||||||
public dialog: MatDialog) {
|
|
||||||
const savedCredentials = this.authenticationService.getCredentials();
|
const savedCredentials = this.authenticationService.getCredentials();
|
||||||
this.username = savedCredentials.username;
|
this.username = savedCredentials.username;
|
||||||
this.groupId = this.route.parent.snapshot.params['groupId'];
|
this.entityId = this.route.parent.snapshot.params['groupId'];
|
||||||
this.route.data.subscribe((data: { groupNotes: any }) => {
|
this.route.data.subscribe((data: { groupNotes: any }) => {
|
||||||
this.groupNotes = data.groupNotes;
|
this.entityNotes = data.groupNotes;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.createNoteForm();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates the note form.
|
|
||||||
*/
|
|
||||||
createNoteForm() {
|
|
||||||
this.noteForm = this.formBuilder.group({
|
|
||||||
'note': ['', Validators.required]
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a new note.
|
* Adds a new note.
|
||||||
*/
|
*/
|
||||||
addNote() {
|
addNote(noteContent: any) {
|
||||||
this.groupsService.createGroupNote(this.groupId, this.noteForm.value).subscribe((response: any) => {
|
this.groupsService.createGroupNote(this.entityId, noteContent).subscribe((response: any) => {
|
||||||
this.groupNotes.push({
|
this.entityNotes.push({
|
||||||
id: response.resourceId,
|
id: response.resourceId,
|
||||||
createdByUsername: this.username,
|
createdByUsername: this.username,
|
||||||
createdOn: new Date(),
|
createdOn: new Date(),
|
||||||
note: this.noteForm.value.note
|
note: noteContent.note
|
||||||
});
|
});
|
||||||
this.formRef.resetForm();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits selected note.
|
* Edits selected note.
|
||||||
* @param {string} noteId Note Id.
|
* @param {string} noteId Note Id.
|
||||||
* @param {string} noteContent Note's content.
|
* @param {any} noteContent Note's content.
|
||||||
* @param {number} index Index of note.
|
|
||||||
*/
|
*/
|
||||||
editNote(noteId: string, noteContent: string, index: number) {
|
editNote(noteId: string, noteContent: any, index: number) {
|
||||||
const formfields: FormfieldBase[] = [
|
this.groupsService.editGroupNote(this.entityId, noteId, noteContent).subscribe(() => {
|
||||||
new InputBase({
|
this.entityNotes[index].note = noteContent.note;
|
||||||
controlName: 'note',
|
|
||||||
label: 'Note',
|
|
||||||
value: noteContent,
|
|
||||||
type: 'text',
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
];
|
|
||||||
const data = {
|
|
||||||
title: 'Edit Note',
|
|
||||||
layout: { addButtonText: 'Confirm' },
|
|
||||||
formfields: formfields
|
|
||||||
};
|
|
||||||
const editNoteDialogRef = this.dialog.open(FormDialogComponent, { data });
|
|
||||||
editNoteDialogRef.afterClosed().subscribe((response: any) => {
|
|
||||||
if (response.data) {
|
|
||||||
this.groupsService.editGroupNote(this.groupId, noteId, response.data.value).subscribe(() => {
|
|
||||||
this.groupNotes[index].note = response.data.value.note;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delets the given note.
|
* Delets the given note.
|
||||||
* @param {string} noteId Note Id.
|
* @param {string} noteId Note Id.
|
||||||
* @param {number} index Index of Note.
|
|
||||||
*/
|
*/
|
||||||
deleteNote(noteId: string, index: number) {
|
deleteNote(noteId: string, index: number) {
|
||||||
const deleteNoteDialogRef = this.dialog.open(DeleteDialogComponent, {
|
this.groupsService.deleteGroupNote(this.entityId, noteId)
|
||||||
data: { deleteContext: `Note id:${noteId}` }
|
.subscribe(() => {
|
||||||
});
|
this.entityNotes.splice(index, 1);
|
||||||
deleteNoteDialogRef.afterClosed().subscribe((response: any) => {
|
|
||||||
if (response.delete) {
|
|
||||||
this.groupsService.deleteGroupNote(this.groupId, noteId).subscribe(() => {
|
|
||||||
this.groupNotes.splice(index, 1);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { ClientsService } from 'app/clients/clients.service';
|
|||||||
import { LoansAccountDetailsStepComponent } from '../loans-account-stepper/loans-account-details-step/loans-account-details-step.component';
|
import { LoansAccountDetailsStepComponent } from '../loans-account-stepper/loans-account-details-step/loans-account-details-step.component';
|
||||||
import { LoansAccountTermsStepComponent } from '../loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component';
|
import { LoansAccountTermsStepComponent } from '../loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component';
|
||||||
import { LoansAccountChargesStepComponent } from '../loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component';
|
import { LoansAccountChargesStepComponent } from '../loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component';
|
||||||
import { Dates } from 'app/core/utils/dates';
|
|
||||||
import { LoansAccountDatatableStepComponent } from '../loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component';
|
import { LoansAccountDatatableStepComponent } from '../loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,7 +28,7 @@ export class CreateLoansAccountComponent implements OnInit {
|
|||||||
@ViewChild(LoansAccountTermsStepComponent, { static: true }) loansAccountTermsStep: LoansAccountTermsStepComponent;
|
@ViewChild(LoansAccountTermsStepComponent, { static: true }) loansAccountTermsStep: LoansAccountTermsStepComponent;
|
||||||
@ViewChild(LoansAccountChargesStepComponent, { static: true }) loansAccountChargesStep: LoansAccountChargesStepComponent;
|
@ViewChild(LoansAccountChargesStepComponent, { static: true }) loansAccountChargesStep: LoansAccountChargesStepComponent;
|
||||||
/** Get handle on dtloan tags in the template */
|
/** Get handle on dtloan tags in the template */
|
||||||
@ViewChildren('dtloan') clientDatatables: QueryList<LoansAccountDatatableStepComponent>;
|
@ViewChildren('dtloan') loanDatatables: QueryList<LoansAccountDatatableStepComponent>;
|
||||||
|
|
||||||
/** Loans Account Template */
|
/** Loans Account Template */
|
||||||
loansAccountTemplate: any;
|
loansAccountTemplate: any;
|
||||||
@@ -47,14 +46,12 @@ export class CreateLoansAccountComponent implements OnInit {
|
|||||||
* Sets loans account create form.
|
* Sets loans account create form.
|
||||||
* @param {route} ActivatedRoute Activated Route.
|
* @param {route} ActivatedRoute Activated Route.
|
||||||
* @param {router} Router Router.
|
* @param {router} Router Router.
|
||||||
* @param {Dates} dateUtils Date Utils
|
|
||||||
* @param {loansService} LoansService Loans Service
|
* @param {loansService} LoansService Loans Service
|
||||||
* @param {SettingsService} settingsService Settings Service
|
* @param {SettingsService} settingsService Settings Service
|
||||||
* @param {ClientsService} clientService Client Service
|
* @param {ClientsService} clientService Client Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private dateUtils: Dates,
|
|
||||||
private loansService: LoansService,
|
private loansService: LoansService,
|
||||||
private settingsService: SettingsService,
|
private settingsService: SettingsService,
|
||||||
private clientService: ClientsService
|
private clientService: ClientsService
|
||||||
@@ -83,13 +80,14 @@ export class CreateLoansAccountComponent implements OnInit {
|
|||||||
this.loansService.getLoansAccountTemplateResource(entityId, isGroup, productId).subscribe((response: any) => {
|
this.loansService.getLoansAccountTemplateResource(entityId, isGroup, productId).subscribe((response: any) => {
|
||||||
this.multiDisburseLoan = response.multiDisburseLoan;
|
this.multiDisburseLoan = response.multiDisburseLoan;
|
||||||
});
|
});
|
||||||
|
this.setDatatables();
|
||||||
}
|
}
|
||||||
|
|
||||||
setDatatables(): void {
|
setDatatables(): void {
|
||||||
this.datatables = [];
|
this.datatables = [];
|
||||||
|
|
||||||
if (this.loansAccountTemplate.datatables) {
|
if (this.loansAccountProductTemplate.datatables) {
|
||||||
this.loansAccountTemplate.datatables.forEach((datatable: any) => {
|
this.loansAccountProductTemplate.datatables.forEach((datatable: any) => {
|
||||||
this.datatables.push(datatable);
|
this.datatables.push(datatable);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -138,9 +136,9 @@ export class CreateLoansAccountComponent implements OnInit {
|
|||||||
const payload = this.loansService.buildLoanRequestPayload(this.loansAccount, this.loansAccountTemplate,
|
const payload = this.loansService.buildLoanRequestPayload(this.loansAccount, this.loansAccountTemplate,
|
||||||
this.loansAccountProductTemplate.calendarOptions, locale, dateFormat);
|
this.loansAccountProductTemplate.calendarOptions, locale, dateFormat);
|
||||||
|
|
||||||
if (this.loansAccountTemplate.datatables && this.loansAccountTemplate.datatables.length > 0) {
|
if (this.loansAccountProductTemplate.datatables && this.loansAccountProductTemplate.datatables.length > 0) {
|
||||||
const datatables: any[] = [];
|
const datatables: any[] = [];
|
||||||
this.loansAccountTemplate.forEach((loanDatatable: LoansAccountDatatableStepComponent) => {
|
this.loanDatatables.forEach((loanDatatable: LoansAccountDatatableStepComponent) => {
|
||||||
datatables.push(loanDatatable.payload);
|
datatables.push(loanDatatable.payload);
|
||||||
});
|
});
|
||||||
payload['datatables'] = datatables;
|
payload['datatables'] = datatables;
|
||||||
|
|||||||
@@ -1,31 +1,15 @@
|
|||||||
<div class="tab-container mat-typography">
|
<div class="tab-container mat-typography">
|
||||||
|
<h3>{{datatableName}}</h3>
|
||||||
<div>
|
<div fxLayout="row" fxLayoutAlign="flex-end">
|
||||||
|
<button mat-raised-button color="primary" (click)="add()" *ngIf="!dataObject.data[0]">
|
||||||
<div fxLayout="column" fxFlex="50%" class="table-name">
|
<fa-icon icon="plus" class="m-r-10"></fa-icon>Add
|
||||||
<h3>{{datatableName}}</h3>
|
</button>
|
||||||
</div>
|
<button mat-raised-button color="primary" (click)="edit()" *ngIf="dataObject.data[0]">
|
||||||
|
<fa-icon icon="edit" class="m-r-10"></fa-icon>Edit
|
||||||
<div fxLayout="column" fxFlex="50%">
|
</button>
|
||||||
<div fxLayout="row" fxLayoutAlign="flex-end">
|
<button class="delete-button" mat-raised-button color="warn" (click)="delete()" *ngIf="dataObject.data[0]">
|
||||||
<span>
|
<fa-icon icon="trash" class="m-r-10"></fa-icon>Delete All
|
||||||
<button mat-raised-button color="primary" (click)="add()" *ngIf="!dataObject.data[0]">
|
</button>
|
||||||
<fa-icon icon="plus" class="m-r-10"></fa-icon>Add
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<button mat-raised-button color="primary" (click)="edit()" *ngIf="dataObject.data[0]">
|
|
||||||
<fa-icon icon="edit" class="m-r-10"></fa-icon>Edit
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
<span class="delete-button">
|
|
||||||
<button mat-raised-button color="warn" (click)="delete()" *ngIf="dataObject.data[0]">
|
|
||||||
<fa-icon icon="trash" class="m-r-10"></fa-icon>Delete
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export class LoanDocumentsTabComponent implements OnInit {
|
|||||||
entityDocuments: any;
|
entityDocuments: any;
|
||||||
/** Loan account Id */
|
/** Loan account Id */
|
||||||
entityId: string;
|
entityId: string;
|
||||||
entityType: string = 'loans';
|
entityType = 'loans';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the loans data from `resolve`.
|
* Retrieves the loans data from `resolve`.
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export class NotesTabComponent implements OnInit {
|
|||||||
id: response.resourceId,
|
id: response.resourceId,
|
||||||
createdByUsername: this.username,
|
createdByUsername: this.username,
|
||||||
createdOn: new Date(),
|
createdOn: new Date(),
|
||||||
note: noteContent
|
note: noteContent.note
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ export class SavingsDocumentsTabComponent implements OnInit {
|
|||||||
entityDocuments: any;
|
entityDocuments: any;
|
||||||
/** Stores the saving Account Id */
|
/** Stores the saving Account Id */
|
||||||
entityId: string;
|
entityId: string;
|
||||||
entityType: string = 'savings';
|
entityType = 'savings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the savings data from `resolve`.
|
* Retrieves the savings data from `resolve`.
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import { SavingsDocumentsTabComponent } from './savings-account-view/savings-doc
|
|||||||
import { NotesTabComponent } from './savings-account-view/notes-tab/notes-tab.component';
|
import { NotesTabComponent } from './savings-account-view/notes-tab/notes-tab.component';
|
||||||
import { SavingNotesResolver } from './common-resolvers/saving-notes.resolver';
|
import { SavingNotesResolver } from './common-resolvers/saving-notes.resolver';
|
||||||
import { SavingDocumentsResolver } from './common-resolvers/saving-documents.resolver';
|
import { SavingDocumentsResolver } from './common-resolvers/saving-documents.resolver';
|
||||||
import { DocumentsTabComponent } from 'app/clients/clients-view/documents-tab/documents-tab.component';
|
|
||||||
/** Savings Routes */
|
/** Savings Routes */
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
@@ -106,10 +105,10 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'documents',
|
path: 'documents',
|
||||||
component: DocumentsTabComponent,
|
component: SavingsDocumentsTabComponent,
|
||||||
data: { title: extract('Savings Account Documents'), breadcrumb: 'Documents', routeParamBreadcrumb: false },
|
data: { title: extract('Savings Account Documents'), breadcrumb: 'Documents', routeParamBreadcrumb: false },
|
||||||
resolve: {
|
resolve: {
|
||||||
savingAccountDocuments: SavingDocumentsResolver
|
savingsDocuments: SavingDocumentsResolver
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,6 +45,6 @@
|
|||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<mat-paginator *ngIf="entityDocuments.length > 10" [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
<mat-paginator *ngIf="entityDocuments && entityDocuments.length > 10" [pageSizeOptions]="[10, 25, 50]" showFirstLastButtons></mat-paginator>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
|||||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ClientsService } from 'app/clients/clients.service';
|
import { ClientsService } from 'app/clients/clients.service';
|
||||||
|
import { GroupsService } from 'app/groups/groups.service';
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
import { SavingsService } from 'app/savings/savings.service';
|
import { SavingsService } from 'app/savings/savings.service';
|
||||||
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||||
@@ -29,6 +30,7 @@ export class EntityNotesTabComponent implements OnInit {
|
|||||||
private savingsService: SavingsService,
|
private savingsService: SavingsService,
|
||||||
private loansService: LoansService,
|
private loansService: LoansService,
|
||||||
private clientsService: ClientsService,
|
private clientsService: ClientsService,
|
||||||
|
private groupsService: GroupsService,
|
||||||
private dialog: MatDialog) { }
|
private dialog: MatDialog) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|||||||
Reference in New Issue
Block a user