Skip to content

feat: Guard search queries against common mistakes #6404

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

Merged
merged 16 commits into from
Mar 2, 2023
Merged

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Mar 1, 2023

Invalid enums, invalid query parameters, duplicate params, etc.

Fixes some of #5829. Still need more UX to assist.

Demo

A bunch of errors you can get.

Duplicate query params

Screenshot from 2023-03-01 13-50-58

Invalid Params

Screenshot from 2023-03-01 13-52-14

Future Work

Make all search bar pages consistent.

Workspaces page

  • Error above and below search bar, no toast error
  • Refreshes every 5s

Screenshot from 2023-03-01 13-22-02

Users & Audit page

  • Error under search bar
  • Toast error

Screenshot from 2023-03-01 13-22-34

Screenshot from 2023-03-01 13-23-14

@Emyrk Emyrk marked this pull request as ready for review March 1, 2023 19:53
@Emyrk Emyrk requested review from Kira-Pilot, mtojek and a team and removed request for mtojek March 1, 2023 19:59
@deansheather deansheather self-requested a review March 1, 2023 20:00
@Kira-Pilot
Copy link
Member

Nice job!

I noticed we have a bit of a bizarre error message on the audit page filter:
Screenshot 2023-03-01 at 4 02 44 PM
Is it an easy fix to normalize this so it matches the error messages on other pages? We can't really be sure a user meant to filter on resource_type.

Another small thing: forgoing a filter totally doesn't yield an error message:
Screenshot 2023-03-01 at 4 00 57 PM

@Emyrk
Copy link
Member Author

Emyrk commented Mar 1, 2023

Nice job!

I noticed we have a bit of a bizarre error message on the audit page filter: Screenshot 2023-03-01 at 4 02 44 PM Is it an easy fix to normalize this so it matches the error messages on other pages? We can't really be sure a user meant to filter on resource_type.

Another small thing: forgoing a filter totally doesn't yield an error message: Screenshot 2023-03-01 at 4 00 57 PM

resource_type is the default search parameter if nothing is given. I could make it something else? But as is, if you do not specify a param, then it is implied as resource_type.

Good catch on the empty param

@Emyrk Emyrk merged commit 8cf292f into main Mar 2, 2023
@Emyrk Emyrk deleted the stevenmasley/search branch March 2, 2023 05:28
@github-actions github-actions bot locked and limited conversation to collaborators Mar 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants