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/480 angular upgrade #494

Merged
merged 4 commits into from
Aug 25, 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
7,917 changes: 3,833 additions & 4,084 deletions front-end/package-lock.json

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions front-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,44 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~13.2.0",
"@angular/cdk": "^13.2.6",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/forms": "~13.2.0",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"@ngrx/effects": "^13.0.2",
"@ngrx/store": "^13.0.2",
"@angular/animations": "~14.1.3",
"@angular/cdk": "^14.1.3",
"@angular/common": "~14.1.3",
"@angular/compiler": "~14.1.3",
"@angular/core": "~14.1.3",
"@angular/forms": "~14.1.3",
"@angular/platform-browser": "~14.1.3",
"@angular/platform-browser-dynamic": "~14.1.3",
"@angular/router": "~14.1.3",
"@ngrx/effects": "^14.2.0",
"@ngrx/store": "^14.2.0",
"@popperjs/core": "^2.10.2",
"bootstrap": "5.1.3",
"class-transformer": "^0.5.1",
"fecfile-validate": "https://github.com/fecgov/fecfile-validate#1f02f1882550c62e2d235877152286586917e151",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
"luxon": "^2.3.2",
"ngrx-store-localstorage": "^13.0.0",
"ngx-cookie-service": "^13.1.2",
"ngrx-store-localstorage": "^14.0.0",
"ngx-cookie-service": "^14.0.1",
"ngx-logger": "^5.0.7",
"primeflex": "^3.1.3",
"primeicons": "^5.0.0",
"primeng": "^13.2.1",
"primeng": "^14.0.1",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.5.4",
"tslib": "^2.3.1",
"zone.js": "^0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.2.2",
"@angular-eslint/builder": "13.1.0",
"@angular-eslint/eslint-plugin": "13.1.0",
"@angular-eslint/eslint-plugin-template": "13.1.0",
"@angular-eslint/schematics": "13.1.0",
"@angular-eslint/template-parser": "13.1.0",
"@angular/cli": "~13.2.2",
"@angular/compiler-cli": "~13.2.0",
"@angular-devkit/build-angular": "~14.1.3",
"@angular-eslint/builder": "14.0.2",
"@angular-eslint/eslint-plugin": "14.0.2",
"@angular-eslint/eslint-plugin-template": "14.0.2",
"@angular-eslint/schematics": "14.0.2",
"@angular-eslint/template-parser": "14.0.2",
"@angular/cli": "~14.1.3",
"@angular/compiler-cli": "~14.1.3",
"@cypress/schematic": "^1.6.0",
"@types/jasmine": "~3.10.0",
"@types/lodash": "^4.14.178",
Expand All @@ -78,7 +78,7 @@
"karma-jasmine-html-reporter": "~1.7.0",
"karma-spec-reporter": "^0.0.33",
"license-checker": "^25.0.1",
"typescript": "~4.5.2"
"typescript": "~4.6.2"
},
"browser": {
"crypto": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@
<div class="card">
<p-toolbar styleClass="mb-4">
<ng-template pTemplate="left">
<button id="button-contacts-new" pButton pRipple label="New" icon="pi pi-plus" class="p-button-success mr-2" (click)="addItem()"></button>
<button
id="button-contacts-new"
pButton
pRipple
label="New"
icon="pi pi-plus"
class="p-button-success mr-2"
(click)="addItem()"
></button>
<button
pButton
pRipple
label="Delete"
icon="pi pi-trash"
class="p-button-danger"
(click)="deleteSelectedItems()"
[disabled]="!selectedItems?.length"
[disabled]="!selectedItems.length"
></button>
</ng-template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class="grid">
<div class="col-12">
<h1 *ngIf='report.upload_submission?.fec_status==="ACCEPTED"' class="super-header">
<h1 *ngIf="report.upload_submission?.fec_status === 'ACCEPTED'" class="super-header">
Congratulations, your report was successfully submitted and accepted.
</h1>
<h1 *ngIf='report.upload_submission?.fec_status==="REJECTED"' class="super-header">
<h1 *ngIf="report.upload_submission?.fec_status === 'REJECTED'" class="super-header">
Your report has been rejected.
</h1>
<h1 *ngIf='report.upload_submission?.fec_status==="PROCESSING"' class="super-header">
<h1 *ngIf="report.upload_submission?.fec_status === 'PROCESSING'" class="super-header">
Thank you for submitting your report. It is currently being processed.
</h1>
</div>
Expand All @@ -31,8 +31,8 @@ <h3 class="no-vert-margins">
<div class="col-12">
<h5 class="no-vert-margins">YOUR COVERAGE DATES:</h5>
<h3 class="no-vert-margins no-wrap">
{{ report.coverage_from_date | longDate }} — <wbr />
{{ report.coverage_through_date | longDate }}
{{ report.coverage_from_date || null | longDate }} — <wbr />
{{ report.coverage_through_date || null | longDate }}
</h3>
<br />
</div>
Expand All @@ -44,7 +44,7 @@ <h3 class="no-vert-margins word-break">
</h3>
<br />
</div>
<ng-container *ngIf='report.upload_submission?.fec_status==="ACCEPTED"'>
<ng-container *ngIf="report.upload_submission?.fec_report_id">
<div class="col-12">
<h5 class="no-vert-margins">FILING ID:</h5>
<h3 class="no-vert-margins">
Expand All @@ -66,12 +66,12 @@ <h3 class="no-vert-margins">
</div>
<div class="grid">
<div class="col-12">
<p *ngIf="report.upload_submission?.fec_status!=='ACCEPTED' && report.upload_submission?.fec_status !=='REJECTED'">
<p *ngIf="!['ACCEPTED', 'REJECTED'].includes(report.upload_submission?.fec_status || '')">
Copy link
Contributor

@Elaine-Krauss-TCG Elaine-Krauss-TCG Aug 24, 2022

Choose a reason for hiding this comment

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

This is just a really elegant change, 👍

The FEC will send a report status message to the confirmation emails you provided during the submission process.
If any problems are encountered during the process, Web Upload will terminate the upload session and relay the
specifics of the error.
</p>
<p *ngIf="report.upload_submission?.fec_status==='REJECTED' && report.upload_submission?.fec_message">
<p *ngIf="report.upload_submission?.fec_status === 'REJECTED' && report.upload_submission?.fec_message">
FEC Error Message: {{ report.upload_submission?.fec_message }}
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export abstract class TableListBaseComponent<T> implements OnInit, AfterViewInit

if (checked) {
this.itemService.getTableData(1).subscribe((response: ListRestResponse) => {
this.selectedItems = response.results;
this.selectedItems = response.results || [];
this.selectAll = true;
});
} else {
Expand Down
7 changes: 5 additions & 2 deletions front-end/src/app/shared/pipes/report-code-label-list.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { ReportCodeLabelList, ReportCodeLabel } from '../utils/reportCodeLabels.

@Pipe({ name: 'findOnReportCodePipe' })
export class FindOnReportCodePipe implements PipeTransform {
transform(list: ReportCodeLabelList | null, reportCode: string | null): ReportCodeLabel | undefined {
if (reportCode === null) {
transform(
list: ReportCodeLabelList | null | undefined,
reportCode: string | null | undefined
): ReportCodeLabel | undefined {
if (!reportCode) {
return undefined;
}

Expand Down
6 changes: 5 additions & 1 deletion front-end/src/app/shared/services/report.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ export class ReportService implements TableListService<Report> {
* @returns Observable<Report>
*/
setActiveReportById(reportId: number): Observable<Report> {
return this.get(reportId).pipe(tap((report) => this.store.dispatch(setActiveReportAction({ payload: report }))));
return this.get(reportId).pipe(
tap((report) => {
return this.store.dispatch(setActiveReportAction({ payload: report || new F3xSummary() }));
})
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/app/store/active-report.selectors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createFeatureSelector } from '@ngrx/store';
import { Report } from '../shared/interfaces/report.interface';

export const selectActiveReport = createFeatureSelector<Report | null>('activeReport');
export const selectActiveReport = createFeatureSelector<Report>('activeReport');