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

Saved queries new UI #8469

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

amsiglan
Copy link
Collaborator

@amsiglan amsiglan commented Oct 3, 2024

Description

This PR updates the UI for saved queries to use Flyouts which give more surface to search and categorize the queries as well as introduce more options when saving them.

Screenshot

  • Saved queries action popup
image
  • Save query action item when clicked opens
image
  • Open query action item when clicked opens
image
  • Templates tab (Note: these queries cannot be deleted from UI)
image

Testing the changes

Tested change with local setup.

Changelog

  • feat: Enhances the saved query UX

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 6.72646% with 208 lines in your changes missing coverage. Please review.

Project coverage is 60.74%. Comparing base (9a25d0d) to head (5a21c1d).

Files with missing lines Patch % Lines
...lugins/data/public/ui/saved_query_form/helpers.tsx 0.00% 64 Missing ⚠️
...ui/saved_query_flyouts/open_saved_query_flyout.tsx 0.00% 63 Missing ⚠️
...public/ui/saved_query_flyouts/saved_query_card.tsx 0.00% 42 Missing ⚠️
...ry_management/saved_query_management_component.tsx 21.42% 10 Missing and 1 partial ⚠️
...ta/public/query/saved_query/saved_query_service.ts 58.82% 4 Missing and 3 partials ⚠️
...ublic/ui/saved_query_flyouts/save_query_flyout.tsx 0.00% 7 Missing ⚠️
...c/plugins/data/public/ui/search_bar/search_bar.tsx 0.00% 6 Missing ⚠️
...ugins/data/public/ui/filter_bar/filter_options.tsx 20.00% 2 Missing and 2 partials ⚠️
...ata/public/ui/saved_query_form/save_query_form.tsx 0.00% 3 Missing ⚠️
...nagement/delete_saved_query_confirmation_modal.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8469      +/-   ##
==========================================
- Coverage   60.84%   60.74%   -0.11%     
==========================================
  Files        3793     3798       +5     
  Lines       90486    90646     +160     
  Branches    14212    14254      +42     
==========================================
+ Hits        55057    55061       +4     
- Misses      31939    32089     +150     
- Partials     3490     3496       +6     
Flag Coverage Δ
Linux_1 29.07% <0.00%> (-0.01%) ⬇️
Linux_2 56.39% <ø> (ø)
Linux_3 37.57% <6.72%> (-0.10%) ⬇️
Linux_4 29.83% <0.00%> (-0.01%) ⬇️
Windows_1 29.08% <0.00%> (-0.01%) ⬇️
Windows_2 56.35% <ø> (ø)
Windows_3 37.57% <6.72%> (-0.10%) ⬇️
Windows_4 29.83% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

amsiglan and others added 3 commits October 16, 2024 22:08
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

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

Didnt get a chance to review the whole thing yet. But a quick question on saved query templates. I see you added the tab, but I couldnt find a way in the UI to create them. Also if our plan is to include them dynamically, can we hide the tab if there arent any present? Having an empty tab there for most users is bad UX

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@amsiglan
Copy link
Collaborator Author

Didnt get a chance to review the whole thing yet. But a quick question on saved query templates. I see you added the tab, but I couldnt find a way in the UI to create them. Also if our plan is to include them dynamically, can we hide the tab if there arent any present? Having an empty tab there for most users is bad UX

Will follow up with another PR to update the UI with either:

  • Add a way to support template creation OR
  • Hide the template tab when there are no templates

Another angle is that now since we will always have some sample queries that we show where there are no results, we could package them as templates as well.

Will work on the best path forward and create a follow up PR

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Copy link
Collaborator

@virajsanghvi virajsanghvi left a comment

Choose a reason for hiding this comment

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

There are tests failing related to saved queries.

Also, we've added a lot of code without tests - how are we tracking following up with those tests?

src/plugins/data/public/ui/search_bar/search_bar.tsx Outdated Show resolved Hide resolved
src/plugins/data/public/ui/_index.scss Outdated Show resolved Hide resolved
}, [savedQueries, searchQuery, activePage, itemsPerPage]);

const onChange: EuiSearchBarProps['onChange'] = ({ query, error }) => {
if (!error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what if there is an error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It will show no results which is fine since user will simply need to change the search query

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@amsiglan
Copy link
Collaborator Author

There are tests failing related to saved queries.

Also, we've added a lot of code without tests - how are we tracking following up with those tests?

Let me add a task on myself to add new tests

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Copy link
Collaborator

@virajsanghvi virajsanghvi left a comment

Choose a reason for hiding this comment

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

I did not have time to pull this down to validate, and looks like there are still some more cases of text to be localized, but approving assuming that and unit tests will be followed up with.

{
type: 'field_value_selection',
field: 'datasetType',
name: 'Data type',
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this label presented to customers as should it be localized?

@ananzh
Copy link
Member

ananzh commented Oct 24, 2024

So we have two places 1) click showFilterActions button and 2) the new three dot one to save queries? What is the purpose or usage pain to resolve for adding another save query? are we going to remove the old one to make the new one the only place to save query?

Screenshot 2024-10-24 at 12 53 34 PM

@amsiglan
Copy link
Collaborator Author

So we have two places 1) click showFilterActions button and 2) the new three dot one to save queries? What is the purpose or usage pain to resolve for adding another save query? are we going to remove the old one to make the new one the only place to save query?

Screenshot 2024-10-24 at 12 53 34 PM

We are replacing the old button in both the places, the one inside the filter options will also show the two options

  • Save query and Open query

@ananzh
Copy link
Member

ananzh commented Oct 24, 2024

So we have two places 1) click showFilterActions button and 2) the new three dot one to save queries? What is the purpose or usage pain to resolve for adding another save query? are we going to remove the old one to make the new one the only place to save query?
Screenshot 2024-10-24 at 12 53 34 PM

We are replacing the old button in both the places, the one inside the filter options will also show the two options

  • Save query and Open query

Got it. Haven't got time to review it in details, only verify the changes with query enhancement and MDS enabled. Since you have resolve multiple people's comments, I will approve to unblock. Will reach out to you there is any concerns in the future.

@kavilla kavilla added v2.19.0 and removed v2.18.0 labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants