This is an automated email from the ASF dual-hosted git repository.

pinal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git

commit fb4d43a50fe9acf30f379fda46dfe7e2e0fb4a24
Author: Farhan Khan <farhan.k...@freestoneinfotech.com>
AuthorDate: Mon Jan 31 19:51:40 2022 +0530

    ATLAS-4544 : Disallow continuous clicking of refresh button for Basic search
    
    Signed-off-by: Pinal Shah <pinal.s...@freestoneinfotech.com>
---
 dashboardv2/public/js/views/search/SearchLayoutView.js            | 8 ++++++++
 .../public/js/templates/search/SearchDefaultLayoutView_tmpl.html  | 2 +-
 dashboardv3/public/js/views/search/SearchDefaultLayoutView.js     | 8 ++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/dashboardv2/public/js/views/search/SearchLayoutView.js 
b/dashboardv2/public/js/views/search/SearchLayoutView.js
index 714e47b..675a521 100644
--- a/dashboardv2/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchLayoutView.js
@@ -232,6 +232,13 @@ define(['require',
                     this.setInitialEntityVal = false;
                 }
             },
+            disableRefreshButton : function(){
+                var that = this;
+                this.ui.refreshBtn.attr('disabled', true);
+                setTimeout( function(){
+                    that.ui.refreshBtn.attr('disabled', false);
+                },1000);
+            },
             makeFilterButtonActive: function(filtertypeParam) {
                 var filtertype = ['entityFilters', 'tagFilters'],
                     that = this;
@@ -385,6 +392,7 @@ define(['require',
                     }), param);
             },
             onRefreshButton: function() {
+                this.disableRefreshButton();
                 var that = this,
                     apiCount = 2,
                     updateSearchList = function() {
diff --git 
a/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html 
b/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
index cbac4eb..7a5a322 100644
--- a/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
@@ -26,7 +26,7 @@
         </div>
     </div>
     <div class="col-sm-12 attributeResultContainer form-group">
-        <button title="Refresh Search Result" class="btn-action btn-sm" 
data-id="refreshSearchResult" data-original-title="Refresh Search Result"><i 
class="fa fa-refresh"></i></button>
+        <button title="Refresh Search Result" class="btn btn-action btn-sm" 
data-id="refreshSearchResult" data-original-title="Refresh Search Result"><i 
class="fa fa-refresh"></i></button>
         <button class="btn-action btn-sm  attribute-filter-text" 
data-id='attrFilter'> <i class="fa fa-angle-right"></i> Filters</button>
         <button class='btn-action btn-sm' 
data-id='clearQuerySearch'>Clear</button>
         <div class="attribute-filter-container hide">
diff --git a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js 
b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
index 23dc560..b65f753 100644
--- a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
@@ -68,6 +68,7 @@ define(["require", "backbone", "utils/Globals", 
"hbs!tmpl/search/SearchDefaultLa
 
                 events["click " + this.ui.refreshSearchQuery] = function(e) {
                     this.options.searchVent.trigger('search:refresh');
+                    this.disableRefreshButton();
                 };
 
                 events["click " + this.ui.attrApply] = function(e) {
@@ -168,6 +169,13 @@ define(["require", "backbone", "utils/Globals", 
"hbs!tmpl/search/SearchDefaultLa
                     }
                 }
             },
+            disableRefreshButton: function() {
+                var that = this;
+                this.ui.refreshSearchQuery.attr('disabled', true);
+                setTimeout(function() {
+                    that.ui.refreshSearchQuery.attr('disabled', false);
+                }, 1000);
+            },
             onCheckExcludeIncludeResult: function(e) {
 
                 var flag = false,

Reply via email to