Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

METRON-2292: [UI] Manual query can't be saved on the Alerts UI #1533

Closed
wants to merge 3 commits into from

Conversation

ruffle1986
Copy link
Contributor

@ruffle1986 ruffle1986 commented Oct 14, 2019

Contributor Comments

Link to the ASF Jira: https://issues.apache.org/jira/browse/METRON-2292

The problem

When users switch to manual query mode and type something in the search field, it doesn't count when they want to save the search. However the manual mode is visible on the screen, it always saves the recent query built by the query builder (if it's anything else but '*')

Testing

  1. Go to the alerts-ui
  2. Switch to manual query mode
  3. Type something in the search field
  4. Click on the search button
  5. Click on the "Save" search button (floppy disc icon on the right of the magnifier)
  6. Open the saved searches pane (Click the button on the left of the search field)
  7. Choose your saved search from the list
  8. Please try to choose it from the recent searches list to make sure it works properly.

Repeat the same with a saved search built by the query builder. The app should turn into the proper filtering mode based on the filtering mode of the saved search.

It's worth to refresh the browser between steps randomly just to make sure it's persisted properly. Since we only store saved and recent searches in the local storages, I recommend you to flush it before testing.

====

During testing, I've realised that the recent search means recent saved search. It was a bit confusing for the first time. I expected the recent search to be my latest search and not the recent saved search from the list below. Anyone else who thinks it might be confusing and misleading for the users?

Pull Request Checklist

Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.

In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:

For all changes:

  • Is there a JIRA ticket associated with this PR? If not one needs to be created at Metron Jira.
  • Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
  • Has your PR been rebased against the latest commit within the target branch (typically master)?

For code changes:

  • Have you included steps to reproduce the behavior or problem that is being changed or addressed?

  • Have you included steps or a guide to how the change may be verified and tested manually?

  • Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:

    mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh 
    
  • Have you written or updated unit tests and or integration tests to verify your changes?

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

  • Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via site-book/target/site/index.html:

    cd site-book
    mvn site
    
  • Have you ensured that any documentation diagrams have been updated, along with their source files, using draw.io? See Metron Development Guidelines for instructions.

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.

@ruffle1986 ruffle1986 changed the title METRON-2292: [UI] Manual query can't be saved METRON-2292: [UI] Manual query can't be saved on the Alerts UI Oct 14, 2019
@ruffle1986
Copy link
Contributor Author

ruffle1986 commented Oct 14, 2019

Closing and re-opening due to one dependency is unavailable to be downloaded at the time

@ruffle1986 ruffle1986 closed this Oct 14, 2019
@ruffle1986 ruffle1986 reopened this Oct 14, 2019
Copy link
Contributor

@tiborm tiborm left a comment

Choose a reason for hiding this comment

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

Reviewed and tested locally. Thanks for fixing this! +1 (non-binding)

@sardell
Copy link
Contributor

sardell commented Oct 30, 2019

I just tested this and I noticed that after I make and save a few searches where I edit the timestamp out of the search, it will be added back into the saved search.

saved-search-bug

@ruffle1986
Copy link
Contributor Author

Nice catch! I'll take a look at it.

@sardell
Copy link
Contributor

sardell commented Nov 26, 2019

Any update on the status of this work?

@ruffle1986
Copy link
Contributor Author

No, not yet. Sorry for the delay. This is going to be the first thing I'll check once I'm done with my other tasks.

@ruffle1986
Copy link
Contributor Author

ruffle1986 commented Dec 13, 2019

According to the gif, I tried to reproduce the problem by following the exact same steps. Could you please provide a detailed guide on what you did so I can do the same? I might have missed something.

This is what I did:

  1. Get all the alerts of he last 1 year.
  2. Click on the source:type cell to filter by a certain type like bro.
  3. Switch to manual query and save the search
  4. Then change the query in manual query mode and remove the time related stuff
  5. Click on the magnifier to apply the query
  6. Save the new query with a different name
  7. Load the previous query (the time should be there)
  8. Load the recently saved query (the time is not there as expected)

Kapture 2019-12-13 at 14 35 14

@sardell
Copy link
Contributor

sardell commented Dec 13, 2019

@ruffle1986 I'm actually unable to reproduce the bug now. I think I might've been using an old VM build before to test, though I'm not sure if that would've caused the issue. Either way, I've tested this pretty thoroughly and I cannot reproduce the bug.

With that said, I'm giving this a +1. Thanks for the contribution, @ruffle1986!

@asfgit asfgit closed this in e57a795 Dec 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants