summaryrefslogtreecommitdiffstats
path: root/install/ui
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-05-21 02:14:59 -0500
committerAdam Young <ayoung@redhat.com>2011-05-24 12:46:28 -0400
commit57f9a297b6a43168316e2c6be945ca210fe7f3e6 (patch)
treebbb9559a88f027d3fd1604d69163db5d3bd13709 /install/ui
parent2a4edbda4d4843980bce5a203135d4895c688211 (diff)
downloadfreeipa-57f9a297b6a43168316e2c6be945ca210fe7f3e6.tar.gz
freeipa-57f9a297b6a43168316e2c6be945ca210fe7f3e6.tar.xz
freeipa-57f9a297b6a43168316e2c6be945ca210fe7f3e6.zip
Fixed Add and Edit without primary key.
The IPA.add_dialog has been modified such that if the user clicks the Add and Edit button it will read the primary key returned by the add operation and use it to open the details page. Ticket #1108
Diffstat (limited to 'install/ui')
-rw-r--r--install/ui/add.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/install/ui/add.js b/install/ui/add.js
index fcd320edf..097753f48 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -40,7 +40,7 @@ IPA.add_dialog = function (spec) {
that.save(record);
that.add(
record,
- function() {
+ function(data, text_status, xhr) {
var entity = IPA.get_entity(that.entity_name);
var facet = entity.get_facet('search');
var table = facet.table;
@@ -56,7 +56,7 @@ IPA.add_dialog = function (spec) {
that.save(record);
that.add(
record,
- function() {
+ function(data, text_status, xhr) {
var entity = IPA.get_entity(that.entity_name);
var facet = entity.get_facet('search');
var table = facet.table;
@@ -71,11 +71,17 @@ IPA.add_dialog = function (spec) {
that.save(record);
that.add(
record,
- function() {
+ function(data, text_status, xhr) {
that.close();
var pkey_name = IPA.metadata.objects[that.entity_name].primary_key;
- var pkey = record[pkey_name];
+
+ var result = data.result.result;
+ var pkey = result[pkey_name];
+
+ if (pkey instanceof Array) {
+ pkey = pkey[0];
+ }
IPA.nav.show_page(that.entity_name, 'details', pkey);
}