Skip to content

Commit

Permalink
Merge pull request #2058 from fecgov/feature/1464
Browse files Browse the repository at this point in the history
feature/1464 - Fix confirmation dialog getting activated multiple times when more than one table on page.
  • Loading branch information
mjtravers authored Jul 25, 2024
2 parents b12c409 + 30d17f0 commit e7cbc25
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 e7cbc25

Please sign in to comment.