Skip to content

Commit

Permalink
Merge pull request #1484 from bcgov/develop
Browse files Browse the repository at this point in the history
Deployment PR - 1007
  • Loading branch information
mhuseinov authored Mar 13, 2024
2 parents 724e683 + efc2034 commit f2a9fe4
Show file tree
Hide file tree
Showing 242 changed files with 10,612 additions and 1,703 deletions.
8 changes: 8 additions & 0 deletions alcs-frontend/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ const routes: Routes = [
},
loadChildren: () => import('./features/notification/notification.module').then((m) => m.NotificationModule),
},
{
path: 'planning-review',
canActivate: [HasRolesGuard],
data: {
roles: ROLES_ALLOWED_APPLICATIONS,
},
loadChildren: () => import('./features/planning-review/planning-review.module').then((m) => m.PlanningReviewModule),
},
{
path: 'schedule',
canActivate: [HasRolesGuard],
Expand Down
33 changes: 8 additions & 25 deletions alcs-frontend/src/app/features/board/board.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,17 @@ <h2 class="board-title center">
</h2>
</div>
<div>
<ng-container
*ngIf="
boardHasCreateApplication ||
boardHasCreateNOI ||
boardHasCreateReconsideration ||
boardHasCreatePlanningReview ||
boardHasCreateAppModification ||
boardHasCreateNOIModification ||
boardHasCreateCovenant
"
>
<ng-container *ngIf="creatableCards.length === 1">
<button mat-flat-button color="primary" (click)="onOpenCreateDialog(creatableCards[0].dialog)">
+ {{ creatableCards[0].label }}
</button>
</ng-container>
<ng-container *ngIf="creatableCards.length > 1">
<button mat-flat-button color="primary" [matMenuTriggerFor]="createMenu">+ New Card ▾</button>
<mat-menu class="move-board-menu" xPosition="before" #createMenu="matMenu">
<button *ngIf="boardHasCreateApplication" mat-menu-item (click)="onApplicationCreate()">Application</button>
<button *ngIf="boardHasCreateNOI" mat-menu-item (click)="onCreateNoticeOfIntent()">Notice of Intent</button>
<button *ngIf="boardHasCreateReconsideration" mat-menu-item (click)="onReconsiderationCreate()">
Reconsideration
</button>
<button *ngIf="boardHasCreatePlanningReview" mat-menu-item (click)="onCreatePlanningReview()">
Planning Review
</button>
<button *ngIf="boardHasCreateAppModification" mat-menu-item (click)="onCreateAppModification()">
Application Modification
</button>
<button *ngIf="boardHasCreateNOIModification" mat-menu-item (click)="onCreateNoiModifications()">
Modification
<button *ngFor="let creator of creatableCards" mat-menu-item (click)="onOpenCreateDialog(creator.dialog)">
{{ creator.label }}
</button>
<button *ngIf="boardHasCreateCovenant" mat-menu-item (click)="onCreateCovenant()">Covenant</button>
</mat-menu>
</ng-container>
</div>
Expand Down
35 changes: 18 additions & 17 deletions alcs-frontend/src/app/features/board/board.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import { NoticeOfIntentModificationService } from '../../services/notice-of-inte
import { NoticeOfIntentService } from '../../services/notice-of-intent/notice-of-intent.service';
import { NotificationDto } from '../../services/notification/notification.dto';
import { NotificationService } from '../../services/notification/notification.service';
import { PlanningReviewDto } from '../../services/planning-review/planning-review.dto';
import { PlanningReferralService } from '../../services/planning-review/planning-referral.service';
import { PlanningReferralDto, PlanningReviewDto } from '../../services/planning-review/planning-review.dto';
import { PlanningReviewService } from '../../services/planning-review/planning-review.service';
import { ToastService } from '../../services/toast/toast.service';
import { CardType } from '../../shared/card/card.component';
Expand All @@ -40,7 +41,7 @@ describe('BoardComponent', () => {
let router: DeepMocked<Router>;
let cardService: DeepMocked<CardService>;
let reconsiderationService: DeepMocked<ApplicationReconsiderationService>;
let planningReviewService: DeepMocked<PlanningReviewService>;
let planningReferralService: DeepMocked<PlanningReferralService>;
let modificationService: DeepMocked<ApplicationModificationService>;
let covenantService: DeepMocked<CovenantService>;
let titleService: DeepMocked<Title>;
Expand Down Expand Up @@ -96,7 +97,7 @@ describe('BoardComponent', () => {
applications: [],
covenants: [],
modifications: [],
planningReviews: [],
planningReferrals: [],
reconsiderations: [],
noticeOfIntents: [],
noiModifications: [],
Expand All @@ -109,7 +110,7 @@ describe('BoardComponent', () => {
router = createMock();
cardService = createMock();
reconsiderationService = createMock();
planningReviewService = createMock();
planningReferralService = createMock();
modificationService = createMock();
covenantService = createMock();
titleService = createMock();
Expand Down Expand Up @@ -162,8 +163,8 @@ describe('BoardComponent', () => {
useValue: reconsiderationService,
},
{
provide: PlanningReviewService,
useValue: planningReviewService,
provide: PlanningReferralService,
useValue: planningReferralService,
},
{
provide: ApplicationModificationService,
Expand Down Expand Up @@ -223,7 +224,7 @@ describe('BoardComponent', () => {
applications: [mockApplication],
covenants: [],
modifications: [],
planningReviews: [],
planningReferrals: [],
reconsiderations: [],
noticeOfIntents: [],
noiModifications: [],
Expand All @@ -244,7 +245,7 @@ describe('BoardComponent', () => {
applications: [],
covenants: [],
modifications: [],
planningReviews: [],
planningReferrals: [],
reconsiderations: [mockRecon],
noticeOfIntents: [],
noiModifications: [],
Expand Down Expand Up @@ -287,7 +288,7 @@ describe('BoardComponent', () => {
applications: [mockApplication, highPriorityApplication, highActiveDays],
covenants: [],
modifications: [],
planningReviews: [],
planningReferrals: [],
reconsiderations: [],
noticeOfIntents: [],
noiModifications: [],
Expand All @@ -311,7 +312,7 @@ describe('BoardComponent', () => {
new Map([
['card', 'app-id'],
['type', CardType.APP],
])
]),
);

await sleep(1);
Expand All @@ -327,7 +328,7 @@ describe('BoardComponent', () => {
new Map([
['card', 'app-id'],
['type', CardType.RECON],
])
]),
);

await sleep(1);
Expand All @@ -337,18 +338,18 @@ describe('BoardComponent', () => {
});

it('should load planning review and open dialog when url is set', async () => {
planningReviewService.fetchByCardUuid.mockResolvedValue({} as PlanningReviewDto);
planningReferralService.fetchByCardUuid.mockResolvedValue({} as PlanningReferralDto);

queryParamMapEmitter.next(
new Map([
['card', 'app-id'],
['type', CardType.PLAN],
])
]),
);

await sleep(1);

expect(planningReviewService.fetchByCardUuid).toHaveBeenCalledTimes(1);
expect(planningReferralService.fetchByCardUuid).toHaveBeenCalledTimes(1);
expect(dialog.open).toHaveBeenCalledTimes(1);
});

Expand All @@ -359,7 +360,7 @@ describe('BoardComponent', () => {
new Map([
['card', 'app-id'],
['type', CardType.COV],
])
]),
);

await sleep(1);
Expand All @@ -375,7 +376,7 @@ describe('BoardComponent', () => {
new Map([
['card', 'app-id'],
['type', CardType.NOTIFICATION],
])
]),
);

await sleep(1);
Expand All @@ -391,7 +392,7 @@ describe('BoardComponent', () => {
new Map([
['card', 'app-id'],
['type', CardType.COV],
])
]),
);

await sleep(1);
Expand Down
Loading

0 comments on commit f2a9fe4

Please sign in to comment.