mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
redirect on error Code for redirecting on error has been moved to IPA.facet so it can be called from both details and assocaiton facets.
This commit is contained in:
parent
554bda2a85
commit
6039fdd6b3
@ -1086,12 +1086,6 @@ IPA.association_facet = function (spec) {
|
|||||||
that.refresh_table();
|
that.refresh_table();
|
||||||
}
|
}
|
||||||
|
|
||||||
function on_error(xhr, text_status, error_thrown) {
|
|
||||||
var summary = $('span[name=summary]', that.table.tfoot).empty();
|
|
||||||
summary.append('<p>Error: '+error_thrown.name+'</p>');
|
|
||||||
summary.append('<p>'+error_thrown.message+'</p>');
|
|
||||||
}
|
|
||||||
|
|
||||||
var pkey = IPA.get_entity(that.entity_name).get_primary_key();
|
var pkey = IPA.get_entity(that.entity_name).get_primary_key();
|
||||||
|
|
||||||
IPA.command({
|
IPA.command({
|
||||||
@ -1099,7 +1093,7 @@ IPA.association_facet = function (spec) {
|
|||||||
method: 'show',
|
method: 'show',
|
||||||
args: pkey,
|
args: pkey,
|
||||||
on_success: on_success,
|
on_success: on_success,
|
||||||
on_error: on_error
|
on_error: that.on_error
|
||||||
}).execute();
|
}).execute();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -640,22 +640,7 @@ IPA.details_facet = function(spec) {
|
|||||||
that.load(data.result.result);
|
that.load(data.result.result);
|
||||||
};
|
};
|
||||||
|
|
||||||
command.on_error = function(xhr, text_status, error_thrown) {
|
command.on_error = that.on_error;
|
||||||
if (that.entity.redirect_facet) {
|
|
||||||
var current_entity = that.entity;
|
|
||||||
while (current_entity.containing_entity){
|
|
||||||
current_entity = current_entity.containing_entity;
|
|
||||||
}
|
|
||||||
IPA.nav.show_page(
|
|
||||||
current_entity.name,
|
|
||||||
that.entity.redirect_facet);
|
|
||||||
return;
|
|
||||||
}else{
|
|
||||||
var details = $('.details', that.container).empty();
|
|
||||||
details.append('<p>Error: '+error_thrown.name+'</p>');
|
|
||||||
details.append('<p>'+error_thrown.message+'</p>');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
command.execute();
|
command.execute();
|
||||||
};
|
};
|
||||||
|
@ -130,6 +130,25 @@ IPA.facet = function (spec) {
|
|||||||
return $('.content', that.container);
|
return $('.content', that.container);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
that.on_error = function(xhr, text_status, error_thrown) {
|
||||||
|
if (that.entity.redirect_facet) {
|
||||||
|
var current_entity = that.entity;
|
||||||
|
while (current_entity.containing_entity){
|
||||||
|
current_entity = current_entity.containing_entity;
|
||||||
|
}
|
||||||
|
IPA.nav.show_page(
|
||||||
|
current_entity.name,
|
||||||
|
that.entity.redirect_facet);
|
||||||
|
return;
|
||||||
|
}else{
|
||||||
|
var details = $('.details', that.container).empty();
|
||||||
|
details.append('<p>Error: '+error_thrown.name+'</p>');
|
||||||
|
details.append('<p>'+error_thrown.message+'</p>');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// methods that should be invoked by subclasses
|
// methods that should be invoked by subclasses
|
||||||
that.facet_init = that.init;
|
that.facet_init = that.init;
|
||||||
that.facet_create_header = that.create_header;
|
that.facet_create_header = that.create_header;
|
||||||
|
Loading…
Reference in New Issue
Block a user