summaryrefslogtreecommitdiffstats
path: root/install/ui/src
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-03-14 13:59:15 +0100
committerPetr Vobornik <pvoborni@redhat.com>2013-05-06 16:22:18 +0200
commit166102a910bad2002819205b009694372f1f0e22 (patch)
treef824c41c873dc3000e5d0980612e773ab90d6253 /install/ui/src
parentbf8bae5080582f0088bda2aab6695d7cedc8b164 (diff)
downloadfreeipa-166102a910bad2002819205b009694372f1f0e22.tar.gz
freeipa-166102a910bad2002819205b009694372f1f0e22.tar.xz
freeipa-166102a910bad2002819205b009694372f1f0e22.zip
Removed entity.get_primary from association facet
Also removed facet usage from entity adder dialog. https://fedorahosted.org/freeipa/ticket/3236
Diffstat (limited to 'install/ui/src')
-rw-r--r--install/ui/src/freeipa/add.js2
-rw-r--r--install/ui/src/freeipa/association.js14
-rw-r--r--install/ui/src/freeipa/search.js7
3 files changed, 15 insertions, 8 deletions
diff --git a/install/ui/src/freeipa/add.js b/install/ui/src/freeipa/add.js
index a91232887..551fc1c51 100644
--- a/install/ui/src/freeipa/add.js
+++ b/install/ui/src/freeipa/add.js
@@ -60,7 +60,6 @@ IPA.entity_adder_dialog = function(spec) {
function(data, text_status, xhr) {
that.added.notify();
that.show_message(that.get_success_message(data));
- that.facet.refresh();
that.reset();
that.focus_first_element();
},
@@ -101,7 +100,6 @@ IPA.entity_adder_dialog = function(spec) {
that.add(
function(data, text_status, xhr) {
that.added.notify();
- that.facet.refresh();
that.close();
that.notify_success(data);
},
diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js
index 30ae99393..5642d64e1 100644
--- a/install/ui/src/freeipa/association.js
+++ b/install/ui/src/freeipa/association.js
@@ -154,12 +154,13 @@ IPA.attribute_adder_dialog = function(spec) {
spec.subject = metadata.label;
var that = IPA.entity_adder_dialog(spec);
+ that.pkeys = spec.pkeys || [];
that.create_add_command = function(record) {
var command = that.entity_adder_dialog_create_add_command(record);
- command.add_args(that.entity.get_primary_key());
+ command.add_args(that.pkeys);
return command;
};
@@ -1100,7 +1101,6 @@ IPA.association_facet = function (spec, no_init) {
if (that.indirect_radio) that.indirect_radio.prop('checked', true);
}
- //var pkey = that.entity.get_primary_key();
var pkeys = that.get_pkeys();
var command = IPA.command({
@@ -1232,7 +1232,7 @@ IPA.attribute_facet = function(spec, no_init) {
that.refresh = function() {
- var pkey = that.entity.get_primary_key();
+ var pkey = that.get_pkeys();
var command = IPA.command({
entity: that.entity.name,
@@ -1269,9 +1269,13 @@ IPA.attribute_facet = function(spec, no_init) {
var dialog = IPA.attribute_adder_dialog({
attribute: spec.attribute,
- entity: that.entity
+ entity: that.entity,
+ pkeys: that.get_pkeys()
});
+ dialog.added.attach(function() {
+ that.refresh();
+ });
dialog.open(that.container);
};
@@ -1310,7 +1314,7 @@ IPA.attribute_facet = function(spec, no_init) {
that.remove = function(values, on_success, on_error) {
- var pkey = that.entity.get_primary_key();
+ var pkey = that.get_pkeys();
var command = IPA.command({
entity: that.entity.name,
diff --git a/install/ui/src/freeipa/search.js b/install/ui/src/freeipa/search.js
index 8bdce7f26..d8b9a4c18 100644
--- a/install/ui/src/freeipa/search.js
+++ b/install/ui/src/freeipa/search.js
@@ -131,7 +131,12 @@ IPA.search_facet = function(spec, no_init) {
that.show_add_dialog = function() {
var dialog = that.managed_entity.get_dialog('add');
- dialog.facet = that;
+ if (!that.adder_dialog) {
+ that.adder_dialog = dialog;
+ dialog.added.attach(function() {
+ that.refresh();
+ });
+ }
dialog.pkey_prefix = that.managed_entity_pkey_prefix();
dialog.open(that.container);
};