From 7ddcff3ef71a1d4254d291bdab99075f2cd8f205 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 19 May 2015 18:48:06 +0200 Subject: [PATCH] webui: prefer search facet's deleter dialog Deleter dialog in search facet is now chosen in order as follows: - facet's, defined as spec, e.g.: deleter_dialog: { $factory: IPA.user.deleter_dialog } - entity's, the same but it entity spec - default, which is IPA.search_deleter_dialog Previous didn't allow to override entity dialog with facet one and also definition by spec was not allowed. Reviewed-By: David Kupka Reviewed-By: Thierry Bordaz --- install/ui/src/freeipa/search.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/install/ui/src/freeipa/search.js b/install/ui/src/freeipa/search.js index 87523b673..941597561 100644 --- a/install/ui/src/freeipa/search.js +++ b/install/ui/src/freeipa/search.js @@ -22,6 +22,7 @@ */ define([ + './builder', './ipa', './jquery', './phases', @@ -30,7 +31,7 @@ define([ './spec_util', './text', './facet'], - function(IPA, $, phases, reg, rpc, su, text, mod_facet) { + function(builder, IPA, $, phases, reg, rpc, su, text, mod_facet) { var exp = {}; @@ -111,7 +112,7 @@ IPA.search_facet = function(spec, no_init) { */ that.command_options = spec.command_options || {}; - that.deleter_dialog = spec.deleter_dialog || IPA.search_deleter_dialog; + that.deleter_dialog = spec.deleter_dialog; that.create_header = function(container) { @@ -191,10 +192,12 @@ IPA.search_facet = function(spec, no_init) { return null; } - var dialog = that.managed_entity.get_dialog('remove'); - + var dialog = builder.build('', that.deleter_dialog); if (!dialog) { - dialog = that.deleter_dialog(); + dialog = that.managed_entity.get_dialog('remove'); + } + if (!dialog) { + dialog = IPA.search_deleter_dialog(); } dialog.entity_name = that.managed_entity.name;