-
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.
Merge pull request #1489 from bcgov/feature/ALCS-1423
Planning Reviews Pt2
- Loading branch information
Showing
42 changed files
with
940 additions
and
58 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
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
48 changes: 48 additions & 0 deletions
48
alcs-frontend/src/app/features/planning-review/header/header.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,48 @@ | ||
<div class="header"> | ||
<div> | ||
<span class="subtext heading">Planning Review</span> | ||
</div> | ||
<div class="first-row"> | ||
<div class="title"> | ||
<h5>{{ planningReview.fileNumber }} ({{ planningReview.documentName }})</h5> | ||
<app-application-legacy-id [legacyId]="legacyId"></app-application-legacy-id> | ||
<div class="labels"> | ||
<app-application-type-pill [type]="planningReview.type"></app-application-type-pill> | ||
</div> | ||
</div> | ||
<div class="center"> | ||
<button | ||
*ngIf="linkedCards.length === 1" | ||
class="menu-item" | ||
mat-flat-button | ||
color="accent" | ||
(click)="onGoToCard(linkedCards[0])" | ||
> | ||
<div class="center"> | ||
Go to card | ||
<mat-icon style="transform: scale(1.1)">arrow_right_alt</mat-icon> | ||
</div> | ||
</button> | ||
<ng-container *ngIf="linkedCards.length > 1"> | ||
<button class="menu-item center" mat-flat-button color="accent" [matMenuTriggerFor]="goToMenu"> | ||
Go to card ▾ | ||
</button> | ||
<mat-menu class="move-board-menu" xPosition="before" #goToMenu="matMenu"> | ||
<button *ngFor="let card of linkedCards" mat-menu-item (click)="onGoToCard(card)"> | ||
{{ card.displayName }} | ||
</button> | ||
</mat-menu> | ||
</ng-container> | ||
</div> | ||
</div> | ||
<div class="sub-heading"> | ||
<div> | ||
<div class="subheading2">Local/First Nation Government:</div> | ||
<div class="body-text"> | ||
{{ planningReview.localGovernment.name }} | ||
<app-no-data *ngIf="!planningReview.localGovernment"></app-no-data> | ||
</div> | ||
</div> | ||
<div class="status-wrapper"><app-application-submission-status-type-pill [type]="statusPill"></app-application-submission-status-type-pill></div> | ||
</div> | ||
</div> |
58 changes: 58 additions & 0 deletions
58
alcs-frontend/src/app/features/planning-review/header/header.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,58 @@ | ||
@use '../../../../styles/colors'; | ||
|
||
.heading { | ||
color: colors.$primary-color-dark; | ||
margin-bottom: 8px; | ||
} | ||
|
||
.header { | ||
padding: 16px 80px; | ||
border-bottom: 1px solid colors.$primary-color-dark; | ||
|
||
.first-row { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
margin-bottom: 16px; | ||
} | ||
|
||
.title { | ||
display: flex; | ||
flex-wrap: wrap; | ||
align-items: center; | ||
line-height: 32px; | ||
|
||
h5 { | ||
margin-right: 8px !important; | ||
} | ||
} | ||
|
||
.labels { | ||
display: flex; | ||
flex-wrap: wrap; | ||
margin-top: -8px; | ||
margin-right: 8px; | ||
|
||
app-application-type-pill { | ||
margin-top: 8px; | ||
} | ||
} | ||
|
||
.sub-heading { | ||
margin-top: 16px; | ||
margin-bottom: 8px; | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
gap: 8px; | ||
} | ||
|
||
.subheading2 { | ||
margin-bottom: 6px !important; | ||
} | ||
} | ||
|
||
.status-wrapper { | ||
display: flex; | ||
flex-direction: row-reverse; | ||
align-items: flex-end; | ||
} |
53 changes: 53 additions & 0 deletions
53
alcs-frontend/src/app/features/planning-review/header/header.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,53 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
|
||
import { HeaderComponent } from './header.component'; | ||
|
||
describe('HeaderComponent', () => { | ||
let component: HeaderComponent; | ||
let fixture: ComponentFixture<HeaderComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [RouterTestingModule], | ||
declarations: [HeaderComponent], | ||
providers: [], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(HeaderComponent); | ||
component = fixture.componentInstance; | ||
|
||
component.planningReview = { | ||
documentName: '', | ||
fileNumber: '', | ||
localGovernment: { | ||
uuid: '', | ||
name: '', | ||
isFirstNation: false, | ||
preferredRegionCode: '', | ||
}, | ||
open: false, | ||
referrals: [], | ||
region: { | ||
label: '', | ||
code: '', | ||
description: '', | ||
}, | ||
type: { | ||
code: '', | ||
description: '', | ||
label: '', | ||
backgroundColor: '', | ||
shortLabel: '', | ||
textColor: '', | ||
}, | ||
uuid: '', | ||
}; | ||
|
||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
47 changes: 47 additions & 0 deletions
47
alcs-frontend/src/app/features/planning-review/header/header.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, OnInit } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
import { Subject } from 'rxjs'; | ||
import { CardDto } from '../../../services/card/card.dto'; | ||
import { PlanningReviewDetailedDto, PlanningReviewDto } from '../../../services/planning-review/planning-review.dto'; | ||
import { CLOSED_PR_LABEL, OPEN_PR_LABEL } from '../../../shared/application-type-pill/application-type-pill.constants'; | ||
|
||
@Component({ | ||
selector: 'app-header[planningReview]', | ||
templateUrl: './header.component.html', | ||
styleUrls: ['./header.component.scss'], | ||
}) | ||
export class HeaderComponent implements OnInit { | ||
destroy = new Subject<void>(); | ||
|
||
@Input() planningReview!: PlanningReviewDetailedDto; | ||
|
||
legacyId?: string; | ||
applicant?: string; | ||
linkedCards: (CardDto & { displayName: string })[] = []; | ||
statusPill = OPEN_PR_LABEL; | ||
|
||
constructor(private router: Router) {} | ||
|
||
ngOnInit(): void { | ||
this.setupLinkedCards(); | ||
if (!this.planningReview.open) { | ||
this.statusPill = CLOSED_PR_LABEL; | ||
} | ||
} | ||
|
||
async onGoToCard(card: CardDto) { | ||
const boardCode = card.boardCode; | ||
const cardUuid = card.uuid; | ||
const cardTypeCode = card.type; | ||
await this.router.navigateByUrl(`/board/${boardCode}?card=${cardUuid}&type=${cardTypeCode}`); | ||
} | ||
|
||
async setupLinkedCards() { | ||
for (const [index, referral] of this.planningReview.referrals.entries()) { | ||
this.linkedCards.push({ | ||
...referral.card, | ||
displayName: `Referral ${index}`, | ||
}); | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
alcs-frontend/src/app/features/planning-review/overview/overview.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,16 @@ | ||
<div class="split"> | ||
<h3>Overview</h3> | ||
</div> | ||
<section> | ||
<app-staff-journal *ngIf="planningReview" parentType="Planning Review" [parentUuid]="planningReview.uuid" /> | ||
</section> | ||
<section *ngIf="planningReview"> | ||
<h5>Planning Review Type</h5> | ||
<div> | ||
<app-inline-dropdown (save)="onSaveType($event)" [options]="types" [value]="planningReview.type.code" /> | ||
</div> | ||
</section> | ||
<section *ngIf="planningReview"> | ||
<h5>Status</h5> | ||
<div>{{ planningReview.open ? 'Open' : 'Closed' }}</div> | ||
</section> |
7 changes: 7 additions & 0 deletions
7
alcs-frontend/src/app/features/planning-review/overview/overview.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,7 @@ | ||
h5 { | ||
margin: 16px 0 !important; | ||
} | ||
|
||
section { | ||
margin: 32px 0; | ||
} |
52 changes: 52 additions & 0 deletions
52
alcs-frontend/src/app/features/planning-review/overview/overview.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,52 @@ | ||
import { NO_ERRORS_SCHEMA } from '@angular/core'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { MatDialog } from '@angular/material/dialog'; | ||
import { createMock, DeepMocked } from '@golevelup/ts-jest'; | ||
import { BehaviorSubject } from 'rxjs'; | ||
import { NoticeOfIntentDecisionService } from '../../../services/notice-of-intent/decision/notice-of-intent-decision.service'; | ||
import { NoticeOfIntentDetailService } from '../../../services/notice-of-intent/notice-of-intent-detail.service'; | ||
import { NoticeOfIntentTimelineService } from '../../../services/notice-of-intent/notice-of-intent-timeline/notice-of-intent-timeline.service'; | ||
import { NoticeOfIntentDto } from '../../../services/notice-of-intent/notice-of-intent.dto'; | ||
import { PlanningReviewDetailService } from '../../../services/planning-review/planning-review-detail.service'; | ||
import { PlanningReviewDetailedDto } from '../../../services/planning-review/planning-review.dto'; | ||
import { PlanningReviewService } from '../../../services/planning-review/planning-review.service'; | ||
import { ConfirmationDialogService } from '../../../shared/confirmation-dialog/confirmation-dialog.service'; | ||
|
||
import { OverviewComponent } from './overview.component'; | ||
import { NoticeOfIntentSubmissionStatusService } from '../../../services/notice-of-intent/notice-of-intent-submission-status/notice-of-intent-submission-status.service'; | ||
|
||
describe('OverviewComponent', () => { | ||
let component: OverviewComponent; | ||
let fixture: ComponentFixture<OverviewComponent>; | ||
let mockPRDetailService: DeepMocked<PlanningReviewDetailService>; | ||
let mockPRService: DeepMocked<PlanningReviewService>; | ||
|
||
beforeEach(async () => { | ||
mockPRService = createMock(); | ||
|
||
mockPRDetailService = createMock(); | ||
mockPRDetailService.$planningReview = new BehaviorSubject<PlanningReviewDetailedDto | undefined>(undefined); | ||
await TestBed.configureTestingModule({ | ||
providers: [ | ||
{ | ||
provide: PlanningReviewDetailService, | ||
useValue: mockPRDetailService, | ||
}, | ||
{ | ||
provide: PlanningReviewService, | ||
useValue: mockPRService, | ||
}, | ||
], | ||
declarations: [OverviewComponent], | ||
schemas: [NO_ERRORS_SCHEMA], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(OverviewComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.