summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/automember.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-03-28 15:50:59 +0100
committerPetr Vobornik <pvoborni@redhat.com>2013-05-06 16:22:20 +0200
commitc0007704e8e8bea785dde410647c79501527eb72 (patch)
treec60edcaa4cf175462fbe212cc06c375aa5a1f57c /install/ui/src/freeipa/automember.js
parent6f80b327314541de30c65176991d8225a16d4643 (diff)
downloadfreeipa-c0007704e8e8bea785dde410647c79501527eb72.tar.gz
freeipa-c0007704e8e8bea785dde410647c79501527eb72.tar.xz
freeipa-c0007704e8e8bea785dde410647c79501527eb72.zip
Fix add/deletion of automember rule - caused by not setting facet for entity adder dialog
https://fedorahosted.org/freeipa/ticket/3236
Diffstat (limited to 'install/ui/src/freeipa/automember.js')
-rw-r--r--install/ui/src/freeipa/automember.js30
1 files changed, 25 insertions, 5 deletions
diff --git a/install/ui/src/freeipa/automember.js b/install/ui/src/freeipa/automember.js
index 0f188bd19..92e69a904 100644
--- a/install/ui/src/freeipa/automember.js
+++ b/install/ui/src/freeipa/automember.js
@@ -183,7 +183,25 @@ IPA.automember.rule_search_facet = function(spec) {
that.default_group_widget.create(header);
that.table.create(content);
+ };
+
+ that.show_add_dialog = function() {
+ var dialog = that.managed_entity.get_dialog('add');
+ if (!that.adder_dialog) {
+ that.adder_dialog = dialog;
+ dialog.added.attach(function() {
+ that.refresh();
+ });
+ }
+ dialog.pkey_prefix = that.managed_entity_pkey_prefix();
+ dialog.group_type = that.group_type;
+ dialog.open(that.container);
+ };
+ that.create_remove_dialog = function() {
+ var dialog = that.search_facet_create_remove_dialog();
+ dialog.group_type = that.group_type;
+ return dialog;
};
init();
@@ -324,6 +342,7 @@ IPA.automember.rule_adder_dialog = function(spec) {
spec = spec || {};
var that = IPA.entity_adder_dialog(spec);
+ that.group_type = spec.group_type || '';
that.show_edit_page = function (entity,result) {
var pkey_name = entity.metadata.primary_key;
@@ -332,7 +351,7 @@ IPA.automember.rule_adder_dialog = function(spec) {
pkey = pkey[0];
}
- var facetname = that.facet.group_type === 'group' ? 'usergrouprule' :
+ var facetname = that.group_type === 'group' ? 'usergrouprule' :
'hostgrouprule';
navigation.show_entity(that.entity.name, facetname, [pkey]);
@@ -342,7 +361,7 @@ IPA.automember.rule_adder_dialog = function(spec) {
var field = that.fields.get_field('cn');
- field.widget.other_entity = IPA.get_entity(that.facet.group_type);
+ field.widget.other_entity = IPA.get_entity(that.group_type);
that.dialog_reset();
};
@@ -350,8 +369,8 @@ IPA.automember.rule_adder_dialog = function(spec) {
that.create_add_command = function(record) {
var command = that.entity_adder_dialog_create_add_command(record);
- command.name = that.entity.name+that.facet.group_type+'_show';
- command.set_option('type', that.facet.group_type);
+ command.name = that.entity.name+that.group_type+'_show';
+ command.set_option('type', that.group_type);
return command;
};
@@ -365,6 +384,7 @@ IPA.automember.rule_deleter_dialog = function(spec) {
spec = spec || {};
var that = IPA.search_deleter_dialog(spec);
+ that.group_type = spec.group_type || '';
that.create_command = function() {
@@ -372,7 +392,7 @@ IPA.automember.rule_deleter_dialog = function(spec) {
for (var i=0; i<batch.commands.length; i++) {
var command = batch.commands[i];
- command.set_option('type', that.facet.group_type);
+ command.set_option('type', that.group_type);
}
return batch;