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 src/app/custom1-module/customComponentMappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ 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<string, any>([
['nde-footer-after', Libraryh3lpComponent],
['nde-account-section-results-before', PayFinesComponent],
['nde-full-display-service-container-after', NdeProblemReportCustom],
['nde-top-bar-after', LibraryAlertsPannelComponent],
['nde-search-no-results-before', TrafficResultLimitComponent]
]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div *ngIf="showComponent" class="search-limit">
<div class="search-limit-content">
<p>Your search results are limited to a maximum of 500 results. If you need assistance refining your search
please access the Library <a target="_self"
href="https://lib.k-state.edu/services-support/research-help/">Research Help</a> page.</p>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.search-limit {
border-style: solid;
border-width: 2px;
padding: 0.5rem;
}
44 changes: 44 additions & 0 deletions src/app/traffic-result-limit/traffic-result-limit.component.ts
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
Loading