-
Notifications
You must be signed in to change notification settings - Fork 507
METRON-1760: Kill PCAP job should prompt for confirmation #1199
Conversation
+1. Tested as described above on full-dev. |
WIth no PCAP data in an environment, the query returns too fast for me to manually push the "Cancel" button? Did you load up some sample PCAP data to test this? |
@nickwallen I added the instructions on how to work with pcap data, but there's another way to slow things down. You can emulate a very slow internet connection by opening the network tab in the dev toolbar if you're using Google Chrome: https://developers.google.com/web/tools/chrome-devtools/network-performance/reference#throttling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. I have one question on dependencies.
I ran it up and tested the interface against real PCAP data. Was able to cancel a job after the additional confirmation step.
"resolved": "https://registry.npmjs.org/angular-confirmation-popover/-/angular-confirmation-popover-4.2.0.tgz", | ||
"integrity": "sha512-ItCPzV52user93NRk9rF4Rp8NpawBWJdkNf8+6lH//f5i/N5HY0Aq5Hcch3xk19h9P48k0WZnfwOQL181xe4MQ==", | ||
"requires": { | ||
"positioning": "^1.3.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the requirement here be for positioning 1.4.0 (not 1.3.1) to match the 'positioning' dependency that you added below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickwallen According to semantic versioning and how npm handles these, The ^
sign at the beginning of the version means that any other "minor" updates of Positioning are accepted by the popover but not a major change.
1.4.0 is a minor update comparing to 1.3.1 since only the second number has been changed so npm installed and stored 1.4.0 which is the latest version and also the latest minor version of the package within version 1.
+1 Thanks! Will merge now. |
…nickwallen) closes apache#1199
Contributor Comments
This PR introduces a so-called
pop confirm
component appearing next to "kill query button" when the user presses it. It provides a middle step between the user interaction and the http request since the querying process can be a time consuming process and the cancel button can be pressed accidentally giving the user a hard time.You can find the original JIRA ticket here.
I decided to not create this floating element from scratch but rather install a component from npm which seemed to fulfil the requirements.
It uses Bootstrap behind the scenes but I slightly modified the css to make it fit to the current design.
The module has the appropriate license and the number of potential vulnerabilities, according to
npm audit
, is zero.Changes included:
Use the new component as a directive on the kill button in pcap-panel.component.html. It's reusable and you can use it on any other elements as you wish by setting the
mwlConfirmationPopover
directive. You can also add different attributes to configure the behaviour of the component. I wouldn't go into details since they're pretty straightforward. Check out the docs!The "killing query process" had been already tested before on the ui so I had to slightly change the test units accordingly. You cannot expect the same result unless you click on the "Yes" button on the pop confirm component.
Override Bootstrap's styles to make it fit to the current (dark) design.
Update the package lock file due to the new dependency.
This is how it looks:
Testing:
Go to the PCAP tab and start a new query by clicking on the magnifier at the right side of the filter panel. The progress bar is supposed to appear with a cancel button on the right (a button with an "X" on it). During the process you should be able to click on the cancel button and the pop confirm component should appear next to the button to prompt the user to solidify his/her decision or give the opportunity to change his/her mind.
In case you want to test it with real generated pcap data, you should do the following:
Set
SAMPLE_PCAP_PATH
to where you save the files on your computer. For example:export SAMPLE_PCAP_PATH=~/Projects/Metron/code/forks/merrimanr/samplePcap
Copy the generated pcap files into full dev. To do that, make sure you’re inside your vagrant machine’s directory (e.g. centos6, etc.) and have the vagrant-scp plugin is added to vagrant. The script to install this plugin is:
To copy the files, run this command:
Login to full dev and upload these files to HDFS:
vagrant ssh su root (password: vagrant or root) su - metron -c "hdfs dfs -put /tmp/pcap* /apps/metron/pcap/input"
install wireshark on full dev with
yum -y install wireshark
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:
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:
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?
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.