summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/src/freeipa/search.js')
-rw-r--r--install/ui/src/freeipa/search.js46
1 files changed, 37 insertions, 9 deletions
diff --git a/install/ui/src/freeipa/search.js b/install/ui/src/freeipa/search.js
index a77f1768c..8dc80cd55 100644
--- a/install/ui/src/freeipa/search.js
+++ b/install/ui/src/freeipa/search.js
@@ -28,13 +28,11 @@ define([
'./reg',
'./text',
'./facet'],
- function(IPA, $, phases, reg, text) {
+ function(IPA, $, phases, reg, text, mod_facet) {
var exp = {};
-IPA.search_facet = function(spec, no_init) {
-
- spec = spec || {};
+exp.search_facet_pre_op = function(spec, context) {
spec.name = spec.name || 'search';
spec.managed_entity = spec.managed_entity ? IPA.get_entity(spec.managed_entity) : spec.entity;
@@ -78,6 +76,13 @@ IPA.search_facet = function(spec, no_init) {
IPA.selected_state_evaluator,
IPA.self_service_state_evaluator);
+ return spec;
+};
+
+IPA.search_facet = function(spec, no_init) {
+
+ spec = spec || {};
+
var that = IPA.table_facet(spec, true);
that.deleter_dialog = spec.deleter_dialog || IPA.search_deleter_dialog;
@@ -354,16 +359,20 @@ IPA.search_deleter_dialog = function(spec) {
return that;
};
-/*TODO. this has much copied code from above. Refactor the search_facet
-To either be nested or not nested. */
-IPA.nested_search_facet = function(spec) {
-
- spec = spec || {};
+exp.nested_search_facet_preop = function(spec, context) {
spec.managed_entity = IPA.get_entity(spec.nested_entity);
spec.disable_breadcrumb = false;
spec.disable_facet_tabs = false;
+ return spec;
+};
+
+/*TODO. this has much copied code from above. Refactor the search_facet
+To either be nested or not nested. */
+exp.nested_search_facet = IPA.nested_search_facet = function(spec) {
+
+ spec = spec || {};
var that = IPA.search_facet(spec);
@@ -516,12 +525,31 @@ IPA.batch_enable_action = function(spec) {
exp.register = function() {
var a = reg.action;
+ var f = reg.facet;
a.register('batch_remove', IPA.batch_remove_action);
a.register('add', IPA.add_action);
a.register('batch_items', IPA.batch_items_action);
a.register('batch_disable', IPA.batch_disable_action);
a.register('batch_enable', IPA.batch_enable_action);
+
+ f.register({
+ type: 'search',
+ factory: IPA.search_facet,
+ pre_ops: [
+ mod_facet.facet_preops.search,
+ exp.search_facet_pre_op
+ ]
+ });
+
+ f.register({
+ type: 'nested_search',
+ factory: IPA.nested_search_facet,
+ pre_ops: [
+ mod_facet.facet_preops.nested_search,
+ exp.nested_search_facet_preop
+ ]
+ });
};
phases.on('registration', exp.register);