From 568288dbcd143bb874d64417f0ecd1fe10dfee9e Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Fri, 18 May 2018 14:56:10 -0400 Subject: [PATCH] NIFI-5186: - Updating UI to support showing when a component is validating. --- .../controller/status/ProcessGroupStatus.java | 4 +- .../nifi/controller/status/RunStatus.java | 1 + .../nifi/cluster/manager/ErrorMerger.java | 20 +++--- .../nifi/cluster/manager/StatusMerger.java | 14 ++-- .../nifi/controller/FlowController.java | 71 ++++++++++--------- .../nifi-web-ui/src/main/webapp/css/graph.css | 45 +++++++++++- .../nifi-web-ui/src/main/webapp/css/main.css | 20 ++++++ .../src/main/webapp/css/slick-nifi-theme.css | 12 ++-- .../propertytable/jquery.propertytable.js | 6 +- .../nf/canvas/nf-connection-configuration.js | 2 +- .../js/nf/canvas/nf-controller-services.js | 51 +++++++------ .../webapp/js/nf/canvas/nf-flow-version.js | 2 +- .../js/nf/canvas/nf-policy-management.js | 4 +- .../main/webapp/js/nf/canvas/nf-processor.js | 51 ++++++++++--- .../webapp/js/nf/canvas/nf-queue-listing.js | 2 +- .../main/webapp/js/nf/canvas/nf-settings.js | 45 +++++++----- .../js/nf/canvas/nf-variable-registry.js | 4 +- .../webapp/js/nf/cluster/nf-cluster-table.js | 8 +-- .../js/nf/counters/nf-counters-table.js | 2 +- .../webapp/js/nf/history/nf-history-table.js | 2 +- .../src/main/webapp/js/nf/nf-common.js | 2 +- .../js/nf/provenance/nf-provenance-table.js | 2 +- .../webapp/js/nf/summary/nf-summary-table.js | 36 +++++----- .../js/nf/templates/nf-templates-table.js | 6 +- .../main/webapp/js/nf/users/nf-users-table.js | 6 +- 25 files changed, 273 insertions(+), 145 deletions(-) diff --git a/nifi-api/src/main/java/org/apache/nifi/controller/status/ProcessGroupStatus.java b/nifi-api/src/main/java/org/apache/nifi/controller/status/ProcessGroupStatus.java index a6acbc1379..f9433d77e7 100644 --- a/nifi-api/src/main/java/org/apache/nifi/controller/status/ProcessGroupStatus.java +++ b/nifi-api/src/main/java/org/apache/nifi/controller/status/ProcessGroupStatus.java @@ -481,7 +481,9 @@ public class ProcessGroupStatus implements Cloneable { // and should not differ amongst nodes. however, whether a processor is invalid // can be driven by environmental conditions. this check allows any of those to // take precedence over the configured run status. - if (RunStatus.Invalid.equals(statusToMerge.getRunStatus())) { + if (RunStatus.Validating.equals(statusToMerge.getRunStatus())) { + merged.setRunStatus(RunStatus.Validating); + } else if (RunStatus.Invalid.equals(statusToMerge.getRunStatus())) { merged.setRunStatus(RunStatus.Invalid); } } diff --git a/nifi-api/src/main/java/org/apache/nifi/controller/status/RunStatus.java b/nifi-api/src/main/java/org/apache/nifi/controller/status/RunStatus.java index 1b7c43dc66..e0e0027dee 100644 --- a/nifi-api/src/main/java/org/apache/nifi/controller/status/RunStatus.java +++ b/nifi-api/src/main/java/org/apache/nifi/controller/status/RunStatus.java @@ -23,6 +23,7 @@ public enum RunStatus { Running, Stopped, + Validating, Invalid, Disabled; } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/ErrorMerger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/ErrorMerger.java index 9eec1d801b..9e9252e4ed 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/ErrorMerger.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/ErrorMerger.java @@ -16,14 +16,14 @@ */ package org.apache.nifi.cluster.manager; +import org.apache.nifi.cluster.protocol.NodeIdentifier; +import org.apache.nifi.web.api.dto.ProcessorDTO; + import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Set; -import org.apache.nifi.cluster.protocol.NodeIdentifier; -import org.apache.nifi.web.api.dto.ProcessorDTO; - public final class ErrorMerger { private ErrorMerger() {} @@ -72,13 +72,6 @@ public final class ErrorMerger { * @return {@link ProcessorDTO#INVALID} if any status is invalid, else {@link ProcessorDTO#VALIDATING} if any status is validating, else {@link ProcessorDTO#VALID} */ public static String mergeValidationStatus(final Collection validationStatuses) { - final boolean anyInvalid = validationStatuses.stream() - .anyMatch(status -> ProcessorDTO.INVALID.equalsIgnoreCase(status)); - - if (anyInvalid) { - return ProcessorDTO.INVALID; - } - final boolean anyValidating = validationStatuses.stream() .anyMatch(status -> ProcessorDTO.VALIDATING.equalsIgnoreCase(status)); @@ -86,6 +79,13 @@ public final class ErrorMerger { return ProcessorDTO.VALIDATING; } + final boolean anyInvalid = validationStatuses.stream() + .anyMatch(status -> ProcessorDTO.INVALID.equalsIgnoreCase(status)); + + if (anyInvalid) { + return ProcessorDTO.INVALID; + } + return ProcessorDTO.VALID; } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java index dd10b5bfde..d15e4f6993 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java @@ -415,13 +415,15 @@ public class StatusMerger { target.setType(toMerge.getType()); } - // if the status to merge is invalid allow it to take precedence. whether the + // if the status to merge is validating/invalid allow it to take precedence. whether the // processor run status is disabled/stopped/running is part of the flow configuration - // and should not differ amongst nodes. however, whether a processor is invalid + // and should not differ amongst nodes. however, whether a processor is validating/invalid // can be driven by environmental conditions. this check allows any of those to // take precedence over the configured run status. - if (RunStatus.Invalid.name().equals(toMerge.getRunStatus())) { - target.setRunStatus(RunStatus.Invalid.name()); + if (RunStatus.Validating.toString().equals(toMerge.getRunStatus())) { + target.setRunStatus(RunStatus.Validating.toString()); + } else if (RunStatus.Invalid.toString().equals(toMerge.getRunStatus())) { + target.setRunStatus(RunStatus.Invalid.toString()); } target.setBytesRead(target.getBytesRead() + toMerge.getBytesRead()); @@ -573,8 +575,8 @@ public class StatusMerger { // should be unnecessary here since ports run status not should be affected by // environmental conditions but doing so in case that changes - if (RunStatus.Invalid.name().equals(toMerge.getRunStatus())) { - target.setRunStatus(RunStatus.Invalid.name()); + if (RunStatus.Invalid.toString().equals(toMerge.getRunStatus())) { + target.setRunStatus(RunStatus.Invalid.toString()); } updatePrettyPrintedFields(target); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java index 091f0fb7cb..98b33ecc54 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java @@ -16,41 +16,6 @@ */ package org.apache.nifi.controller; -import static java.util.Objects.requireNonNull; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.lang.management.GarbageCollectorMXBean; -import java.lang.management.ManagementFactory; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.Future; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; -import java.util.concurrent.locks.ReentrantReadWriteLock; -import java.util.stream.Collectors; - -import javax.net.ssl.SSLContext; - import org.apache.commons.collections4.Predicate; import org.apache.commons.lang3.StringUtils; import org.apache.nifi.action.Action; @@ -269,6 +234,40 @@ import org.apache.zookeeper.server.quorum.QuorumPeerConfig.ConfigException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.net.ssl.SSLContext; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.Future; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.stream.Collectors; + +import static java.util.Objects.requireNonNull; + public class FlowController implements EventAccess, ControllerServiceProvider, ReportingTaskProvider, QueueProvider, Authorizable, ProvenanceAuthorizableFactory, NodeTypeProvider, IdentifierLookup, ReloadComponent { @@ -3306,6 +3305,8 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R status.setRunStatus(RunStatus.Disabled); } else if (ScheduledState.RUNNING.equals(procNode.getScheduledState())) { status.setRunStatus(RunStatus.Running); + } else if (procNode.getValidationStatus() == ValidationStatus.VALIDATING) { + status.setRunStatus(RunStatus.Validating); } else if (procNode.getValidationStatus() == ValidationStatus.INVALID) { status.setRunStatus(RunStatus.Invalid); } else { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css index 95fbbbd949..15daa76bec 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css @@ -141,6 +141,48 @@ path.component-comments { stroke: #000; } +text.spin { + -webkit-animation-name: rotate; + -webkit-animation-duration: 2s; + -webkit-animation-iteration-count: infinite; + -webkit-animation-timing-function: linear; + -moz-animation-name: rotate; + -moz-animation-duration: 2s; + -moz-animation-iteration-count: infinite; + -moz-animation-timing-function: linear; + animation-name: rotate; + animation-duration: 2s; + animation-iteration-count: infinite; + animation-timing-function: linear; +} + +@-webkit-keyframes rotate { + from { + -webkit-transform: rotate(0deg); + } + to { + -webkit-transform: rotate(360deg); + } +} + +@-moz-keyframes rotate { + from { + -moz-transform: rotate(0deg); + } + to { + -moz-transform: rotate(360deg); + } +} + +@keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + /* Selection */ @@ -210,7 +252,8 @@ text.is-primary { } text.run-status-icon { - font-size: 13px; + font-size: 14px; + transform-origin: 62px 18px 0; } /* diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/main.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/main.css index 0cd66c2a66..aeff30496a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/main.css +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/main.css @@ -138,6 +138,26 @@ div.context-menu-provenance { text-shadow: 0 0 4px rgba(255,255,255,1); } +.validating { + float: left; + width: 12px; + height: 12px; + line-height: 12px !important; + margin-top: 5px !important; + color: #a8a8a8 !important; + fill: #a8a8a8 !important; + text-shadow: 0 0 4px rgba(255,255,255,1); + transform-origin: 6px 6px 0; +} + +.validating:before { + font-family: FontAwesome; + font-size: 12px; + content: "\f1ce"; + color: #a8a8a8; + text-shadow: 0 0 4px rgba(255,255,255,1); +} + .transmitting { float: left; color: #44a3cf !important; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/slick-nifi-theme.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/slick-nifi-theme.css index 398f9cdf05..bc77b6d9d7 100755 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/slick-nifi-theme.css +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/slick-nifi-theme.css @@ -72,21 +72,23 @@ .slick-viewport .fa { color: #004849; line-height: 22px; - margin-top: 0 !important; + margin-top: 0; width: 12px; height: 12px; float: left; - margin-right: 3px !important; + margin-right: 5px; + text-align: center; } .slick-viewport .icon { color: #004849; line-height: 24px; - margin-top: 0 !important; + margin-top: 0; width: 12px; height: 12px; float: left; - margin-right: 3px !important; + margin-right: 5px; + text-align: center; } .slick-header.ui-state-default, .slick-headerrow.ui-state-default { @@ -125,7 +127,7 @@ div.status-text { padding-left: 4px; - line-height: normal; + line-height: 22px; overflow: hidden; text-overflow: ellipsis; float: left; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js index abd27b2bd0..2aa96a4f8b 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js @@ -1195,7 +1195,7 @@ // show the property description if applicable if (nfCommon.isDefinedAndNotNull(propertyDescriptor)) { if (!nfCommon.isBlank(propertyDescriptor.description) || !nfCommon.isBlank(propertyDescriptor.defaultValue) || !nfCommon.isBlank(propertyDescriptor.supportsEl)) { - $('
').appendTo(cellContent); + $('
').appendTo(cellContent); $('').text(dataContext.property).appendTo(cellContent); nameWidthOffset = 46; // 10 + icon width (10) + icon margin (6) + padding (20) } @@ -1299,7 +1299,7 @@ $.each(propertyDescriptor.allowableValues, function (_, allowableValueEntity) { var allowableValue = allowableValueEntity.allowableValue; if (allowableValue.value === dataContext.value) { - markup += '
'; + markup += '
'; return false; } }); @@ -1307,7 +1307,7 @@ // allow user defined properties to be removed if (options.readOnly !== true && dataContext.type === 'userDefined') { - markup += '
'; + markup += '
'; } return markup; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js index e206bf9518..82c34e5378 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js @@ -1256,7 +1256,7 @@ // add the description if applicable if (nfCommon.isDefinedAndNotNull(prioritizerType.description)) { - $('
').appendTo(prioritizer).qtip($.extend({ + $('
').appendTo(prioritizer).qtip($.extend({ content: nfCommon.escapeHtml(prioritizerType.description) }, nfCommon.config.tooltipConfig)); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js index 9797a47d3e..c15d1ab1b6 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js @@ -814,12 +814,20 @@ var bType = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? nfCommon.substringAfterLast(b.component[sortDetails.columnId], '.') : ''; return aType === bType ? 0 : aType > bType ? 1 : -1; } else if (sortDetails.columnId === 'state') { - var aState = 'Invalid'; - if (nfCommon.isEmpty(a.component.validationErrors)) { + var aState; + if (a.component.validationStatus === 'VALIDATING') { + aState = 'Validating'; + } else if (a.component.validationStatus === 'INVALID') { + aState = 'Invalid'; + } else { aState = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; } - var bState = 'Invalid'; - if (nfCommon.isEmpty(b.component.validationErrors)) { + var bState; + if (a.component.validationStatus === 'VALIDATING') { + bState = 'Validating'; + } else if (a.component.validationStatus === 'INVALID') { + bState = 'Invalid'; + } else { bState = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; } return aState === bState ? 0 : aState > bState ? 1 : -1; @@ -858,17 +866,17 @@ } // always include a button to view the usage - var markup = '
'; + var markup = '
'; var hasErrors = !nfCommon.isEmpty(dataContext.component.validationErrors); var hasBulletins = !nfCommon.isEmpty(dataContext.bulletins); if (hasErrors) { - markup += '
'; + markup += '
'; } if (hasBulletins) { - markup += '
'; + markup += '
'; } if (hasErrors || hasBulletins) { @@ -885,7 +893,10 @@ // determine the appropriate label var icon = '', label = ''; - if (!nfCommon.isEmpty(dataContext.component.validationErrors)) { + if (dataContext.component.validationStatus === 'VALIDATING') { + icon = 'validating fa fa-spin fa-circle-notch'; + label = 'Validating'; + } else if (dataContext.component.validationStatus === 'INVALID') { icon = 'invalid fa fa-warning'; label = 'Invalid'; } else { @@ -905,8 +916,8 @@ } // format the markup - var formattedValue = '
'; - return formattedValue + '
' + label + '
'; + var formattedValue = '
'; + return formattedValue + '
' + label + '
'; }; var controllerServiceActionFormatter = function (row, cell, value, columnDef, dataContext) { @@ -928,43 +939,43 @@ if (dataContext.permissions.canWrite) { // write permission... allow actions based on the current state of the service if (dataContext.component.state === 'ENABLED' || dataContext.component.state === 'ENABLING') { - markup += '
'; - markup += '
'; + markup += '
'; + markup += '
'; } else if (dataContext.component.state === 'DISABLED') { - markup += '
'; + markup += '
'; // if there are no validation errors allow enabling if (nfCommon.isEmpty(dataContext.component.validationErrors)) { - markup += '
'; + markup += '
'; } if (dataContext.component.multipleVersionsAvailable === true) { - markup += '
'; + markup += '
'; } if (canWriteControllerServiceParent(dataContext)) { - markup += '
'; + markup += '
'; } } if (dataContext.component.persistsState === true) { - markup += '
'; + markup += '
'; } } else { // no write permission... allow viewing configuration if in current group if (definedByCurrentGroup === true) { - markup += '
'; + markup += '
'; } } } else { // not defined in current group... show go to arrow - markup += '
'; + markup += '
'; } } // allow policy configuration conditionally if (nfCanvasUtils.isManagedAuthorizer() && nfCommon.canAccessTenants()) { - markup += '
'; + markup += '
'; } return markup; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js index ebbfd25c89..2bb45f9565 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-flow-version.js @@ -618,7 +618,7 @@ var markup = ''; if (dataContext.differenceType !== 'Component Removed' && nfCommon.isDefinedAndNotNull(dataContext.processGroupId)) { - markup += '
'; + markup += '
'; } return markup; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js index c0da4815f2..b0f1d4350d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js @@ -200,7 +200,7 @@ }, _renderGroup: function (ul, match) { var groupLabel = $('').text(match.component.identity); - var groupContent = $('').append('
').append(groupLabel); + var groupContent = $('').append('
').append(groupLabel); return $('
  • ').data('ui-autocomplete-item', match).append(groupContent).appendTo(ul); } }); @@ -594,7 +594,7 @@ var identityFormatter = function (row, cell, value, columnDef, dataContext) { var markup = ''; if (dataContext.type === 'group') { - markup += '
    '; + markup += '
    '; } markup += nfCommon.escapeHtml(dataContext.component.identity); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js index 71d6de9929..751caac1e6 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js @@ -259,7 +259,9 @@ .attrs({ 'class': 'run-status-icon', 'x': 55, - 'y': 23 + 'y': 23, + 'width': 14, + 'height': 14 }); // processor type @@ -795,6 +797,35 @@ return nfClusterSummary.isClustered() && d.status.aggregateSnapshot.executionNode === 'PRIMARY' ? 'visible' : 'hidden'; }; + /** + * Determines whether the specific component needs a tooltip. + * + * @param d + * @return if a tip is required + */ + var needsTip = function (d) { + return (d.permissions.canRead && !nfCommon.isEmpty(d.component.validationErrors)) || d.status.aggregateSnapshot.runStatus === 'Validating'; + }; + + /** + * Gets the tooltip content. + * + * @param d + * @return the tip content + */ + var getTip = function (d) { + if (d.permissions.canRead && !nfCommon.isEmpty(d.component.validationErrors)) { + var list = nfCommon.formatUnorderedList(d.component.validationErrors); + if (list === null || list.length === 0) { + return ''; + } else { + return list; + } + } else { + return 'Validating...'; + } + }; + /** * Updates the stats for the processors in the specified selection. * @@ -811,7 +842,9 @@ 'fill': function (d) { var fill = '#728e9b'; - if (d.status.aggregateSnapshot.runStatus === 'Invalid') { + if (d.status.aggregateSnapshot.runStatus === 'Validating') { + fill = '#a8a8a8'; + } else if (d.status.aggregateSnapshot.runStatus === 'Invalid') { fill = '#cf9f5d'; } else if (d.status.aggregateSnapshot.runStatus === 'Running') { fill = '#7dc7a0'; @@ -829,10 +862,15 @@ return family; } }) + .classed('fa-spin', function (d) { + return d.status.aggregateSnapshot.runStatus === 'Validating'; + }) .text(function (d) { var img = ''; if (d.status.aggregateSnapshot.runStatus === 'Disabled') { img = '\ue802'; + } else if (d.status.aggregateSnapshot.runStatus === 'Validating') { + img = '\uf1ce'; } else if (d.status.aggregateSnapshot.runStatus === 'Invalid') { img = '\uf071'; } else if (d.status.aggregateSnapshot.runStatus === 'Running') { @@ -847,7 +885,7 @@ var tip = d3.select('#run-status-tip-' + d.id); // if there are validation errors generate a tooltip - if (d.permissions.canRead && !nfCommon.isEmpty(d.component.validationErrors)) { + if (needsTip(d)) { // create the tip if necessary if (tip.empty()) { tip = d3.select('#processor-tooltips').append('div') @@ -859,12 +897,7 @@ // update the tip tip.html(function () { - var list = nfCommon.formatUnorderedList(d.component.validationErrors); - if (list === null || list.length === 0) { - return ''; - } else { - return $('
    ').append(list).html(); - } + return $('
    ').append(getTip(d)).html(); }); // add the tooltip diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js index f214158566..65f1311431 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js @@ -499,7 +499,7 @@ // define a custom formatter for showing more processor details var moreDetailsFormatter = function (row, cell, value, columnDef, dataContext) { - return '
    '; + return '
    '; }; // function for formatting data sizes diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js index 563aff37fd..198f62ace4 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js @@ -264,12 +264,20 @@ var bType = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? nfCommon.substringAfterLast(b.component[sortDetails.columnId], '.') : ''; return aType === bType ? 0 : aType > bType ? 1 : -1; } else if (sortDetails.columnId === 'state') { - var aState = 'Invalid'; - if (nfCommon.isEmpty(a.component.validationErrors)) { + var aState; + if (a.component.validationStatus === 'VALIDATING') { + aState = 'Validating'; + } else if (a.component.validationStatus === 'INVALID') { + aState = 'Invalid'; + } else { aState = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; } - var bState = 'Invalid'; - if (nfCommon.isEmpty(b.component.validationErrors)) { + var bState; + if (a.component.validationStatus === 'VALIDATING') { + bState = 'Validating'; + } else if (a.component.validationStatus === 'INVALID') { + bState = 'Invalid'; + } else { bState = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; } return aState === bState ? 0 : aState > bState ? 1 : -1; @@ -997,9 +1005,12 @@ // determine the appropriate label var icon = '', label = ''; - if (!nfCommon.isEmpty(dataContext.component.validationErrors)) { - label = 'Invalid'; + if (dataContext.component.validationStatus === 'VALIDATING') { + icon = 'validating fa fa-spin fa-circle-notch'; + label = 'Validating'; + } else if (dataContext.component.validationStatus === 'INVALID') { icon = 'invalid fa fa-warning'; + label = 'Invalid'; } else { if (dataContext.component.state === 'STOPPED') { label = 'Stopped'; @@ -1020,8 +1031,8 @@ } // format the markup - var formattedValue = '
    '; - return formattedValue + '
    ' + nfCommon.escapeHtml(label) + '
    ' + nfCommon.escapeHtml(activeThreadCount) + '
    '; + var formattedValue = '
    '; + return formattedValue + '
    ' + nfCommon.escapeHtml(label) + '
    ' + nfCommon.escapeHtml(activeThreadCount) + '
    '; }; var reportingTaskActionFormatter = function (row, cell, value, columnDef, dataContext) { @@ -1029,32 +1040,32 @@ if (dataContext.permissions.canRead && dataContext.permissions.canWrite) { if (dataContext.component.state === 'RUNNING') { - markup += '
    '; + markup += '
    '; } else if (dataContext.component.state === 'STOPPED' || dataContext.component.state === 'DISABLED') { - markup += '
    '; + markup += '
    '; // support starting when stopped and no validation errors if (dataContext.component.state === 'STOPPED' && nfCommon.isEmpty(dataContext.component.validationErrors)) { - markup += '
    '; + markup += '
    '; } if (dataContext.component.multipleVersionsAvailable === true) { - markup += '
    '; + markup += '
    '; } if (nfCommon.canModifyController()) { - markup += '
    '; + markup += '
    '; } } if (dataContext.component.persistsState === true) { - markup += '
    '; + markup += '
    '; } } // allow policy configuration conditionally if (nfCanvasUtils.isManagedAuthorizer() && nfCommon.canAccessTenants()) { - markup += '
    '; + markup += '
    '; } return markup; @@ -1283,10 +1294,10 @@ if (nfCommon.canModifyController()) { // edit registry - markup += '
    '; + markup += '
    '; // remove registry - markup += '
    '; + markup += '
    '; } return markup; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-variable-registry.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-variable-registry.js index 7265b70746..86590f6e29 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-variable-registry.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-variable-registry.js @@ -398,12 +398,12 @@ var markup = ''; if (dataContext.isEditable === true) { - markup += '
    '; + markup += '
    '; } else { var currentProcessGroupId = $('#variable-registry-process-group-id').text(); if (dataContext.processGroupId !== currentProcessGroupId) { - markup += '
    '; + markup += '
    '; } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js index ef1d2f9e6c..095f7149f4 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js @@ -543,7 +543,7 @@ */ function createNodeTableColumnModel() { var moreDetailsFormatter = function (row, cell, value, columnDef, dataContext) { - return '
    '; + return '
    '; }; // define a custom formatter for the run status column @@ -640,9 +640,9 @@ // return the appropriate markup if (canConnect) { - return '
    '; + return '
    '; } else if (canDisconnect) { - return '
    '; + return '
    '; } else { return '
     
    '; } @@ -705,7 +705,7 @@ function createJvmTableColumnModel() { var gcFormatter = function (row, cell, value, columnDef, dataContext) { - return '
    '; + return '
    '; }; return [ diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js index ab549bb227..81577f42c8 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js @@ -214,7 +214,7 @@ if (nfCommon.canModifyCounters()) { // function for formatting the actions column var actionFormatter = function (row, cell, value, columnDef, dataContext) { - return '
    '; + return '
    '; }; // add the action column diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js index 64bcab0ba1..efab6edbd0 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js @@ -301,7 +301,7 @@ // define a custom formatter for the more details column var moreDetailsFormatter = function (row, cell, value, columnDef, dataContext) { if (dataContext.canRead === true) { - return '
    '; + return '
    '; } return ""; }; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js index 99b2d35e6d..6b31fe94b0 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js @@ -375,7 +375,7 @@ } if (!nfCommon.isEmpty(dataContext.controllerServiceApis)) { - markup += '
    '; + markup += '
    '; } markup += '
    '; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js index 9094795f91..3229b8288c 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js @@ -635,7 +635,7 @@ // conditionally include the cluster node id if (nfCommon.SUPPORTS_SVG) { - markup += '
    '; + markup += '
    '; } // conditionally support going to the component diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js index e1311b4d54..1838a6668d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js @@ -266,7 +266,7 @@ // define a custom formatter for showing more processor details var moreProcessorDetails = function (row, cell, value, columnDef, dataContext) { - var markup = '
    '; + var markup = '
    '; // if there are bulletins, render them on the graph if (!nfCommon.isEmpty(dataContext.bulletins)) { @@ -329,6 +329,9 @@ case 'disabled': classes = 'icon icon-enable-false disabled'; break; + case 'validating': + classes = 'fa fa-spin fa-circle-notch validating'; + break; case 'invalid': classes = 'fa fa-warning invalid'; break; @@ -336,11 +339,10 @@ classes = ''; } - var markup = '
    ' + '
    ' + - '
    ' + + '
    ' + nfCommon.escapeHtml(value) + '
    ' + '
    ' + @@ -456,11 +458,11 @@ var markup = ''; if (isInShell) { - markup += '
    '; + markup += '
    '; } if (nfCommon.SUPPORTS_SVG) { - markup += '
    '; + markup += '
    '; } if (isClustered) { @@ -703,7 +705,7 @@ // define a custom formatter for showing more processor details var moreConnectionDetails = function (row, cell, value, columnDef, dataContext) { - return '
    '; + return '
    '; }; var backpressureFormatter = function (row, cell, value, columnDef, dataContext) { @@ -788,11 +790,11 @@ var markup = ''; if (isInShell) { - markup += '
    '; + markup += '
    '; } if (nfCommon.SUPPORTS_SVG) { - markup += '
    '; + markup += '
    '; } if (isClustered) { @@ -1010,7 +1012,7 @@ // if there are bulletins, render them on the graph if (!nfCommon.isEmpty(dataContext.bulletins)) { - markup += '
    '; + markup += '
    '; } return markup; @@ -1086,7 +1088,7 @@ classes = ''; label = ''; } - return '
    ' + label + '
    '; + return '
    ' + label + '
    '; }; // define the column model for the summary table @@ -1123,11 +1125,11 @@ var markup = ''; if (isInShell && dataContext.groupId !== null) { - markup += '
    '; + markup += '
    '; } if (nfCommon.SUPPORTS_SVG) { - markup += '
    '; + markup += '
    '; } if (isClustered) { @@ -1383,7 +1385,7 @@ var markup = ''; if (isInShell) { - markup += '
    '; + markup += '
    '; } if (isClustered) { @@ -1630,7 +1632,7 @@ var markup = ''; if (isInShell) { - markup += '
    '; + markup += '
    '; } if (isClustered) { @@ -1882,7 +1884,7 @@ // generate the mark up var formattedValue = '
    '; - return formattedValue + '
    ' + transmissionLabel + '
    ' + nfCommon.escapeHtml(activeThreadCount) + '
    '; + return formattedValue + '
    ' + transmissionLabel + '
    ' + nfCommon.escapeHtml(activeThreadCount) + '
    '; }; var transmissionStatusColumn = { @@ -1929,11 +1931,11 @@ var markup = ''; if (isInShell) { - markup += '
    '; + markup += '
    '; } if (nfCommon.SUPPORTS_SVG) { - markup += '
    '; + markup += '
    '; } if (isClustered) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js index 89c7cf2372..26dea4a137 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js @@ -283,18 +283,18 @@ var markup = ''; if (dataContext.permissions.canRead === true) { - markup += '
    '; + markup += '
    '; } // all DFMs to remove templates if (dataContext.permissions.canWrite === true) { - markup += '
    '; + markup += '
    '; } // allow policy configuration conditionally if embedded in if (top !== window && nfCommon.canAccessTenants()) { if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.CanvasUtils) && parent.nf.CanvasUtils.isManagedAuthorizer()) { - markup += '
    '; + markup += '
    '; } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js index 6da6668945..2dfaec9f72 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js @@ -783,7 +783,7 @@ var identityFormatter = function (row, cell, value, columnDef, dataContext) { var markup = ''; if (dataContext.type === 'group') { - markup += '
    '; + markup += '
    '; } markup += nfCommon.escapeHtml(dataContext.component.identity); @@ -810,7 +810,7 @@ // ensure user can modify the user if (configurableUsersAndGroups && dataContext.component.configurable === true && nfCommon.canModifyTenants()) { - markup += '
    '; + markup += '
    '; markup += '
    '; } @@ -1127,7 +1127,7 @@ var groupId = $('').text(group.id); // icon - var groupIcon = $('
    '); + var groupIcon = $('
    '); // identity var identity = $('
    ').text(group.component.identity);