Replaced checked in package-lock.json by regenerated one. Ran ng update @angular/core@20 @angular/cli@20 Ran npm install @angular-builders/jest@^20.0.0 @fortawesome/angular-fontawesome@^3.0.0 @swimlane/ngx-graph@^11 Ran npm install ngx-mat-select-search@^8.0.2. Ran ng update @angular/material@20. Updated all eslint and typescript to the latest versions. Removed @angular-devkit/schematics. Updated fontawesome. Updated rxjs and tslib. Moved required node version from 16 to 20. Updated jest-preset-angular. Set preserveWhitespaces to false. Corrected two type declarations in two typescript files to make ng serve run without errors. Removed unused angular-devkit/schematics from view-user.component.ts . Updated list of supported browsers. Upgraded prettier. Ran prettier . --write the first time. Ran prettier . --write the second time. Ran ng generate @angular/core:inject with defaults, excepted a handful of files. Fixed remaining eslint problems. Added dist directory to ignores in eslint.config.js. Let prettier fix formatting, almost everything is just line breaks. Made htmlhint ignore @if and @for Angular constructs. Updated node version in Github workflow to 22.12.0 (build.yml). Updated .env.ts. Updated Angular datetime format strings from YYYY-MM-DD to yyyy-MM-dd. Merged changes from dev into angular20 branch.
109 lines
4.3 KiB
TypeScript
109 lines
4.3 KiB
TypeScript
/** Angular Imports */
|
|
import { Component, inject } from '@angular/core';
|
|
import { ActivatedRoute } from '@angular/router';
|
|
import { Currency } from 'app/shared/models/general.model';
|
|
import { ApproveSavingsAccountComponent } from './approve-savings-account/approve-savings-account.component';
|
|
import { RejectSavingsAccountComponent } from './reject-savings-account/reject-savings-account.component';
|
|
import { ActivateSavingsAccountComponent } from './activate-savings-account/activate-savings-account.component';
|
|
import { UndoApprovalSavingsAccountComponent } from './undo-approval-savings-account/undo-approval-savings-account.component';
|
|
import { PostInterestAsOnSavingsAccountComponent } from './post-interest-as-on-savings-account/post-interest-as-on-savings-account.component';
|
|
import { SavingsAccountAssignStaffComponent } from './savings-account-assign-staff/savings-account-assign-staff.component';
|
|
import { SavingsAccountUnassignStaffComponent } from './savings-account-unassign-staff/savings-account-unassign-staff.component';
|
|
import { WithdrawByClientSavingsAccountComponent } from './withdraw-by-client-savings-account/withdraw-by-client-savings-account.component';
|
|
import { AddChargeSavingsAccountComponent } from './add-charge-savings-account/add-charge-savings-account.component';
|
|
import { SavingsAccountTransactionsComponent } from './savings-account-transactions/savings-account-transactions.component';
|
|
import { CloseSavingsAccountComponent } from './close-savings-account/close-savings-account.component';
|
|
import { ApplyAnnualFeesSavingsAccountComponent } from './apply-annual-fees-savings-account/apply-annual-fees-savings-account.component';
|
|
import { ManageSavingsAccountComponent } from './manage-savings-account/manage-savings-account.component';
|
|
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
|
|
|
/**
|
|
* Savings account actions component.
|
|
*/
|
|
@Component({
|
|
selector: 'mifosx-saving-account-actions',
|
|
templateUrl: './saving-account-actions.component.html',
|
|
styleUrls: ['./saving-account-actions.component.scss'],
|
|
imports: [
|
|
...STANDALONE_SHARED_IMPORTS,
|
|
ApproveSavingsAccountComponent,
|
|
RejectSavingsAccountComponent,
|
|
ActivateSavingsAccountComponent,
|
|
UndoApprovalSavingsAccountComponent,
|
|
PostInterestAsOnSavingsAccountComponent,
|
|
SavingsAccountAssignStaffComponent,
|
|
SavingsAccountUnassignStaffComponent,
|
|
WithdrawByClientSavingsAccountComponent,
|
|
AddChargeSavingsAccountComponent,
|
|
SavingsAccountTransactionsComponent,
|
|
CloseSavingsAccountComponent,
|
|
ApplyAnnualFeesSavingsAccountComponent,
|
|
ManageSavingsAccountComponent
|
|
]
|
|
})
|
|
export class SavingAccountActionsComponent {
|
|
private route = inject(ActivatedRoute);
|
|
|
|
/** Flag object to store possible actions and render appropriate UI to the user */
|
|
actions: {
|
|
Approve: boolean;
|
|
Reject: boolean;
|
|
Withdrawal: boolean;
|
|
Deposit: boolean;
|
|
Activate: boolean;
|
|
Close: boolean;
|
|
'Undo Approval': boolean;
|
|
'Post Interest As On': boolean;
|
|
'Assign Staff': boolean;
|
|
'Add Charge': boolean;
|
|
'Unassign Staff': boolean;
|
|
'Withdrawn by Client': boolean;
|
|
'Apply Annual Fees': boolean;
|
|
'Hold Amount': boolean;
|
|
'Block Account': boolean;
|
|
'Unblock Account': boolean;
|
|
'Block Deposit': boolean;
|
|
'Unblock Deposit': boolean;
|
|
'Block Withdrawal': boolean;
|
|
'Unblock Withdrawal': boolean;
|
|
} = {
|
|
Approve: false,
|
|
Reject: false,
|
|
Withdrawal: false,
|
|
Deposit: false,
|
|
Activate: false,
|
|
Close: false,
|
|
'Undo Approval': false,
|
|
'Post Interest As On': false,
|
|
'Assign Staff': false,
|
|
'Add Charge': false,
|
|
'Unassign Staff': false,
|
|
'Withdrawn by Client': false,
|
|
'Apply Annual Fees': false,
|
|
'Hold Amount': false,
|
|
'Block Account': false,
|
|
'Unblock Account': false,
|
|
'Block Deposit': false,
|
|
'Unblock Deposit': false,
|
|
'Block Withdrawal': false,
|
|
'Unblock Withdrawal': false
|
|
};
|
|
|
|
currency: Currency;
|
|
|
|
/**
|
|
* @param {ActivatedRoute} route Activated Route
|
|
*/
|
|
constructor() {
|
|
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
|
|
if (data.savingsAccountActionData) {
|
|
this.currency = data.savingsAccountActionData.currency;
|
|
}
|
|
});
|
|
const name = this.route.snapshot.params['name'] as string;
|
|
if (name in this.actions) {
|
|
this.actions[name as keyof typeof this.actions] = true;
|
|
}
|
|
}
|
|
}
|