NIFI-6756:

- Fixing issue opening a users policy listing when there is a policy for a specific parameter context.

This closes #3805.

Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
Matt Gilman 2019-10-09 23:14:22 -04:00 committed by Joe Witt
parent 99e9010b32
commit 4e8dd6557f
No known key found for this signature in database
GPG Key ID: 9093BF854F811A1A
5 changed files with 35 additions and 8 deletions

View File

@ -16,12 +16,12 @@
*/
package org.apache.nifi.parameter;
import org.apache.nifi.authorization.resource.Authorizable;
import org.apache.nifi.authorization.resource.ComponentAuthorizable;
import java.util.Map;
import java.util.Optional;
public interface ParameterContext extends ParameterLookup, Authorizable {
public interface ParameterContext extends ParameterLookup, ComponentAuthorizable {
/**
* @return the UUID for this Parameter Context

View File

@ -67,6 +67,11 @@ public class StandardParameterContext implements ParameterContext {
return id;
}
@Override
public String getProcessGroupIdentifier() {
return null;
}
public String getName() {
readLock.lock();
try {

View File

@ -33,9 +33,10 @@
'nf.Birdseye',
'nf.ContextMenu',
'nf.Actions',
'nf.ProcessGroup'],
function ($, d3, nfCommon, nfDialog, nfGraph, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils, nfBirdseye, nfContextMenu, nfActions, nfProcessGroup) {
return (nf.Canvas = factory($, d3, nfCommon, nfDialog, nfGraph, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils, nfBirdseye, nfContextMenu, nfActions, nfProcessGroup));
'nf.ProcessGroup',
'nf.ParameterContexts'],
function ($, d3, nfCommon, nfDialog, nfGraph, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils, nfBirdseye, nfContextMenu, nfActions, nfProcessGroup, nfParameterContexts) {
return (nf.Canvas = factory($, d3, nfCommon, nfDialog, nfGraph, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils, nfBirdseye, nfContextMenu, nfActions, nfProcessGroup, nfParameterContexts));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Canvas =
@ -53,7 +54,8 @@
require('nf.Birdseye'),
require('nf.ContextMenu'),
require('nf.Actions'),
require('nf.ProcessGroup')));
require('nf.ProcessGroup'),
require('nf.ParameterContexts')));
} else {
nf.Canvas = factory(root.$,
root.d3,
@ -69,9 +71,10 @@
root.nf.Birdseye,
root.nf.ContextMenu,
root.nf.Actions,
root.nf.ProcessGroup);
root.nf.ProcessGroup,
root.nf.ParameterContexts);
}
}(this, function ($, d3, nfCommon, nfDialog, nfGraph, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils, nfBirdseye, nfContextMenu, nfActions, nfProcessGroup) {
}(this, function ($, d3, nfCommon, nfDialog, nfGraph, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils, nfBirdseye, nfContextMenu, nfActions, nfProcessGroup, nfParameterContexts) {
'use strict';
var SCALE = 1;
@ -689,6 +692,11 @@
});
});
// listen for events to go to parameter contexts
$('body').on('GoTo:ParameterContext', function (e, item) {
nfParameterContexts.showParameterContexts(item.id);
});
// don't let the reload action get called more than once every second
var throttledCanvasReload = nfCommon.throttle(nfActions.reload, 1000);

View File

@ -606,6 +606,8 @@
policyLabel += 'reporting task ';
} else if (resource.startsWith('/templates')) {
policyLabel += 'template ';
} else if (resource.startsWith('/parameter-contexts')) {
policyLabel += 'parameter context '
}
if (dataContext.component.componentReference.permissions.canRead === true) {
@ -658,6 +660,8 @@
//TODO: implement go to for RT
} else if (dataContext.component.resource.indexOf('/templates') >= 0) {
//TODO: implement go to for Templates
} else if (dataContext.component.resource.indexOf('/parameter-contexts') >= 0) {
markup += '<div title="Go To" class="pointer go-to-parameter-context fa fa-long-arrow-right" style="float: left;"></div>';
}
}
}
@ -759,6 +763,11 @@
id: item.component.componentReference.id
});
parent.$('#shell-close-button').click();
} else if (target.hasClass('go-to-parameter-context')) {
parent.$('body').trigger('GoTo:ParameterContext', {
id: item.component.componentReference.id
});
parent.$('#shell-close-button').click();
}
}
});

View File

@ -42,6 +42,11 @@ public class StatelessParameterContext implements ParameterContext {
return "NiFi Stateless Parameter Context";
}
@Override
public String getProcessGroupIdentifier() {
return null;
}
@Override
public String getName() {
return "NiFi Stateless Parameter Context";