[NIFI-6282] manage parameters and parameter contexts

[NIFI-6282] when creating a parameter context inline during PG configuration set the newly created parameter context as the selected option
[NIFI-6282] If a request to update a parameter context fails, then update the button model to give the user the ability to Apply or Cancel again.
[NIFI-6282] address pr review comments
[NIFI-6282] remove es6 let
[NIFI-6282] update marshall parameters logic and add comments
[NIFI-6282] deterministic parameter usage listing, update CS status on PG PC change, expand all twisties by default, remove es6 const
[NIFI-6282] update regex and
[NIFI-6282] update parameter loading/serialization/marshalling
[NIFI-6282] use referencingComponents instead of affectedComponents
[NIFI-6282] activate Apply button for sensitive parameter set empty string change
[NIFI-6282] fix bug with PG parameters context menu enable
[NIFI-6282] only allow delete and recreate of a parameter with equivalent sensitivity
[NIFI-6282] display referencing components during parameter management as well as during the parameter context update
[NIFI-6282] display no value set in parameter table when parameter value is null
[NIFI-6282]
- Add ellipsis to referencing component names.
- Addressing issues canceling update requests.
- Addressing issues with incorrect service scope.
- Addressing issue showing the affected parameters.
This commit is contained in:
Scott Aslan 2019-07-25 23:03:27 -04:00 committed by Matt Gilman
parent 2e554cbb67
commit f678c75d70
No known key found for this signature in database
GPG Key ID: DF61EC19432AEE37
39 changed files with 3331 additions and 105 deletions

View File

@ -25,7 +25,7 @@ import java.util.Set;
@XmlType(name = "parameterContextUpdateRequest")
public class ParameterContextUpdateRequestDTO extends AsynchronousRequestDTO<ParameterContextUpdateStepDTO> {
private ParameterContextDTO parameterContext;
private Set<AffectedComponentEntity> affectedComponents;
private Set<AffectedComponentEntity> referencingComponents;
@ApiModelProperty(value = "The Parameter Context that is being operated on. This may not be populated until the request has successfully completed.", readOnly = true)
public ParameterContextDTO getParameterContext() {
@ -36,12 +36,12 @@ public class ParameterContextUpdateRequestDTO extends AsynchronousRequestDTO<Par
this.parameterContext = parameterContext;
}
@ApiModelProperty(value = "The components that are affected by the update.", readOnly = true)
public Set<AffectedComponentEntity> getAffectedComponents() {
return affectedComponents;
@ApiModelProperty(value = "The components that are referenced by the update.", readOnly = true)
public Set<AffectedComponentEntity> getReferencingComponents() {
return referencingComponents;
}
public void setAffectedComponents(final Set<AffectedComponentEntity> affectedComponents) {
this.affectedComponents = affectedComponents;
public void setReferencingComponents(final Set<AffectedComponentEntity> referencingComponents) {
this.referencingComponents = referencingComponents;
}
}

View File

@ -0,0 +1,45 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.nifi.web.api.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlType;
@XmlType(name="processGroupName")
public class ProcessGroupNameDTO {
private String id;
private String name;
public void setId(String id) {
this.id = id;
}
@ApiModelProperty("The ID of the Process Group")
public String getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
@ApiModelProperty("The name of the Process Group, or the ID of the Process Group if the user does not have the READ policy for the Process Group")
public String getName() {
return name;
}
}

View File

@ -16,7 +16,9 @@
*/
package org.apache.nifi.web.api.entity;
import io.swagger.annotations.ApiModelProperty;
import org.apache.nifi.web.api.dto.AffectedComponentDTO;
import org.apache.nifi.web.api.dto.ProcessGroupNameDTO;
import javax.xml.bind.annotation.XmlRootElement;
@ -24,10 +26,11 @@ import javax.xml.bind.annotation.XmlRootElement;
* A serialized representation of this class can be placed in the entity body of a response to the API.
* This particular entity holds a reference to component that references a variable.
*/
@XmlRootElement(name = "affectComponentEntity")
@XmlRootElement(name = "affectedComponentEntity")
public class AffectedComponentEntity extends ComponentEntity implements Permissible<AffectedComponentDTO> {
private AffectedComponentDTO component;
private ProcessGroupNameDTO processGroup;
/**
* @return variable referencing components that is being serialized
@ -42,6 +45,15 @@ public class AffectedComponentEntity extends ComponentEntity implements Permissi
this.component = component;
}
@ApiModelProperty("The Process Group that the component belongs to")
public ProcessGroupNameDTO getProcessGroup() {
return processGroup;
}
public void setProcessGroup(ProcessGroupNameDTO processGroup) {
this.processGroup = processGroup;
}
@Override
public String toString() {
return component == null ? "AffectedComponent[No Component]" : component.toString();

View File

@ -38,6 +38,7 @@ public class CurrentUserEntity extends Entity {
private PermissionsDTO controllerPermissions;
private PermissionsDTO policiesPermissions;
private PermissionsDTO systemPermissions;
private PermissionsDTO parameterContextPermissions;
private PermissionsDTO restrictedComponentsPermissions;
private Set<ComponentRestrictionPermissionDTO> componentRestrictionPermissions;
@ -139,6 +140,18 @@ public class CurrentUserEntity extends Entity {
this.systemPermissions = systemPermissions;
}
/**
* @return permissions for accessing parameter contexts
*/
@ApiModelProperty("Permissions for accessing parameter contexts.")
public PermissionsDTO getParameterContextPermissions() {
return parameterContextPermissions;
}
public void setParameterContextPermissions(PermissionsDTO parameterContextPermissions) {
this.parameterContextPermissions = parameterContextPermissions;
}
/**
* @return permissions for accessing the restricted components
*/

View File

@ -66,7 +66,7 @@ public class ParameterContextUpdateEndpointMerger extends AbstractSingleEntityEn
clientUpdateRequestDto.setPercentCompleted(Math.min(clientUpdateRequestDto.getPercentCompleted(), updateRequestDto.getPercentCompleted()));
// Merge the Affected Components.
for (final AffectedComponentEntity entity : requestEntity.getRequest().getAffectedComponents()) {
for (final AffectedComponentEntity entity : requestEntity.getRequest().getReferencingComponents()) {
final AffectedComponentEntity mergedAffectedComponentEntity = affectedComponentEntities.get(entity.getId());
if (mergedAffectedComponentEntity == null) {
affectedComponentEntities.put(entity.getId(), entity);
@ -81,7 +81,7 @@ public class ParameterContextUpdateEndpointMerger extends AbstractSingleEntityEn
entityMap.forEach( (nodeId, entity) -> contextDtoMap.put(nodeId, entity.getRequest().getParameterContext()));
ParameterContextMerger.merge(clientUpdateRequestDto.getParameterContext(), contextDtoMap);
clientUpdateRequestDto.setAffectedComponents(new HashSet<>(affectedComponentEntities.values()));
clientUpdateRequestDto.setReferencingComponents(new HashSet<>(affectedComponentEntities.values()));
}
}

View File

@ -95,6 +95,10 @@ public class AffectedComponentEntityMerger {
} else {
affectedComponent.setPermissions(permissions);
affectedComponent.setComponent(null);
if (affectedComponent.getProcessGroup() != null) {
affectedComponent.getProcessGroup().setName(affectedComponent.getProcessGroup().getId());
}
}
}
}

View File

@ -1277,7 +1277,9 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
}
final Parameter parameter = parameterOption.get();
final boolean updated = !Objects.equals(updatedValue, parameter.getValue());
final boolean valueUpdated = !Objects.equals(updatedValue, parameter.getValue());
final boolean descriptionUpdated = parameterDto.getDescription() != null && !parameterDto.getDescription().equals(parameter.getDescriptor().getDescription());
final boolean updated = valueUpdated || descriptionUpdated;
if (updated) {
updatedParameters.add(parameterName);
}
@ -4004,6 +4006,7 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
entity.setControllerPermissions(dtoFactory.createPermissionsDto(authorizableLookup.getController()));
entity.setPoliciesPermissions(dtoFactory.createPermissionsDto(authorizableLookup.getPolicies()));
entity.setSystemPermissions(dtoFactory.createPermissionsDto(authorizableLookup.getSystem()));
entity.setParameterContextPermissions(dtoFactory.createPermissionsDto(authorizableLookup.getParameterContexts()));
entity.setCanVersionFlows(CollectionUtils.isNotEmpty(flowRegistryClient.getRegistryIdentifiers()));
entity.setRestrictedComponentsPermissions(dtoFactory.createPermissionsDto(authorizableLookup.getRestrictedComponents()));

View File

@ -802,7 +802,7 @@ public class ParameterContextResource extends ApplicationResource {
final Consumer<AsynchronousWebRequest<ParameterContextEntity, ParameterContextEntity>> updateTask = asyncRequest -> {
try {
final ParameterContextEntity updatedParameterContextEntity = updateParameterContext(asyncRequest, requestWrapper.getComponentLifecycle(), requestWrapper.getExampleUri(),
requestWrapper.getAffectedComponents(), requestWrapper.isReplicateRequest(), requestRevision, requestWrapper.getParameterContextEntity());
requestWrapper.getReferencingComponents(), requestWrapper.isReplicateRequest(), requestRevision, requestWrapper.getParameterContextEntity());
asyncRequest.markStepComplete(updatedParameterContextEntity);
} catch (final ResumeFlowException rfe) {
@ -1162,7 +1162,7 @@ public class ParameterContextResource extends ApplicationResource {
}
}
updateRequestDto.setAffectedComponents(new HashSet<>(affectedComponents.values()));
updateRequestDto.setReferencingComponents(new HashSet<>(affectedComponents.values()));
// Populate the Affected Components
final ParameterContextEntity contextEntity = serviceFacade.getParameterContext(asyncRequest.getComponentId(), NiFiUserUtils.getNiFiUser());
@ -1211,7 +1211,7 @@ public class ParameterContextResource extends ApplicationResource {
return exampleUri;
}
public Set<AffectedComponentEntity> getAffectedComponents() {
public Set<AffectedComponentEntity> getReferencingComponents() {
return affectedComponents;
}

View File

@ -144,10 +144,11 @@ public class AsyncRequestManager<R, T> implements RequestManager<R, T> {
}
if (!request.isComplete()) {
throw new IllegalStateException("Cannot remove the request because it is not yet complete");
request.cancel();
}
return requests.remove(key);
requests.remove(key);
return request;
}
@Override

View File

@ -1943,12 +1943,17 @@ public final class DtoFactory {
final ProcessorDTO processorDto = processorEntity.getComponent();
final AffectedComponentDTO componentDto = new AffectedComponentDTO();
componentDto.setId(processorDto.getId());
componentDto.setName(processorDto.getName());
componentDto.setProcessGroupId(processorDto.getParentGroupId());
componentDto.setReferenceType(AffectedComponentDTO.COMPONENT_TYPE_PROCESSOR);
componentDto.setState(processorDto.getState());
componentDto.setValidationErrors(processorDto.getValidationErrors());
if (componentDto == null) {
componentDto.setId(processorEntity.getId());
componentDto.setName(processorEntity.getId());
} else {
componentDto.setId(processorDto.getId());
componentDto.setName(processorDto.getName());
componentDto.setProcessGroupId(processorDto.getParentGroupId());
componentDto.setReferenceType(AffectedComponentDTO.COMPONENT_TYPE_PROCESSOR);
componentDto.setState(processorDto.getState());
componentDto.setValidationErrors(processorDto.getValidationErrors());
}
component.setComponent(componentDto);
return component;
@ -1969,12 +1974,18 @@ public final class DtoFactory {
final PortDTO portDto = portEntity.getComponent();
final AffectedComponentDTO componentDto = new AffectedComponentDTO();
componentDto.setId(portDto.getId());
componentDto.setName(portDto.getName());
componentDto.setProcessGroupId(portDto.getParentGroupId());
componentDto.setReferenceType(referenceType);
componentDto.setState(portDto.getState());
componentDto.setValidationErrors(portDto.getValidationErrors());
if (componentDto == null) {
componentDto.setId(portEntity.getId());
componentDto.setName(portEntity.getId());
} else {
componentDto.setId(portDto.getId());
componentDto.setName(portDto.getName());
componentDto.setProcessGroupId(portDto.getParentGroupId());
componentDto.setReferenceType(referenceType);
componentDto.setState(portDto.getState());
componentDto.setValidationErrors(portDto.getValidationErrors());
}
component.setComponent(componentDto);
return component;
@ -1995,12 +2006,19 @@ public final class DtoFactory {
final ControllerServiceDTO serviceDto = serviceEntity.getComponent();
final AffectedComponentDTO componentDto = new AffectedComponentDTO();
componentDto.setId(serviceDto.getId());
componentDto.setName(serviceDto.getName());
componentDto.setProcessGroupId(serviceDto.getParentGroupId());
componentDto.setReferenceType(AffectedComponentDTO.COMPONENT_TYPE_CONTROLLER_SERVICE);
componentDto.setState(serviceDto.getState());
componentDto.setValidationErrors(serviceDto.getValidationErrors());
if (serviceDto == null) {
componentDto.setId(serviceEntity.getId());
componentDto.setName(serviceEntity.getId());
componentDto.setProcessGroupId(serviceEntity.getParentGroupId());
} else {
componentDto.setId(serviceDto.getId());
componentDto.setName(serviceDto.getName());
componentDto.setProcessGroupId(serviceDto.getParentGroupId());
componentDto.setReferenceType(AffectedComponentDTO.COMPONENT_TYPE_CONTROLLER_SERVICE);
componentDto.setState(serviceDto.getState());
componentDto.setValidationErrors(serviceDto.getValidationErrors());
}
component.setComponent(componentDto);
return component;
@ -2707,7 +2725,26 @@ public final class DtoFactory {
final AffectedComponentDTO affectedComponent = createAffectedComponentDto(componentNode);
final PermissionsDTO permissions = createPermissionsDto(componentNode);
final RevisionDTO revision = createRevisionDTO(revisionManager.getRevision(componentNode.getIdentifier()));
return entityFactory.createAffectedComponentEntity(affectedComponent, revision, permissions);
final ProcessGroupNameDTO groupNameDto = new ProcessGroupNameDTO();
groupNameDto.setId(componentNode.getProcessGroupIdentifier());
groupNameDto.setName(componentNode.getProcessGroupIdentifier());
ProcessGroup processGroup = null;
if (componentNode instanceof ProcessorNode) {
processGroup = ((ProcessorNode) componentNode).getProcessGroup();
} else if (componentNode instanceof ControllerServiceNode) {
processGroup = ((ControllerServiceNode) componentNode).getProcessGroup();
}
if (processGroup != null) {
final boolean authorized = processGroup.isAuthorized(authorizer, RequestAction.READ, NiFiUserUtils.getNiFiUser());
if (authorized) {
groupNameDto.setName(processGroup.getName());
}
}
return entityFactory.createAffectedComponentEntity(affectedComponent, revision, permissions, groupNameDto);
}
public VariableRegistryDTO createVariableRegistryDto(final ProcessGroup processGroup, final RevisionManager revisionManager) {

View File

@ -358,7 +358,8 @@ public final class EntityFactory {
return entity;
}
public AffectedComponentEntity createAffectedComponentEntity(final AffectedComponentDTO dto, final RevisionDTO revision, final PermissionsDTO permissions) {
public AffectedComponentEntity createAffectedComponentEntity(final AffectedComponentDTO dto, final RevisionDTO revision, final PermissionsDTO permissions,
final ProcessGroupNameDTO processGroupNameDto) {
final AffectedComponentEntity entity = new AffectedComponentEntity();
entity.setRevision(revision);
if (dto != null) {
@ -369,6 +370,8 @@ public final class EntityFactory {
entity.setComponent(dto);
}
}
entity.setProcessGroup(processGroupNameDto);
return entity;
}

View File

@ -81,10 +81,10 @@ public class StandardParameterContextDAO implements ParameterContextDAO {
final boolean deletion = parameterDto.getDescription() == null && parameterDto.getSensitive() == null && parameterDto.getValue() == null;
if (deletion) {
parameterMap.put(parameterDto.getName(), null);
parameterMap.put(parameterDto.getName().trim(), null);
} else {
final Parameter parameter = createParameter(parameterDto);
parameterMap.put(parameterDto.getName(), parameter);
parameterMap.put(parameterDto.getName().trim(), parameter);
}
}

View File

@ -406,7 +406,11 @@ public class ClusterReplicationComponentLifecycle implements ComponentLifecycle
boolean allReachedDesiredState = true;
for (final ControllerServiceEntity serviceEntity : serviceEntities) {
final ControllerServiceDTO serviceDto = serviceEntity.getComponent();
if (!affectedServices.containsKey(serviceDto.getId())) {
if (serviceDto == null) {
continue;
}
if (!serviceIds.contains(serviceDto.getId())) {
continue;
}

View File

@ -393,6 +393,40 @@
</plugins>
</build>
<profiles>
<profile>
<id>development-mode</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<!--
Speed up build time by excluding node, npm, and any node_modules from `mvn clean` since the front-end-maven plugin uses these
directories as cache.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${project.build.directory}</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>frontend-working-directory/node/**/*</exclude>
<exclude>frontend-working-directory/node_modules/**/*</exclude>
</excludes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>minify-and-compress</id>
<activation>
@ -486,6 +520,7 @@
<include>${staging.dir}/js/nf/nf-status-history.js</include>
<include>${staging.dir}/js/nf/canvas/nf-queue-listing.js</include>
<include>${staging.dir}/js/nf/canvas/nf-policy-management.js</include>
<include>${staging.dir}/js/nf/canvas/nf-parameter-contexts.js</include>
<include>${staging.dir}/js/nf/canvas/nf-actions.js</include>
<include>${staging.dir}/js/nf/canvas/nf-canvas.js</include>
<include>${staging.dir}/js/nf/canvas/nf-canvas-error-handler.js</include>
@ -688,12 +723,14 @@
<include>${staging.dir}/css/new-port-dialog.css</include>
<include>${staging.dir}/css/new-controller-service-dialog.css</include>
<include>${staging.dir}/css/new-reporting-task-dialog.css</include>
<include>${staging.dir}/css/new-parameter-context-dialog.css</include>
<include>${staging.dir}/css/graph.css</include>
<include>${staging.dir}/css/header.css</include>
<include>${staging.dir}/css/main.css</include>
<include>${staging.dir}/css/banner.css</include>
<include>${staging.dir}/css/navigation.css</include>
<include>${staging.dir}/css/flow-status.css</include>
<include>${staging.dir}/css/parameter-contexts.css</include>
<include>${staging.dir}/css/settings.css</include>
<include>${staging.dir}/css/about.css</include>
<include>${staging.dir}/css/status-history.css</include>
@ -922,7 +959,7 @@
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jstl</artifactId>
<scope>provided</scope>
</dependency>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>

View File

@ -62,6 +62,7 @@ nf.canvas.script.tags=<script type="text/javascript" src="js/nf/nf-ng-bridge.js?
<script type="text/javascript" src="js/nf/nf-status-history.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/nf-queue-listing.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/nf-policy-management.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/nf-parameter-contexts.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/nf-actions.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/nf-canvas.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/nf-canvas-error-handler.js?${project.version}"></script>\n\
@ -91,4 +92,4 @@ nf.canvas.script.tags=<script type="text/javascript" src="js/nf/nf-ng-bridge.js?
<script type="text/javascript" src="js/nf/nf-ng-app-config.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/nf-canvas-bootstrap.js?${project.version}"></script>
nf.canvas.style.tags=<link rel="stylesheet" href="css/canvas.css?${project.version}" type="text/css" />\n\
<link rel="stylesheet" href="css/common-ui.css?${project.version}" type="text/css" />
<link rel="stylesheet" href="css/common-ui.css?${project.version}" type="text/css" />

View File

@ -110,6 +110,7 @@
<jsp:include page="/WEB-INF/partials/canvas/enable-controller-service-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/new-controller-service-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/new-reporting-task-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/new-parameter-context-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/new-processor-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/new-port-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/new-process-group-dialog.jsp"/>
@ -133,6 +134,7 @@
</div>
<jsp:include page="/WEB-INF/partials/canvas/navigation.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/settings-content.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/parameter-contexts-content.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/shell.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/controller-service-configuration.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/reporting-task-configuration.jsp"/>
@ -160,4 +162,4 @@
<div id="context-menu" class="context-menu unselectable"></div>
<span id="nifi-content-viewer-url" class="hidden"></span>
</body>
</html>
</html>

View File

@ -132,6 +132,12 @@
<i class="fa fa-wrench"></i>Controller Settings
</a>
</md-menu-item>
<md-menu-item layout-align="space-around center">
<a id="parameter-contexts-link"
ng-click="appCtrl.serviceProvider.headerCtrl.globalMenuCtrl.parameterContexts.shell.launch();">
<i class="fa"></i>Parameter Contexts
</a>
</md-menu-item>
<md-menu-item ng-if="appCtrl.serviceProvider.headerCtrl.globalMenuCtrl.cluster.visible();"
layout-align="space-around center">
<a id="cluster-link"
@ -185,4 +191,4 @@
</md-menu>
</div>
</div>
</md-toolbar>
</md-toolbar>

View File

@ -0,0 +1,146 @@
<%--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--%>
<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<div id="parameter-context-dialog" layout="column" class="hidden">
<div id="parameter-context-status-bar"></div>
<div class="parameter-context-tab-container dialog-content">
<div id="parameter-context-tabs" class="tab-container"></div>
<div id="parameter-context-tabs-content">
<div id="parameter-context-standard-settings-tab-content" class="configuration-tab">
<div class="settings-left">
<div class="setting">
<div class="setting-name">Name</div>
<div id="parameter-context-name-container" class="setting-field">
<input type="text" id="parameter-context-name" name="parameter-context-name"/>
</div>
</div>
<div class="setting">
<div class="setting-name">Description</div>
<div class="setting-field parameter-context-description-container">
<textarea id="parameter-context-description-field" rows="6"></textarea>
</div>
<div class="clear"></div>
</div>
</div>
<div class="spacer">&nbsp;</div>
<div class="settings-right">
</div>
</div>
<div id="parameter-context-parameters-tab-content" class="configuration-tab">
<div class="settings-left">
<div>
<div id="add-parameter"><button class="button fa fa-plus"></button></div>
<div class="clear"></div>
</div>
<div id="parameter-table"></div>
<div id="parameter-context-update-status" class="hidden">
<div class="setting">
<div class="setting-name">
Steps to update parameters
</div>
<div class="setting-field">
<ol id="parameter-context-update-steps"></ol>
</div>
</div>
</div>
</div>
<div class="spacer">&nbsp;</div>
<div id="parameter-context-usage" class="settings-right">
<div class="setting">
<div class="setting-name">
Parameter
</div>
<div class="setting-field">
<div id="parameter-referencing-components-context"></div>
</div>
</div>
<div class="setting">
<div class="setting-name">
Referencing Components
<div class="fa fa-question-circle" alt="Info" title="Components referencing this parameter grouped by process group."></div>
</div>
<div id="parameter-referencing-components-container" class="setting-field">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="parameter-dialog" class="dialog cancellable hidden">
<div class="dialog-content">
<div class="setting">
<div class="setting-name">Name</div>
<div class="setting-field new-parameter-name-container">
<input id="parameter-name" type="text"/>
</div>
<div class="clear"></div>
</div>
<div class="setting">
<div class="setting-name">Value</div>
<div class="setting-field new-parameter-value-container">
<textarea id="parameter-value-field"></textarea>
<div class="string-check-container">
<div id="parameter-set-empty-string-field" class="nf-checkbox string-check checkbox-unchecked"></div>
<span class="string-check-label nf-checkbox-label">Set empty string</span>
</div>
</div>
<div class="clear"></div>
</div>
<div class="setting">
<div class="setting-field new-parameter-sensitive-value-container">
<div class="setting-name">Sensitive value</div>
<input id="parameter-sensitive-radio-button" type="radio" name="sensitive" value="sensitive"/> Yes
<input id="parameter-not-sensitive-radio-button" type="radio" name="sensitive" value="plain" checked="checked" style="margin-left: 20px;"/> No
</div>
<div class="clear"></div>
</div>
<div class="setting">
<div class="setting-name">Description</div>
<div class="setting-field new-parameter-description-container">
<textarea id="parameter-description-field" rows="6"></textarea>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div id="referencing-components-template" class="referencing-components-template hidden clear">
<div class="setting">
<div class="setting-name">
Referencing Processors
</div>
<div class="setting-field">
<ul class="parameter-context-referencing-processors"></ul>
</div>
</div>
<div class="setting">
<div class="setting-name">
Referencing Controller Services
</div>
<div class="setting-field">
<ul class="parameter-context-referencing-controller-services"></ul>
</div>
</div>
<div class="setting">
<div class="setting-name">
Unauthorized referencing components
</div>
<div class="setting-field">
<ul class="parameter-context-referencing-unauthorized-components"></ul>
</div>
</div>
</div>

View File

@ -0,0 +1,32 @@
<%--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--%>
<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<div id="parameter-contexts" class="hidden">
<button id="new-parameter-context" class="add-button fa fa-plus" title="Create a new parameter context" style="display: block;"></button>
<div id="parameter-contexts-header-text" class="parameter-contexts-header-text">NiFi Parameter Contexts</div>
<div class="parameter-contexts-container">
<div id="parameter-contexts-table" class="parameter-contexts-table"></div>
</div>
<div id="parameter-contexts-refresh-container">
<button id="parameter-contexts-refresh-button" class="refresh-button pointer fa fa-refresh" title="Refresh"></button>
<div id="parameter-contexts-last-refreshed-container" class="last-refreshed-container">
Last updated:&nbsp;<span id="parameter-contexts-last-refreshed" class="value-color"></span>
</div>
<div id="parameter-contexts-loading-container" class="loading-container"></div>
<div class="clear"></div>
</div>
</div>

View File

@ -74,6 +74,16 @@
</div>
<div class="clear"></div>
</div>
<div id="policy-selected-parameter-context-container" class="hidden policy-selected-component-container">
<div class="policy-selected-component-type-icon">
<i class="icon icon-drop"></i>
</div>
<div class="policy-selected-component-details-container">
<div class="policy-selected-component-name"></div>
<div class="policy-selected-component-type">Parameter Context</div>
</div>
<div class="clear"></div>
</div>
<div id="selected-policy-component-id" class="hidden"></div>
<div id="selected-policy-component-type" class="hidden"></div>
<div id="component-policy-target"></div>
@ -94,4 +104,4 @@
<div id="restriction-message" class="hidden">Only listing restriction specific users. Users with permission "regardless of restrictions" not shown but are also allowed.</div>
<div class="clear"></div>
</div>
</div>
</div>

View File

@ -33,7 +33,16 @@
<input type="text" id="process-group-name" class="setting-input"/>
</div>
<div class="read-only setting-field">
<span id="read-only-process-group-name"></span>
<span id="read-only-process-group-name" class="unset"></span>
</div>
</div>
<div class="setting">
<div class="setting-name">Process group parameter context</div>
<div class="editable setting-field">
<div id="process-group-parameter-context-combo"></div>
</div>
<div class="read-only setting-field">
<span id="read-only-process-group-parameter-context" class="unset">Unauthorized</span>
</div>
</div>
<div class="setting">
@ -42,7 +51,7 @@
<textarea id="process-group-comments" class="setting-input"></textarea>
</div>
<div class="read-only setting-field">
<span id="read-only-process-group-comments"></span>
<span id="read-only-process-group-comments" class="unset"></span>
</div>
</div>
<div class="editable settings-buttons">
@ -65,4 +74,4 @@
<div id="flow-cs-availability" class="hidden">Listed services are available to all descendant Processors and services of this Process Group.</div>
<div class="clear"></div>
</div>
</div>
</div>

View File

@ -48,7 +48,7 @@
Variables
</div>
<div class="setting-field">
<div id="affected-components-context"></div>
<div id="variable-affected-components-context"></div>
</div>
</div>
<div class="setting">
@ -91,4 +91,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -34,16 +34,18 @@
@import url(new-port-dialog.css);
@import url(new-controller-service-dialog.css);
@import url(new-reporting-task-dialog.css);
@import url(new-parameter-context-dialog.css);
@import url(graph.css);
@import url(header.css);
@import url(main.css);
@import url(banner.css);
@import url(navigation.css);
@import url(flow-status.css);
@import url(parameter-contexts.css);
@import url(settings.css);
@import url(about.css);
@import url(message-pane.css);
@import url(common-ui.css);
@import url(status-history.css);
@import url(../fonts/flowfont/flowfont.css);
@import url(../assets/font-awesome/css/font-awesome.css);
@import url(../assets/font-awesome/css/font-awesome.css);

View File

@ -377,3 +377,10 @@ div.variable-step {
width: 300px;
margin-bottom: 2px;
}
div.parameter-context-step {
width: 16px;
height: 16px;
background-color: transparent;
float: right;
}

View File

@ -0,0 +1,103 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
Parameter context dialog
*/
#parameter-context-dialog {
width: 850px;
height: 575px;
}
#parameter-context-dialog div.settings-left {
float: left;
width: 65%;
}
#parameter-context-dialog div.settings-right {
float: left;
width: 33%;
height: 100%;
position: absolute;
left: calc(65% - -15px);
}
#parameter-context-standard-settings-tab-content,
#parameter-context-parameters-tab-content {
bottom: 10px;
}
#parameter-table {
height: 370px;
}
#add-parameter {
float: right;
margin-bottom: 4px;
font-size: 16px;
text-transform: uppercase;
}
#parameter-context-update-steps li {
width: 300px;
margin-bottom: 2px;
}
#parameter-value-field {
height: 54px;
}
#parameter-description-field {
height: 85px;
}
#parameter-context-description-field {
height: 85px;
}
#parameter-referencing-components-container {
position: absolute;
bottom: 10px;
top: 75px;
width: calc(100% - 5px);
overflow: auto;
border: 0 solid #CCCCCC;
overflow: auto;
padding: 2px;
}
.referencing-components-template {
position: relative;
left: 15px;
width: calc(100% - 15px);
}
/*
Parameter creation/configuration dialog
*/
#parameter-dialog {
width: 470px;
height: 470px;
}
span.parameter-context-referencing-component-name {
margin-left: 5px;
margin-right: 5px;
max-width: calc(100% - 10px);
}

View File

@ -0,0 +1,92 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#parameter-contexts {
position: absolute;
top: 0px;
bottom: 0px;
left: 20px;
right: 20px;
overflow: auto;
}
#new-parameter-context {
position: absolute;
right: 0;
top: 26px;
}
div.parameter-contexts-header-text {
height: 28px;
font-size: 18px;
font-weight: bold;
color: #728E9B;
margin-bottom: 30px;
}
div.parameter-contexts-container {
padding: 0;
position: absolute;
top: 58px;
bottom: 52px;
left: 0px;
right: 0px;
}
#parameter-contexts-refresh-container {
position: absolute;
bottom: 20px;
right: 0px;
left: 0px;
height: 32px;
}
div.parameter-contexts-table {
position: absolute;
top: 0px;
left: 0px;
bottom: 20px;
right: 0px;
min-height: 150px;
}
#parameter-contexts-table div.slick-viewport {
overflow-x: hidden !important;
}
span.sorted {
text-decoration: underline;
}
div.parameter-contexts-refresh-button {
height: 24px;
width: 26px;
float: left;
}
#parameter-contexts-loading-container {
float: left;
width: 16px;
height: 16px;
background-color: transparent;
margin-top: 4px;
margin-left: 3px;
}
#parameter-contexts-last-refreshed {
font-weight: 500;
}

View File

@ -81,6 +81,10 @@
vertical-align: middle;
}
#process-group-parameter-context-combo {
width: 328px;
}
#process-group-comments {
height: 100px;
}
@ -91,4 +95,4 @@
#process-group-controller-services-tab-content {
top: 32px;
}
}

View File

@ -23,12 +23,13 @@
'nf.Common',
'nf.QueueListing',
'nf.Shell',
'nf.ParameterContexts',
'nf.PolicyManagement',
'nf.ClusterSummary',
'nf.ErrorHandler',
'nf.Settings',
'nf.CanvasUtils'],
function ($, nfCommon, nfQueueListing, nfShell, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils) {
function ($, nfCommon, nfQueueListing, nfShell, nfParameterContexts, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils) {
return (nf.ng.Canvas.GlobalMenuCtrl = factory($, nfCommon, nfQueueListing, nfShell, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
@ -37,6 +38,7 @@
require('nf.Common'),
require('nf.QueueListing'),
require('nf.Shell'),
require('nf.ParameterContexts'),
require('nf.PolicyManagement'),
require('nf.ClusterSummary'),
require('nf.ErrorHandler'),
@ -47,13 +49,14 @@
root.nf.Common,
root.nf.QueueListing,
root.nf.Shell,
root.nf.ParameterContexts,
root.nf.PolicyManagement,
root.nf.ClusterSummary,
root.nf.ErrorHandler,
root.nf.Settings,
root.nf.CanvasUtils);
}
}(this, function ($, nfCommon, nfQueueListing, nfShell, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils) {
}(this, function ($, nfCommon, nfQueueListing, nfShell, nfParameterContexts, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils) {
'use strict';
return function (serviceProvider) {
@ -167,6 +170,25 @@
}
};
/**
* The parameter contexts menu item controller.
*/
this.parameterContexts = {
/**
* The parameter contexts menu item's shell controller.
*/
shell: {
/**
* Launch the parameter contexts shell.
*/
launch: function () {
nfParameterContexts.showParameterContexts();
}
}
};
/**
* The cluster menu item controller.
*/
@ -432,9 +454,9 @@
init: function () {
this.about.init();
}
}
};
var globalMenuCtrl = new GlobalMenuCtrl();
return globalMenuCtrl;
};
}));
}));

View File

@ -28,6 +28,7 @@
'nf.Client',
'nf.ErrorHandler',
'nf.Clipboard',
'nf.ParameterContexts',
'nf.Snippet',
'nf.GoTo',
'nf.ng.Bridge',
@ -57,8 +58,8 @@
'nf.ComponentVersion',
'nf.QueueListing',
'nf.StatusHistory'],
function ($, d3, nfCanvasUtils, nfCommon, nfDialog, nfStorage, nfClient, nfErrorHandler, nfClipboard, nfSnippet, nfGoto, nfNgBridge, nfShell, nfVariableRegistry, nfComponentState, nfFlowVersion, nfDraggable, nfBirdseye, nfConnection, nfGraph, nfProcessGroupConfiguration, nfProcessorConfiguration, nfProcessorDetails, nfLabelConfiguration, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupDetails, nfPortConfiguration, nfPortDetails, nfConnectionConfiguration, nfConnectionDetails, nfPolicyManagement, nfRemoteProcessGroup, nfLabel, nfProcessor, nfRemoteProcessGroupPorts, nfComponentVersion, nfQueueListing, nfStatusHistory) {
return (nf.Actions = factory($, d3, nfCanvasUtils, nfCommon, nfDialog, nfStorage, nfClient, nfErrorHandler, nfClipboard, nfSnippet, nfGoto, nfNgBridge, nfShell, nfVariableRegistry, nfComponentState, nfFlowVersion, nfDraggable, nfBirdseye, nfConnection, nfGraph, nfProcessGroupConfiguration, nfProcessorConfiguration, nfProcessorDetails, nfLabelConfiguration, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupDetails, nfPortConfiguration, nfPortDetails, nfConnectionConfiguration, nfConnectionDetails, nfPolicyManagement, nfRemoteProcessGroup, nfLabel, nfProcessor, nfRemoteProcessGroupPorts, nfComponentVersion, nfQueueListing, nfStatusHistory));
function ($, d3, nfCanvasUtils, nfCommon, nfDialog, nfStorage, nfClient, nfErrorHandler, nfClipboard, nfParameterContexts, nfSnippet, nfGoto, nfNgBridge, nfShell, nfVariableRegistry, nfComponentState, nfFlowVersion, nfDraggable, nfBirdseye, nfConnection, nfGraph, nfProcessGroupConfiguration, nfProcessorConfiguration, nfProcessorDetails, nfLabelConfiguration, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupDetails, nfPortConfiguration, nfPortDetails, nfConnectionConfiguration, nfConnectionDetails, nfPolicyManagement, nfRemoteProcessGroup, nfLabel, nfProcessor, nfRemoteProcessGroupPorts, nfComponentVersion, nfQueueListing, nfStatusHistory) {
return (nf.Actions = factory($, d3, nfCanvasUtils, nfCommon, nfDialog, nfStorage, nfClient, nfErrorHandler, nfClipboard, nfParameterContexts, nfSnippet, nfGoto, nfNgBridge, nfShell, nfVariableRegistry, nfComponentState, nfFlowVersion, nfDraggable, nfBirdseye, nfConnection, nfGraph, nfProcessGroupConfiguration, nfProcessorConfiguration, nfProcessorDetails, nfLabelConfiguration, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupDetails, nfPortConfiguration, nfPortDetails, nfConnectionConfiguration, nfConnectionDetails, nfPolicyManagement, nfRemoteProcessGroup, nfLabel, nfProcessor, nfRemoteProcessGroupPorts, nfComponentVersion, nfQueueListing, nfStatusHistory));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Actions =
@ -71,6 +72,7 @@
require('nf.Client'),
require('nf.ErrorHandler'),
require('nf.Clipboard'),
require('nf.ParameterContexts'),
require('nf.Snippet'),
require('nf.GoTo'),
require('nf.ng.Bridge'),
@ -110,6 +112,7 @@
root.nf.Client,
root.nf.ErrorHandler,
root.nf.Clipboard,
root.nf.ParameterContexts,
root.nf.Snippet,
root.nf.GoTo,
root.nf.ng.Bridge,
@ -140,13 +143,14 @@
root.nf.QueueListing,
root.nf.StatusHistory);
}
}(this, function ($, d3, nfCanvasUtils, nfCommon, nfDialog, nfStorage, nfClient, nfErrorHandler, nfClipboard, nfSnippet, nfGoto, nfNgBridge, nfShell, nfVariableRegistry, nfComponentState, nfFlowVersion, nfDraggable, nfBirdseye, nfConnection, nfGraph, nfProcessGroupConfiguration, nfProcessorConfiguration, nfProcessorDetails, nfLabelConfiguration, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupDetails, nfPortConfiguration, nfPortDetails, nfConnectionConfiguration, nfConnectionDetails, nfPolicyManagement, nfRemoteProcessGroup, nfLabel, nfProcessor, nfRemoteProcessGroupPorts, nfComponentVersion, nfQueueListing, nfStatusHistory) {
}(this, function ($, d3, nfCanvasUtils, nfCommon, nfDialog, nfStorage, nfClient, nfErrorHandler, nfClipboard, nfParameterContexts, nfSnippet, nfGoto, nfNgBridge, nfShell, nfVariableRegistry, nfComponentState, nfFlowVersion, nfDraggable, nfBirdseye, nfConnection, nfGraph, nfProcessGroupConfiguration, nfProcessorConfiguration, nfProcessorDetails, nfLabelConfiguration, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupDetails, nfPortConfiguration, nfPortDetails, nfConnectionConfiguration, nfConnectionDetails, nfPolicyManagement, nfRemoteProcessGroup, nfLabel, nfProcessor, nfRemoteProcessGroupPorts, nfComponentVersion, nfQueueListing, nfStatusHistory) {
'use strict';
var config = {
urls: {
api: '../nifi-api',
controller: '../nifi-api/controller'
controller: '../nifi-api/controller',
parameterContexts: '../nifi-api/parameter-contexts'
}
};
@ -1401,6 +1405,27 @@
}
},
/**
* Opens the parameter context for the specified selection of the current group if the selection is empty.
*
* @param {selection} selection
*/
openParameterContext: function (selection) {
var pcid;
if (selection.empty()) {
pcid = nfCanvasUtils.getParameterContextId();
} else if (selection.size() === 1) {
if (nfCanvasUtils.isProcessGroup(selection)) {
var pg = selection.datum();
pcid = pg.component.parameterContext.id;
}
}
if (nfCommon.isDefinedAndNotNull(pcid)) {
nfParameterContexts.showParameterContext(pcid);
}
},
/**
* Views the state for the specified processor.
*
@ -1944,4 +1969,4 @@
};
return nfActions;
}));
}));

View File

@ -32,6 +32,7 @@
'nf.ContextMenu',
'nf.QuickSelect',
'nf.Shell',
'nf.ParameterContexts',
'nf.Settings',
'nf.Snippet',
'nf.Actions',
@ -82,8 +83,8 @@
'nf.ng.Canvas.OperateCtrl',
'nf.ng.BreadcrumbsDirective',
'nf.ng.DraggableDirective'],
function ($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVariableRegistry, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
return factory($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVariableRegistry, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective);
function ($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfParameterContexts, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVariableRegistry, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
return factory($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfParameterContexts, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVariableRegistry, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective);
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = factory(require('jquery'),
@ -99,6 +100,7 @@
require('nf.ContextMenu'),
require('nf.QuickSelect'),
require('nf.Shell'),
require('nf.ParameterContexts'),
require('nf.Settings'),
require('nf.Actions'),
require('nf.Snippet'),
@ -163,6 +165,7 @@
root.nf.ContextMenu,
root.nf.QuickSelect,
root.nf.Shell,
root.nf.ParameterContexts,
root.nf.Settings,
root.nf.Actions,
root.nf.Snippet,
@ -214,7 +217,7 @@
root.nf.ng.BreadcrumbsDirective,
root.nf.ng.DraggableDirective);
}
}(this, function ($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVariableRegistry, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
}(this, function ($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfParameterContexts, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVariableRegistry, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
var config = {
urls: {
@ -343,6 +346,7 @@
nfShell.init(nfContextMenu);
nfNgBridge.injector.get('headerCtrl').init();
nfSettings.init();
nfParameterContexts.init();
nfActions.init();
nfQueueListing.init();
nfVariableRegistry.init();
@ -369,8 +373,8 @@
supportsStatusBar : true,
nfActions : nfActions
});
// initialize the PG config and invert control of the controllerServices
nfProcessGroupConfiguration.init(nfControllerServices);
// initialize the PG config and invert control of the controllerServices and parameter contexts
nfProcessGroupConfiguration.init(nfControllerServices, nfParameterContexts);
nfRemoteProcessGroupConfiguration.init();
nfRemoteProcessGroupPorts.init();
nfPortConfiguration.init();

View File

@ -2088,6 +2088,22 @@
return nfCanvas.getGroupId();
},
/**
* Set the parameter context id.
*
* @argument {string} pcid The parameter context id
*/
setParameterContextId: function (pcid) {
return nfCanvas.setParameterContextId(pcid);
},
/**
* Get the parameter context id.
*/
getParameterContextId: function () {
return nfCanvas.getParameterContextId();
},
/**
* Get the group name.
*/
@ -2199,4 +2215,4 @@
}
};
return nfCanvasUtils;
}));
}));

View File

@ -86,6 +86,7 @@
var polling = false;
var allowPageRefresh = false;
var groupId = 'root';
var parameterContextId;
var groupName = null;
var permissions = null;
var parentGroupId = null;
@ -147,8 +148,9 @@
// get the controller and its contents
var processGroupFlow = flowResponse.processGroupFlow;
// set the group details
// set the group and parameter context details
nfCanvas.setGroupId(processGroupFlow.id);
nfCanvas.setParameterContextId(processGroupFlow.parameterContextId);
// get the current group name from the breadcrumb
var breadcrumb = processGroupFlow.breadcrumb;
@ -218,15 +220,17 @@
var changeProcessGroup = function (processGroupId, options) {
// capture the current group id to reset to in case of failure
var currentProcessGroup = nfCanvas.getGroupId();
var currentParameterContext = nfCanvas.getParameterContextId();
// update process group id and attempt to reload
nfCanvas.setGroupId(processGroupId);
var processGroupXhr = reloadProcessGroup(options);
// if the request fails, ensure the process group id is reset
// if the request fails, ensure the process group id and parameter context id is reset
processGroupXhr
.fail(function (xhr, status, error) {
nfCanvas.setGroupId(currentProcessGroup);
nfCanvas.setParameterContextId(currentParameterContext);
});
return processGroupXhr;
@ -903,6 +907,22 @@
}).promise();
},
/**
* Set the parameter context id.
*
* @argument {string} pcid The parameter context id
*/
setParameterContextId: function (pcid) {
parameterContextId = pcid;
},
/**
* Get the parameter context id.
*/
getParameterContextId: function () {
return parameterContextId;
},
/**
* Set the group id.
*
@ -1369,4 +1389,4 @@
};
return nfCanvas;
}));
}));

View File

@ -81,6 +81,21 @@
return selection.empty() || nfCanvasUtils.isProcessGroup(selection);
};
/**
* Determines whether the component in the specified selection has a parameter context.
*
* @param {selection} selection The selection of currently selected components
*/
var hasParameterContext = function (selection) {
if (selection.empty()) {
return !nfCommon.isUndefinedOrNull(nfCanvasUtils.getParameterContextId());
} else if (nfCanvasUtils.isProcessGroup(selection)) {
var pg = selection.datum();
return !nfCommon.isUndefinedOrNull(pg.component.parameterContext.id);
}
return false;
};
/**
* Determines whether the component in the specified selection has configuration details.
*
@ -832,6 +847,7 @@
{separator: true},
{id: 'show-configuration-menu-item', condition: isConfigurable, menuItem: {clazz: 'fa fa-gear', text: 'Configure', action: 'showConfiguration'}},
{id: 'show-details-menu-item', condition: hasDetails, menuItem: {clazz: 'fa fa-gear', text: 'View configuration', action: 'showDetails'}},
{id: 'parameters-menu-item', condition: hasParameterContext, menuItem: {clazz: 'fa', text: 'Parameters', action: 'openParameterContext'}},
{id: 'variable-registry-menu-item', condition: hasVariables, menuItem: {clazz: 'fa', text: 'Variables', action: 'openVariableRegistry'}},
{separator: true},
{id: 'version-menu-item', groupMenuItem: {clazz: 'fa', text: 'Version'}, menuItems: [
@ -1116,4 +1132,4 @@
};
return nfContextMenu;
}));
}));

View File

@ -58,7 +58,7 @@
}
}(this, function ($, Slick, nfErrorHandler, nfCommon, nfClient, nfStorage, nfCanvasUtils, nfNgBridge, nfDialog, nfShell) {
'use strict';
var config = {
urls: {
api: '../nifi-api',
@ -68,6 +68,7 @@
var initialized = false;
var initializedComponentRestrictions = false;
var initializingComponentPolicy = false;
var initAddTenantToPolicyDialog = function () {
$('#new-policy-user-button').on('click', function () {
@ -337,7 +338,7 @@
* @returns {boolean} whether the policy supports read/write options
*/
var globalPolicySupportsReadWrite = function (policyType) {
return policyType === 'controller' || policyType === 'counters' || policyType === 'policies' || policyType === 'tenants';
return policyType === 'controller' || policyType === 'parameter-contexts' || policyType === 'counters' || policyType === 'policies' || policyType === 'tenants';
};
/**
@ -407,6 +408,7 @@
options: [
nfCommon.getPolicyTypeListing('flow'),
nfCommon.getPolicyTypeListing('controller'),
nfCommon.getPolicyTypeListing('parameter-contexts'),
nfCommon.getPolicyTypeListing('provenance'),
nfCommon.getPolicyTypeListing('restricted-components'),
nfCommon.getPolicyTypeListing('policies'),
@ -518,7 +520,7 @@
}
}
});
// component policy target
$('#component-policy-target').combo({
options: [{
@ -601,8 +603,10 @@
// set the resource
$('#selected-policy-type').text(resource);
// reload the policy
loadPolicy();
// reload the policy if we are finished loading
if (!initializingComponentPolicy) {
loadPolicy();
}
}
}
});
@ -810,7 +814,7 @@
var deletePolicy = function () {
var currentEntity = $('#policy-table').data('policy');
var revision = nfClient.getRevision(currentEntity);
if (nfCommon.isDefinedAndNotNull(currentEntity)) {
$.ajax({
type: 'DELETE',
@ -908,6 +912,8 @@
return $('<span>Showing effective policy inherited from all policies.</span>');
} else if (resource === '/controller') {
return $('<span>Showing effective policy inherited from the controller.</span>');
} else if (resource === '/parameter-contexts') {
return $('<span>Showing effective policy inherited from global parameter context policy.</span>');
} else {
// extract the group id
var processGroupId = nfCommon.substringAfterLast(resource, '/');
@ -1319,7 +1325,7 @@
'userGroups': userGroups
}
};
$.ajax({
type: 'PUT',
url: currentEntity.uri,
@ -1406,7 +1412,7 @@
$('#selected-policy-action').text('');
$('#selected-policy-component-id').text('');
$('#selected-policy-component-type').text('');
// clear the selected component details
$('div.policy-selected-component-container').hide();
};
@ -1454,6 +1460,8 @@
* @param d
*/
showControllerServicePolicy: function (d) {
initializingComponentPolicy = true;
// reset the policy message
resetPolicyMessage();
@ -1492,6 +1500,8 @@
value: 'read-component'
});
initializingComponentPolicy = false;
return loadPolicy().always(showPolicy);
},
@ -1501,6 +1511,8 @@
* @param d
*/
showReportingTaskPolicy: function (d) {
initializingComponentPolicy = true;
// reset the policy message
resetPolicyMessage();
@ -1515,7 +1527,7 @@
$('#policy-selected-reporting-task-container div.policy-selected-component-name').text(d.id);
}
$('#policy-selected-reporting-task-container').show();
// populate the initial resource
$('#selected-policy-component-id').text(d.id);
$('#selected-policy-component-type').text('reporting-tasks');
@ -1539,6 +1551,8 @@
value: 'read-component'
});
initializingComponentPolicy = false;
return loadPolicy().always(showPolicy);
},
@ -1548,6 +1562,8 @@
* @param d
*/
showTemplatePolicy: function (d) {
initializingComponentPolicy = true;
// reset the policy message
resetPolicyMessage();
@ -1567,6 +1583,9 @@
$('#selected-policy-component-id').text(d.id);
$('#selected-policy-component-type').text('templates');
$('#component-policy-target')
.combo('setOptionEnabled', {
value: 'operate-component'
}, false)
.combo('setOptionEnabled', {
value: 'write-receive-data'
}, false)
@ -1586,6 +1605,62 @@
value: 'read-component'
});
initializingComponentPolicy = false;
return loadPolicy().always(showPolicy);
},
/**
* Shows the parameter context policy.
*
* @param d
*/
showParameterContextPolicy: function (d) {
initializingComponentPolicy = true;
// reset the policy message
resetPolicyMessage();
// update the policy controls visibility
$('#component-policy-controls').show();
$('#global-policy-controls').hide();
// update the visibility
if (d.permissions.canRead === true) {
$('#policy-selected-parameter-context-container div.policy-selected-component-name').text(d.component.name);
} else {
$('#policy-selected-parameter-context-container div.policy-selected-component-name').text(d.id);
}
$('#policy-selected-parameter-context-container').show();
// populate the initial resource
$('#selected-policy-component-id').text(d.id);
$('#selected-policy-component-type').text('parameter-contexts');
$('#component-policy-target')
.combo('setOptionEnabled', {
value: 'operate-component'
}, false)
.combo('setOptionEnabled', {
value: 'write-receive-data'
}, false)
.combo('setOptionEnabled', {
value: 'write-send-data'
}, false)
.combo('setOptionEnabled', {
value: 'read-data'
}, false)
.combo('setOptionEnabled', {
value: 'read-provenance'
}, false)
.combo('setOptionEnabled', {
value: 'write-data'
}, false)
.combo('setSelectedOption', {
value: 'read-component'
});
initializingComponentPolicy = false;
return loadPolicy().always(showPolicy);
},
@ -1593,6 +1668,8 @@
* Shows the component policy dialog.
*/
showComponentPolicy: function (selection) {
initializingComponentPolicy = true;
// reset the policy message
resetPolicyMessage();
@ -1602,7 +1679,7 @@
// update the visibility
$('#policy-selected-component-container').show();
var resource;
if (selection.empty()) {
$('#selected-policy-component-id').text(nfCanvasUtils.getGroupId());
@ -1610,6 +1687,9 @@
// disable site to site option
$('#component-policy-target')
.combo('setOptionEnabled', {
value: 'operate-component'
}, true)
.combo('setOptionEnabled', {
value: 'write-receive-data'
}, false)
@ -1647,6 +1727,9 @@
// enable site to site option
$('#component-policy-target')
.combo('setOptionEnabled', {
value: 'operate-component'
}, !nfCanvasUtils.isLabel(selection))
.combo('setOptionEnabled', {
value: 'write-receive-data'
}, nfCanvasUtils.isInputPort(selection) && d.allowRemoteAccess === true)
@ -1667,6 +1750,8 @@
value: 'read-component'
});
initializingComponentPolicy = false;
return loadPolicy().always(showPolicy);
},
@ -1698,4 +1783,4 @@
};
return nfPolicyManagement;
}));
}));

View File

@ -60,10 +60,12 @@
'use strict';
var nfControllerServices;
var nfParameterContexts;
var config = {
urls: {
api: '../nifi-api'
api: '../nifi-api',
parameterContexts: '../nifi-api/flow/parameter-contexts'
}
};
@ -100,7 +102,10 @@
'component': {
'id': groupId,
'name': $('#process-group-name').val(),
'comments': $('#process-group-comments').val()
'comments': $('#process-group-comments').val(),
'parameterContext': {
'id': $('#process-group-parameter-context-combo').combo('getSelectedOption').value
}
}
};
@ -128,6 +133,25 @@
saveConfiguration(response.revision.version, groupId);
});
var controllerServicesUri = config.urls.api + '/flow/process-groups/' + encodeURIComponent(groupId) + '/controller-services';
$.ajax({
type: 'GET',
url: controllerServicesUri,
dataType: 'json'
}).done(function (response) {
var serviceTable = getControllerServicesTable();
nfCommon.cleanUpTooltips(serviceTable, 'div.has-errors');
var controllerServicesGrid = serviceTable.data('gridInstance');
var controllerServicesData = controllerServicesGrid.getData();
$.each(response.controllerServices, function (_, controllerServiceEntity) {
controllerServicesData.updateItem(controllerServiceEntity.id, controllerServiceEntity);
});
});
nfCanvasUtils.reload();
}).fail(nfErrorHandler.handleConfigurationUpdateAjaxError);
};
@ -139,8 +163,8 @@
*/
var loadConfiguration = function (groupId) {
var setUnauthorizedText = function () {
$('#read-only-process-group-name').addClass('unset').text('Unauthorized');
$('#read-only-process-group-comments').addClass('unset').text('Unauthorized');
$('#read-only-process-group-name').text('Unauthorized');
$('#read-only-process-group-comments').text('Unauthorized');
};
var setEditable = function (editable) {
@ -201,8 +225,8 @@
} else {
if (response.permissions.canRead) {
// populate the process group settings
$('#read-only-process-group-name').removeClass('unset').text(processGroup.name);
$('#read-only-process-group-comments').removeClass('unset').text(processGroup.comments);
$('#read-only-process-group-name').text(processGroup.name);
$('#read-only-process-group-comments').text(processGroup.comments);
// populate the header
$('#process-group-configuration-header-text').text(processGroup.name + ' Configuration');
@ -212,23 +236,25 @@
setEditable(false);
}
deferred.resolve();
deferred.resolve(response);
}).fail(function (xhr, status, error) {
if (xhr.status === 403) {
var unauthorizedGroup;
if (groupId === nfCanvasUtils.getGroupId()) {
$('#process-group-configuration').data('process-group', {
unauthorizedGroup = {
'permissions': {
canRead: false,
canWrite: nfCanvasUtils.canWriteCurrentGroup()
}
});
};
} else {
$('#process-group-configuration').data('process-group', nfProcessGroup.get(groupId));
unauthorizedGroup = nfProcessGroup.get(groupId);
}
$('#process-group-configuration').data('process-group', unauthorizedGroup);
setUnauthorizedText();
setEditable(false);
deferred.resolve();
deferred.resolve(unauthorizedGroup);
} else {
deferred.reject(xhr, status, error);
}
@ -239,12 +265,127 @@
var controllerServicesUri = config.urls.api + '/flow/process-groups/' + encodeURIComponent(groupId) + '/controller-services';
var controllerServices = nfControllerServices.loadControllerServices(controllerServicesUri, getControllerServicesTable());
var parameterContexts = $.ajax({
type: 'GET',
url: config.urls.parameterContexts,
dataType: 'json'
});
// wait for everything to complete
return $.when(processGroup, controllerServices).done(function (processGroupResult, controllerServicesResult) {
return $.when(processGroup, controllerServices, parameterContexts).done(function (processGroupResult, controllerServicesResult, parameterContextsResult) {
var controllerServicesResponse = controllerServicesResult[0];
var parameterContextsResponse = parameterContextsResult[0];
// update the current time
$('#process-group-configuration-last-refreshed').text(controllerServicesResponse.currentTime);
var parameterContexts = parameterContextsResponse.parameterContexts;
var options = [{
text: 'No parameter context',
value: null
}];
parameterContexts.forEach(function (parameterContext) {
var option;
if (parameterContext.permissions.canRead) {
option = {
'text': parameterContext.component.name,
'value': parameterContext.id,
'description': parameterContext.component.description
};
} else {
option = {
'text': parameterContext.id,
'value': parameterContext.id
}
}
options.push(option);
});
var createNewParameterContextOption = {
text: 'Create new parameter context...',
value: undefined,
optionClass: 'unset'
};
if (nfCommon.canModifyParameterContexts()) {
options.push(createNewParameterContextOption);
}
var comboOptions = {
options: options,
select: function (option) {
if (typeof option.value === 'undefined') {
$('#parameter-context-dialog').modal('setHeaderText', 'Add Parameter Context').modal('setButtonModel', [{
buttonText: 'Apply',
color: {
base: '#728E9B',
hover: '#004849',
text: '#ffffff'
},
disabled: function () {
if ($('#parameter-context-name').val() !== '') {
return false;
}
return true;
},
handler: {
click: function () {
nfParameterContexts.addParameterContext(function (parameterContextEntity) {
options.pop();
var option = {
'text': parameterContextEntity.component.name,
'value': parameterContextEntity.component.id,
'description': parameterContextEntity.component.description
};
options.push(option);
if (nfCommon.canModifyParameterContexts()) {
options.push(createNewParameterContextOption);
}
comboOptions.selectedOption = {
value: parameterContextEntity.component.id
};
combo.combo('destroy').combo(comboOptions);
});
}
}
}, {
buttonText: 'Cancel',
color: {
base: '#E3E8EB',
hover: '#C7D2D7',
text: '#004849'
},
handler: {
click: function () {
$(this).modal('hide');
}
}
}]).modal('show');
// set the initial focus
$('#parameter-context-name').focus();
}
}
};
// initialize the parameter context combo
var combo = $('#process-group-parameter-context-combo').combo('destroy').combo(comboOptions);
// populate the parameter context
if (processGroupResult.permissions.canRead) {
var parameterContextId = null;
if ($.isEmptyObject(processGroupResult.component.parameterContext) === false) {
parameterContextId = processGroupResult.component.parameterContext.id;
}
$('#process-group-parameter-context-combo').combo('setSelectedOption', {
value: parameterContextId
});
}
}).fail(nfErrorHandler.handleAjaxError);
};
@ -288,9 +429,11 @@
* Initialize the process group configuration.
*
* @param nfControllerServicesRef The nfControllerServices module.
* @param nfParameterContextsRef The nfParameterContexts module.
*/
init: function (nfControllerServicesRef) {
init: function (nfControllerServicesRef, nfParameterContextsRef) {
nfControllerServices = nfControllerServicesRef;
nfParameterContexts = nfParameterContextsRef;
// initialize the process group configuration tabs
$('#process-group-configuration-tabs').tabbs({
@ -384,4 +527,4 @@
};
return nfProcessGroupConfiguration;
}));
}));

View File

@ -1229,11 +1229,11 @@
// open the documentation for this reporting task
nfShell.showPage('../nifi-docs/documentation?' + $.param({
select: reportingTaskEntity.component.type,
group: reportingTaskEntity.component.bundle.group,
artifact: reportingTaskEntity.component.bundle.artifact,
version: reportingTaskEntity.component.bundle.version
})).done(function () {
select: reportingTaskEntity.component.type,
group: reportingTaskEntity.component.bundle.group,
artifact: reportingTaskEntity.component.bundle.artifact,
version: reportingTaskEntity.component.bundle.version
})).done(function () {
nfSettings.showSettings();
});
}
@ -1944,4 +1944,4 @@
};
return nfSettings;
}));
}));

View File

@ -576,7 +576,7 @@
// only populate affected components if this variable is different than the last selected
if (lastSelectedId === null || lastSelectedId !== variable.id) {
// update the details for this variable
$('#affected-components-context').removeClass('unset').text(variable.name);
$('#variable-affected-components-context').removeClass('unset').text(variable.name);
populateAffectedComponents(variable.affectedComponents);
// update the last selected id
@ -1150,7 +1150,7 @@
$('<li class="affected-component-container"><span class="unset">None</span></li>').appendTo(unauthorizedComponentsContainer);
// update the selection context
$('#affected-components-context').addClass('unset').text('None');
$('#variable-affected-components-context').addClass('unset').text('None');
} else {
// select the desired row
variableGrid.setSelectedRows([index]);
@ -1202,7 +1202,7 @@
var variableNames = variables.map(function (v) {
return v.variable.name;
});
$('#affected-components-context').removeClass('unset').text(variableNames.join(', '));
$('#variable-affected-components-context').removeClass('unset').text(variableNames.join(', '));
// get the current group id
var processGroupId = $('#variable-registry-process-group-id').text();
@ -1533,7 +1533,7 @@
$('#process-group-variable-registry').text('');
$('#variable-registry-process-group-id').text('').removeData('revision');
$('#affected-components-context').removeClass('unset').text('');
$('#variable-affected-components-context').removeClass('unset').text('');
var variableGrid = $('#variable-registry-table').data('gridInstance');
var variableData = variableGrid.getData();

View File

@ -115,7 +115,11 @@
}, {
text: 'access the controller',
value: 'controller',
description: 'Allows users to view/modify the controller including Reporting Tasks, Controller Services, and Nodes in the Cluster'
description: 'Allows users to view/modify the controller including Reporting Tasks, Controller Services, Parameter Contexts, and Nodes in the Cluster'
}, {
text: 'access parameter contexts',
value: 'parameter-contexts',
description: 'Allows users to view/modify Parameter Contexts'
}, {
text: 'query provenance',
value: 'provenance',
@ -708,6 +712,19 @@
}
},
/**
* Determines whether the current user can modify parameter contexts.
*
* @returns {boolean}
*/
canModifyParameterContexts: function () {
if (nfCommon.isDefinedAndNotNull(nfCommon.currentUser)) {
return nfCommon.currentUser.parameterContextPermissions.canRead === true && nfCommon.currentUser.parameterContextPermissions.canWrite === true;
} else {
return false;
}
},
/**
* Determines whether the current user can access counters.
*