Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use currency input for contribution amount and aggregate #315

Merged
merged 1 commit into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { CalendarModule } from 'primeng/calendar';
import { CheckboxModule } from 'primeng/checkbox';
import { InputTextModule } from 'primeng/inputtext';
import { InputTextareaModule } from 'primeng/inputtextarea';
import { InputNumberModule } from 'primeng/inputnumber';

describe('TransactionContainerComponent', () => {
let component: TransactionContainerComponent;
Expand All @@ -42,6 +43,7 @@ describe('TransactionContainerComponent', () => {
CalendarModule,
CheckboxModule,
InputTextModule,
InputNumberModule,
InputTextareaModule,
],
declarations: [TransactionContainerComponent, TransactionGroupBComponent],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,13 @@ <h3>Contribution</h3>
<div class="col-6">
<div class="field">
<label for="contribution_amount">CONTRIBUTION AMOUNT</label>
<input type="text" pInputText id="contribution_amount" formControlName="contribution_amount" />
<p-inputNumber
id="contribution_amount"
formControlName="contribution_amount"
mode="currency"
currency="USD"
locale="en-US"
></p-inputNumber>
<app-error-messages
[form]="form"
fieldName="contribution_amount"
Expand All @@ -221,14 +227,15 @@ <h3>Contribution</h3>
<div class="col-6">
<div class="field">
<label for="contribution_aggregate">CONTRIBUTION AGGREGATE</label>
<input
type="text"
pInputText
<p-inputNumber
id="contribution_aggregate"
formControlName="contribution_aggregate"
class="readonly"
readonly
/>
mode="currency"
currency="USD"
locale="en-US"
[readonly]="true"
styleClass="readonly"
></p-inputNumber>
<app-error-messages
[form]="form"
fieldName="contribution_aggregate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { ContactTypes } from 'app/shared/models/contact.model';
import { SchATransaction } from 'app/shared/models/scha-transaction.model';
import { environment } from '../../../environments/environment';
import { schema as OFFSET_TO_OPEX } from 'fecfile-validate/fecfile_validate_js/dist/OFFSET_TO_OPEX';
import { InputNumberModule } from 'primeng/inputnumber';

describe('TransactionGroupBComponent', () => {
let httpTestingController: HttpTestingController;
Expand Down Expand Up @@ -63,6 +64,7 @@ describe('TransactionGroupBComponent', () => {
CalendarModule,
ButtonModule,
CheckboxModule,
InputNumberModule,
InputTextModule,
InputTextareaModule,
],
Expand Down
2 changes: 2 additions & 0 deletions front-end/src/app/transactions/transactions.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { TransactionsRoutingModule } from './transactions-routing.module';
import { TransactionContainerComponent } from './transaction-container/transaction-container.component';
import { TransactionGroupBComponent } from './transaction-group-b/transaction-group-b.component';
import { TransactionTypePickerComponent } from './transaction-type-picker/transaction-type-picker.component';
import { InputNumberModule } from 'primeng/inputnumber';

@NgModule({
declarations: [TransactionContainerComponent, TransactionGroupBComponent, TransactionTypePickerComponent],
Expand All @@ -33,6 +34,7 @@ import { TransactionTypePickerComponent } from './transaction-type-picker/transa
CheckboxModule,
InputTextModule,
InputTextareaModule,
InputNumberModule,
CalendarModule,
ToastModule,
SharedModule,
Expand Down