Updating Controller Service scope header.
Rendering the name of the parent when possible.
Fixing the check if the parent Process Group is write-able when the parent is selected on the current canvas.
This closes
}
if (nfCommon.isDefinedAndNotNull(dataContext.component.parentGroupId)) {
- return dataContext.component.parentGroupId;
+ // see if this listing is based off a selected process group
+ var selection = nfCanvasUtils.getSelection();
+ if (selection.empty() === false) {
+ var selectedData = selection.datum();
+ if (selectedData.id === dataContext.component.parentGroupId) {
+ if (selectedData.permissions.canRead) {
+ return selectedData.component.name;
+ } else {
+ return selectedData.id;
+ }
+ }
+ }
+
+ // there's either no selection or the service is defined in an ancestor component
+ var breadcrumbs = nfNgBridge.injector.get('breadcrumbsCtrl').getBreadcrumbs();
+
+ var processGroupLabel = dataContext.component.parentGroupId;
+ $.each(breadcrumbs, function (_, breadcrumbEntity) {
+ if (breadcrumbEntity.id === dataContext.component.parentGroupId) {
+ processGroupLabel = breadcrumbEntity.label;
+ return false;
+ }
+ });
+
+ return processGroupLabel;
} else {
return 'Controller';
}
* @returns {boolean} whether the user has write permissions for the parent of the controller service
*/
var canWriteControllerServiceParent = function (dataContext) {
- // we know the process group for this controller service is part
- // of the current breadcrumb trail
+ // we know the process group for this controller service is part of the current breadcrumb trail
var canWriteProcessGroupParent = function (processGroupId) {
+ // see if this listing is based off a selected process group
+ var selection = nfCanvasUtils.getSelection();
+ if (selection.empty() === false) {
+ var datum = selection.datum();
+ if (datum.id === processGroupId) {
+ return datum.permissions.canWrite;
+ }
+ }
+
+ // there's either no selection or the service is defined in an ancestor component
var breadcrumbs = nfNgBridge.injector.get('breadcrumbsCtrl').getBreadcrumbs();
var isAuthorized = false;
},
{
id: 'parentGroupId',
- name: 'Process Group',
+ name: 'Scope',
formatter: groupIdFormatter,
sortable: true,
resizeable: true
