Skip to content

Commit

Permalink
Merge pull request #1381 from bcgov/feature/ALCS-1608
Browse files Browse the repository at this point in the history
Add Lots of Loading Spinners
  • Loading branch information
dhaselhan authored Feb 5, 2024
2 parents 812aae4 + d1bcd66 commit d574a33
Show file tree
Hide file tree
Showing 20 changed files with 106 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
[showEdit]="true"
></app-application-details>
</div>
<div class="center">
<mat-spinner *ngIf="!application || !submission"></mat-spinner>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section>
<app-parcel *ngIf="files && submission" [files]="files" [application]="submission"></app-parcel>
<app-parcel *ngIf="submission" [application]="submission"></app-parcel>
<div class="review-table edit-section">
<div class="full-width center">
<button *ngIf="showEdit" [disabled]="disableEdit" (click)="onEdit(0)" mat-flat-button color="accent">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ <h3 class="flex-item">
</h3>

<div class="review-table">
<div *ngIf="!parcels" class="center full-width">
<mat-spinner />
</div>

<ng-container *ngFor="let parcel of parcels; let parcelInd = index">
<div class="full-width flex-space-between-wrap">
<h4 [id]="parcel.uuid">Parcel #{{ parcelInd + 1 }}: Parcel and Owner Information</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ export class ParcelComponent implements OnInit, OnChanges, OnDestroy, AfterConte
$destroy = new Subject<void>();

@Input() application!: ApplicationSubmissionDto;
@Input() files: ApplicationDocumentDto[] = [];

pageTitle: string = 'Application Parcels';
showCertificateOfTitle: boolean = true;

fileId: string = '';
parcels: any[] = [];
parcels: any[] | undefined;

PARCEL_OWNERSHIP_TYPES = PARCEL_OWNERSHIP_TYPE;
private anchorededParcelUuid: string | undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<table mat-table [dataSource]="parcels">
<div *ngIf="!parcels" class="center">
<mat-spinner></mat-spinner>
</div>
<table *ngIf="parcels" mat-table [dataSource]="parcels">
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ export class ParcelPrepComponent implements OnChanges {
@Input() fileNumber = '';

displayedColumns = ['number', 'pid', 'pin', 'civicAddress', 'area', 'alrArea', 'owners', 'actions'];
parcels: {
pin?: string;
pid?: string;
mapAreaHectares: string;
alrArea: number;
owners: string;
fullOwners: string;
hasManyOwners: boolean;
uuid: string;
}[] = [];
parcels:
| {
pin?: string;
pid?: string;
mapAreaHectares: string;
alrArea: number;
owners: string;
fullOwners: string;
hasManyOwners: boolean;
uuid: string;
}[]
| undefined;

constructor(
private parcelService: ApplicationParcelService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
[showEdit]="true"
></app-noi-details>
</div>

<div class="center">
<mat-spinner *ngIf="!noticeOfIntent || !submission"></mat-spinner>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ export class NoticeOfIntentDetailsComponent implements OnInit, OnChanges, OnDest
this.otherFiles = documents.filter(
(document) =>
document.type &&
[DOCUMENT_TYPE.PHOTOGRAPH, DOCUMENT_TYPE.OTHER, DOCUMENT_TYPE.PROFESSIONAL_REPORT].includes(document.type.code)
[DOCUMENT_TYPE.PHOTOGRAPH, DOCUMENT_TYPE.OTHER, DOCUMENT_TYPE.PROFESSIONAL_REPORT].includes(document.type.code),
);
this.authorizationLetters = documents.filter(
(document) => document.type?.code === DOCUMENT_TYPE.AUTHORIZATION_LETTER
(document) => document.type?.code === DOCUMENT_TYPE.AUTHORIZATION_LETTER,
);
this.files = documents;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CommonModule } from '@angular/common';
import { CommonModule, NgIf } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { NgxMaskPipe } from 'ngx-mask';
import { SharedModule } from '../../../../shared/shared.module';
import { AdditionalInformationComponent } from './additional-information/additional-information.component';
Expand All @@ -18,7 +19,7 @@ import { RosoDetailsComponent } from './roso-details/roso-details.component';
NoticeOfIntentDetailsComponent,
AdditionalInformationComponent,
],
imports: [CommonModule, SharedModule, NgxMaskPipe],
imports: [CommonModule, SharedModule, NgxMaskPipe, MatProgressSpinnerModule, NgIf],
exports: [NoticeOfIntentDetailsComponent],
})
export class NoticeOfIntentDetailsModule {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<h3 class="flex-item">Notice of Intent Parcels</h3>

<div class="review-table">
<div *ngIf="!parcels" class="center full-width">
<mat-spinner />
</div>

<ng-container *ngFor="let parcel of parcels; let parcelInd = index">
<div class="full-width flex-space-between-wrap">
<h4 [id]="parcel.uuid">Parcel #{{ parcelInd + 1 }}: Parcel and Owner Information</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ import {
import { PARCEL_OWNERSHIP_TYPE } from '../../../../../shared/dto/parcel-ownership.type.dto';

@Component({
selector: 'app-parcel',
selector: 'app-parcel[noticeOfIntent][files]',
templateUrl: './parcel.component.html',
styleUrls: ['./parcel.component.scss'],
})
export class ParcelComponent implements OnInit, OnChanges, OnDestroy, AfterContentChecked {
$destroy = new Subject<void>();

@Input() noticeOfIntent!: NoticeOfIntentSubmissionDto;
@Input() files: NoticeOfIntentDocumentDto[] = [];
@Input() files!: NoticeOfIntentDocumentDto[];

fileId: string = '';
parcels: NoticeOfIntentParcelDto[] = [];
parcels: NoticeOfIntentParcelDto[] | undefined;

PARCEL_OWNERSHIP_TYPES = PARCEL_OWNERSHIP_TYPE;
private anchorededParcelUuid: string | undefined;
Expand All @@ -45,6 +45,8 @@ export class ParcelComponent implements OnInit, OnChanges, OnDestroy, AfterConte
const file = this.files.find((file) => file.uuid === uuid);
if (file) {
await this.noiDocumentService.download(file.uuid, file.fileName);
} else {
console.error('Failed to find File in Array');
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<table mat-table [dataSource]="parcels">
<div *ngIf="!parcels" class="center">
<mat-spinner></mat-spinner>
</div>
<table *ngIf="parcels" mat-table [dataSource]="parcels">
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ export class ParcelPrepComponent implements OnChanges {
@Input() fileNumber = '';

displayedColumns = ['number', 'pid', 'pin', 'civicAddress', 'area', 'alrArea', 'owners', 'actions'];
parcels: {
pin?: string;
pid?: string;
mapAreaHectares: string;
alrArea: number;
owners: string;
fullOwners: string;
hasManyOwners: boolean;
uuid: string;
}[] = [];
parcels:
| {
pin?: string;
pid?: string;
mapAreaHectares: string;
alrArea: number;
owners: string;
fullOwners: string;
hasManyOwners: boolean;
uuid: string;
}[]
| undefined;

constructor(
private parcelService: NoticeOfIntentParcelService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ <h4 *ngIf="application">Application ID: {{ application.fileNumber }}</h4>
<div class="navigation">
<mat-tab-group [(selectedIndex)]="selectedIndex">
<mat-tab label="Applicant Submission">
<div *ngIf="!application" class="center">
<mat-spinner></mat-spinner>
</div>
<div *ngIf="application" class="content">
<section>
<div class="header">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AfterViewInit, Component, EventEmitter, OnInit, Output } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { BehaviorSubject, takeUntil } from 'rxjs';
import { NoticeOfIntentOwnerDto } from '../../../../services/notice-of-intent-owner/notice-of-intent-owner.dto';
import { NoticeOfIntentOwnerService } from '../../../../services/notice-of-intent-owner/notice-of-intent-owner.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ <h4 *ngIf="submission">NOI ID: {{ submission.fileNumber }}</h4>
<div class="navigation">
<mat-tab-group [(selectedIndex)]="selectedIndex">
<mat-tab label="Applicant Submission">
<div *ngIf="!submission" class="center">
<mat-spinner></mat-spinner>
</div>
<div *ngIf="submission" class="content">
<section>
<div class="header">
Expand All @@ -41,8 +44,12 @@ <h2>Applicant Submission</h2>
<button mat-flat-button color="accent" (click)="onDownloadSubmissionPdf(submission.fileNumber)">
Download PDF
</button>
<button mat-flat-button color="primary" *ngIf="submission && submission.canEdit"
[routerLink]="'/notice-of-intent/' + submission.fileNumber + '/edit'">
<button
mat-flat-button
color="primary"
*ngIf="submission && submission.canEdit"
[routerLink]="'/notice-of-intent/' + submission.fileNumber + '/edit'"
>
<div class="continue-button-content">
<span>Continue NOI</span>
<mat-icon>keyboard_double_arrow_right</mat-icon>
Expand All @@ -69,16 +76,18 @@ <h2>Applicant Submission</h2>
</mat-tab>
</mat-tab-group>
<div *ngIf="submission && submission.canEdit" class="continue-button-container">
<button mat-stroked-button color="warn" (click)="onCancel(submission.uuid)">
Cancel NOI
<button mat-stroked-button color="warn" (click)="onCancel(submission.uuid)">Cancel NOI</button>
<button
mat-flat-button
color="primary"
*ngIf="submission && submission.canEdit"
[routerLink]="'/notice-of-intent/' + submission.fileNumber + '/edit'"
>
<div class="continue-button-content">
<span>Continue NOI</span>
<mat-icon>keyboard_double_arrow_right</mat-icon>
</div>
</button>
<button mat-flat-button color="primary" *ngIf="submission && submission.canEdit"
[routerLink]="'/notice-of-intent/' + submission.fileNumber + '/edit'">
<div class="continue-button-content">
<span>Continue NOI</span>
<mat-icon>keyboard_double_arrow_right</mat-icon>
</div>
</button>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,20 @@ <h4 *ngIf="submission">Notification ID: {{ submission.fileNumber }}</h4>
<div class="navigation">
<mat-tab-group [(selectedIndex)]="selectedIndex">
<mat-tab label="Applicant Submission">
<div *ngIf="!submission" class="center">
<mat-spinner></mat-spinner>
</div>
<div *ngIf="submission" class="content">
<section>
<div class="header">
<h2>Applicant Submission</h2>
<div class="btns-wrapper">
<button mat-flat-button color="primary" *ngIf="submission && submission.canEdit"
[routerLink]="'/notification/' + submission.fileNumber + '/edit'">
<button
mat-flat-button
color="primary"
*ngIf="submission && submission.canEdit"
[routerLink]="'/notification/' + submission.fileNumber + '/edit'"
>
<div class="continue-button-content">
<span>Continue SRW</span>
<mat-icon>keyboard_double_arrow_right</mat-icon>
Expand Down Expand Up @@ -68,16 +75,13 @@ <h2>Applicant Submission</h2>
</mat-tab>
</mat-tab-group>
<div *ngIf="submission && submission.canEdit" class="continue-button-container">
<button mat-stroked-button color="warn" (click)="onCancel(submission.uuid)">
Cancel SRW
<button mat-stroked-button color="warn" (click)="onCancel(submission.uuid)">Cancel SRW</button>
<button mat-flat-button color="primary" [routerLink]="'/notification/' + submission.fileNumber + '/edit'">
<div class="continue-button-content">
<span>Continue SRW</span>
<mat-icon>keyboard_double_arrow_right</mat-icon>
</div>
</button>
<button mat-flat-button color="primary"
[routerLink]="'/notification/' + submission.fileNumber + '/edit'">
<div class="continue-button-content">
<span>Continue SRW</span>
<mat-icon>keyboard_double_arrow_right</mat-icon>
</div>
</button>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ <h4 *ngIf="submission">Application ID: {{ submission.fileNumber }}</h4>
<div class="navigation">
<mat-tab-group [(selectedIndex)]="selectedIndex">
<mat-tab label="Applicant Submission">
<div *ngIf="!submission" class="center">
<mat-spinner></mat-spinner>
</div>
<div *ngIf="submission" class="content">
<section>
<div class="header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ <h4 *ngIf="submission">Notice of Intent ID: {{ submission.fileNumber }}</h4>
<div class="navigation">
<mat-tab-group [(selectedIndex)]="selectedIndex">
<mat-tab label="Applicant Submission">
<div *ngIf="!submission" class="center">
<mat-spinner></mat-spinner>
</div>
<div *ngIf="submission" class="content">
<section>
<div class="header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ <h4 *ngIf="submission">Notification ID: {{ submission.fileNumber }}</h4>
<div class="navigation">
<mat-tab-group [(selectedIndex)]="selectedIndex">
<mat-tab label="Applicant Submission">
<div *ngIf="!submission" class="center">
<mat-spinner></mat-spinner>
</div>
<div *ngIf="submission" class="content">
<section>
<div class="header">
Expand Down

0 comments on commit d574a33

Please sign in to comment.