Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose regexp search and bookmarkable URLs for filtered incidents table #1570

Closed
srabraham opened this issue Feb 1, 2025 · 0 comments
Closed
Assignees

Comments

@srabraham
Copy link
Member

I was reading over the IMS-related Ranger Ops Debrief issues from the last several years, and the search functionality is a common source of frustration.

The DataTables "smart" search tokenizes the input string, then filters the incidents to any that contain all of those words. That allows for only pretty limited searching.

DataTables does support regexps for searching, and I think we want to expose that in a limited fashion, for power users or for specific use cases.

A great use case was put forward in 2019 by the Command Cadre, who want to be able to see all incidents that contain any of a list of words. Let's say they want incidents containing "dog", "cat", or "snake". The smart search feature doesn't support that sort of thing. Instead, we could easily just do a regexp search for "(dog|cat|snake)" and that ought to be fine. It'd be better still if they could bookmark a URL like https://ranger-ims/.../incidents/?q="(dog|cat|snake)" so that they could jump right to the filtered view they want to see.

@srabraham srabraham self-assigned this Feb 1, 2025
srabraham added a commit that referenced this issue Feb 1, 2025
I don't expect most users to notice this feature, which is totally fine
by me. The major use case for this is to allow "OR"-based searching,
which the current DataTables "smart search" approach doesn't support.

For example, this will let someone bookmark this (not URL-encoded here,
for clarity):
https://.../ims/app/events/2024/incidents/?q=/\b(dog|cat|snake)\b/
to easily find any incident that contains the word "dog" or "cat" or
"snake". The word boundary check might be useful too, as shown in that
example.

#1570
srabraham added a commit that referenced this issue Feb 1, 2025
I don't expect most users to notice this feature, which is totally fine
by me. The major use case for this is to allow "OR"-based searching,
which the current DataTables "smart search" approach doesn't support.

For example, this will let someone bookmark this (not URL-encoded here,
for clarity):
https://.../ims/app/events/2024/incidents/?q=/\b(dog|cat|snake)\b/
to easily find any incident that contains the word "dog" or "cat" or
"snake". The word boundary check might be useful too, as shown in that
example.

#1570
srabraham added a commit that referenced this issue Feb 1, 2025
I don't expect most users to notice this feature, which is totally fine
by me. The major use case for this is to allow "OR"-based searching,
which the current DataTables "smart search" approach doesn't support.

For example, this will let someone bookmark this (not URL-encoded here,
for clarity):
https://.../ims/app/events/2024/incidents/?q=/\b(dog|cat|snake)\b/
to easily find any incident that contains the word "dog" or "cat" or
"snake". The word boundary check might be useful too, as shown in that
example.

#1570
srabraham added a commit that referenced this issue Feb 5, 2025
This makes bookmarking a lot more intuitive, since the URL
will always reflect the current state of the search field.
This approach works on the client-side to replace that URL,
using pushState.

After this, I plan to create query params for the other filters
on the Incidents and Field Reports pages, then add those values
to this updated URL as well.

#1570
srabraham added a commit that referenced this issue Feb 5, 2025
This makes bookmarking a lot more intuitive, since the URL
will always reflect the current state of the search field.
This approach works on the client-side to replace that URL,
using pushState.

After this, I plan to create query params for the other filters
on the Incidents and Field Reports pages, then add those values
to this updated URL as well.

#1570
@srabraham srabraham changed the title Expose a better search for the incidents table Expose regexp search and bookmarkable URLs for filtered incidents table Feb 6, 2025
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

No branches or pull requests

1 participant