summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorPavel Vomacka <pvomacka@redhat.com>2016-10-05 10:09:20 +0200
committerMartin Basti <mbasti@redhat.com>2017-03-14 10:40:10 +0100
commitec63456b7c1fba6bd8d9073e63c27ef685f08c60 (patch)
tree390783f76c82e2c7dd2ca1c2bfcbae6ce318b20b /install
parentc3115fa617fb049ba48d356d280fdb23c312ebca (diff)
downloadfreeipa-ec63456b7c1fba6bd8d9073e63c27ef685f08c60.tar.gz
freeipa-ec63456b7c1fba6bd8d9073e63c27ef685f08c60.tar.xz
freeipa-ec63456b7c1fba6bd8d9073e63c27ef685f08c60.zip
Allow to set another other_entity name
Association table's add, del commands needs as option list of cn of other_entity, which is added or deleted. There is a case (currently in vaults) that the name of option is different than the name of other_entity. In this situation we can set 'other_option_name' and put there the option name. This option name will be used instead of 'other_entity' name. Part of: https://fedorahosted.org/freeipa/ticket/5426 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Diffstat (limited to 'install')
-rw-r--r--install/ui/src/freeipa/association.js29
1 files changed, 26 insertions, 3 deletions
diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js
index d44f8c805..02f990a7f 100644
--- a/install/ui/src/freeipa/association.js
+++ b/install/ui/src/freeipa/association.js
@@ -429,6 +429,22 @@ IPA.association_table_widget = function (spec) {
*/
that.additional_add_del_field = spec.additional_add_del_field;
+ /**
+ * Can be used in situations when the *_add_member command needs entity
+ * as a parameter, but parameter has different name than entity.
+ * i.e. vault_add_member --services=[values] ... this needs values from service
+ * entity, but option is called services, that we can set by setting
+ * this option in spec to other_option_name: 'services'
+ *
+ * @property {String} other_option_name
+ */
+ that.other_option_name = spec.other_option_name;
+
+ /**
+ * Entity which is added into member table.
+ *
+ * @property {String} other_entity
+ */
that.other_entity = IPA.get_entity(spec.other_entity);
that.attribute_member = spec.attribute_member;
@@ -683,9 +699,9 @@ IPA.association_table_widget = function (spec) {
on_success: on_success,
on_error: on_error
});
- command.set_option(that.other_entity.name, values);
that.join_additional_option(command);
+ that.handle_entity_option(command, values);
command.execute();
};
@@ -701,6 +717,14 @@ IPA.association_table_widget = function (spec) {
}
};
+ that.handle_entity_option = function(command, values) {
+ var option_name = that.other_option_name;
+ if (!option_name) {
+ option_name = that.other_entity.name;
+ }
+ command.set_option(option_name, values);
+ };
+
that.show_remove_dialog = function() {
var selected_values = that.get_selected_values();
@@ -745,7 +769,6 @@ IPA.association_table_widget = function (spec) {
);
};
-
dialog.open();
};
@@ -761,8 +784,8 @@ IPA.association_table_widget = function (spec) {
on_error: on_error
});
- command.set_option(that.other_entity.name, values);
that.join_additional_option(command);
+ that.handle_entity_option(command, values);
command.execute();
};