You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2020/03/27 10:14:14 UTC

[atlas] branch branch-2.0 updated: ATLAS-3697:- [Business Metadata] Incorrect values populated in Entity details > Business Metatdata attribute values, after encountering an error previously

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

kbhatt pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 1a0d778  ATLAS-3697:- [Business Metadata] Incorrect values populated in Entity details > Business Metatdata attribute values, after encountering an error previously
1a0d778 is described below

commit 1a0d7786078ade3c7be12c809f452518080e8e64
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Fri Mar 27 15:30:05 2020 +0530

    ATLAS-3697:- [Business Metadata] Incorrect values populated in Entity details > Business Metatdata attribute values, after encountering an error previously
    
    (cherry picked from commit d0147981ceb9a0afdef58ee53fea6c5d2379b0f3)
---
 dashboardv2/public/css/scss/form.scss                        | 12 ++++++++++--
 dashboardv2/public/js/views/glossary/GlossaryLayoutView.js   |  6 +++++-
 dashboardv2/public/js/views/tag/TagLayoutView.js             |  2 ++
 dashboardv3/public/css/scss/form.scss                        | 12 ++++++++++--
 .../public/js/views/entity/EntityBusinessMetaDataItemView.js |  2 +-
 .../public/js/views/entity/EntityBusinessMetaDataView.js     |  2 +-
 .../js/views/search/tree/BusinessMetadataTreeLayoutView.js   |  2 ++
 .../js/views/search/tree/ClassificationTreeLayoutView.js     |  2 ++
 .../js/views/search/tree/CustomFilterTreeLayoutView.js       |  2 ++
 .../public/js/views/search/tree/EntityTreeLayoutView.js      |  2 ++
 .../public/js/views/search/tree/GlossaryTreeLayoutView.js    |  3 ++-
 11 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/dashboardv2/public/css/scss/form.scss b/dashboardv2/public/css/scss/form.scss
index 360cbee..853b103 100644
--- a/dashboardv2/public/css/scss/form.scss
+++ b/dashboardv2/public/css/scss/form.scss
@@ -100,8 +100,16 @@ label {
     font-weight: 600;
 }
 
-button:focus {
-    outline: none !important;
+button {
+    &:focus {
+        outline: none !important;
+    }
+
+    &[disabled] {
+        .fa {
+            opacity: .65;
+        }
+    }
 }
 
 .btn {
diff --git a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
index 8195a54..93e02f8 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
@@ -79,7 +79,10 @@ define(['require',
                         }
                     })
                 };
-                events["click " + this.ui.refreshGlossary] = 'getGlossary';
+                events["click " + this.ui.refreshGlossary] = function() {
+                    this.ui.refreshGlossary.attr("disabled", true);
+                    this.getGlossary();
+                };
                 events["click " + this.ui.importGlossary] = 'onClickImportGlossary';
                 events["keyup " + this.ui.searchTerm] = function() {
                     this.ui.termTree.jstree("search", this.ui.searchTerm.val());
@@ -113,6 +116,7 @@ define(['require',
                     this.generateTree();
                     this.setValues();
                     this.changeLoaderState(false);
+                    this.ui.refreshGlossary.attr("disabled", false);
                 }, this);
                 this.listenTo(this.glossaryCollection, "update:details", function(options) {
                     var isGlossaryUpdate = options.isGlossaryUpdate;
diff --git a/dashboardv2/public/js/views/tag/TagLayoutView.js b/dashboardv2/public/js/views/tag/TagLayoutView.js
index 6657ef2..1095790 100644
--- a/dashboardv2/public/js/views/tag/TagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagLayoutView.js
@@ -113,6 +113,7 @@ define(['require',
             },
             fetchCollections: function() {
                 this.changeLoaderState(true);
+                this.ui.refreshTag.attr("disabled", true);
                 this.collection.fetch({ reset: true });
                 this.ui.offLineSearchTag.val("");
             },
@@ -245,6 +246,7 @@ define(['require',
 
                 }
                 this.changeLoaderState(false);
+                this.ui.refreshTag.attr("disabled", false);
             },
             getTagTreeList: function(options) {
                 var that = this,
diff --git a/dashboardv3/public/css/scss/form.scss b/dashboardv3/public/css/scss/form.scss
index 38c9c45..6fa9a07 100644
--- a/dashboardv3/public/css/scss/form.scss
+++ b/dashboardv3/public/css/scss/form.scss
@@ -107,8 +107,16 @@ label {
     font-weight: 600;
 }
 
-button:focus {
-    outline: none !important;
+button {
+    &:focus {
+        outline: none !important;
+    }
+
+    &[disabled] {
+        .fa {
+            opacity: .65;
+        }
+    }
 }
 
 .btn {
diff --git a/dashboardv3/public/js/views/entity/EntityBusinessMetaDataItemView.js b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataItemView.js
index e19bd43..437a1fc 100644
--- a/dashboardv3/public/js/views/entity/EntityBusinessMetaDataItemView.js
+++ b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataItemView.js
@@ -180,7 +180,7 @@ define(['require',
                 } else if (typeName.indexOf("date") > -1) {
                     returnEL = '<' + (isMultiValued ? "textarea" : "input") + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '"data-multi="' + isMultiValued + '" data-type="date" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '>' + (isMultiValued === true && !_.isUndefinedNull(val) ? val : "") + (isMultiValued ? "</textarea>" : "");
                     setTimeout(function() {
-                        var dateObj = { "singleDatePicker": true, autoUpdateInput: isMultiValued ? false : true },
+                        var dateObj = { singleDatePicker: true, showDropdowns: true, autoUpdateInput: isMultiValued ? false : true },
                             dateEl = that.$el.find('[data-type="date"][data-key="' + key + '"]').daterangepicker(dateObj);
                         if (isMultiValued) {
                             dateEl.on("apply.daterangepicker", function(ev, picker) {
diff --git a/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
index 3409847..bfc1e2c 100644
--- a/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
+++ b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
@@ -83,7 +83,7 @@ define([
         },
         updateToActualData: function(options) {
             var silent = options && options.silent || false;
-            this.collection.reset(this.actualCollection.toJSON(), { silent: silent });
+            this.collection.reset($.extend(true, [], this.actualCollection.toJSON()), { silent: silent });
         },
         onAddBusinessMetadata: function() {
             this.ui.addBusinessMetadata.hide();
diff --git a/dashboardv3/public/js/views/search/tree/BusinessMetadataTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/BusinessMetadataTreeLayoutView.js
index 98d4985..f7a62fb 100644
--- a/dashboardv3/public/js/views/search/tree/BusinessMetadataTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/BusinessMetadataTreeLayoutView.js
@@ -56,6 +56,7 @@ define([
             // refresh individual tree
             events["click " + this.ui.refreshTree] = function(e) {
                 that.changeLoaderState(true);
+                that.ui.refreshTree.attr("disabled", true).tooltip("hide");
                 e.stopPropagation();
                 that.refresh();
             };
@@ -200,6 +201,7 @@ define([
                     that.businessMetadataDefCollection.fullCollection.sort({ silent: true });
                     that.ui.businessMetadataSearchTree.jstree(true).refresh();
                     that.changeLoaderState(false);
+                    that.ui.refreshTree.attr("disabled", false);
                 }
             });
         },
diff --git a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
index 37e1f4c..899c465 100644
--- a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
@@ -66,6 +66,7 @@ define([
                 that = this;
             events["click " + this.ui.refreshTree] = function(e) {
                 that.changeLoaderState(true);
+                that.ui.refreshTree.attr("disabled", true).tooltip("hide");
                 var type = $(e.currentTarget).data("type");
                 e.stopPropagation();
                 that.refresh({ type: type });
@@ -380,6 +381,7 @@ define([
                         that.classificationTreeUpdate = true
                         that.ui.classificationSearchTree.jstree(true).refresh();
                         that.changeLoaderState(false);
+                        that.ui.refreshTree.attr("disabled", false);
                     }
                 };
             this.classificationDefCollection.fetch({
diff --git a/dashboardv3/public/js/views/search/tree/CustomFilterTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/CustomFilterTreeLayoutView.js
index 28d413f..585ec98 100644
--- a/dashboardv3/public/js/views/search/tree/CustomFilterTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/CustomFilterTreeLayoutView.js
@@ -57,6 +57,7 @@ define([
                 that = this;
             events["click " + this.ui.refreshTree] = function(e) {
                 that.changeLoaderState(true);
+                that.ui.refreshTree.attr("disabled", true).tooltip("hide");
                 var type = $(e.currentTarget).data("type");
                 e.stopPropagation();
                 that.refreshCustomFilterTree();
@@ -190,6 +191,7 @@ define([
                     that.saveSearchBaiscCollection.fullCollection.reset(_.where(data, { searchType: "BASIC" }));
                     that.saveSearchAdvanceCollection.fullCollection.reset(_.where(data, { searchType: "ADVANCED" }));
                     that.changeLoaderState(false);
+                    that.ui.refreshTree.attr("disabled", false);
                 },
                 silent: true
             });
diff --git a/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js
index 488284b..e136d36 100644
--- a/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js
@@ -55,6 +55,7 @@ define([
                 that = this;
             events["click " + this.ui.refreshTree] = function(e) {
                 that.changeLoaderState(true);
+                this.ui.refreshTree.attr("disabled", true).tooltip("hide");
                 var type = $(e.currentTarget).data("type");
                 e.stopPropagation();
                 that.ui[type + "SearchTree"].jstree(true).destroy();
@@ -525,6 +526,7 @@ define([
                     if (apiCount === 0) {
                         that.renderEntityTree();
                         that.changeLoaderState(false);
+                        that.ui.refreshTree.attr("disabled", false);
                     }
                 };
             this.entityDefCollection.fetch({
diff --git a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
index c84dbba..d068b8c 100644
--- a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
@@ -53,10 +53,10 @@ define([
                 that = this;
             events["click " + this.ui.refreshTree] = function(e) {
                 that.changeLoaderState(true);
+                that.ui.refreshTree.attr("disabled", true).tooltip("hide");
                 var type = $(e.currentTarget).data("type");
                 e.stopPropagation();
                 that.refresh({ type: type });
-
             };
 
             events["click " + this.ui.createGlossary] = function(e) {
@@ -98,6 +98,7 @@ define([
                         this.renderGlossaryTree();
                     }
                     that.changeLoaderState();
+                    that.ui.refreshTree.attr("disabled", false);
                 },
                 this
             );