Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion src/app/custom1-module/customComponentMappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TrafficResultLimitComponent } from '../traffic-result-limit/traffic-res
// Define the map
export const selectorComponentMap = new Map<string, any>([
['nde-footer-after', Libraryh3lpComponent],
['nde-account-section-results-before', PayFinesComponent],
['nde-fines-before', PayFinesComponent],
['nde-full-display-service-container-after', NdeProblemReportCustom],
['nde-top-bar-after', LibraryAlertsPannelComponent],
['nde-search-no-results-before', TrafficResultLimitComponent]
Expand Down
89 changes: 45 additions & 44 deletions src/app/traffic-result-limit/traffic-result-limit.component.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
import { Component, OnInit } from '@angular/core';
import { Location, NgIf } from '@angular/common';

@Component({
selector: 'custom-traffic-result-limit',
standalone: true,
imports: [NgIf],
templateUrl: './traffic-result-limit.component.html',
styleUrl: './traffic-result-limit.component.scss',
})
export class TrafficResultLimitComponent implements OnInit {
showComponent: boolean = false;
offsetValue: number | null = null;

constructor(private location: Location) {}

ngOnInit(): void {
this.checkOffset();
}

checkOffset(): void {
const url = this.location.path();
const queryString = url.includes('?') ? url.split('?')[1] : '';

if (!queryString) {
this.showComponent = false;
return;
}

const urlParams = new URLSearchParams(queryString);
const offsetParam = urlParams.get('offset');

if (offsetParam) {
const offsetValue = parseInt(offsetParam, 10);
if (!isNaN(offsetValue) && offsetValue > 500) {
this.showComponent = true;
} else {
this.showComponent = false;
}
} else {
this.showComponent = false;
}
}
}
import { Component, OnInit } from '@angular/core';
import { Location, NgIf } from '@angular/common';

@Component({
selector: 'custom-traffic-result-limit',
standalone: true,
imports: [NgIf],
templateUrl: './traffic-result-limit.component.html',
styleUrl: './traffic-result-limit.component.scss',
})
export class TrafficResultLimitComponent implements OnInit {
showComponent: boolean = false;
offsetValue: number | null = null;

constructor(private location: Location) {}

ngOnInit(): void {
this.checkOffset();
}

checkOffset(): void {
const url = this.location.path();
const queryString = url.includes('?') ? url.split('?')[1] : '';

if (!queryString) {
this.showComponent = false;
return;
}

const urlParams = new URLSearchParams(queryString);
const offsetParam = urlParams.get('offset');

if (offsetParam) {
const offsetValue = parseInt(offsetParam, 10);
// if the user uses the navigation button, this will display with the offset is `550`. If `500` is mannually added to the `offset` parameter within the browser url box, this will not dispaly if the the below function is set to `offsetValue > 500`. Think about making this change within production before going live.
if (!isNaN(offsetValue) && offsetValue >= 0) {
this.showComponent = true;
} else {
this.showComponent = false;
}
} else {
this.showComponent = false;
}
}
}
Loading