Skip to content

LNK-4924: Added Search field to Report Dashboard and Facility View Re… - #1515

Merged
arianamihailescu merged 4 commits into
devfrom
LNK-4924-Add-SearchFieldsReportScreen
Mar 24, 2026
Merged

LNK-4924: Added Search field to Report Dashboard and Facility View Re…#1515
arianamihailescu merged 4 commits into
devfrom
LNK-4924-Add-SearchFieldsReportScreen

Conversation

@arianamihailescu

@arianamihailescu arianamihailescu commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

🛠️ Description of Changes

Added Search field to Report Dashboard and Facility View Report pages.
Added deleted facilities to the facilities displayed in the search fields if show deleted is checked

🧪 Testing Performed

Tested locally

🧑‍🔬 Unit Testing

  • I have written or updated unit tests to cover my changes
  • Coverage: 0.0%

📓 Documentation Updated

Please update any relevant sections in the project documentation that were impacted by the changes in the PR.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added "Created Date" filter to report searches.
    • Added "Reporting Period" date range filtering for reports.
    • Facility selector now uses autocomplete dropdown instead of text input.
    • Deleted items visibility now applies to facility list filtering.
  • Style

    • Updated form field styling to outline appearance.
    • Enhanced filter bar UI layout and spacing with improved visual hierarchy.

…port pages.

Added deleted facilities to the facilities displayed in the search fields if show deleted is checked
@coderabbitai

coderabbitai Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 639271e9-a48e-44fd-b9a4-0fa16a6997ac

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request adds a creation date filter capability across the reporting stack. The backend propagates a new createDate query parameter through the report API layers and applies same-day filtering logic in the database query. The frontend introduces reactive facility autocomplete controls, new date range pickers, and updates service methods to pass the creation date filter alongside existing parameters.

Changes

Cohort / File(s) Summary
Backend Report API Layer
DotNet/Admin.BFF/Application/Clients/ReportService.cs, DotNet/Admin.BFF/Presentation/Endpoints/.../GetReportSummaries.cs
Added optional createDate parameter to method signatures; conditionally appends ISO-8601 formatted createDate query string parameter when provided.
Backend Report Manager
DotNet/Report/Business/Managers/ReportScheduledManager.cs, DotNet/Report/Controllers/ReportScheduleController.cs
Implemented createDate filtering logic that constrains results to records created on the same calendar day; added parameter propagation and cancellation token handling in controller.
Backend Tenant/Facility
DotNet/Tenant/Controllers/FacilityController.cs
Now forwards includeDeleted query parameter to facility search queries; previously omitted this parameter.
Frontend Report Service & Interface
Web/Admin.UI/src/app/services/gateway/report/report.service.ts, Web/Admin.UI/src/app/interfaces/report/report-schedule.interface.ts
Added optional createDate parameter to searchReportSchedules(); renamed IsDeleted to isDeleted for property casing consistency.
Frontend Tenant Service
Web/Admin.UI/src/app/services/gateway/tenant/tenant.service.ts
Updated getAllFacilities() and autocompleteFacilities() to accept and forward includeDeleted boolean flag in query parameters.
Frontend Report Dashboard Component
Web/Admin.UI/src/app/components/reports/reports-dashboard/reports-dashboard.component.ts, ...component.html, ...component.scss
Major overhaul: switched facility filter from plain string to reactive FormControl with autocomplete; added createDateFilter and split date range into separate "Created Date" and "Reporting Period" pickers; implemented facility autocomplete with deleted-visibility toggling; updated filter lifecycle and status timestamp display.
Frontend Facility View Component
Web/Admin.UI/src/app/components/tenant/facility-view/facility-view.component.ts, ...component.html, ...component.scss
Added filter bar UI with status, frequency, and date range filters; implemented applyFilters(), clearFilters(), and hasActiveFilters() methods; updated Material form-field appearance and added extensive styling for filter layout.
Frontend Acquisition Log Component
Web/Admin.UI/src/app/components/tenant/acquisition-log/acquisition-log-view/acquisition-log-view.component.ts, ...component.html
Deferred filter application to new onIncludeDeletedChange() handler; now refreshes facility list and resets selected facility if it becomes unavailable when toggling deleted visibility.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • amphillipsLGC
  • dvargaslantana
  • smailliwcs

Poem

🐰 Filters bloom like clover in the spring,
Creation dates now make our reports sing,
With autocomplete and date-range delight,
The dashboard sparkles, a beautiful sight!
✨ Let the deleted stay hidden away,
While fresh reports dance in the light of the day!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title is partially related to the changeset, referring to adding search fields to Report Dashboard and Facility View, but it is truncated and does not fully convey the complete scope of changes including the createDate filter and deleted facilities functionality.
Description check ✅ Passed The description covers the main changes (search fields, deleted facilities) and mentions local testing, but lacks detail on the specific createDate filter implementation and does not address documentation updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch LNK-4924-Add-SearchFieldsReportScreen

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

… LNK-4924-Add-SearchFieldsReportScreen

# Conflicts:
#	Web/Admin.UI/src/app/components/reports/reports-dashboard/reports-dashboard.component.html

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
DotNet/Tenant/Controllers/FacilityController.cs (1)

149-164: ⚠️ Potential issue | 🟡 Minor

Missing input sanitization on search parameter.

The search query parameter should be sanitized before use, consistent with other endpoints in this controller (e.g., GetFacilities sanitizes facilityId, facilityName, sortBy). As per coding guidelines: "The HtmlInputSanitizer class's Sanitize() and SanitizeAndRemove() methods should be used when dealing with string query parameters from REST requests."

Proposed fix
 public async Task<IActionResult> GetFacilityList([FromQuery] string? search, bool includeDeleted = false)
 {
     try
     {
+        search = search?.Sanitize();
         FacilitySearchModel searchModel = new FacilitySearchModel();
         if (!string.IsNullOrEmpty(search))
         {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@DotNet/Tenant/Controllers/FacilityController.cs` around lines 149 - 164,
GetFacilityList reads the raw search query into FacilitySearchModel without
sanitizing; before assigning to searchModel.FacilityName use the
HtmlInputSanitizer (call Sanitize or SanitizeAndRemove as appropriate) on the
incoming search string to strip unsafe input, then set FacilityName and
FacilityNameContains and proceed to call _facilityQueries.SearchAsync; ensure
the same sanitizer is used as in other controller methods (e.g., GetFacilities)
so the input is consistently cleaned before constructing the
FacilitySearchModel.
DotNet/Report/Controllers/ReportScheduleController.cs (1)

241-269: ⚠️ Potential issue | 🟡 Minor

Document the new createDate query parameter.

The XML comments stop at pageNumber, so this filter will be exposed without any description of what day semantics it uses. Please add a <param name="createDate"> entry here. As per coding guidelines, "Implement Swagger/OpenAPI documentation for every API."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@DotNet/Report/Controllers/ReportScheduleController.cs` around lines 241 -
269, Add an XML <param name="createDate"> entry to the Search method's
documentation in ReportScheduleController (the Search(...) action) describing
the new createDate query parameter as an optional filter that matches schedules
created on the specified date; clarify the day semantics (treats the value as a
date-only filter matching any timestamp on that calendar day, inclusive of the
day's start and end, and specify whether it uses UTC or server/local time per
project convention). Ensure the new <param> follows the same style as the other
parameters.
🧹 Nitpick comments (2)
Web/Admin.UI/src/app/components/tenant/facility-view/facility-view.component.html (1)

91-141: Pick one filtering interaction model.

These selects/date pickers already call applyFilters() on every change, so the Apply button is redundant and each intermediate tweak fires a new request. If this screen should follow the manual pattern used elsewhere, remove the per-control change handlers and let the explicit Apply action own reloads. Based on learnings, the team prefers manual filtering with an explicit applyFilters() action rather than per-control change handlers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Web/Admin.UI/src/app/components/tenant/facility-view/facility-view.component.html`
around lines 91 - 141, Remove the per-control automatic submissions and rely
solely on the explicit Apply button: delete all
(selectionChange)="applyFilters()" on the mat-selects and all
(dateChange)="applyFilters()" on the date inputs so statusFilter,
frequencyFilter, createDateFilter, reportStartDateFilter and reportEndDateFilter
only update via ngModel; keep the Apply button wired to applyFilters() and Clear
button to clearFilters()/hasActiveFilters() so manual filtering behavior is
preserved.
Web/Admin.UI/src/app/components/reports/reports-dashboard/reports-dashboard.component.html (1)

45-92: Pick one filtering interaction model.

These selects/date pickers already call applyFilters() on every change, so the Apply button is redundant and each intermediate tweak fires a new request. If this screen is meant to use explicit filtering, remove the per-control change handlers and let the Apply action own reloads. Based on learnings, the team prefers manual filtering with an explicit applyFilters() action rather than per-control change handlers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Web/Admin.UI/src/app/components/reports/reports-dashboard/reports-dashboard.component.html`
around lines 45 - 92, The template currently calls applyFilters() on each
control change ((selectionChange) and (dateChange)), causing immediate reloads;
since we want an explicit/manual filter model, remove the per-control change
handlers from the status/frequency mat-selects and the createDate/start/end date
inputs so they only update bound properties (statusFilter, frequencyFilter,
createDateFilter, reportStartDateFilter, reportEndDateFilter) and rely on the
existing Apply button's (click)="applyFilters()" to trigger filtering; leave
clearFilters()/hasActiveFilters() behavior as-is for the Clear button.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@DotNet/Report/Business/Managers/ReportScheduledManager.cs`:
- Around line 234-239: The current filter builds day bounds from a server
timestamp (createDate.Value.Date) which causes timezone off-by-one errors for
ReportSchedule.CreateDate; update the predicate in ReportScheduledManager (the
block using createDate, dayStart, dayEnd and predicate.And) to use explicit UTC
date bounds (e.g., interpret the incoming createDate as a date-only in a
documented timezone, convert to UTC start-of-day and end-of-day offsets, and
compare CreateDate converted to UTC) or switch to a date-only comparison
(DateOnly) so comparisons are timezone-safe; also add XUnit tests covering
createDate == null and the boundary cases (exactly at start and end-of-day in
both server and non-server timezones) so each branch is covered.

In
`@Web/Admin.UI/src/app/components/reports/reports-dashboard/reports-dashboard.component.ts`:
- Around line 155-156: The reportEndDateFilter is sent raw to the API while the
backend treats it as inclusive, causing same-day results to be dropped; before
the API call in ReportsDashboardComponent, normalize reportEndDateFilter by
converting it to an end-of-day timestamp (set time to 23:59:59.999) or
alternatively advance it by one day and send that as an exclusive upper bound,
then pass that normalized value instead of this.reportEndDateFilter (keep
reportStartDateFilter unchanged); update the place where these values are
assembled (the code around the this.reportStartDateFilter /
this.reportEndDateFilter usage) to perform this normalization.
- Around line 120-126: The facility textbox and filter logic are out of sync:
typed edits to facilityInputControl never update selectedFacilityId so requests
keep using a stale ID or none; fix by syncing the ID with control edits and
selection events — when the user selects a suggestion set selectedFacilityId to
that facilityId (handle the option selection/selection event), and on
valueChanges (in filteredFacilities pipeline or a separate subscriber) clear
selectedFacilityId whenever the typed text no longer equals the selected
facilityName; alternatively change the Apply/Enter filter logic to derive the
requested facility filter directly from facilityInputControl.value instead of
selectedFacilityId. Update the code referencing filteredFacilities,
facilityInputControl, selectedFacilityId and
tenantService.autocompleteFacilities (and repeat the same fix for the other
occurrences mentioned) so the textbox and selected ID stay consistent.

In
`@Web/Admin.UI/src/app/components/tenant/acquisition-log/acquisition-log-view/acquisition-log-view.component.ts`:
- Around line 394-405: The onIncludeDeletedChange method calls applyFilters()
immediately after subscribing to tenantService.getAllFacilities, causing a race
where filters run before facilities are updated; move the applyFilters() call
into the subscription handlers so filters are applied after facilities are
loaded (inside the next callback after setting facilityFilterOptions and
possibly resetting selectedFacilityFilter) and also call applyFilters() in the
error callback to ensure consistent behavior when the request fails.

In
`@Web/Admin.UI/src/app/components/tenant/facility-view/facility-view.component.ts`:
- Around line 186-187: The reportEndDateFilter is sent as-is but backend treats
ReportEndDate as inclusive, so normalize reportEndDateFilter before the API call
in facility-view.component.ts (where reportStartDateFilter and
reportEndDateFilter are passed) by converting it to an end-of-day timestamp (set
time to 23:59:59.999) or by converting it to an exclusive next-day bound (add
one day and use exclusive comparison) so reports on the selected day are not
dropped; update the code that constructs the request payload to use the
normalizedReportEndDate instead of raw reportEndDateFilter.

---

Outside diff comments:
In `@DotNet/Report/Controllers/ReportScheduleController.cs`:
- Around line 241-269: Add an XML <param name="createDate"> entry to the Search
method's documentation in ReportScheduleController (the Search(...) action)
describing the new createDate query parameter as an optional filter that matches
schedules created on the specified date; clarify the day semantics (treats the
value as a date-only filter matching any timestamp on that calendar day,
inclusive of the day's start and end, and specify whether it uses UTC or
server/local time per project convention). Ensure the new <param> follows the
same style as the other parameters.

In `@DotNet/Tenant/Controllers/FacilityController.cs`:
- Around line 149-164: GetFacilityList reads the raw search query into
FacilitySearchModel without sanitizing; before assigning to
searchModel.FacilityName use the HtmlInputSanitizer (call Sanitize or
SanitizeAndRemove as appropriate) on the incoming search string to strip unsafe
input, then set FacilityName and FacilityNameContains and proceed to call
_facilityQueries.SearchAsync; ensure the same sanitizer is used as in other
controller methods (e.g., GetFacilities) so the input is consistently cleaned
before constructing the FacilitySearchModel.

---

Nitpick comments:
In
`@Web/Admin.UI/src/app/components/reports/reports-dashboard/reports-dashboard.component.html`:
- Around line 45-92: The template currently calls applyFilters() on each control
change ((selectionChange) and (dateChange)), causing immediate reloads; since we
want an explicit/manual filter model, remove the per-control change handlers
from the status/frequency mat-selects and the createDate/start/end date inputs
so they only update bound properties (statusFilter, frequencyFilter,
createDateFilter, reportStartDateFilter, reportEndDateFilter) and rely on the
existing Apply button's (click)="applyFilters()" to trigger filtering; leave
clearFilters()/hasActiveFilters() behavior as-is for the Clear button.

In
`@Web/Admin.UI/src/app/components/tenant/facility-view/facility-view.component.html`:
- Around line 91-141: Remove the per-control automatic submissions and rely
solely on the explicit Apply button: delete all
(selectionChange)="applyFilters()" on the mat-selects and all
(dateChange)="applyFilters()" on the date inputs so statusFilter,
frequencyFilter, createDateFilter, reportStartDateFilter and reportEndDateFilter
only update via ngModel; keep the Apply button wired to applyFilters() and Clear
button to clearFilters()/hasActiveFilters() so manual filtering behavior is
preserved.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9a7a1709-95a7-4adf-9341-12d754ca02c5

📥 Commits

Reviewing files that changed from the base of the PR and between 6ac6836 and 65d21d1.

📒 Files selected for processing (16)
  • DotNet/Admin.BFF/Application/Clients/ReportService.cs
  • DotNet/Admin.BFF/Presentation/Endpoints/Aggregation/Handlers/Report/GetReportSummaries.cs
  • DotNet/Report/Business/Managers/ReportScheduledManager.cs
  • DotNet/Report/Controllers/ReportScheduleController.cs
  • DotNet/Tenant/Controllers/FacilityController.cs
  • Web/Admin.UI/src/app/components/reports/reports-dashboard/reports-dashboard.component.html
  • Web/Admin.UI/src/app/components/reports/reports-dashboard/reports-dashboard.component.scss
  • Web/Admin.UI/src/app/components/reports/reports-dashboard/reports-dashboard.component.ts
  • Web/Admin.UI/src/app/components/tenant/acquisition-log/acquisition-log-view/acquisition-log-view.component.html
  • Web/Admin.UI/src/app/components/tenant/acquisition-log/acquisition-log-view/acquisition-log-view.component.ts
  • Web/Admin.UI/src/app/components/tenant/facility-view/facility-view.component.html
  • Web/Admin.UI/src/app/components/tenant/facility-view/facility-view.component.scss
  • Web/Admin.UI/src/app/components/tenant/facility-view/facility-view.component.ts
  • Web/Admin.UI/src/app/interfaces/report/report-schedule.interface.ts
  • Web/Admin.UI/src/app/services/gateway/report/report.service.ts
  • Web/Admin.UI/src/app/services/gateway/tenant/tenant.service.ts

Comment thread DotNet/Report/Business/Managers/ReportScheduledManager.cs
Comment thread Web/Admin.UI/src/app/components/tenant/facility-view/facility-view.component.ts Outdated
@arianamihailescu
arianamihailescu merged commit 51dd9d7 into dev Mar 24, 2026
18 checks passed
@arianamihailescu
arianamihailescu deleted the LNK-4924-Add-SearchFieldsReportScreen branch March 24, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants