feat: add new standalone components for system and organization management modules

This commit is contained in:
2026-09-28 12:55:42 +05:30
parent f451672ce7
commit 4ca08f6ee9
32 changed files with 347 additions and 32 deletions
@@ -33,7 +33,7 @@
mat-stroked-button
color="warn"
(click)="delete()"
*mifosxHasPermission="'DELETE_CODEVALUE'"
*mifosxHasPermission="'DELETE_CODE'"
class="vc-header__btn-delete"
>
<fa-icon icon="trash" class="m-r-10"></fa-icon>
@@ -30,6 +30,7 @@ import { MatCard, MatCardContent } from '@angular/material/card';
import { MatCheckbox } from '@angular/material/checkbox';
import { MatTooltip } from '@angular/material/tooltip';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
import { AlertService } from 'app/core/alert/alert.service';
/**
* View Code Component.
@@ -53,6 +54,7 @@ export class ViewCodeComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private dialog = inject(MatDialog);
private translateService = inject(TranslateService);
private alertService = inject(AlertService);
/** Code Data */
codeData: any;
@@ -152,6 +154,13 @@ export class ViewCodeComponent implements OnInit {
deleteCodeValue(index: number) {
const codeValueId = this.codeValuesData[index].id;
this.systemService.deleteCodeValue(this.codeData.id, codeValueId).subscribe((response: any) => {
if (response?.rollbackTransaction) {
this.alertService.alert({
type: 'Success',
message: 'Code value deletion has been submitted for approval.'
});
return;
}
this.codeValuesData.splice(index, 1);
this.codeValues.removeAt(index);
this.codeValueRowStatus.splice(index, 1);
@@ -177,6 +186,13 @@ export class ViewCodeComponent implements OnInit {
this.systemService
.updateCodeValue(this.codeData.id, this.codeValuesData[index].id, updatedCodeValue)
.subscribe((response: any) => {
if (response?.rollbackTransaction) {
this.alertService.alert({
type: 'Success',
message: 'Code value update has been submitted for approval.'
});
return;
}
this.codeValues.at(index).disable();
this.codeValueRowStatus[index] = 'disabled';
this.codeValues.at(index).markAsPristine();
@@ -192,7 +208,13 @@ export class ViewCodeComponent implements OnInit {
});
deleteCodeDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
this.systemService.deleteCode(this.codeData.id).subscribe(() => {
this.systemService.deleteCode(this.codeData.id).subscribe((deleteResponse: any) => {
if (deleteResponse?.rollbackTransaction) {
this.alertService.alert({
type: 'Success',
message: 'Code deletion has been submitted for approval.'
});
}
this.router.navigate(['/system/codes']);
});
}
@@ -221,6 +243,13 @@ export class ViewCodeComponent implements OnInit {
const newCodeValue: { name: string; description: string; position: string; isActive: boolean } =
this.codeValues.at(index).value;
this.systemService.createCodeValue(this.codeData.id, newCodeValue).subscribe((response: any) => {
if (response?.rollbackTransaction) {
this.alertService.alert({
type: 'Success',
message: 'Code value creation has been submitted for approval.'
});
return;
}
this.codeValues.at(index).disable();
this.codeValueRowStatus[index] = 'disabled';
this.codeValuesData.push({