mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Update other facets on delete from search page
When an object in search facet was deleted, other facets were not notified that they need to refresh. If one crated object with same pkey as deleted object and then navigated to it's details he could see old object's data. This notification was added. https://fedorahosted.org/freeipa/ticket/2618
This commit is contained in:
committed by
Martin Kosek
parent
d227c70d15
commit
690211adb5
@@ -1206,6 +1206,12 @@ IPA.facet_builder = function(entity) {
|
||||
spec.tab_label = spec.tab_label || attr_metadata.label;
|
||||
spec.factory = spec.factory || IPA.attribute_facet;
|
||||
|
||||
entity.policies.add_policy(IPA.build({
|
||||
factory: IPA.facet_update_policy,
|
||||
source_facet: 'search',
|
||||
dest_facet: spec.name
|
||||
}));
|
||||
|
||||
return spec;
|
||||
};
|
||||
|
||||
@@ -1242,6 +1248,12 @@ IPA.facet_builder = function(entity) {
|
||||
spec.read_only = true;
|
||||
}
|
||||
|
||||
entity.policies.add_policy(IPA.build({
|
||||
factory: IPA.facet_update_policy,
|
||||
source_facet: 'search',
|
||||
dest_facet: spec.name
|
||||
}));
|
||||
|
||||
return spec;
|
||||
};
|
||||
|
||||
|
||||
@@ -310,6 +310,7 @@ IPA.search_deleter_dialog = function(spec) {
|
||||
|
||||
batch.on_success = function() {
|
||||
that.facet.refresh();
|
||||
that.facet.on_update.notify([],that.facet);
|
||||
that.close();
|
||||
};
|
||||
|
||||
@@ -421,9 +422,7 @@ IPA.batch_items_action = function(spec) {
|
||||
|
||||
var batch = IPA.batch_command({
|
||||
name: entity.name + '_batch_'+ that.method,
|
||||
on_success: function() {
|
||||
facet.refresh();
|
||||
}
|
||||
on_success: that.get_on_success(facet, on_success)
|
||||
});
|
||||
|
||||
for (var i=0; i<pkeys.length; i++) {
|
||||
@@ -441,5 +440,18 @@ IPA.batch_items_action = function(spec) {
|
||||
batch.execute();
|
||||
};
|
||||
|
||||
that.on_success = function(facet, data, text_status, xhr) {
|
||||
facet.on_update.notify();
|
||||
facet.refresh();
|
||||
};
|
||||
|
||||
that.get_on_success = function(facet, on_success) {
|
||||
return function(data, text_status, xhr) {
|
||||
that.on_success(facet, data, text_status, xhr);
|
||||
if (on_success) on_success.call(this, data, text_status, xhr);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user