From 86494ffd7c79e8c2b3f7a90abd10085002cbf5f7 Mon Sep 17 00:00:00 2001
From: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Date: Fri, 3 Jun 2016 12:32:25 -0700
Subject: [PATCH] ATLAS-848 Atlas UI: Search term box in left navigation is not auto refresh.(Kalyanikashikar via sumasai)

---
 dashboardv2/public/css/scss/form.scss                                                | 14 +++++++-------
 dashboardv2/public/js/templates/business_catalog/BusinessCatalogLayoutView_tmpl.html |  5 +++--
 dashboardv2/public/js/views/business_catalog/BusinessCatalogLayoutView.js            | 23 +++++++++++++++--------
 release-log.txt                                                                      |  1 +
 4 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/dashboardv2/public/css/scss/form.scss b/dashboardv2/public/css/scss/form.scss
index f5f9672..ace005f 100644
--- a/dashboardv2/public/css/scss/form.scss
+++ b/dashboardv2/public/css/scss/form.scss
@@ -102,7 +102,7 @@ button:focus {
     border-radius: 4px;
     //Instead of the line below you could use @include transition($transition-1, $transition-2, $transition-3, $transition-4, $transition-5, $transition-6, $transition-7, $transition-8, $transition-9, $transition-10)
     transition: all .3s ease;
-    margin:2px;
+    margin: 2px;
     &.cancel {
         background-color: $transparent;
         color: $color_keppel_approx;
@@ -142,21 +142,22 @@ button:focus {
     background-color: $transparent;
     color: $color_keppel_approx;
     margin-bottom: 10px;
+    border-radius: 4px;
+    padding: 5px 10px;
     &:hover {
-        color: $color_keppel_approx;
-    }
-    &:focus {
-        background-color: $transparent;
-        color: $color_keppel_approx;
+        background-color: $color_keppel_approx;
+        color: $white;
     }
 }
 
 .input-spacing {
     padding-bottom: 10px!important;
 }
+
 .input-group-btn .glyphicon {
     top: 2px;
 }
+
 .pagination > .active {
     > a {
         background-color: $color_curious_blue_approx;
@@ -170,7 +171,6 @@ button:focus {
             border-color: $color_curious_blue_approx;
         }
     }
-    
     > span {
         background-color: $color_curious_blue_approx;
         border-color: $color_curious_blue_approx;
diff --git a/dashboardv2/public/js/templates/business_catalog/BusinessCatalogLayoutView_tmpl.html b/dashboardv2/public/js/templates/business_catalog/BusinessCatalogLayoutView_tmpl.html
index 844071d..a48f041 100644
--- a/dashboardv2/public/js/templates/business_catalog/BusinessCatalogLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/business_catalog/BusinessCatalogLayoutView_tmpl.html
@@ -17,8 +17,9 @@
 <div class="form-group">
     <select type="text" class="form-control" data-id="searchTermInput" placeholder="Search term"></select>
 </div>
-<div class="row">
-    <button class="btn btn-taxanomyBack btn-atlas" data-id="backTaxanomy"><i class="fa fa-chevron-left"></i> Back</button>
+<div class="clearfix">
+    <button class="btn btn-taxanomyBack btn-atlas pull-left" data-id="backTaxanomy"><i class="fa fa-chevron-left"></i> Back</button>
+    <button class="btn btn-taxanomyBack btn-atlas pull-right" data-id="refreshTaxanomy"><i class="fa fa-refresh"></i> Refresh</button>
 </div>
 <div class="">
     <ul class="taxonomyTree">
diff --git a/dashboardv2/public/js/views/business_catalog/BusinessCatalogLayoutView.js b/dashboardv2/public/js/views/business_catalog/BusinessCatalogLayoutView.js
index 66f870a..3112963 100644
--- a/dashboardv2/public/js/views/business_catalog/BusinessCatalogLayoutView.js
+++ b/dashboardv2/public/js/views/business_catalog/BusinessCatalogLayoutView.js
@@ -41,7 +41,8 @@ define(['require',
                 liClick: 'li a[data-href]',
                 backTaxanomy: '[data-id="backTaxanomy"]',
                 expandArrow: '[data-id="expandArrow"]',
-                searchTermInput: '[data-id="searchTermInput"]'
+                searchTermInput: '[data-id="searchTermInput"]',
+                refreshTaxanomy: '[data-id="refreshTaxanomy"]'
             },
             /** ui events hash */
             events: function() {
@@ -56,6 +57,7 @@ define(['require',
                     this.forwardClick(e);
                 };
                 events['click ' + this.ui.backTaxanomy] = 'backButtonTaxanomy';
+                events['click ' + this.ui.refreshTaxanomy] = 'refreshButtonTaxanomy';
                 events['click ' + this.ui.expandArrow] = 'changeArrowState';
                 events["change " + this.ui.searchTermInput] = function() {
                     this.singleClick = false;
@@ -288,13 +290,11 @@ define(['require',
                     createTaxonomy();
                 } else {
                     this.changeArrowState();
-                    /*  if (!this.create) {
-                          this.changeArrowState();
-                      } else {
-                          this.create = false;
-                      }*/
                     createTerm();
-
+                }
+                if (this.refresh) {
+                    this.$('.taxonomyTree').find('a[data-href="' + this.refresh + '"]').parent().addClass('active');
+                    this.refresh = undefined;
                 }
                 this.$('.taxanomyloader').hide();
                 this.$('.contentLoading').hide();
@@ -354,6 +354,7 @@ define(['require',
                 view.model.set({ description: view.ui.termDetail.val() }).save(null, {
                     success: function(model, response) {
                         that.create = true;
+                        that.fetchTaxanomyCollections();
                         that.forwardClick(undefined, true, url);
                         //that.fetchCollection(that.url);
                         Utils.notifySuccess({
@@ -472,7 +473,13 @@ define(['require',
                     placeholder: "Search Term",
                     allowClear: true
                 });
-            }
+            },
+            refreshButtonTaxanomy: function() {
+                this.fetchTaxanomyCollections();
+                this.refresh = this.$('.taxonomyTree').find('.active a').data('href');
+                this.fetchCollection(this.url);
+                this.changeArrowState();
+            },
         });
     return BusinessCatalogLayoutView;
 });
diff --git a/release-log.txt b/release-log.txt
index c6f3901..3db4c3c 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -22,6 +22,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
 ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
 
 ALL CHANGES:
+ATLAS-848 Atlas UI: Search term box in left navigation is not auto refresh.(Kalyanikashikar via sumasai)
 ATLAS-793 Business Catalog Delete (jspeidel via yhemanth)
 ATLAS-846 Atlas UI : Add Pagination to Tags and Terms tabs of asset detailes page (kevalbhatt18 via yhemanth)
 ATLAS-503 Lock exceptions occurring due to concurrent updates to backend stores (yhemanth)
--
libgit2 0.27.1