-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Viewing of Public App Submissions and Documents * New Module and Pages Created
- Loading branch information
Daniel Haselhan
committed
Oct 4, 2023
1 parent
b348604
commit 905890e
Showing
79 changed files
with
4,321 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
portal-frontend/src/app/features/public/application/alc-review/alc-review.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<div *ngIf="application"> | ||
<div class="header"> | ||
<h3>ALC Review and Decision</h3> | ||
<div> | ||
<button | ||
[routerLink]="'/application/' + application.fileNumber + '/edit'" | ||
*ngIf="application.canEdit" | ||
mat-flat-button | ||
color="primary" | ||
> | ||
Edit Application | ||
</button> | ||
<button *ngIf="application.canReview" (click)="onReview(application.fileNumber)" mat-flat-button color="primary"> | ||
Review Application | ||
</button> | ||
</div> | ||
</div> | ||
<div | ||
*ngIf=" | ||
application.status.code === SUBMISSION_STATUS.IN_PROGRESS || | ||
application.status.code === SUBMISSION_STATUS.IN_REVIEW_BY_LG || | ||
application.status.code === SUBMISSION_STATUS.INCOMPLETE || | ||
application.status.code === SUBMISSION_STATUS.WRONG_GOV || | ||
application.status.code === SUBMISSION_STATUS.SUBMITTED_TO_LG | ||
" | ||
class="warning" | ||
> | ||
This section will update after the application is submitted to the ALC. | ||
</div> | ||
<div *ngIf="application.status.code === SUBMISSION_STATUS.REFUSED_TO_FORWARD_LG" class="warning"> | ||
Application not subject to Agricultural Land Commission review. | ||
</div> | ||
<div | ||
*ngIf=" | ||
application.status.code === SUBMISSION_STATUS.SUBMITTED_TO_ALC || | ||
application.status.code === SUBMISSION_STATUS.SUBMITTED_TO_ALC_INCOMPLETE || | ||
application.status.code === SUBMISSION_STATUS.RECEIVED_BY_ALC || | ||
application.status.code === SUBMISSION_STATUS.IN_REVIEW_BY_ALC || | ||
application.status.code === SUBMISSION_STATUS.ALC_DECISION | ||
" | ||
> | ||
<app-decisions [fileNumber]="application.fileNumber"></app-decisions> | ||
<app-submission-documents [$applicationDocuments]="$applicationDocuments"></app-submission-documents> | ||
</div> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
portal-frontend/src/app/features/public/application/alc-review/alc-review.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@use '../../../../../styles/functions' as *; | ||
@use '../../../../../styles/colors'; | ||
|
||
.warning { | ||
background-color: rgba(colors.$accent-color-light, 0.5); | ||
padding: rem(16); | ||
margin-bottom: rem(24); | ||
} |
33 changes: 33 additions & 0 deletions
33
portal-frontend/src/app/features/public/application/alc-review/alc-review.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { createMock, DeepMocked } from '@golevelup/ts-jest'; | ||
import { ApplicationSubmissionReviewService } from '../../../../services/application-submission-review/application-submission-review.service'; | ||
|
||
import { AlcReviewComponent } from './alc-review.component'; | ||
|
||
describe('AlcsReviewComponent', () => { | ||
let component: AlcReviewComponent; | ||
let fixture: ComponentFixture<AlcReviewComponent>; | ||
let mockAppReviewService: DeepMocked<ApplicationSubmissionReviewService>; | ||
|
||
beforeEach(async () => { | ||
mockAppReviewService = createMock(); | ||
|
||
await TestBed.configureTestingModule({ | ||
providers: [ | ||
{ | ||
provide: ApplicationSubmissionReviewService, | ||
useValue: mockAppReviewService, | ||
}, | ||
], | ||
declarations: [AlcReviewComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(AlcReviewComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
47 changes: 47 additions & 0 deletions
47
portal-frontend/src/app/features/public/application/alc-review/alc-review.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Component, Input, OnDestroy, OnInit } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
import { BehaviorSubject, Subject, takeUntil } from 'rxjs'; | ||
import { ApplicationDocumentDto } from '../../../../services/application-document/application-document.dto'; | ||
import { ApplicationSubmissionReviewService } from '../../../../services/application-submission-review/application-submission-review.service'; | ||
import { | ||
SUBMISSION_STATUS, | ||
ApplicationSubmissionDetailedDto, | ||
} from '../../../../services/application-submission/application-submission.dto'; | ||
|
||
@Component({ | ||
selector: 'app-alc-review', | ||
templateUrl: './alc-review.component.html', | ||
styleUrls: ['./alc-review.component.scss'], | ||
}) | ||
export class AlcReviewComponent implements OnInit, OnDestroy { | ||
private $destroy = new Subject<void>(); | ||
|
||
@Input() $application = new BehaviorSubject<ApplicationSubmissionDetailedDto | undefined>(undefined); | ||
@Input() $applicationDocuments = new BehaviorSubject<ApplicationDocumentDto[]>([]); | ||
|
||
application: ApplicationSubmissionDetailedDto | undefined; | ||
SUBMISSION_STATUS = SUBMISSION_STATUS; | ||
|
||
constructor(private applicationReviewService: ApplicationSubmissionReviewService, private router: Router) {} | ||
|
||
ngOnInit(): void { | ||
this.$application.pipe(takeUntil(this.$destroy)).subscribe((application) => { | ||
this.application = application; | ||
}); | ||
} | ||
|
||
ngOnDestroy(): void { | ||
this.$destroy.next(); | ||
this.$destroy.complete(); | ||
} | ||
|
||
async onReview(fileId: string) { | ||
if (this.application?.status.code === SUBMISSION_STATUS.SUBMITTED_TO_LG) { | ||
const review = await this.applicationReviewService.startReview(fileId); | ||
if (!review) { | ||
return; | ||
} | ||
} | ||
await this.router.navigateByUrl(`application/${fileId}/review`); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...rontend/src/app/features/public/application/alc-review/decisions/decisions.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div *ngFor="let decision of decisions; let index = index"> | ||
<h4>Decision #{{ decisions.length - index }}</h4> | ||
<div class="decision-table"> | ||
<div> | ||
<div class="subheading2">Decision Date</div> | ||
{{ decision.date | momentFormat }} | ||
</div> | ||
|
||
<div> | ||
<div class="subheading2">Resolution Number</div> | ||
#{{ decision.resolutionNumber }}/{{ decision.resolutionYear }} | ||
</div> | ||
|
||
<div> | ||
<div class="subheading2">Decision Outcome</div> | ||
{{ decision.outcome.label }} {{ decision.isSubjectToConditions ? '- Subject to Conditions' : '' }} | ||
</div> | ||
|
||
<div> | ||
<div class="subheading2">Decision Document</div> | ||
<div *ngFor="let document of decision.documents"> | ||
<a (click)="openFile(document.uuid)">{{ document.fileName }}</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
20 changes: 20 additions & 0 deletions
20
...rontend/src/app/features/public/application/alc-review/decisions/decisions.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@use '../../../../../../styles/functions' as *; | ||
@use '../../../../../../styles/colors'; | ||
|
||
.decision-table { | ||
padding: rem(8); | ||
margin: rem(12) 0 rem(20) 0; | ||
background-color: colors.$grey-light; | ||
display: grid; | ||
grid-row-gap: rem(24); | ||
grid-column-gap: rem(16); | ||
grid-template-columns: 100%; | ||
word-wrap: break-word; | ||
hyphens: auto; | ||
|
||
@media screen and (min-width: $tabletBreakpoint) { | ||
padding: rem(16); | ||
margin: rem(24) 0 rem(40) 0; | ||
grid-template-columns: 50% 50%; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...tend/src/app/features/public/application/alc-review/decisions/decisions.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { createMock } from '@golevelup/ts-jest'; | ||
import { ApplicationDecisionService } from '../../../../../services/application-decision/application-decision.service'; | ||
|
||
import { DecisionsComponent } from './decisions.component'; | ||
|
||
describe('DecisionsComponent', () => { | ||
let component: DecisionsComponent; | ||
let fixture: ComponentFixture<DecisionsComponent>; | ||
let mockDecisionService: ApplicationDecisionService; | ||
|
||
beforeEach(async () => { | ||
mockDecisionService = createMock(); | ||
|
||
await TestBed.configureTestingModule({ | ||
declarations: [DecisionsComponent], | ||
providers: [ | ||
{ | ||
provide: ApplicationDecisionService, | ||
useValue: mockDecisionService, | ||
}, | ||
], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DecisionsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
39 changes: 39 additions & 0 deletions
39
...-frontend/src/app/features/public/application/alc-review/decisions/decisions.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; | ||
import { ApplicationPortalDecisionDto } from '../../../../../services/application-decision/application-decision.dto'; | ||
import { ApplicationDecisionService } from '../../../../../services/application-decision/application-decision.service'; | ||
|
||
@Component({ | ||
selector: 'app-decisions[fileNumber]', | ||
templateUrl: './decisions.component.html', | ||
styleUrls: ['./decisions.component.scss'], | ||
}) | ||
export class DecisionsComponent implements OnInit, OnChanges { | ||
@Input() fileNumber = ''; | ||
decisions: ApplicationPortalDecisionDto[] = []; | ||
|
||
constructor(private decisionService: ApplicationDecisionService) {} | ||
|
||
ngOnInit(): void { | ||
this.loadDecisions(); | ||
} | ||
|
||
ngOnChanges(changes: SimpleChanges): void { | ||
this.loadDecisions(); | ||
} | ||
|
||
async openFile(uuid: string) { | ||
const res = await this.decisionService.openFile(uuid); | ||
if (res) { | ||
window.open(res.url, '_blank'); | ||
} | ||
} | ||
|
||
private async loadDecisions() { | ||
if (this.fileNumber) { | ||
const decisions = await this.decisionService.getByFileId(this.fileNumber); | ||
if (decisions) { | ||
this.decisions = decisions; | ||
} | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...es/public/application/alc-review/submission-documents/submission-documents.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<h4>Application Documents</h4> | ||
<div class='table-container'> | ||
<table mat-table [dataSource]='dataSource' matSort class='mat-elevation-z3 documents'> | ||
<ng-container matColumnDef='type'> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header sortActionDescription='Sort by type'>Type</th> | ||
<td mat-cell *matCellDef='let element'> | ||
{{ element.type?.label }} | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef='fileName'> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header sortActionDescription='Sort by name'>Document Name</th> | ||
<td mat-cell *matCellDef='let element'> | ||
<a (click)='openFile(element.uuid)'>{{ element.fileName }}</a> | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef='source'> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header sortActionDescription='Sort by source'>Source</th> | ||
<td mat-cell *matCellDef='let element'>{{ element.source }}</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef='uploadedAt'> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header sortActionDescription='Sort by date'>Upload Date</th> | ||
<td mat-cell *matCellDef='let element'>{{ element.uploadedAt | date }}</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef='actions'> | ||
<th mat-header-cell *matHeaderCellDef>Actions</th> | ||
<td mat-cell *matCellDef='let element'> | ||
<button mat-icon-button (click)='downloadFile(element.uuid)'> | ||
<mat-icon>file_download</mat-icon> | ||
</button> | ||
</td> | ||
</ng-container> | ||
|
||
<tr mat-header-row *matHeaderRowDef='displayedColumns'></tr> | ||
<tr mat-row *matRowDef='let row; columns: displayedColumns'></tr> | ||
<tr class='mat-row' *matNoDataRow> | ||
<td class='text-center' colspan='6'>Documents will be visible here once provided by ALC</td> | ||
</tr> | ||
</table> | ||
</div> |
25 changes: 25 additions & 0 deletions
25
...es/public/application/alc-review/submission-documents/submission-documents.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@use '../../../../../../styles/colors'; | ||
@use '../../../../../../styles/functions' as *; | ||
|
||
.header { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.table-container { | ||
margin: rem(4); | ||
overflow-x: auto; | ||
} | ||
|
||
.documents { | ||
margin-top: rem(12); | ||
} | ||
|
||
.mat-mdc-no-data-row { | ||
height: rem(56); | ||
color: colors.$grey-dark; | ||
} | ||
|
||
a { | ||
word-break: break-all; | ||
} |
35 changes: 35 additions & 0 deletions
35
...public/application/alc-review/submission-documents/submission-documents.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { NO_ERRORS_SCHEMA } from '@angular/core'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { createMock, DeepMocked } from '@golevelup/ts-jest'; | ||
import { ApplicationDocumentService } from '../../../../../services/application-document/application-document.service'; | ||
|
||
import { SubmissionDocumentsComponent } from './submission-documents.component'; | ||
|
||
describe('SubmissionDocumentsComponent', () => { | ||
let component: SubmissionDocumentsComponent; | ||
let fixture: ComponentFixture<SubmissionDocumentsComponent>; | ||
let mockAppDocService: DeepMocked<ApplicationDocumentService>; | ||
|
||
beforeEach(async () => { | ||
mockAppDocService = createMock(); | ||
|
||
await TestBed.configureTestingModule({ | ||
declarations: [SubmissionDocumentsComponent], | ||
providers: [ | ||
{ | ||
provide: ApplicationDocumentService, | ||
useValue: mockAppDocService, | ||
}, | ||
], | ||
schemas: [NO_ERRORS_SCHEMA], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(SubmissionDocumentsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.