NIFI-1383: - Ensuring appropriate access and state prior to attempting an action with hot keys. - Fixing contrib-check issue.

This commit is contained in:
Matt Gilman 2016-01-15 13:04:44 -05:00
parent 561f5b740a
commit 53322c99ac
2 changed files with 20 additions and 11 deletions

View File

@ -3467,8 +3467,8 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
final boolean allNodesFailed = problematicNodeResponses.size() == nodeResponses.size(); final boolean allNodesFailed = problematicNodeResponses.size() == nodeResponses.size();
// some nodes had a problematic response because of a missing counter, ensure the are not disconnected // some nodes had a problematic response because of a missing counter, ensure the are not disconnected
final boolean someNodesFailedMissingCounter = !problematicNodeResponses.isEmpty() && final boolean someNodesFailedMissingCounter = !problematicNodeResponses.isEmpty()
problematicNodeResponses.size() < nodeResponses.size() && isMissingCounter(problematicNodeResponses, uri); && problematicNodeResponses.size() < nodeResponses.size() && isMissingCounter(problematicNodeResponses, uri);
// ensure nodes stay connected in certain scenarios // ensure nodes stay connected in certain scenarios
if (allNodesFailed || someNodesFailedMissingCounter) { if (allNodesFailed || someNodesFailedMissingCounter) {

View File

@ -626,6 +626,9 @@ nf.Canvas = (function () {
return; return;
} }
// get the current selection
var selection = nf.CanvasUtils.getSelection();
// handle shortcuts // handle shortcuts
if (isCtrl) { if (isCtrl) {
if (evt.keyCode === 82) { if (evt.keyCode === 82) {
@ -640,24 +643,30 @@ nf.Canvas = (function () {
evt.preventDefault(); evt.preventDefault();
} else if (evt.keyCode === 67) { } else if (evt.keyCode === 67) {
if (nf.Common.isDFM() && nf.CanvasUtils.isCopyable(selection)) {
// ctrl-c // ctrl-c
nf.Actions.copy(nf.CanvasUtils.getSelection()); nf.Actions.copy(selection);
evt.preventDefault();
} else if (evt.keyCode === 86) {
// ctrl-p
nf.Actions.paste();
evt.preventDefault(); evt.preventDefault();
} }
} else { } else if (evt.keyCode === 86) {
if (evt.keyCode === 46) { if (nf.Common.isDFM() && nf.CanvasUtils.isPastable()) {
// delete // ctrl-p
nf.Actions['delete'](nf.CanvasUtils.getSelection()); nf.Actions.paste(selection);
evt.preventDefault(); evt.preventDefault();
} }
} }
} else {
if (evt.keyCode === 46) {
if (nf.Common.isDFM() && nf.CanvasUtils.isDeletable(selection)) {
// delete
nf.Actions['delete'](selection);
evt.preventDefault();
}
}
}
}); });
// get the banners and update the page accordingly // get the banners and update the page accordingly