Skip to content

Commit

Permalink
Fix confirmation dialog getting activated multiple times when more th…
Browse files Browse the repository at this point in the history
…an one table on page.
  • Loading branch information
sasha-dresden committed Jul 24, 2024
1 parent 38b71ec commit 30d17f0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions front-end/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div>
<router-outlet></router-outlet>
<p-confirmDialog></p-confirmDialog>
<app-download-tray></app-download-tray>
</div>
2 changes: 2 additions & 0 deletions front-end/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import { SharedModule } from './shared/shared.module';
import { UsersModule } from './users/users.module';
import { SchedulerAction, asyncScheduler } from 'rxjs';
import { ReportsModule } from './reports/reports.module';
import { ConfirmDialogModule } from 'primeng/confirmdialog';

// Save ngrx store to localStorage dynamically
function localStorageSyncReducer(reducer: ActionReducer<AppState>): ActionReducer<AppState> {
Expand Down Expand Up @@ -127,6 +128,7 @@ const metaReducers: Array<MetaReducer<AppState, Action>> = [localStorageSyncRedu
OverlayPanelModule,
SharedModule,
ReportsModule,
ConfirmDialogModule,
],
providers: [
CookieService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ export abstract class TransactionListTableBaseComponent extends TableListBaseCom

public forceItemization(transaction: Transaction, itemized: boolean) {
this.confirmationService.confirm({
key: 'transaction-itemization-dialog',
message:
'Changing the itemization status of this transaction will affect its associated transactions (such as memos).',
header: 'Heads up!',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1 class="gandhi-bold size-36">Transactions in this report</h1>
></app-transaction-loans-and-debts>
</div>

<p-confirmDialog #cd [style]="{ width: '450px' }">
<p-confirmDialog #cd [style]="{ width: '450px' }" key="transaction-itemization-dialog">
<ng-template pTemplate="footer">
<span class="confirm-footer">
<button type="button" pButton class="p-button-secondary" label="Cancel" (click)="cd.reject()"></button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,3 @@ <h1 class="m-0">{{ title }}</h1>
</div>

<p-toast></p-toast>
<p-confirmDialog></p-confirmDialog>

0 comments on commit 30d17f0

Please sign in to comment.