feat: add permissions (#1198)

- add permission in centers, loans, recurring deposits, products and account transfer module
- add charges action in loans view
This commit is contained in:
Muskan Khedia
2020-08-12 20:44:00 +05:30
committed by GitHub
parent dbcf40e064
commit 2f3005cab8
58 changed files with 744 additions and 101 deletions
@@ -233,7 +233,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!createStandingInstructionsForm.valid"
<button mat-raised-button color="primary" [disabled]="!createStandingInstructionsForm.valid" *mifosxHasPermission="'CREATE_STANDINGINSTRUCTION'"
(click)="submit()">Submit</button>
</mat-card-actions>
@@ -160,7 +160,8 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!editStandingInstructionsForm.valid" (click)="submit()">Submit</button>
<button mat-raised-button color="primary" [disabled]="!editStandingInstructionsForm.valid"
(click)="submit()" *mifosxHasPermission="'UPDATE_STANDINGINSTRUCTION'">Submit</button>
</mat-card-actions>
</form>
@@ -35,7 +35,7 @@
<input matInput placeholder="From Account Id" [formControl]="fromAccountId">
</mat-form-field>
<button mat-raised-button color="primary" (click)="filterStandingInstructions()" class="filter-button">
<button mat-raised-button color="primary" *mifosxHasPermission="'READ_STANDINGINSTRUCTION'" (click)="filterStandingInstructions()" class="filter-button">
&nbsp;&nbsp;Filter
</button>
</div>
@@ -132,7 +132,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!makeAccountTransferForm.valid"
<button mat-raised-button color="primary" [disabled]="!makeAccountTransferForm.valid" *mifosxHasPermission="'CREATE_ACCOUNTTRANSFER'"
(click)="submit()">Submit</button>
</mat-card-actions>
@@ -3,7 +3,7 @@
<fa-icon icon="edit"></fa-icon>&nbsp;&nbsp;
Edit
</button>
<button mat-raised-button color="primary" [routerLink]="['../', 'list-account-transactions']">
<button mat-raised-button color="primary" [routerLink]="['../', 'list-account-transactions']" *mifosxHasPermission="'READ_ACCOUNTTRANSFER'">
View Transactions History
</button>
</div>
@@ -41,7 +41,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../']">Cancel</button>
<button mat-raised-button color="primary" (click)="submit()">Confirm</button>
<button mat-raised-button color="primary" (click)="submit()" *mifosxHasPermission="'CREATE_MEETING'">Confirm</button>
</mat-card-actions>
</mat-card>
@@ -36,7 +36,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../']">Cancel</button>
<button mat-raised-button color="warn" [disabled]="!closeCenterForm.valid">Confirm</button>
<button mat-raised-button color="warn" [disabled]="!closeCenterForm.valid" *mifosxHasPermission="'CLOSE_CENTER'">Confirm</button>
</mat-card-actions>
</form>
@@ -38,8 +38,10 @@
<div class="center-meeting" fxLayoutAlign="start start">
<div *ngIf="centerViewData.collectionMeetingCalendar; else unassigned">
<p>
Next Meeting on: {{centerViewData.collectionMeetingCalendar?.nextTenRecurringDates[0] | date}}
<i class="fa fa-edit" *ngIf="editMeeting" (click)="doAction('Edit Meeting')"></i><br/>
Next Meeting on: {{centerViewData.collectionMeetingCalendar?.nextTenRecurringDates[0] | date}}
<span *ngIf="editMeeting">
<i class="fa fa-edit" (click)="doAction('Edit Meeting')" *mifosxHasPermission="'UPDATE_MEETING'"></i><br />
</span>
Meeting Frequency: {{centerViewData.collectionMeetingCalendar?.frequency.value | lowercase}}
</p>
</div>
+2 -2
View File
@@ -11,10 +11,10 @@
</mat-checkbox>
</div>
<div class="action-button" fxLayoutGap="25px">
<button mat-raised-button color="primary" [routerLink]="['../', 'organization', 'bulk-import', 'Centers']">
<button mat-raised-button color="primary" [routerLink]="['../', 'organization', 'bulk-import', 'Centers']" *mifosxHasPermission="'CREATE_CENTER'">
<fa-icon icon="download"></fa-icon>&nbsp;&nbsp;Import Center
</button>
<button mat-raised-button color="primary" [routerLink]="['create']">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_CENTER'">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;Create Center
</button>
</div>
@@ -119,7 +119,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!centerForm.valid" (click)="submit()">Submit</button>
<button mat-raised-button color="primary" [disabled]="!centerForm.valid" (click)="submit()" *mifosxHasPermission="'CREATE_CENTER'">Submit</button>
</mat-card-actions>
</form>
@@ -24,7 +24,7 @@ export class LoanDetailsChargesResolver implements Resolve<Object> {
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.paramMap.get('loanId');
const loanId = route.parent.parent.paramMap.get('loanId');
return this.loansService.getLoanAccountAssociationDetails(loanId);
}
@@ -0,0 +1,33 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { LoansService } from '../loans.service';
/**
* Loans Account Charge data resolver.
*/
@Injectable()
export class LoansAccountChargeResolver implements Resolve<Object> {
/**
* @param {LoansService} LoansService Loans service.
*/
constructor(private loansService: LoansService) { }
/**
* Returns the Loans Account Charge data.
* @param {ActivatedRouteSnapshot} route Route Snapshot
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanAccountId = route.parent.parent.paramMap.get('loanId');
const chargeId = route.paramMap.get('id');
return this.loansService.getLoansAccountCharge(loanAccountId, chargeId);
}
}
@@ -20,7 +20,7 @@
<mat-dialog-actions align="end">
<button mat-raised-button mat-dialog-close>Cancel</button>
<button mat-raised-button color="primary" [disabled]="!uploadDocumentForm.valid"
<button mat-raised-button color="primary" [disabled]="!uploadDocumentForm.valid" *mifosxHasPermission="'CREATE_DOCUMENT'"
[mat-dialog-close]="{data: {name: uploadDocumentForm.value.name, description: uploadDocumentForm.value.description, file: uploadDocumentForm.value.file} }">Confirm</button>
</mat-dialog-actions>
+22 -6
View File
@@ -35,6 +35,8 @@ import { LoanActionButtonResolver } from './common-resolvers/loan-action-button.
import { LoansAccountTemplateResolver } from './common-resolvers/loans-account-template.resolver';
import { LoanDocumentsResolver } from './common-resolvers/loan-documents.resolver';
import { LoansAccountAndTemplateResolver } from './common-resolvers/loans-account-and-template.resolver';
import { LoansAccountChargeResolver } from './common-resolvers/loans-account-charge.resolver';
import { ViewChargeComponent } from './loans-view/view-charge/view-charge.component';
/** Loans Route. */
const routes: Routes = [
@@ -128,11 +130,24 @@ const routes: Routes = [
},
{
path: 'charges',
component: ChargesTabComponent,
data: { title: extract('Charges'), breadcrumb: 'Charges', routeParamBreadcrumb: false },
resolve: {
loanDetailsAssociationData: LoanDetailsChargesResolver
}
data: { title: extract('Loans Account Charges'), breadcrumb: 'Charges', routeParamBreadcrumb: false },
children: [
{
path: '',
component: ChargesTabComponent,
resolve: {
loanDetailsAssociationData: LoanDetailsChargesResolver
}
},
{
path: ':id',
data: { routeParamBreadcrumb: 'id' },
component: ViewChargeComponent,
resolve: {
loansAccountCharge: LoansAccountChargeResolver
}
}
]
},
{
path: 'loan-documents',
@@ -206,7 +221,8 @@ const routes: Routes = [
LoanActionButtonResolver,
LoansAccountTemplateResolver,
LoanDocumentsResolver,
LoansAccountAndTemplateResolver
LoansAccountAndTemplateResolver,
LoansAccountChargeResolver
]
})
@@ -1,4 +1,4 @@
<div class="container">
<div class="tab-container">
<table mat-table [dataSource]="dataSource" matSort>
@@ -52,24 +52,30 @@
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Actions </th>
<td mat-cell *matCellDef="let charge">
<button class="charges-action-button" mat-raised-button color="primary" *ngIf="status === 'Submitted and pending approval'">
<i class="fa fa-edit" matTooltip="edit"></i>
</button>
<button class="charges-action-button" mat-raised-button color="warning" *ngIf="status === 'Submitted and pending approval'">
<i class="fa fa-trash-o" matTooltip="delete"></i>
</button>
<button class="charges-action-button" mat-raised-button color="primary" *ngIf="!charge.actionFlag">
<i class="fa fa-flag"></i>
</button>
<button class="charges-action-button" mat-raised-button color="success" *ngIf="charge.chargePayable && status=='Active'">
Pay
</button>
<td mat-cell *matCellDef="let charge">
<span *ngIf="status === 'Submitted and pending approval'">
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Edit Charge"
(click)="routeEdit($event); editCharge(charge)">
<i class="fa fa-pencil"></i>
</button>
<button class="account-action-button" mat-raised-button color="warn" matTooltip="Delete Charge"
(click)="routeEdit($event); deleteCharge(charge.id)">
<i class="fa fa-trash"></i>
</button>
</span>
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Pay Charge" *ngIf="charge.chargePayable && status=='Active'"
(click)="routeEdit($event); payCharge(charge.id)">
<i class="fa fa-dollar"></i>
</button>
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Waive Charge" *ngIf="!charge.actionFlag"
(click)="routeEdit($event); waiveCharge(charge.id)">
<i class="fa fa-flag"></i>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" class="select-row" [routerLink]="[row.id]"></tr>
</table>
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
@@ -1,4 +1,20 @@
table {
.tab-container {
padding: 1%;
margin: 1%;
h3 {
margin:1% auto;
}
table {
width: 100%;
margin-top: 3%;
.account-action-button{
min-width: 26px;
padding: 0 6px;
margin: 4px;
line-height: 25px;
}
.select-row:hover {
cursor: pointer;
}
}
}
@@ -1,7 +1,21 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatTableDataSource, MatPaginator, MatSort } from '@angular/material';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog, MatTableDataSource, MatTable, MatPaginator, MatSort } from '@angular/material';
import { DatePipe } from '@angular/common';
/** Custom Services */
import { LoansService } from 'app/loans/loans.service';
/** Custom Dialogs */
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-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';
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
@Component({
selector: 'mifosx-charges-tab',
@@ -30,7 +44,11 @@ export class ChargesTabComponent implements OnInit {
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
constructor(private loansService: LoansService,
private route: ActivatedRoute,
private datePipe: DatePipe,
private router: Router,
public dialog: MatDialog) {
this.route.data.subscribe(( data: { loanDetailsAssociationData: any }) => {
this.loanDetails = data.loanDetailsAssociationData;
});
@@ -54,4 +72,139 @@ export class ChargesTabComponent implements OnInit {
this.dataSource.sort = this.sort;
}
/**
* Pays the charge.
* @param {any} chargeId Charge Id
*/
payCharge(chargeId: any) {
const formfields: FormfieldBase[] = [
new InputBase({
controlName: 'amount',
label: 'Amount',
value: '',
type: 'number',
required: true
}),
new DatepickerBase({
controlName: 'dueDate',
label: 'Payment Date',
value: '',
type: 'date',
required: true
})
];
const data = {
title: `Pay Charge ${chargeId}`,
layout: { addButtonText: 'Confirm' },
formfields: formfields
};
const payChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
payChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.data) {
const locale = 'en';
const dateFormat = 'dd MMMM yyyy';
const dataObject = {
...response.data.value,
dueDate: this.datePipe.transform(response.data.value.dueDate, dateFormat),
dateFormat,
locale
};
this.loansService.executeLoansAccountChargesCommand(this.loanDetails.id, 'paycharge', dataObject, chargeId)
.subscribe(() => {
this.reload();
});
}
});
}
/**
* Waive's the charge
* @param {any} chargeId Charge Id
*/
waiveCharge(chargeId: any) {
const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: 'Waive Charge', dialogContext: `Are you sure you want to waive charge with id: ${chargeId}`, type: 'Basic' } });
waiveChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.loansService.executeLoansAccountChargesCommand(this.loanDetails.id, 'waive', {}, chargeId)
.subscribe(() => {
this.reload();
});
}
});
}
/**
* Edits the charge
* @param {any} charge Charge
*/
editCharge(charge: any) {
const formfields: FormfieldBase[] = [
new InputBase({
controlName: 'amount',
label: 'Amount',
value: charge.amount || charge.amountOrPercentage,
type: 'number',
required: true
})
];
const data = {
title: `Edit Charge ${charge.id}`,
layout: { addButtonText: 'Confirm' },
formfields: formfields
};
const editChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
editChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.data) {
const locale = 'en';
const dateFormat = 'dd MMMM yyyy';
const dataObject = {
...response.data.value,
dateFormat,
locale
};
this.loansService.editLoansAccountCharge(this.loanDetails.id, dataObject, charge.id)
.subscribe(() => {
this.reload();
});
}
});
}
/**
* Deletes the charge
* @param {any} chargeId Charge Id
*/
deleteCharge(chargeId: any) {
const deleteChargeDialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `charge id:${chargeId}` }
});
deleteChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
this.loansService.deleteLoansAccountCharge(this.loanDetails.id, chargeId)
.subscribe(() => {
this.reload();
});
}
});
}
/**
* Stops the propagation to view charge page.
* @param $event Mouse Event
*/
routeEdit($event: MouseEvent) {
$event.stopPropagation();
}
/**
* Refetches data fot the component
* TODO: Replace by a custom reload component instead of hard-coded back-routing.
*/
private reload() {
const clientId = this.loanDetails.clientId;
const url: string = this.router.url;
this.router.navigateByUrl(`/clients/${clientId}/loans`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
}
@@ -48,7 +48,7 @@
<mat-card-actions fxLayoutGap="5px" fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center">
<button type="button" mat-raised-button [routerLink]="['../../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!loanChargeForm.valid">Submit</button>
<button mat-raised-button color="primary" [disabled]="!loanChargeForm.valid" *mifosxHasPermission="'CREATE_LOANCHARGE'">Submit</button>
</mat-card-actions>
</mat-card-content>
@@ -150,7 +150,7 @@
<th mat-header-cell *matHeaderCellDef> Action </th>
<td mat-cell *matCellDef="let guarantor; let id = index">
<span *ngIf="!guarantor.guarantorFundingDetails">
<button mat-raised-button class="account-action-button" color="primary" (click)="viewGuarantorDetails(guarantor)">
<button mat-raised-button class="account-action-button" color="primary" *mifosxHasPermission="'READ_SAVINGSACCOUNT'" (click)="viewGuarantorDetails(guarantor)">
<fa-icon icon="eye"></fa-icon>&nbsp;&nbsp;
</button>
<button mat-raised-button class="account-action-button" color="primary" *ngIf="guarantor.status && guarantor.guarantorType.id == 3 && guarantor.id">
@@ -0,0 +1,119 @@
<div *ngIf="loansAccountData.status.value === 'Active' && chargeData.amountOutstanding !== 0"
fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<button mat-raised-button color="accent" *mifosxHasPermission="'PAY_SAVINGSACCOUNTCHARGE'" (click)="payCharge()">
<fa-icon icon="dollar-sign"></fa-icon>&nbsp;&nbsp;
Pay
</button>
<button mat-raised-button color="primary" *mifosxHasPermission="'WAIVE_SAVINGSACCOUNTCHARGE'" (click)="waiveCharge()">
<fa-icon icon="flag"></fa-icon>&nbsp;&nbsp;
Waive
</button>
</div>
<div *ngIf="loansAccountData.status.value === 'Submitted and pending approval'"
fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<button mat-raised-button color="primary" *mifosxHasPermission="'UPDATE_SAVINGSACCOUNTCHARGE'" (click)="editCharge()">
<fa-icon icon="edit"></fa-icon>&nbsp;&nbsp;
Edit
</button>
<button mat-raised-button color="warn" *mifosxHasPermission="'DELETE_SAVINGSACCOUNTCHARGE'" (click)="deleteCharge()">
<fa-icon icon="trash"></fa-icon>&nbsp;&nbsp;
Delete
</button>
</div>
<div class="container">
<mat-card>
<mat-card-content>
<div fxLayout="row wrap" class="content">
<div fxFlex="50%" class="mat-body-strong">
Name
</div>
<div fxFlex="50%">
{{ chargeData.name }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Charge Type
</div>
<div fxFlex="50%">
{{ chargeData.penalty ? 'Penalty' : 'Fees' }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Currency
</div>
<div fxFlex="50%">
{{ chargeData.currency.displayLabel }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Payment due at
</div>
<div fxFlex="50%">
{{ chargeData.chargeTimeType.value }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Payment due as of
</div>
<div fxFlex="50%">
{{ chargeData.dueDate | date }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Calculation Type
</div>
<div fxFlex="50%">
{{ chargeData.chargeCalculationType.value }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Due
</div>
<div fxFlex="50%">
{{ chargeData.amount }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Paid
</div>
<div fxFlex="50%">
{{ chargeData.amountPaid }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Waived
</div>
<div fxFlex="50%">
{{ chargeData.amountWaived }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Outstanding
</div>
<div fxFlex="50%">
{{ chargeData.amountOutstanding }}
</div>
</div>
</mat-card-content>
</mat-card>
</div>
@@ -0,0 +1,10 @@
.container {
max-width: 37rem;
.content {
div {
margin: 1rem 0;
word-wrap: break-word;
}
}
}
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ViewChargeComponent } from './view-charge.component';
describe('ViewChargeComponent', () => {
let component: ViewChargeComponent;
let fixture: ComponentFixture<ViewChargeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewChargeComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ViewChargeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,179 @@
/** Angular Imports */
import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material';
import { DatePipe } from '@angular/common';
/** Custom Services */
import { LoansService } from 'app/loans/loans.service';
/** Custom Dialogs */
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-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';
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
/**
* View Charge Component.
*/
@Component({
selector: 'mifosx-view-charge',
templateUrl: './view-charge.component.html',
styleUrls: ['./view-charge.component.scss']
})
export class ViewChargeComponent {
/** Charge data. */
chargeData: any;
/** Loans Account Data */
loansAccountData: any;
/**
* Retrieves the Charge data from `resolve`.
* @param {LoansService} loansService Loans Service
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
* @param {MatDialog} dialog Dialog reference.
* @param {DatePipe} datePipe DatePipe.
*/
constructor(private loansService: LoansService,
private route: ActivatedRoute,
private datePipe: DatePipe,
private router: Router,
public dialog: MatDialog) {
this.route.data.subscribe((data: { loansAccountCharge: any }) => {
this.chargeData = data.loansAccountCharge;
});
this.route.parent.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loansAccountData = data.loanDetailsData;
});
}
/**
* Pays the charge.
*/
payCharge() {
const formfields: FormfieldBase[] = [
new InputBase({
controlName: 'amount',
label: 'Amount',
value: '',
type: 'number',
required: true
}),
new DatepickerBase({
controlName: 'dueDate',
label: 'Payment Date',
value: '',
type: 'date',
required: true
})
];
const data = {
title: 'Pay Charge',
layout: { addButtonText: 'Confirm' },
formfields: formfields
};
const payChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
payChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.data) {
const locale = 'en';
const dateFormat = 'dd MMMM yyyy';
const dataObject = {
...response.data.value,
dueDate: this.datePipe.transform(response.data.value.dueDate, dateFormat),
dateFormat,
locale
};
this.loansService.executeLoansAccountChargesCommand(this.chargeData.accountId, 'paycharge', dataObject, this.chargeData.id)
.subscribe(() => {
this.reload();
});
}
});
}
/**
* Waive's the charge
*/
waiveCharge() {
const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: 'Waive Charge', dialogContext: `Are you sure you want to waive charge with id: ${this.chargeData.id}`, type: 'Basic' } });
waiveChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.loansService.executeLoansAccountChargesCommand(this.chargeData.accountId, 'waive', {}, this.chargeData.id)
.subscribe(() => {
this.reload();
});
}
});
}
/**
* Edits the charge
*/
editCharge() {
const formfields: FormfieldBase[] = [
new InputBase({
controlName: 'amount',
label: 'Amount',
value: this.chargeData.amount || this.chargeData.amountOrPercentage,
type: 'number',
required: true
})
];
const data = {
title: 'Edit Charge',
layout: { addButtonText: 'Confirm' },
formfields: formfields
};
const editChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
editChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.data) {
const locale = 'en';
const dateFormat = 'dd MMMM yyyy';
const dataObject = {
...response.data.value,
dateFormat,
locale
};
this.loansService.editLoansAccountCharge(this.loansAccountData.id, dataObject, this.chargeData.id)
.subscribe(() => {
this.reload();
});
}
});
}
/**
* Deletes the charge
*/
deleteCharge() {
const deleteChargeDialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `charge id:${this.chargeData.id}` }
});
deleteChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
this.loansService.deleteLoansAccountCharge(this.loansAccountData.id, this.chargeData.id)
.subscribe(() => {
this.reload();
});
}
});
}
/**
* Refetches data fot the component
* TODO: Replace by a custom reload component instead of hard-coded back-routing.
*/
private reload() {
const clientId = this.loansAccountData.clientId;
const url: string = this.router.url.replace(`/${this.chargeData.id}`, '');
this.router.navigateByUrl(`/clients/${clientId}/loansaccounts`, {skipLocationChange: true})
.then(() => this.router.navigate([url]));
}
}
+7 -5
View File
@@ -51,16 +51,17 @@ import { WithdrawnByClientComponent } from './loans-view/loan-account-actions/wi
import { UndoDisbursalComponent } from './loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component';
import { AddCollateralComponent } from './loans-view/loan-account-actions/add-collateral/add-collateral.component';
import { LoanDocumentsTabComponent } from './loans-view/loan-documents-tab/loan-documents-tab.component';
import { ViewChargeComponent } from './loans-view/view-charge/view-charge.component';
import { StandingInstructionsTabComponent } from './loans-view/standing-instructions-tab/standing-instructions-tab.component';
import { EditLoansAccountComponent } from './edit-loans-account/edit-loans-account.component';
import { LoanScreenReportsComponent } from './loans-view/loan-account-actions/loan-screen-reports/loan-screen-reports.component';
import { ApproveLoanComponent } from './loans-view/loan-account-actions/approve-loan/approve-loan.component';
/** Dialog Components */
import { LoansAccountViewGuarantorDetailsDialogComponent } from './custom-dialog/loans-account-view-guarantor-details-dialog/loans-account-view-guarantor-details-dialog.component';
import { LoansAccountAddCollateralDialogComponent } from './custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component';
import { LoansConfirmationDialogBoxComponent } from './custom-dialog/loans-confirmation-dialog-box/loans-confirmation-dialog-box.component';
import { LoanAccountLoadDocumentsDialogComponent } from './custom-dialog/loan-account-load-documents-dialog/loan-account-load-documents-dialog.component';
import { StandingInstructionsTabComponent } from './loans-view/standing-instructions-tab/standing-instructions-tab.component';
import { EditLoansAccountComponent } from './edit-loans-account/edit-loans-account.component';
import { LoanScreenReportsComponent } from './loans-view/loan-account-actions/loan-screen-reports/loan-screen-reports.component';
import { ApproveLoanComponent } from './loans-view/loan-account-actions/approve-loan/approve-loan.component';
/**
* Loans Module
@@ -119,7 +120,8 @@ import { ApproveLoanComponent } from './loans-view/loan-account-actions/approve-
StandingInstructionsTabComponent,
EditLoansAccountComponent,
LoanScreenReportsComponent,
ApproveLoanComponent
ApproveLoanComponent,
ViewChargeComponent
],
entryComponents: [
LoansAccountAddCollateralDialogComponent,
+40
View File
@@ -364,4 +364,44 @@ export class LoansService {
return this.http.get(`/loans/${loanId}/guarantors/accounts/template`, { params: httpParams });
}
/**
* @param {string} accountId loans account Id
* @param {string} chargeId loans charge Id
* @returns {Observable<any>}
*/
getLoansAccountCharge(accountId: string, chargeId: string): Observable<any> {
return this.http.get(`/loans/${accountId}/charges/${chargeId}`);
}
/**
* @param {string} accountId Loans Account Id
* @param {string} command Command
* @param {any} data Data
* @param {string} chargeId Charge Id
* @returns {Observable<any>}
*/
executeLoansAccountChargesCommand(accountId: string, command: string, data: any, chargeId: any): Observable<any> {
const httpParams = new HttpParams().set('command', command);
return this.http.post(`/loans/${accountId}/charges/${chargeId}`, data, { params: httpParams });
}
/**
* @param {string} accountId Loans Account Id
* @param {any} data Charge Data
* @param {any} chargeId Charge Id
* @returns {Observable<any>}
*/
editLoansAccountCharge(accountId: string, data: any, chargeId: any): Observable<any> {
return this.http.put(`/loans/${accountId}/charges/${chargeId}`, data);
}
/**
* @param {string} accountId Loans Account Id
* @param {any} chargeId Charge Id
* @returns {Observable<any>}
*/
deleteLoansAccountCharge(accountId: string, chargeId: any): Observable<any> {
return this.http.delete(`/loans/${accountId}/charges/${chargeId}`);
}
}
@@ -1,5 +1,5 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<button mat-raised-button color="primary" [routerLink]="['create']">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_FIXEDDEPOSITPRODUCT'">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Create Fixed Deposit Product
</button>
@@ -90,7 +90,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button type="submit" color="primary" [disabled]="!floatingRateForm.valid">Submit</button>
<button mat-raised-button type="submit" color="primary" [disabled]="!floatingRateForm.valid" *mifosxHasPermission="'CREATE_FLOATINGRATE'">Submit</button>
</mat-card-actions>
</form>
@@ -1,5 +1,5 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<button mat-raised-button color="primary" [routerLink]="['create']">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_FLOATINGRATE'">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Create Floating Rate
</button>
@@ -1,6 +1,6 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<button mat-raised-button color="primary" [routerLink]="['edit']">
<button mat-raised-button color="primary" [routerLink]="['edit']" *mifosxHasPermission="'UPDATE_FLOATINGRATE'">
<fa-icon icon="edit"></fa-icon>&nbsp;&nbsp;
Edit
</button>
@@ -1,5 +1,5 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<button mat-raised-button color="primary" [routerLink]="['create']">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_LOANPRODUCT'">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Create Loan Product
</button>
@@ -1,5 +1,5 @@
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<button mat-raised-button color="primary" [routerLink]="['edit']">
<button mat-raised-button color="primary" [routerLink]="['edit']" *mifosxHasPermission="'UPDATE_LOANPRODUCT'">
<fa-icon icon="edit"></fa-icon>&nbsp;&nbsp;
Edit
</button>
@@ -86,7 +86,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!taxComponentForm.valid">Submit</button>
<button mat-raised-button color="primary" [disabled]="!taxComponentForm.valid" *mifosxHasPermission="'CREATE_TAXCOMPONENT'">Submit</button>
</mat-card-actions>
</form>
@@ -50,7 +50,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!taxComponentForm.valid">Submit</button>
<button mat-raised-button color="primary" [disabled]="!taxComponentForm.valid" *mifosxHasPermission="'UPDATE_TAXCOMPONENT'">Submit</button>
</mat-card-actions>
</form>
@@ -1,5 +1,5 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<button mat-raised-button color="primary" [routerLink]="['create']">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_TAXCOMPONENT'">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Create Tax Component
</button>
@@ -1,5 +1,5 @@
<div class="container m-b-20" fxLayout="row" fxLayout.lt-md="column" fxLayoutAlign="end" fxLayoutGap="2%">
<button mat-raised-button color="primary" [routerLink]="['edit']">
<button mat-raised-button color="primary" [routerLink]="['edit']" *mifosxHasPermission="'UPDATE_TAXCOMPONENT'">
<fa-icon icon="edit"></fa-icon>&nbsp;&nbsp;
Edit
</button>
@@ -8,7 +8,7 @@
<mat-nav-list>
<mat-list-item [routerLink]="['tax-components']">
<mat-list-item [routerLink]="['tax-components']" *mifosxHasPermission="'READ_TAXCOMPONENT'">
<mat-icon matListIcon>
<fa-icon icon="building" size="sm"></fa-icon>
</mat-icon>
@@ -24,7 +24,7 @@
<mat-nav-list>
<mat-list-item [routerLink]="['tax-groups']">
<mat-list-item [routerLink]="['tax-groups']" *mifosxHasPermission="'READ_TAXGROUP'">
<mat-icon matListIcon>
<fa-icon icon="building" size="sm"></fa-icon>
</mat-icon>
@@ -65,7 +65,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!taxGroupForm.valid">Submit</button>
<button mat-raised-button color="primary" [disabled]="!taxGroupForm.valid" *mifosxHasPermission="'CREATE_TAXGROUP'">Submit</button>
</mat-card-actions>
</form>
@@ -71,7 +71,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!taxGroupForm.valid">Submit</button>
<button mat-raised-button color="primary" [disabled]="!taxGroupForm.valid" *mifosxHasPermission="'UPDATE_TAXGROUP'">Submit</button>
</mat-card-actions>
</form>
+9 -9
View File
@@ -8,7 +8,7 @@
<mat-nav-list>
<mat-list-item [routerLink]="['loan-products']">
<mat-list-item [routerLink]="['loan-products']" *mifosxHasPermission="'READ_LOANPRODUCT'">
<mat-icon matListIcon>
<fa-icon icon="briefcase" size="sm"></fa-icon>
</mat-icon>
@@ -16,7 +16,7 @@
<p matLine>Add new loan product or modify or inactivate loan product</p>
</mat-list-item>
<mat-list-item [routerLink]="['saving-products']">
<mat-list-item [routerLink]="['saving-products']" *mifosxHasPermission="'READ_SAVINGSPRODUCT'">
<mat-icon matListIcon>
<fa-icon icon="briefcase" size="sm"></fa-icon>
</mat-icon>
@@ -24,7 +24,7 @@
<p matLine>Add new savings product or modify or inactivate savings product</p>
</mat-list-item>
<mat-list-item [routerLink]="['share-products']">
<mat-list-item [routerLink]="['share-products']" *mifosxHasPermission="'READ_SHAREPRODUCT'">
<mat-icon matListIcon>
<fa-icon icon="briefcase" size="sm"></fa-icon>
</mat-icon>
@@ -32,7 +32,7 @@
<p matLine>Add new share product or modify or inactivate share product</p>
</mat-list-item>
<mat-list-item [routerLink]="['charges']">
<mat-list-item [routerLink]="['charges']" *mifosxHasPermission="'READ_CHARGE'">
<mat-icon matListIcon>
<fa-icon icon="money-bill-alt" size="sm"></fa-icon>
</mat-icon>
@@ -48,7 +48,7 @@
<mat-nav-list>
<mat-list-item [routerLink]="['products-mix']">
<mat-list-item [routerLink]="['products-mix']" *mifosxHasPermission="'READ_PRODUCTMIX'">
<mat-icon matListIcon>
<fa-icon icon="random" size="sm"></fa-icon>
</mat-icon>
@@ -56,7 +56,7 @@
<p matLine>Defines rules for taking multiple rules</p>
</mat-list-item>
<mat-list-item [routerLink]="['fixed-deposit-products']">
<mat-list-item [routerLink]="['fixed-deposit-products']" *mifosxHasPermission="'READ_FIXEDDEPOSITPRODUCT'">
<mat-icon matListIcon>
<fa-icon icon="briefcase" size="sm"></fa-icon>
</mat-icon>
@@ -64,7 +64,7 @@
<p matLine>Add, modify or inactivate a Fixed deposit product</p>
</mat-list-item>
<mat-list-item [routerLink]="['recurring-deposit-products']">
<mat-list-item [routerLink]="['recurring-deposit-products']" *mifosxHasPermission="'READ_RECURRINGDEPOSITPRODUCT'">
<mat-icon matListIcon>
<fa-icon icon="briefcase" size="sm"></fa-icon>
</mat-icon>
@@ -72,7 +72,7 @@
<p matLine>Add, modify or inactivate a Recurring Deposit product</p>
</mat-list-item>
<mat-list-item [routerLink]="['tax-configurations']">
<mat-list-item [routerLink]="['tax-configurations']" *mifosxHasPermission="'READ_TAXGROUP'">
<mat-icon matListIcon>
<fa-icon icon="cogs" size="sm"></fa-icon>
</mat-icon>
@@ -80,7 +80,7 @@
<p matLine>Define Tax components and Tax groups</p>
</mat-list-item>
<mat-list-item [routerLink]="['floating-rates']">
<mat-list-item [routerLink]="['floating-rates']" *mifosxHasPermission="'READ_FLOATINGRATE'">
<mat-icon matListIcon>
<fa-icon icon="money-bill-alt" size="sm"></fa-icon>
</mat-icon>
@@ -88,6 +88,7 @@
[savingProductsTemplate]="savingProductsTemplate"
[accountingRuleData]="accountingRuleData"
[savingProduct]="savingProduct"
[taskPermission]='"CREATE_SAVINGSPRODUCT"'
(submit)="submit()"
>
</mifosx-saving-product-preview-step>
@@ -88,6 +88,7 @@
[savingProductsTemplate]="savingProductAndTemplate"
[accountingRuleData]="accountingRuleData"
[savingProduct]="savingProduct"
[taskPermission]='"UPDATE_SAVINGSPRODUCT"'
(submit)="submit()"
>
</mifosx-saving-product-preview-step>
@@ -341,7 +341,7 @@
<button mat-raised-button [routerLink]="['../']">
Cancel
</button>
<button mat-raised-button color="primary" (click)="submit.emit()">
<button mat-raised-button color="primary" (click)="submit.emit()" *mifosxHasPermission="taskPermission">
Submit
</button>
</div>
@@ -10,6 +10,7 @@ export class SavingProductPreviewStepComponent implements OnInit {
@Input() savingProductsTemplate: any;
@Input() accountingRuleData: any;
@Input() savingProduct: any;
@Input() taskPermission: string;
@Output() submit = new EventEmitter();
chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType'];
@@ -1,5 +1,5 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<button mat-raised-button color="primary" [routerLink]="['create']">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_SAVINGSPRODUCT'">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Create Saving Product
</button>
@@ -1,5 +1,5 @@
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<button mat-raised-button color="primary" [routerLink]="['edit']">
<button mat-raised-button color="primary" [routerLink]="['edit']" *mifosxHasPermission="'UPDATE_SAVINGSPRODUCT'">
<fa-icon icon="edit"></fa-icon>&nbsp;&nbsp;
Edit
</button>
@@ -95,6 +95,7 @@
[shareProductsTemplate]="shareProductsTemplate"
[accountingRuleData]="accountingRuleData"
[shareProduct]="shareProduct"
[taskPermission]='"CREATE_SHAREPRODUCT"'
(submit)="submit()"
>
</mifosx-share-product-preview-step>
@@ -1,5 +1,5 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'mifosxHasPermission'">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_SHAREDIVIDEND'">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Initiate Dividend
</button>
@@ -95,6 +95,7 @@
[shareProductsTemplate]="shareProductAndTemplate"
[accountingRuleData]="accountingRuleData"
[shareProduct]="shareProduct"
[taskPermission]='"UPDATE_SHAREPRODUCT"'
(submit)="submit()"
>
</mifosx-share-product-preview-step>
@@ -208,7 +208,7 @@
<button mat-raised-button [routerLink]="['../']">
Cancel
</button>
<button mat-raised-button color="primary" (click)="submit.emit()">
<button mat-raised-button color="primary" (click)="submit.emit()" *mifosxHasPermission="taskPermission">
Submit
</button>
</div>
@@ -10,6 +10,7 @@ export class ShareProductPreviewStepComponent implements OnInit {
@Input() shareProductsTemplate: any;
@Input() accountingRuleData: any;
@Input() shareProduct: any;
@Input() taskPermission: string;
@Output() submit = new EventEmitter();
marketPriceDisplayedColumns: string[] = ['fromDate', 'shareValue'];
@@ -1,5 +1,5 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<button mat-raised-button color="primary" [routerLink]="['create']">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_SHAREPRODUCT'">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Create Share Product
</button>
@@ -1,9 +1,9 @@
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<button mat-raised-button color="primary" [routerLink]="['edit']">
<button mat-raised-button color="primary" [routerLink]="['edit']" *mifosxHasPermission="'UPDATE_SHAREPRODUCT'">
<fa-icon icon="edit"></fa-icon>&nbsp;&nbsp;
Edit
</button>
<button mat-raised-button color="primary" [routerLink]="['dividends']">
<button mat-raised-button color="primary" [routerLink]="['dividends']" *mifosxHasPermission="'UPDATE_SHAREPRODUCT'">
<fa-icon icon="hand-holding-usd"></fa-icon>&nbsp;&nbsp;
Dividends
</button>
@@ -1,5 +1,5 @@
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<button mat-raised-button color="primary" (click)="editTask(); backupCheckValues();">
<button mat-raised-button color="primary" (click)="editTask(); backupCheckValues();" *mifosxHasPermission="'UPDATE_PERMISSION'">
<fa-icon icon="edit"></fa-icon>&nbsp;&nbsp;
Edit
</button>
@@ -23,6 +23,8 @@
</mat-list>
</div>
<mat-divider [vertical]="true"></mat-divider>
<div fxFlex="70" fxLayout="column" class="listPermission">
<form [formGroup]="formGroup" (submit)="submit()">
@@ -45,7 +47,7 @@
<div fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px" *ngIf="!isDisabled">
<mat-card-actions>
<button type="button" mat-raised-button (click)="cancel(); restoreCheckboxes();">Cancel</button>
<button mat-raised-button color="primary" (click)="submit()">Submit</button>
<button mat-raised-button color="primary" (click)="submit()" *mifosxHasPermission="'UPDATE_PERMISSION'">Submit</button>
</mat-card-actions>
</div>
@@ -104,7 +104,7 @@
<ng-container matColumnDef="edit">
<th mat-header-cell *matHeaderCellDef> </th>
<td mat-cell *matCellDef="let listdata">
<button type="button" color="primary" mat-icon-button matTooltip="Edit" matTooltipPosition="above"
<button type="button" color="primary" mat-icon-button matTooltip="Edit" matTooltipPosition="above" *mifosxHasPermission="'UPDATE_ENTITYMAPPING'"
(click)="showEditScreen(listdata.mapId, selectedMappingType)">
<fa-icon icon="edit" size="lg"></fa-icon>
</button>
@@ -114,7 +114,7 @@
<ng-container matColumnDef="delete">
<th mat-header-cell *matHeaderCellDef> </th>
<td mat-cell *matCellDef="let listdata">
<button type="button" color="warn" mat-icon-button matTooltip="Delete" matTooltipPosition="above"
<button type="button" color="warn" mat-icon-button matTooltip="Delete" matTooltipPosition="above" *mifosxHasPermission="'DELETE_ENTITYMAPPING'"
(click)="delete(listdata.mapId)">
<fa-icon icon="trash" size="lg"></fa-icon>
</button>
@@ -182,7 +182,7 @@
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button mat-raised-button color="danger" (click)=cancelOperation()> Cancel </button>
<button mat-raised-button color="primary" [disabled]="!addMappingForm.valid">Submit</button>
<button mat-raised-button color="primary" [disabled]="!addMappingForm.valid" *mifosxHasPermission="'CREATE_ENTITYMAPPING'">Submit</button>
</mat-card-actions>
</form>
</ng-container>
@@ -242,7 +242,7 @@
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button mat-raised-button color="danger" (click)=cancelOperation()> Cancel </button>
<button mat-raised-button color="primary" [disabled]="!editMappingForm.valid">Submit</button>
<button mat-raised-button color="primary" [disabled]="!editMappingForm.valid" *mifosxHasPermission="'CREATE_ENTITYMAPPING'">Submit</button>
</mat-card-actions>
</form>
</ng-container>
@@ -48,8 +48,8 @@ export class EntityToEntityMappingComponent implements OnInit {
/**
* stores the data for clicked mapType
*/
firstEntityData: string[] = [];
secondEntityData: string[] = [];
firstEntityData: any = [];
secondEntityData: any = [];
firstMappingEntity: string;
secondMappingEntity: string;
@@ -21,22 +21,42 @@
</div>
<div class="container">
<div class="container m-b-20">
<mat-card class="mat-elevation-z8">
<mat-card-content>
<div fxLayout="row wrap" class="content">
<div fxFlex="40%" fxFlex.lt-md="50%" class="header">
<b>Name:</b>
</div>
<div fxFlex="60%" fxFlex.lt-md="50%">
{{ rolePermissionService.name }}
</div>
<div fxFlex="40%" fxFlex.lt-md="50%" class="header">
<b>Description:</b>
</div>
<div fxFlex="60%" fxFlex.lt-md="50%">
{{ rolePermissionService.description }}
</div>
</div>
</mat-card-content>
</mat-card>
</div>
<div class="mat-elevation-z8 container">
<mat-card>
<div fxFlexFill>
<span fxFlex="30%">Name:</span>
<span fxFlex="70%">{{ rolePermissionService.name }}</span>
</div>
<div fxFlexFill>
<span fxFlex="30%">Description:</span>
<span fxFlex="70%">{{ rolePermissionService.description }}</span>
</div>
<mat-divider></mat-divider>
<ng-container>
<div fxLayout="row" class="permissionSelected">
@@ -66,6 +86,8 @@
</div>
<mat-divider [vertical]="true"></mat-divider>
<div fxFlex="70" fxLayout="column" class="listPermission">
<form [formGroup]="formGroup" (submit)="submit()">
@@ -73,8 +95,7 @@
<div *ngFor="let permission of permissions.permissions" class="displayPermissions">
<div formArrayName="roster">
<div [formGroupName]="permission.id">
<mat-checkbox name="cp" id="{{ permission.code }}" formControlName="selected"
>
<mat-checkbox name="cp" id="{{ permission.code }}" formControlName="selected">
{{ permissionName(permission.code) }}
</mat-checkbox>
</div>
@@ -38,3 +38,13 @@ mat-list-item {
.inactive:hover {
transform: scale(1.1);
}
.content {
div {
line-height: 3rem;
&.header {
font-weight: 500;
}
}
}
+3 -1
View File
@@ -5,6 +5,7 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { SystemRoutingModule } from './system-routing.module';
import { PipesModule } from '../pipes/pipes.module';
import { DirectivesModule } from '../directives/directives.module';
/** Component Imports */
import { CodesComponent } from './codes/codes.component';
@@ -61,7 +62,8 @@ import { ConfigureMakerCheckerTasksComponent } from './configure-maker-checker-t
imports: [
SystemRoutingModule,
SharedModule,
PipesModule
PipesModule,
DirectivesModule
],
declarations: [
SystemComponent,