diff --git a/src/app/custom1-module/customComponentMappings.ts b/src/app/custom1-module/customComponentMappings.ts index e7d88d3f..f4a78171 100644 --- a/src/app/custom1-module/customComponentMappings.ts +++ b/src/app/custom1-module/customComponentMappings.ts @@ -2,6 +2,7 @@ import { LibraryAlertsPannelComponent } from '../library-alerts-pannel/library-a import { Libraryh3lpComponent } from '../libraryh3lp/libraryh3lp.component'; import { NdeProblemReportCustom } from '../nde-problem-report-custom/nde-problem-report-custom.component'; import { PayFinesComponent } from '../pay-fines/pay-fines.component'; +import { TrafficResultLimitComponent } from '../traffic-result-limit/traffic-result-limit.component'; // Define the map export const selectorComponentMap = new Map([ @@ -9,4 +10,5 @@ export const selectorComponentMap = new Map([ ['nde-account-section-results-before', PayFinesComponent], ['nde-full-display-service-container-after', NdeProblemReportCustom], ['nde-top-bar-after', LibraryAlertsPannelComponent], + ['nde-search-no-results-before', TrafficResultLimitComponent] ]); diff --git a/src/app/traffic-result-limit/traffic-result-limit.component.html b/src/app/traffic-result-limit/traffic-result-limit.component.html new file mode 100644 index 00000000..12949b16 --- /dev/null +++ b/src/app/traffic-result-limit/traffic-result-limit.component.html @@ -0,0 +1,7 @@ +
+
+

Your search results are limited to a maximum of 500 results. If you need assistance refining your search + please access the Library Research Help page.

+
+
\ No newline at end of file diff --git a/src/app/traffic-result-limit/traffic-result-limit.component.scss b/src/app/traffic-result-limit/traffic-result-limit.component.scss new file mode 100644 index 00000000..080a03eb --- /dev/null +++ b/src/app/traffic-result-limit/traffic-result-limit.component.scss @@ -0,0 +1,5 @@ +.search-limit { + border-style: solid; + border-width: 2px; + padding: 0.5rem; +} \ No newline at end of file diff --git a/src/app/traffic-result-limit/traffic-result-limit.component.ts b/src/app/traffic-result-limit/traffic-result-limit.component.ts new file mode 100644 index 00000000..631fc1ae --- /dev/null +++ b/src/app/traffic-result-limit/traffic-result-limit.component.ts @@ -0,0 +1,44 @@ + 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; + } + } + } \ No newline at end of file