diff --git a/src/app/organization/currencies/manage-currencies/manage-currencies.component.ts b/src/app/organization/currencies/manage-currencies/manage-currencies.component.ts
index a1564f3b9..f34083525 100644
--- a/src/app/organization/currencies/manage-currencies/manage-currencies.component.ts
+++ b/src/app/organization/currencies/manage-currencies/manage-currencies.component.ts
@@ -42,6 +42,7 @@ import { AsyncPipe } from '@angular/common';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { MatGridList, MatGridTile } from '@angular/material/grid-list';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
+import { AlertService } from 'app/core/alert/alert.service';
/**
* Manage Currencies component.
@@ -68,6 +69,7 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr
private translateService = inject(TranslateService);
private configurationWizardService = inject(ConfigurationWizardService);
private popoverService = inject(PopoverService);
+ private alertService = inject(AlertService);
//** Defining PlaceHolders for the search bar */
placeHolderLabel = '';
@@ -164,8 +166,17 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr
if (!selectedCurrencyCodes.includes(newCurrency.code)) {
selectedCurrencyCodes.push(newCurrency.code);
this.organizationservice.updateCurrencies(selectedCurrencyCodes).subscribe((response: any) => {
- this.selectedCurrencies.push(newCurrency);
this.formRef.resetForm();
+ if (response?.rollbackTransaction) {
+ // Parked for checker approval - the currency has not actually been added yet, so the
+ // local list must not be mutated as if it had.
+ this.alertService.alert({
+ type: 'Success',
+ message: 'Currency configuration update has been submitted for approval.'
+ });
+ return;
+ }
+ this.selectedCurrencies.push(newCurrency);
if (this.configurationWizardService.showCurrencyForm) {
this.configurationWizardService.showCurrencyForm = false;
this.openDialog();
@@ -187,9 +198,18 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr
});
deleteCurrencyDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
- this.organizationservice.updateCurrencies(selectedCurrencyCodes).subscribe(() => {
- this.selectedCurrencies.splice(index, 1);
+ this.organizationservice.updateCurrencies(selectedCurrencyCodes).subscribe((updateResponse: any) => {
this.formRef.resetForm();
+ if (updateResponse?.rollbackTransaction) {
+ // Parked for checker approval - the currency has not actually been removed yet, so the
+ // local list must not be mutated as if it had.
+ this.alertService.alert({
+ type: 'Success',
+ message: 'Currency configuration update has been submitted for approval.'
+ });
+ return;
+ }
+ this.selectedCurrencies.splice(index, 1);
});
}
});
diff --git a/src/app/organization/manage-funds/create-fund/create-fund.component.ts b/src/app/organization/manage-funds/create-fund/create-fund.component.ts
index 4d2c0de59..292d6c132 100644
--- a/src/app/organization/manage-funds/create-fund/create-fund.component.ts
+++ b/src/app/organization/manage-funds/create-fund/create-fund.component.ts
@@ -11,6 +11,7 @@ import { UntypedFormBuilder, UntypedFormGroup, Validators, ReactiveFormsModule }
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { OrganizationService } from 'app/organization/organization.service';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
+import { AlertService } from 'app/core/alert/alert.service';
@Component({
selector: 'mifosx-create-fund',
@@ -25,6 +26,7 @@ export class CreateFundComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private router = inject(Router);
private route = inject(ActivatedRoute);
+ private alertService = inject(AlertService);
/** Charge form. */
fundForm: UntypedFormGroup;
@@ -49,6 +51,12 @@ export class CreateFundComponent implements OnInit {
submit() {
const payload = this.fundForm.getRawValue();
this.organizationService.createFund(payload).subscribe((response: any) => {
+ if (response?.rollbackTransaction) {
+ this.alertService.alert({
+ type: 'Success',
+ message: 'Fund creation has been submitted for approval.'
+ });
+ }
this.router.navigate(['../'], { relativeTo: this.route });
});
}
diff --git a/src/app/system/account-number-preferences/account-number-preferences.component.html b/src/app/system/account-number-preferences/account-number-preferences.component.html
index d16691645..4a234addc 100644
--- a/src/app/system/account-number-preferences/account-number-preferences.component.html
+++ b/src/app/system/account-number-preferences/account-number-preferences.component.html
@@ -7,7 +7,12 @@
-->
-