Skip to content

Commit

Permalink
Merge pull request #304 from fecgov/bug/230-validate-issue
Browse files Browse the repository at this point in the history
Fix textarea required message and form refresh issues
  • Loading branch information
mjtravers authored May 24, 2022
2 parents 352d736 + b6b540c commit 57bf64a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export interface TransactionMeta {
title: string;
contributionPurposeDescripReadonly: (...params: any) => string; // eslint-disable-line @typescript-eslint/no-explicit-any
schema: JsonSchema;
transaction: Transaction;
factory: () => Transaction;
transaction: Transaction | null;
}
1 change: 1 addition & 0 deletions front-end/src/app/shared/resolvers/transaction.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class TransactionResolver implements Resolve<TransactionMeta | undefined>
if (transactionType) {
// This is a new transaction
tm = TransactionUtils.getMeta(transactionType);
tm.transaction = tm.factory();
tm.transaction.report_id = Number(reportId);
return of(tm);
}
Expand Down
3 changes: 2 additions & 1 deletion front-end/src/app/shared/utils/transaction.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ const meta: { [transaction_type_identifier: string]: TransactionMeta } = {
title: 'Offsets to Operating Expenditures',
contributionPurposeDescripReadonly: () => '',
schema: OFFSET_TO_OPEX,
transaction: SchATransaction.fromJSON({
factory: () => SchATransaction.fromJSON({
form_type: 'SA15',
transaction_type_identifier: 'OFFSET_TO_OPEX',
}),
transaction: null,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ <h3>Additional Information</h3>
[autoResize]="true"
formControlName="contribution_purpose_descrip"
></textarea>
<app-error-messages
[form]="form"
fieldName="contribution_purpose_descrip"
[formSubmitted]="formSubmitted"
></app-error-messages>
</div>
</div>
</div>
Expand All @@ -266,6 +271,11 @@ <h3>Additional Information</h3>
[autoResize]="true"
formControlName="memo_text_description"
></textarea>
<app-error-messages
[form]="form"
fieldName="memo_text_description"
[formSubmitted]="formSubmitted"
></app-error-messages>
</div>
</div>
</div>
Expand Down

0 comments on commit 57bf64a

Please sign in to comment.