Skip to content

Commit

Permalink
Merge pull request #2721 from romanblanco/correct_ae_fqname
Browse files Browse the repository at this point in the history
Correct entry point for dynamic objects
  • Loading branch information
martinpovolny committed Nov 23, 2017
2 parents 23681d4 + 71f5fad commit 7e8ba54
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ManageIQ.angular.app.controller('dialogEditorController', ['$window', '$http', '
// treeSelector related
vm.lazyLoad = lazyLoad;
vm.onSelect = onSelect;
vm.showFullyQualifiedName = showFullyQualifiedName;
vm.node = {};
vm.treeSelectorToggle = treeSelectorToggle;
vm.treeSelectorIncludeDomain = false;
Expand Down Expand Up @@ -105,10 +106,24 @@ ManageIQ.angular.app.controller('dialogEditorController', ['$window', '$http', '
if (vm.treeSelectorIncludeDomain === false) {
fqname.splice(1, 1);
}
elementData.resource_action.ae_namespace = fqname.join('/');
elementData.resource_action.ae_instance = fqname.pop();
elementData.resource_action.ae_class = fqname.pop();
elementData.resource_action.ae_namespace = fqname.filter(String).join('/');
vm.treeSelectorShow = false;
}

function showFullyQualifiedName(resourceAction) {
if (typeof resourceAction.ae_namespace === 'undefined' ||
typeof resourceAction.ae_class === 'undefined' ||
typeof resourceAction.ae_instance === 'undefined') {
return '';
}
var fqname = resourceAction.ae_namespace
+ '/' + resourceAction.ae_class
+ '/' + resourceAction.ae_instance;
return fqname;
}

function treeSelectorToggle() {
vm.treeSelectorShow = ! vm.treeSelectorShow;
}
Expand Down
1 change: 1 addition & 0 deletions app/views/miq_ae_customization/editor.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"element-info" => "vm.elementInfo",
"lazy-load" => "vm.lazyLoad",
"on-select" => "vm.onSelect",
"show-fully-qualified-name" => "vm.showFullyQualifiedName",
"tree-selector-data" => "vm.treeSelectorData",
"tree-selector-include-domain" => "vm.treeSelectorIncludeDomain",
"tree-selector-show" => "vm.treeSelectorShow",
Expand Down

0 comments on commit 7e8ba54

Please sign in to comment.