Skip to content

Commit

Permalink
Merge pull request #2065 from bcgov/batch/QTN41-release-1
Browse files Browse the repository at this point in the history
QT-N41 Batch Release
  • Loading branch information
DaveK-N41 authored Feb 13, 2025
2 parents 8f2d17d + 28adfd9 commit 5e2d898
Show file tree
Hide file tree
Showing 27 changed files with 1,138 additions and 513 deletions.
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ services:
SERILOG__WRITETO__0__ARGS__THEME: Serilog.Sinks.SystemConsole.Themes.ConsoleTheme::None, Serilog.Sinks.Console
SERILOG__WRITETO__0__NAME: Console
SERILOG__MINIMUMLEVEL__DEFAULT: ${SERILOG__MINIMUMLEVEL__DEFAULT:-Information}
ORDSDATASERVICE__ADDRESS: ${ORDSDATASERVICE__ADDRESS}
ORDSDATASERVICE__PASSWORD: ${ORDSDATASERVICE__PASSWORD}
ORDSDATASERVICE__USERNAME: ${ORDSDATASERVICE__USERNAME}
ports:
- "5080:8080"
restart: always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,14 @@ <h4><b>Contact details</b></h4>
minlength="7" maxlength="9" />
<input matInput formControlName="drivers_licence_number" maxlength="20"
*ngIf="driversLicenceProvinceFormControl.value?.provId !== bc.provId" />
<mat-error
*ngIf="form.controls.drivers_licence_number.errors?.minlength || form.controls.drivers_licence_number.hasError('maxlength')">
Must be a valid driver's licence number of seven to nine digits
</mat-error>
<mat-error *ngIf="form.controls.drivers_licence_number.invalid && form.controls.drivers_licence_number.touched">
<ng-container *ngIf="driversLicenceProvinceFormControl.value?.provId === bc.provId">
Must be a valid driver's licence number of seven to nine digits.
</ng-container>
<ng-container *ngIf="driversLicenceProvinceFormControl.value?.provId !== bc.provId">
Must be a valid driver's licence number with a maximum of 20 characters.
</ng-container>
</mat-error>
</mat-form-field>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,41 @@ export class DisputantFormComponent implements OnInit, AfterViewInit {
} else {
this.countryFormControl.setValue(country);
}

let province = this.provincesAndStates.filter(i => i.provAbbreviationCd === this.form.value.address_province).shift();
if (!this.form.value.address_province) {
this.provinceFormControl.setValue(this.bc);
} else {
this.provinceFormControl.setValue(province);
}

let form = this.form as NoticeOfDisputeFormGroup;
// search for drivers licence province using abbreviation e.g. BC
if (form.value.drivers_licence_province) {
let foundProvinces = this.provincesAndStates.filter(x => x.provAbbreviationCd === form.value.drivers_licence_province).shift();
if (foundProvinces) {
this.driversLicenceProvinceFormControl.setValue(foundProvinces);
} else{
} else {
this.driversLicenceProvinceFormControl.setValue(null);
}
} else if (form.controls.drivers_licence_province) { // have control but no value
if(this.mode !== DisputeFormMode.UPDATE) {
} else if (form.controls.drivers_licence_province) {
if (this.mode !== DisputeFormMode.UPDATE) {
this.driversLicenceProvinceFormControl.setValue(this.bc);
} else {
this.driversLicenceProvinceFormControl.setValue(null);
}
}
}


// Check for the driver's licence number validity on load
const driversLicenceNumber = form.controls.drivers_licence_number.value;
const isBC = this.driversLicenceProvinceFormControl.value?.provId === this.bc.provId;
const isInvalid = isBC ? !(driversLicenceNumber && driversLicenceNumber.length >= 7 && driversLicenceNumber.length <= 9 && /^[0-9]+$/.test(driversLicenceNumber)) :
!(driversLicenceNumber && driversLicenceNumber.length <= 20);

if (isInvalid) {
form.controls.drivers_licence_number.markAsTouched();
form.controls.drivers_licence_number.markAsDirty();
}

if (this.preferEmail !== undefined && this.preferEmail !== true) {
this.form.controls.email_address.disable();
this.optOut = true;
Expand Down Expand Up @@ -180,10 +190,17 @@ export class DisputantFormComponent implements OnInit, AfterViewInit {
}

if (province != null && province.provId === this.bc.provId) {
form.controls.drivers_licence_number.setValidators([Validators.maxLength(9)]);
form.controls.drivers_licence_number.addValidators([Validators.minLength(7)]);
form.controls.drivers_licence_number.setValidators([
Validators.required,
Validators.minLength(7),
Validators.maxLength(9),
Validators.pattern(/^\d+$/) // Ensure it's numeric
]);
} else {
form.controls.drivers_licence_number.setValidators([Validators.maxLength(20)]);
form.controls.drivers_licence_number.setValidators([
Validators.required,
Validators.maxLength(20)
]);
}

form.controls.drivers_licence_number.updateValueAndValidity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,19 @@ <h1>Ticket request sent successfully</h1>
<div class="d-print-none">
<strong>Next Steps</strong><br>
<p *ngIf="isCreate && noticeOfDispute.email_address" class="text-dark">
A member of the court registry will review your request and you will receive an email to the address you supplied
which will inform you if the ticket request has been approved or rejected, and what to expect next.
A member of the court registry will review your request and inform you if the ticket request has been approved or rejected, and what to expect next.
<br>
<br>
A confirmation email of the request information will be sent to:
<br>
{{ noticeOfDispute.email_address }}
</p>
<p *ngIf="isCreate && !noticeOfDispute.email_address" class="text-dark">
A member of the court registry will review your request and inform you if the ticket request has been approved or
rejected, and what to expect next.
A member of the court registry will review your request and inform you if the ticket request has been approved or rejected, and what to expect next.
<br>
</p>
<p *ngIf="!isCreate" class="text-dark">
A member of the court registry will review your request and you will receive an email to the address you supplied
which will inform you if the dispute update request has been approved or rejected, and what to expect next.
A member of the court registry will review your request and inform you if the ticket request has been approved or rejected, and what to expect next.
</p>
<hr class="d-print-none" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ <h1 style="margin: 0;">Email successfully confirmed.</h1>
<div class="d-print-none" *ngIf="verified === true && checking === false">
<strong>Next Steps</strong><br>
<p class="text-dark">
A member of the court registry will review your request and you will receive an email to the address you supplied
which will inform you if the ticket request has been approved or rejected, and what to expect next.
A member of the court registry will review your request and inform you if the ticket request has been approved or rejected, and what to expect next.
<br>
<br>
A confirmation email of the request information will be sent to the email address you supplied.
Expand All @@ -40,8 +39,7 @@ <h1 style="margin: 0;">Your email address could NOT be verified.</h1>
</app-alert>

<div class="d-print-none" *ngIf="verified === false && checking === false">
A member of the court registry will review your request and you will be notified if the ticket request has been
approved or rejected, and what to expect next.
A member of the court registry will review your request and inform you if the ticket request has been approved or rejected, and what to expect next.
<br>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h4>Useful links</h4>

<mat-expansion-panel class="pt-1 pb-1">
<mat-expansion-panel-header>
<mat-panel-title> RoadSafetyBC </mat-panel-title>
<mat-panel-title> Intersection Safety Camera Tickets (RoadSafetyBC) </mat-panel-title>
</mat-expansion-panel-header>
<div class="landing-card-text my-2">
Governing drivers, putting road safety policies in place, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<li>want to raise a defence</li>
</ul>
</div>
<div subHeader class="sub-header">
If you received an Intersection Safety Camera ticket (ticket number starts with an 'S'), click
<a [attr.href]="roadSafetyBCVisitUsLink" target="_blank" rel="noopener">
here
</a> for more information.
</div>
</app-page-header>

<div fxLayout="row" fxLayoutAlign="space-between">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { AppConfigService } from 'app/services/app-config.service';

@Component({
selector: 'app-ticket-landing',
Expand All @@ -7,7 +8,10 @@ import { Component } from '@angular/core';
})

export class TicketLandingComponent {
roadSafetyBCVisitUsLink: string;
constructor(
private appConfigService: AppConfigService
) {
this.roadSafetyBCVisitUsLink = this.appConfigService.roadSafetyBCVisitUsLink;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class DisputeService {
const data: DialogOptions = {
titleKey: "Warning",
actionType: "warn",
messageKey: `You could not be authenticated as the contact noted on this dispute. ` + err,
messageKey: `You could not be authenticated as the contact noted on this dispute as your information does not match your BC Services Card information.`,
actionTextKey: "Close",
cancelHide: true
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Inject, ChangeDetectionStrategy} from '@angular/core';
import { Component, Inject, ChangeDetectionStrategy, HostListener} from '@angular/core';
import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog';
import { MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog';

Expand Down Expand Up @@ -59,5 +59,15 @@ export class ImageTicketNotFoundDialogComponent {
...options,
};
}
@HostListener('document:keydown', ['$event'])
public preventEvent(event: KeyboardEvent): void {
if (/error/i.test(this.options.messageKey)) {
event.preventDefault();
event.stopPropagation();
if (event.key === 'Enter') {
this.dialogRef.close();
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { TabType } from '@shared/enums/tab-type.enum';
import { Dispute } from 'app/services/dispute.service';
import { DisputeStatus } from '@shared/consts/DisputeStatus.model';
import { HearingType } from '@shared/consts/HearingType.model';
import { ChangeDetectorRef } from '@angular/core';

@Component({
selector: 'app-jj-dispute',
Expand Down Expand Up @@ -131,7 +132,8 @@ export class JJDisputeComponent implements OnInit {
private lookupsService: LookupsService,
private config: ConfigService,
private documentService: DocumentService,
private historyRecordService: HistoryRecordService
private historyRecordService: HistoryRecordService,
private cdr: ChangeDetectorRef,
) {
this.authService.jjList$.subscribe(result => {
this.jjList = result;
Expand Down Expand Up @@ -554,18 +556,40 @@ export class JJDisputeComponent implements OnInit {

onUpload(files: FileList) {
if (files.length <= 0) return;

// upload to coms

// Initially, set the status to "waiting for virus scan..."
let item: FileMetadata = {
fileId: '',
fileName: files[0].name,
virusScanStatus: "waiting for virus scan..."
};

// Add the item to the fileData array
this.lastUpdatedJJDispute.fileData.push(item);

// Manually trigger change detection to ensure the UI is refreshed
this.cdr.detectChanges();

// Upload the file
this.documentService.apiDocumentPost(this.lastUpdatedJJDispute.noticeOfDisputeGuid, this.fileTypeToUpload, files[0], this.lastUpdatedJJDispute.id)
.subscribe(fileId => {

// add to display of files in DCF
let item: FileMetadata = { fileId: fileId, fileName: files[0].name, virusScanStatus: "waiting for virus scan..." };
this.lastUpdatedJJDispute.fileData.push(item);
// Once the file is uploaded, update the fileId and status
item.fileId = fileId;
item.virusScanStatus = ""; // or any other status

// Manually trigger change detection again to update the view
this.cdr.detectChanges();

// Call refreshFileHistory() to update the history if needed
this.refreshFileHistory();
}, error => {
// If the upload fails, set an error message
item.virusScanStatus = "upload failed";
this.cdr.detectChanges(); // Ensure the component updates in case of error
});
}


onPrint(isCompleteVersion: boolean) {
var type = DcfTemplateType.DcfTemplate;
if (!isCompleteVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class JJDisputeDigitalCaseFileComponent implements OnInit {

ngOnInit(): void {
let dataFilter: TableFilter = this.tableFilterService.tableFilters[this.tabIndex];
dataFilter.status = dataFilter.status ?? "";
//dataFilter.status = dataFilter.status ?? "";
this.filters = dataFilter;
this.previousFilters = { ...dataFilter };
this.currentPage = this.tableFilterService.currentPage[this.tabIndex];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class DisputeDecisionInboxComponent implements OnInit {

public ngOnInit() {
let dataFilter: TableFilter = this.tableFilterService.tableFilters[this.tabIndex];
dataFilter.status = dataFilter.status ?? "";
//dataFilter.status = dataFilter.status ?? "";
this.filters = dataFilter;
this.previousFilters = { ...dataFilter };
this.currentPage = this.tableFilterService.currentPage[this.tabIndex];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<app-table-filters [tabIndex]="tabIndex" [tableFilterKeys]="tableFilterKeys" [statusFilterOptions]="statusFilterOptions"
[statusFilterDefaultText]="'NEW & VALIDATED'" (onFilterChanged)="onApplyFilter($event)">
<ng-container recordCount>
[statusFilterDefault]="statusFilterDefault" (onFilterChanged)="onApplyFilter($event)">
<ng-container recordCount *ngIf="newCountShow">
<div fxFlex fxFlex.gt-md="20">
<div class="vcenter">
<span class="BC-Gov-15px-black-text" style="color:green;"><b>{{ newCount }} NEW ticket
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DisputeService, Dispute } from 'app/services/dispute.service';
import { DisputeRequestCourtAppearanceYn, DisputeDisputantDetectedOcrIssues, DisputeStatus, DisputeSystemDetectedOcrIssues, PagedDisputeListItemCollection, SortDirection } from 'app/api';
import { LoggerService } from '@core/services/logger.service';
import { AuthService, KeycloakProfile } from 'app/services/auth.service';
import { TableFilter, TableFilterKeys } from '@shared/models/table-filter-options.model';
import { TableFilter, TableFilterKeys, TableFilterStatus, TableFilterStatusOptions, TableFilterStatusDefault } from '@shared/models/table-filter-options.model';
import { TableFilterService } from 'app/services/table-filter.service';

@Component({
Expand All @@ -22,7 +22,8 @@ export class TicketInboxComponent implements OnInit {
dataSource = new MatTableDataSource(this.disputes);

tableFilterKeys: TableFilterKeys[] = ["dateSubmittedFrom", "dateSubmittedTo", "disputantSurname", "status", "ticketNumber"];
statusFilterOptions = [DisputeStatus.New, DisputeStatus.Processing, DisputeStatus.Validated, DisputeStatus.Rejected, DisputeStatus.Cancelled, DisputeStatus.Concluded];
statusFilterOptions = TableFilterStatusOptions;
statusFilterDefault = TableFilterStatusDefault;

displayedColumns: string[] = [
'__RedGreenAlert',
Expand All @@ -47,6 +48,7 @@ export class TicketInboxComponent implements OnInit {
sortBy: Array<string> = ["submittedTs"];
sortDirection: Array<SortDirection> = [SortDirection.Desc];
newCount: number = 0;
newCountShow: boolean = false;
filters: TableFilter = new TableFilter();
previousFilters: TableFilter = new TableFilter();

Expand All @@ -71,7 +73,7 @@ export class TicketInboxComponent implements OnInit {

// when authentication token available, get data
let dataFilter: TableFilter = this.tableFilterService.tableFilters[this.tabIndex];
dataFilter.status = dataFilter.status ?? "";
//dataFilter.status = dataFilter.status ?? [];
this.filters = dataFilter;
this.previousFilters = { ...dataFilter };
this.currentPage = this.tableFilterService.currentPage[this.tabIndex];
Expand Down Expand Up @@ -129,6 +131,8 @@ export class TicketInboxComponent implements OnInit {
this.filters = dataFilters;
this.previousFilters = { ...dataFilters };
this.getAllDisputes();

this.newCountShow = (this.filters && this.filters.status) ? this.filters.status.mapping.includes(DisputeStatus.New) : false;
}

backWorkbench(element) {
Expand Down
Loading

0 comments on commit 5e2d898

Please sign in to comment.