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

feature/1465 - Update Form 1M to use the report_code_label now coming from api. Update Report list coverage to default to N/A when no coverage #2059

Merged
merged 2 commits into from
Jul 25, 2024
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 @@ -40,9 +40,10 @@ <h1 class="m-0">Manage reports</h1>
<td>{{ item.formLabel }}</td>
<td>{{ item.report_code_label }}</td>
<td>
<ng-container *ngIf="item.coverage_from_date || item.coverage_through_date"
<ng-container *ngIf="item.coverage_from_date || item.coverage_through_date; else noCoverage"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never seen that before. pretty cool

>{{ item.coverage_from_date | fecDate }} - {{ item.coverage_through_date | fecDate }}
</ng-container>
<ng-template #noCoverage> N/A </ng-template>
</td>
<td>{{ item.report_status }}</td>
<td>{{ item.version_label }}</td>
Expand Down
14 changes: 13 additions & 1 deletion front-end/src/app/shared/models/form-1m.model.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,25 @@ describe('Form-1M', () => {
expect(form.formLabel).toEqual('FORM 1M');
});

it('should display empty string for sub label', () => {
it('should display "NOTIFICATION OF MULTICANDIDATE STATUS" for sub label', () => {
const data = {
id: '999',
form_type: F1MFormTypes.F1MN,
committee_name: 'foo',
report_code_label: 'NOTIFICATION OF MULTICANDIDATE STATUS',
};
const form = Form1M.fromJSON(data);
expect(form.formSubLabel).toEqual('NOTIFICATION OF MULTICANDIDATE STATUS');
});

it('should display empty string for sub label', () => {
const data = {
id: '999',
form_type: F1MFormTypes.F1MN,
committee_name: 'foo',
report_code_label: undefined,
};
const form = Form1M.fromJSON(data);
expect(form.formSubLabel).toEqual('');
});
});
2 changes: 1 addition & 1 deletion front-end/src/app/shared/models/form-1m.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Form1M extends Report {
}

get formSubLabel() {
return 'NOTIFICATION OF MULTICANDIDATE STATUS';
return this.report_code_label ?? '';
}

committee_type?: CommitteeType;
Expand Down