From 64b24351c6fb45d04f927b6cfd6f61e486e7fe23 Mon Sep 17 00:00:00 2001
From: kevalbhatt <kbhatt@apache.org>
Date: Fri, 3 Apr 2020 12:50:48 +0530
Subject: [PATCH] ATLAS-3681 : Cluttered Business Metadata Attribute listing under entity filters

---
 dashboardv2/public/js/templates/search/UserDefine_tmpl.html |  8 --------
 dashboardv2/public/js/views/search/QueryBuilderView.js      |  5 ++++-
 dashboardv3/public/js/templates/search/UserDefine_tmpl.html |  8 --------
 dashboardv3/public/js/views/search/QueryBuilderView.js      |  9 ++++++---
 4 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/dashboardv2/public/js/templates/search/UserDefine_tmpl.html b/dashboardv2/public/js/templates/search/UserDefine_tmpl.html
index 8868e90..756ea8c 100644
--- a/dashboardv2/public/js/templates/search/UserDefine_tmpl.html
+++ b/dashboardv2/public/js/templates/search/UserDefine_tmpl.html
@@ -26,14 +26,6 @@
                 <textarea placeholder="value" data-type="value" data-index="0" class="form-control"></textarea>
                 <p class="errorMsg"></p>
             </td>
-            <!-- <td class="custom-col-2">
-                <button class="btn btn-default btn-sm" title="" data-index="0" data-id="deleteUserDefineItem">
-                    <i class="fa fa-minus"> </i>
-                </button>
-                <button class="btn btn-default btn-sm" title="" data-index="0" data-id="addUserDefineItem">
-                    <i class="fa fa-plus"> </i>
-                </button>
-            </td> -->
         </tr>
         <tr>
             <td colspan="4">
diff --git a/dashboardv2/public/js/views/search/QueryBuilderView.js b/dashboardv2/public/js/views/search/QueryBuilderView.js
index cca7992..b6296d4 100644
--- a/dashboardv2/public/js/views/search/QueryBuilderView.js
+++ b/dashboardv2/public/js/views/search/QueryBuilderView.js
@@ -76,7 +76,10 @@ define(['require',
                 if (type === "string") {
                     obj.operators = ['=', '!=', 'contains', 'begins_with', 'ends_with'];
                 }
-                if (type === "date" || type === "int" || type === "byte" || type === "short" || type === "long" || type === "float" || type === "double") {
+                if (type === "date") {
+                    obj.operators = ['>', '<'];
+                }
+                if (type === "int" || type === "byte" || type === "short" || type === "long" || type === "float" || type === "double") {
                     obj.operators = ['=', '!=', '>', '<', '>=', '<='];
                 }
                 if (type === "enum" || type === "boolean") {
diff --git a/dashboardv3/public/js/templates/search/UserDefine_tmpl.html b/dashboardv3/public/js/templates/search/UserDefine_tmpl.html
index 8868e90..756ea8c 100644
--- a/dashboardv3/public/js/templates/search/UserDefine_tmpl.html
+++ b/dashboardv3/public/js/templates/search/UserDefine_tmpl.html
@@ -26,14 +26,6 @@
                 <textarea placeholder="value" data-type="value" data-index="0" class="form-control"></textarea>
                 <p class="errorMsg"></p>
             </td>
-            <!-- <td class="custom-col-2">
-                <button class="btn btn-default btn-sm" title="" data-index="0" data-id="deleteUserDefineItem">
-                    <i class="fa fa-minus"> </i>
-                </button>
-                <button class="btn btn-default btn-sm" title="" data-index="0" data-id="addUserDefineItem">
-                    <i class="fa fa-plus"> </i>
-                </button>
-            </td> -->
         </tr>
         <tr>
             <td colspan="4">
diff --git a/dashboardv3/public/js/views/search/QueryBuilderView.js b/dashboardv3/public/js/views/search/QueryBuilderView.js
index fc16d6c..82677ea 100644
--- a/dashboardv3/public/js/views/search/QueryBuilderView.js
+++ b/dashboardv3/public/js/views/search/QueryBuilderView.js
@@ -66,7 +66,10 @@ define(['require',
                 if (type === "string") {
                     obj.operators = ['=', '!=', 'contains', 'begins_with', 'ends_with'];
                 }
-                if (type === "date" || type === "int" || type === "byte" || type === "short" || type === "long" || type === "float" || type === "double") {
+                if (type === "date") {
+                    obj.operators = ['>', '<'];
+                }
+                if (type === "int" || type === "byte" || type === "short" || type === "long" || type === "float" || type === "double") {
                     obj.operators = ['=', '!=', '>', '<', '>=', '<='];
                 }
                 if (type === "enum" || type === "boolean") {
@@ -354,10 +357,10 @@ define(['require',
                     if (this.type) {
                         var pushBusinessMetadataFilter = function(sortedAttributes, businessMetadataKey) {
                             _.each(sortedAttributes, function(attrDetails) {
-                                var returnObj = that.getObjDef(attrDetails, rules_widgets, isGroupView, 'Business Metadata Attribute', true);
+                                var returnObj = that.getObjDef(attrDetails, rules_widgets, isGroupView, "Business Attributes: " + businessMetadataKey);
                                 if (returnObj) {
                                     returnObj.id = businessMetadataKey + "." + returnObj.id;
-                                    returnObj.label = businessMetadataKey + ": " + returnObj.label;
+                                    returnObj.label = returnObj.label;
                                     returnObj.data = { 'entityType': "businessMetadata" };
                                     filters.push(returnObj);
                                 }
--
libgit2 0.27.1