Skip to content

Commit

Permalink
Merge pull request #961 from bcgov/feature/ALCS-1118
Browse files Browse the repository at this point in the history
Bug Fixes
  • Loading branch information
dhaselhan authored Sep 11, 2023
2 parents 34173be + 155c94b commit c1fc189
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@ export class DecisionInputV2Component implements OnInit, OnDestroy {

if (
!this.form.valid ||
!this.existingDecision ||
this.existingDecision.documents.length === 0 ||
!this.conditionsValid ||
!this.componentsValid ||
(this.components.length === 0 && requiresComponents) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ export class DecisionInputV2Component implements OnInit, OnDestroy {

if (
!this.form.valid ||
!this.existingDecision ||
this.existingDecision.documents.length === 0 ||
!this.conditionsValid ||
!this.componentsValid ||
(this.components.length === 0 && requiresComponents) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[submissionStatusService]="noticeOfIntentStatusService"
></app-details-header>
<div class="content">
<div class="nav">
<div *ngIf='!isApplicantSubmission || showSubmittedToAlcMenuItems' class="nav">
<div *ngFor="let route of childRoutes" class="nav-link">
<div
[routerLink]="route.path ? route.path : './'"
Expand All @@ -23,6 +23,19 @@
</div>
</div>
</div>
<div *ngIf='isApplicantSubmission && !showSubmittedToAlcMenuItems' class="nav">
<div *ngFor="let route of preSubmissionRoute" class="nav-link">
<div
[routerLink]="route.path ? route.path : './'"
routerLinkActive="active"
[routerLinkActiveOptions]="{ exact: route.path === '' }"
class="nav-item nav-text"
>
<mat-icon>{{ route.icon }}</mat-icon>
{{ route.menuTitle }}
</div>
</div>
</div>
<div class="child-content">
<router-outlet></router-outlet>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { environment } from '../../../environments/environment';
import { NoticeOfIntentDetailService } from '../../services/notice-of-intent/notice-of-intent-detail.service';
import { NoticeOfIntentModificationDto } from '../../services/notice-of-intent/notice-of-intent-modification/notice-of-intent-modification.dto';
import { NoticeOfIntentModificationService } from '../../services/notice-of-intent/notice-of-intent-modification/notice-of-intent-modification.service';
import { NoticeOfIntentDto } from '../../services/notice-of-intent/notice-of-intent.dto';
import { NoticeOfIntentSubmissionStatusService } from '../../services/notice-of-intent/notice-of-intent-submission-status/notice-of-intent-submission-status.service';
import { NOI_SUBMISSION_STATUS, NoticeOfIntentDto } from '../../services/notice-of-intent/notice-of-intent.dto';
import { SYSTEM_SOURCE_TYPES } from '../../shared/dto/system-source.types.dto';
import { ApplicantInfoComponent } from './applicant-info/applicant-info.component';
import { decisionChildRoutes, DecisionModule } from './decision/decision.module';
import { NoiDocumentsComponent } from './documents/documents.component';
Expand All @@ -15,7 +17,6 @@ import { IntakeComponent } from './intake/intake.component';
import { OverviewComponent } from './overview/overview.component';
import { PostDecisionComponent } from './post-decision/post-decision.component';
import { ProposalComponent } from './proposal/proposal.component';
import { NoticeOfIntentSubmissionStatusService } from '../../services/notice-of-intent/notice-of-intent-submission-status/notice-of-intent-submission-status.service';

export const childRoutes = [
{
Expand Down Expand Up @@ -71,6 +72,22 @@ export const childRoutes = [
},
];

const preSubmissionRoutes = [
{
path: '',
menuTitle: 'Overview',
icon: 'summarize',
component: OverviewComponent,
},
{
path: 'applicant-info',
menuTitle: 'NOI Preview',
icon: 'persons',
component: ApplicantInfoComponent,
portalOnly: true,
},
];

@Component({
selector: 'app-notice-of-intent',
templateUrl: './notice-of-intent.component.html',
Expand All @@ -79,12 +96,14 @@ export const childRoutes = [
export class NoticeOfIntentComponent implements OnInit, OnDestroy {
destroy = new Subject<void>();
childRoutes = childRoutes;
preSubmissionRoute = preSubmissionRoutes;

fileNumber?: string;
noticeOfIntent: NoticeOfIntentDto | undefined;
modifications: NoticeOfIntentModificationDto[] = [];

isAuthorized = true;
isApplicantSubmission = false;
showSubmittedToAlcMenuItems = false;

constructor(
private noticeOfIntentDetailService: NoticeOfIntentDetailService,
Expand All @@ -101,12 +120,18 @@ export class NoticeOfIntentComponent implements OnInit, OnDestroy {
this.load();
});

this.noticeOfIntentDetailService.$noticeOfIntent.pipe(takeUntil(this.destroy)).subscribe((noticeOfIntent) => {
this.noticeOfIntentDetailService.$noticeOfIntent.pipe(takeUntil(this.destroy)).subscribe(async (noticeOfIntent) => {
if (noticeOfIntent) {
this.titleService.setTitle(
`${environment.siteName} | ${noticeOfIntent.fileNumber} (${noticeOfIntent.applicant})`
);

this.isApplicantSubmission = noticeOfIntent.source === SYSTEM_SOURCE_TYPES.APPLICANT;

if (this.isApplicantSubmission) {
this.showSubmittedToAlcMenuItems = !!noticeOfIntent.dateSubmittedToAlc;
}

this.noticeOfIntentModificationService.fetchByFileNumber(noticeOfIntent.fileNumber);
this.noticeOfIntent = noticeOfIntent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ <h3>ALC Review and Decision</h3>
<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
"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('ApplicationTimelineService', () => {
);

mockAppRepo.findOneOrFail.mockResolvedValue(
new Application({ decisionDate: mockSameDate }),
new Application({ decisionDate: mockSameDate, source: 'APPLICANT' }),
);
mockAppModificationRepo.find.mockResolvedValue([]);
mockAppReconsiderationRepo.find.mockResolvedValue([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export class ApplicationTimelineService {
await this.addReconsiderationEvents(application, events);
await this.addModificationEvents(application, events);
await this.addMeetingEvents(application, events);
await this.addStatusEvents(application, events);
if (application.source === 'APPLICANT') {
await this.addStatusEvents(application, events);
}

if (application.card) {
for (const subtask of application.card.subtasks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ describe('NoticeOfIntentTimelineService', () => {
NoticeOfIntentTimelineService,
);

mockNOIRepo.findOneOrFail.mockResolvedValue(new NoticeOfIntent());
mockNOIRepo.findOneOrFail.mockResolvedValue(
new NoticeOfIntent({
source: 'APPLICANT',
}),
);
mockNOIDecisionRepo.find.mockResolvedValue([]);
mockNOIModificationRepo.find.mockResolvedValue([]);
mockNOIMeetingService.getByFileNumber.mockResolvedValue([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ export class NoticeOfIntentTimelineService {
await this.addDecisionEvents(noticeOfIntent, events);
await this.addModificationEvents(noticeOfIntent, events);
await this.addMeetingEvents(noticeOfIntent, events);
await this.addStatusEvents(noticeOfIntent, events);

if (noticeOfIntent.source === 'APPLICANT') {
await this.addStatusEvents(noticeOfIntent, events);
}
if (noticeOfIntent.card) {
for (const subtask of noticeOfIntent.card.subtasks) {
const mappedEvent = this.mapSubtaskToEvent(subtask);
Expand Down

0 comments on commit c1fc189

Please sign in to comment.