[
https://issues.apache.org/jira/browse/METRON-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16614864#comment-16614864
]
ASF GitHub Bot commented on METRON-1760:
----------------------------------------
GitHub user ruffle1986 opened a pull request:
https://github.com/apache/metron/pull/1199
METRON-1760: Kill PCAP job should prompt for confirmation
## Contributor Comments
This PR introduces a so-called `pop confirm` component appearing next to
"kill query button" when the user presses it. We thought it would be better to
provide 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](https://issues.apache.org/jira/browse/METRON-1760).
I decided to not create this floating element from scratch but rather
install a
[component](https://www.npmjs.com/package/angular-confirmation-popover) 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](https://github.com/mattlewis92/angular-confirmation-popover/blob/master/package.json#L55)
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](https://github.com/ruffle1986/metron/blob/METRON-1760/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.html#L23).
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](https://github.com/ruffle1986/metron/blob/METRON-1760/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.html#L24-L31)
to configure the behaviour of the component. I wouldn't go into details since
they're pretty straightforward. Check out the
[docs](https://mattlewis92.github.io/angular-confirmation-popover/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](https://github.com/ruffle1986/metron/blob/METRON-1760/metron-interface/metron-alerts/src/confirm-popover.scss)
Bootstrap's styles to make it fit to the current (dark) design.
- Update the package lock file due to the new dependency.
**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.
## Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our [Development
Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235)
for the complete guide to follow for contributions.
Please refer also to our [Build Verification
Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview)
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:
- [X] Is there a JIRA ticket associated with this PR? If not one needs to
be created at [Metron
Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
- [X] 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.
- [X] Has your PR been rebased against the latest commit within the target
branch (typically master)?
### For code changes:
- [X] Have you included steps to reproduce the behavior or problem that is
being changed or addressed?
- [X] Have you included steps or a guide to how the change may be verified
and tested manually?
- [X] 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
```
- [X] Have you written or updated unit tests and or integration tests to
verify your changes?
- [X] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [X] Have you verified the basic functionality of the build by building
and running locally with Vagrant full-dev environment or the equivalent?
```
cd site-book
mvn site
```
#### 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](https://travis-ci.org) is set up
for your personal repository such that your branches are built there before
submitting a pull request.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ruffle1986/metron METRON-1760
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/metron/pull/1199.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1199
----
----
> Kill PCAP job should prompt for confirmation
> --------------------------------------------
>
> Key: METRON-1760
> URL: https://issues.apache.org/jira/browse/METRON-1760
> Project: Metron
> Issue Type: Improvement
> Reporter: Tamas Fodor
> Assignee: Tamas Fodor
> Priority: Major
>
> Since killing a PCAP job is a disruptive operation, it would be good to
> prompt for user confirmation before carrying out the operation.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)