mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-28 01:41:14 -06:00
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
This commit is contained in:
parent
2a4edbda4d
commit
57f9a297b6
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user