Skip to content

Add a full text complaint search field - #886

Draft
dougwaldron wants to merge 2 commits into
mainfrom
884-simplified-search-form
Draft

Add a full text complaint search field#886
dougwaldron wants to merge 2 commits into
mainfrom
884-simplified-search-form

Conversation

@dougwaldron

Copy link
Copy Markdown
Member

No description provided.

@dougwaldron dougwaldron linked an issue Mar 5, 2025 that may be closed by this pull request
@dougwaldron dougwaldron self-assigned this Mar 5, 2025
@dougwaldron
dougwaldron requested a review from Copilot March 5, 2025 16:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PR Overview

This PR introduces a full text complaint search field and updates related components to support broader text queries.

  • Replaces the old ContainsText filter with a new ContainsDetails method and adds a ContainsAnyText filter across multiple text fields.
  • Adds a new property (Text) to the search DTO and updates the UI to include a text search input.
  • Updates the changelog to document the fixes and improvements in complaint search functionality.

Reviewed Changes

File Description
src/AppServices/Complaints/ComplaintFilters.cs Updated filter methods to use expression-based text search and replaced the ContainsText method with ContainsDetails and ContainsAnyText.
CHANGELOG.md Updated entries to reflect search fixes and UI improvements.
src/AppServices/Complaints/QueryDto/ComplaintSearchDto.cs Added a new Text property for full text search and updated display names accordingly.
src/WebApp/Pages/Staff/Complaints/Index.cshtml Added a new input field for text search and updated header levels for better UI structure.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

src/AppServices/Complaints/ComplaintFilters.cs:233

  • [nitpick] Consider adding explicit parentheses in the aggregate OR expression chain to ensure the intended operator precedence and improve code clarity.
input.Split(' ', StringSplitOptions.RemoveEmptyEntries).Aggregate(predicate, (current, term) =>

src/WebApp/Pages/Staff/Complaints/Index.cshtml:176

  • [nitpick] Review the change in header level from

    to

    for 'Source Contact' to ensure it maintains the intended semantic hierarchy and accessibility.

<h3 class="h5">Source Contact</h3>

src/AppServices/Complaints/QueryDto/ComplaintSearchDto.cs:149

  • Verify that the 'Contact' property is defined in this record or inherited from IBasicSearchDisplay to avoid potential compilation issues.
Contact = Contact?.Trim(),

@dougwaldron
dougwaldron force-pushed the 884-simplified-search-form branch from 0b107f8 to 0161ed7 Compare March 21, 2025 13:03
@sonarqubecloud

Copy link
Copy Markdown

@dougwaldron

Copy link
Copy Markdown
Member Author

This is not ready for production as is. Some issues that need to be resolved:

  • It's too slow. This change would require moving the SQL to a view and stored procedure.
  • It's confusing. It allows partial word matches, and it doesn't allow matching phrases, both of which go against user expectations.

@dougwaldron
dougwaldron marked this pull request as draft March 31, 2025 17:52
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.

Add a full text complaint search field

2 participants