feat: fix standing instructions action buttons for all account types

- Wire up Edit/View/Delete buttons with click handlers in all 4 HTML templates
  (Current Account, Savings, Fixed Deposit, Recurring Deposit)
- Remove broken [routerLink] from Recurring Deposit HTML
- Add viewInstruction() and editInstruction() methods to all 4 tab components
- Use navigateByUrl with absolute path built from this.router.url to avoid
  Angular multi-level .. navigation bug (was producing literal .. in URL)
  CA/Savings/RD: basePath + /transfer-funds/:id/view|edit
  FD: basePath + /transactions/account-transfers/:id/view|edit
- Fix deleteStandingInstruction() to refresh table after delete in all tabs
- Fix AccountTransfersService.deleteStandingInstrucions to use
  PUT ?command=delete instead of HTTP DELETE (backend soft-delete only)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jaanu423
2026-05-26 11:42:18 +05:30
co-authored by Claude Sonnet 4.6
parent ae414c620e
commit 33b01d667d
9 changed files with 70 additions and 11 deletions
@@ -74,6 +74,7 @@
color="primary"
matTooltip="{{ 'tooltips.Edit Standing Instruction' | translate }}"
*mifosxHasPermission="'UPDATE_STANDINGINSTRUCTION'"
(click)="editInstruction(instruction.id)"
>
<i class="fa fa-edit"></i>
</button>
@@ -99,6 +100,7 @@
color="primary"
matTooltip="{{ 'tooltips.View Standing Instruction' | translate }}"
*mifosxHasPermission="'READ_STANDINGINSTRUCTION'"
(click)="viewInstruction(instruction.id)"
>
<i class="fa fa-eye"></i>
</button>
@@ -22,7 +22,7 @@ import {
MatRowDef,
MatRow
} from '@angular/material/table';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
/** Custom Services */
import { CurrentAccountsService } from 'app/current-accounts/current-accounts.service';
@@ -60,6 +60,7 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
})
export class StandingInstructionsTabComponent implements OnInit {
private route = inject(ActivatedRoute);
private router = inject(Router);
private currentAccountsService = inject(CurrentAccountsService);
private dialog = inject(MatDialog);
private accountTransfersService = inject(AccountTransfersService);
@@ -118,13 +119,25 @@ export class StandingInstructionsTabComponent implements OnInit {
});
}
viewInstruction(instructionId: any) {
const base = this.router.url.split('?')[0].replace(/\/standing-instructions(-tab)?$/, '');
this.router.navigateByUrl(`${base}/transfer-funds/${instructionId}/view`);
}
editInstruction(instructionId: any) {
const base = this.router.url.split('?')[0].replace(/\/standing-instructions(-tab)?$/, '');
this.router.navigateByUrl(`${base}/transfer-funds/${instructionId}/edit`);
}
deleteStandingInstruction(instructionId: any) {
const deleteStandingInstructionDialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `standing instruction id: ${instructionId}` }
});
deleteStandingInstructionDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
this.accountTransfersService.deleteStandingInstrucions(instructionId).subscribe(() => {});
this.accountTransfersService.deleteStandingInstrucions(instructionId).subscribe(() => {
this.getStandingInstructions();
});
}
});
}