feat(ui): remove Undo / Revert transaction actions
Removes the Undo button and Undo menu item from savings, current, fixed deposit, recurring deposit and loan transactions, the account-transfer Undo, and the Revert Transaction button on the journal entry transaction detail, to prevent accidental reversal of posted entries. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
-18
@@ -24,24 +24,6 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="txn-header-bar__actions">
|
||||
@if (dataSource?.data[0].manualEntry) {
|
||||
<button
|
||||
mat-raised-button
|
||||
color="warn"
|
||||
(click)="revertTransaction()"
|
||||
*mifosxHasPermission="'REVERSE_JOURNALENTRY'"
|
||||
[disabled]="dataSource?.data[0].reversed"
|
||||
class="txn-revert-btn"
|
||||
>
|
||||
@if (!dataSource.data[0].reversed) {
|
||||
<span><fa-icon icon="undo" class="m-r-6"></fa-icon>Revert Transaction</span>
|
||||
} @else {
|
||||
<span><fa-icon icon="check-circle" class="m-r-6"></fa-icon>Reverted</span>
|
||||
}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Transaction Info Cards -->
|
||||
|
||||
+1
-29
@@ -8,10 +8,8 @@
|
||||
|
||||
import { Component, OnInit, ViewChild, inject } from '@angular/core';
|
||||
import { ViewJournalEntryComponent } from '../view-journal-entry/view-journal-entry.component';
|
||||
import { RevertTransactionComponent } from 'app/accounting/revert-transaction/revert-transaction.component';
|
||||
import { AccountingService } from 'app/accounting/accounting.service';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import {
|
||||
@@ -65,9 +63,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
]
|
||||
})
|
||||
export class ViewJournalEntryTransactionComponent implements OnInit {
|
||||
private accountingService = inject(AccountingService);
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
dialog = inject(MatDialog);
|
||||
private location = inject(Location);
|
||||
|
||||
@@ -147,30 +143,6 @@ export class ViewJournalEntryTransactionComponent implements OnInit {
|
||||
this.dialog.open(ViewJournalEntryComponent, { data: { journalEntry } });
|
||||
}
|
||||
|
||||
revertTransaction(transactionId?: string) {
|
||||
const revertTransactionDialogRef = this.dialog.open(RevertTransactionComponent, {
|
||||
data: { reverted: this.dataSource.data[0].reversed, transactionId }
|
||||
});
|
||||
revertTransactionDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.revert) {
|
||||
this.accountingService
|
||||
.revertTransaction(this.transactionId, response.comments)
|
||||
.subscribe((reversedTransaction: any) => {
|
||||
this.dataSource.data[0].reversed = true;
|
||||
this.revertTransaction(reversedTransaction.transactionId);
|
||||
});
|
||||
} else if (response.redirect) {
|
||||
this.router.navigate(
|
||||
[
|
||||
'../',
|
||||
transactionId
|
||||
],
|
||||
{ relativeTo: this.route }
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
goBack(): void {
|
||||
this.location.back();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user