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,22 +643,28 @@ nf.Canvas = (function () {
evt.preventDefault(); evt.preventDefault();
} else if (evt.keyCode === 67) { } else if (evt.keyCode === 67) {
// ctrl-c if (nf.Common.isDFM() && nf.CanvasUtils.isCopyable(selection)) {
nf.Actions.copy(nf.CanvasUtils.getSelection()); // ctrl-c
nf.Actions.copy(selection);
evt.preventDefault(); evt.preventDefault();
}
} else if (evt.keyCode === 86) { } else if (evt.keyCode === 86) {
// ctrl-p if (nf.Common.isDFM() && nf.CanvasUtils.isPastable()) {
nf.Actions.paste(); // ctrl-p
nf.Actions.paste(selection);
evt.preventDefault(); evt.preventDefault();
}
} }
} else { } else {
if (evt.keyCode === 46) { if (evt.keyCode === 46) {
// delete if (nf.Common.isDFM() && nf.CanvasUtils.isDeletable(selection)) {
nf.Actions['delete'](nf.CanvasUtils.getSelection()); // delete
nf.Actions['delete'](selection);
evt.preventDefault(); evt.preventDefault();
}
} }
} }
}); });