URL: https://github.com/freeipa/freeipa/pull/908
Author: pvomacka
 Title: #908: WebUI: Actions array in search facet spec does not have 
'undefined' value anymore
Action: opened

PR body:
"""
In case that there are no actions specified in spec object, the concatenation
of arrays causes that 'undefined' item is added into the array.

https://pagure.io/freeipa/issue/7052
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/908/head:pr908
git checkout pr908
From afcba4fc6354d9d46d4a2e86e278457450182986 Mon Sep 17 00:00:00 2001
From: Pavel Vomacka <pvoma...@redhat.com>
Date: Mon, 26 Jun 2017 17:41:16 +0200
Subject: [PATCH] Fixes bug in actions creating for search facet

In case that there are no actions specified in spec object, the concatenation
of arrays causes that 'undefined' item is added into the array.

https://pagure.io/freeipa/issue/7052
---
 install/ui/src/freeipa/search.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/install/ui/src/freeipa/search.js b/install/ui/src/freeipa/search.js
index fd7174d999..ff31d1e297 100644
--- a/install/ui/src/freeipa/search.js
+++ b/install/ui/src/freeipa/search.js
@@ -63,7 +63,12 @@ exp.search_facet_control_buttons_pre_op = function(spec, context) {
     var default_actions = ['refresh', 'batch_remove', 'add'];
     var merged_actions = override_actions(spec.custom_actions, default_actions);
 
-    spec.actions = merged_actions.concat(spec.actions);
+    if (spec.actions) {
+        spec.actions = merged_actions.concat(spec.actions);
+    } else {
+        spec.actions = merged_actions;
+    }
+
     spec.control_buttons = spec.control_buttons || [];
 
     if (!spec.no_update) {
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to