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/05/21 17:00:01 UTC

[atlas] branch branch-2.0 updated (c1c1dae -> 7d6f9cd)

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

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


    from c1c1dae  ATLAS-1530: updated committer/ppmc members contact and employment info
     new 4b32bb3  ATLAS-3791:- New UI: In valid option are visible For _CLASSIFIED , _NOT_CLASSIFIED, _ALL_CLASSIFICATION_TYPES
     new 937e31f  ATLAS-3728:- UI: Show uploaded data details (status)
     new fd25164  ATLAS-3795:- UI: statistics Memory Section should have suffix like Bytes /KB /MB
     new 70aa94a  ATLAS-3793:- UI: Entity detail page improvement for label, user-define properties, BM panel
     new 7d6f9cd  ATLAS-3792:- New UI: makes it mandate to apply an attribute filter when "Filters" is selected even if the user just wants to select "Show Deleted Entities"

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 dashboardv2/public/css/scss/panel.scss             |  2 +-
 dashboardv2/public/css/scss/theme.scss             | 34 +++++++++++++++++
 .../BusinessMetadataAttributeItemView_tmpl.html    |  5 ++-
 .../entity/EntityBusinessMetaDataView_tmpl.html    |  2 +-
 .../entity/EntityLabelDefineView_tmpl.html         | 11 +++---
 .../entity/EntityUserDefineItemView_tmpl.html      |  4 +-
 .../entity/EntityUserDefineView_tmpl.html          | 24 +++---------
 .../js/templates/import/ImportLayoutView_tmpl.html |  5 ++-
 dashboardv2/public/js/utils/Helper.js              | 14 +++++++
 .../js/views/entity/EntityBusinessMetaDataView.js  | 28 +++++++++-----
 .../js/views/entity/EntityLabelDefineView.js       | 10 ++++-
 .../js/views/entity/EntityUserDefineItemView.js    | 18 +++++++--
 .../public/js/views/entity/EntityUserDefineView.js | 26 ++++++++++---
 .../public/js/views/import/ImportLayoutView.js     | 44 ++++++++++++++++++++--
 dashboardv2/public/js/views/site/Statistics.js     |  3 +-
 dashboardv3/public/css/scss/theme.scss             | 19 ++++++++++
 .../BusinessMetadataAttributeItemView_tmpl.html    |  5 ++-
 .../entity/EntityBusinessMetaDataView_tmpl.html    |  2 +-
 .../entity/EntityLabelDefineView_tmpl.html         | 11 +++---
 .../entity/EntityUserDefineItemView_tmpl.html      |  4 +-
 .../entity/EntityUserDefineView_tmpl.html          | 24 +++---------
 .../js/templates/import/ImportLayoutView_tmpl.html |  5 ++-
 dashboardv3/public/js/utils/Helper.js              | 14 +++++++
 dashboardv3/public/js/utils/Utils.js               |  9 +++--
 .../js/views/entity/EntityBusinessMetaDataView.js  | 28 +++++++++-----
 .../js/views/entity/EntityLabelDefineView.js       | 10 ++++-
 .../js/views/entity/EntityUserDefineItemView.js    | 18 +++++++--
 .../public/js/views/entity/EntityUserDefineView.js | 26 ++++++++++---
 .../public/js/views/import/ImportLayoutView.js     | 44 ++++++++++++++++++++--
 .../js/views/search/SearchDefaultLayoutView.js     | 12 ++++--
 .../views/search/SearchFilterBrowseLayoutView.js   |  3 ++
 .../search/tree/ClassificationTreeLayoutView.js    | 18 ++++++---
 dashboardv3/public/js/views/site/Statistics.js     |  3 +-
 33 files changed, 370 insertions(+), 115 deletions(-)


[atlas] 01/05: ATLAS-3791:- New UI: In valid option are visible For _CLASSIFIED , _NOT_CLASSIFIED, _ALL_CLASSIFICATION_TYPES

Posted by kb...@apache.org.
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

commit 4b32bb3eb8507a91b5a3d1a2ce85e4d8db171acf
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Thu May 21 13:38:53 2020 +0530

    ATLAS-3791:- New UI: In valid option are visible For _CLASSIFIED , _NOT_CLASSIFIED, _ALL_CLASSIFICATION_TYPES
    
    (cherry picked from commit 887087d9b9de0e2cf932c4ddd337693efbbd3ddd)
---
 .../js/views/search/SearchFilterBrowseLayoutView.js    |  3 +++
 .../views/search/tree/ClassificationTreeLayoutView.js  | 18 ++++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/dashboardv3/public/js/views/search/SearchFilterBrowseLayoutView.js b/dashboardv3/public/js/views/search/SearchFilterBrowseLayoutView.js
index 9e5fe64..d26a6e8 100644
--- a/dashboardv3/public/js/views/search/SearchFilterBrowseLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchFilterBrowseLayoutView.js
@@ -201,6 +201,9 @@ define([
             if (options) {
                 _.extend(this.options, options);
                 this.showHideGlobalFilter();
+                if(!this.options.value){
+                    this.ui.searchNode.val('').trigger('keyup');
+                }
                 if (this.RBusinessMetadataTreeRender.currentView) {
                     this.RBusinessMetadataTreeRender.currentView.manualRender(this.options);
                 }
diff --git a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
index 899c465..67ac7c6 100644
--- a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
@@ -254,9 +254,14 @@ define([
                 popoverOptions: {
                     selector: '.classificationPopover',
                     content: function() {
-                        var type = $(this).data('detail'),
-                            liString = " <li><i class='fa fa-plus'></i><a href='javascript:void(0)' data-fn='onClickCreateTag'>Create Sub-classification</a></li><li><i class='fa fa-list-alt'></i><a href='javascript:void(0)' data-fn='onViewEdit'>View/Edit</a></li><li><i class='fa fa-trash-o'></i><a href='javascript:void(0)' data-fn='onDelete'>Delete</a></li><li><i class='fa fa-search'></i><a href='javascript:void(0)' data-fn='onSelectedSearch'>Search</a></li>"
-                        return "<ul>" + liString + "</ul>";
+                        var name = this.dataset.name || null,
+                            searchString = "<li><i class='fa fa-search'></i><a href='javascript:void(0)' data-fn='onSelectedSearch'>Search</a></li>";
+                        if (name && Enums.addOnClassification.includes(name)) {
+                            return "<ul>" + searchString + "</ul>";
+                        } else {
+                            var liString = " <li><i class='fa fa-plus'></i><a href='javascript:void(0)' data-fn='onClickCreateTag'>Create Sub-classification</a></li><li><i class='fa fa-list-alt'></i><a href='javascript:void(0)' data-fn='onViewEdit'>View/Edit</a></li><li><i class='fa fa-trash-o'></i><a href='javascript:void(0)' data-fn='onDelete'>Delete</a></li>";
+                            return "<ul>" + liString + searchString + "</ul>";
+                        }
                     }
                 }
             });
@@ -581,9 +586,10 @@ define([
                         },
                         node_customize: {
                             default: function(el) {
-                                var aTag = $(el).find(">a.jstree-anchor");
-                                aTag.append("<span class='tree-tooltip'>" + aTag.text() + "</span>");
-                                $(el).append('<div class="tools"><i class="fa fa-ellipsis-h classificationPopover" rel="popover"></i></div>');
+                                var aTag = $(el).find(">a.jstree-anchor"),
+                                    nameText = aTag.text();
+                                aTag.append("<span class='tree-tooltip'>" + nameText + "</span>");
+                                $(el).append('<div class="tools"><i class="fa fa-ellipsis-h classificationPopover" rel="popover" data-name=' + nameText + '></i></div>');
                             }
                         },
                         core: {


[atlas] 03/05: ATLAS-3795:- UI: statistics Memory Section should have suffix like Bytes /KB /MB

Posted by kb...@apache.org.
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

commit fd2516412622ed622e3fc6d5a77edd3a0fe9132a
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Thu May 21 14:43:56 2020 +0530

    ATLAS-3795:- UI: statistics Memory Section should have suffix like Bytes /KB /MB
    
    (cherry picked from commit 2dd41162b1832a1f574a28567289772fa21d65af)
---
 dashboardv2/public/js/utils/Helper.js          | 14 ++++++++++++++
 dashboardv2/public/js/views/site/Statistics.js |  3 ++-
 dashboardv3/public/js/utils/Helper.js          | 14 ++++++++++++++
 dashboardv3/public/js/views/site/Statistics.js |  3 ++-
 4 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/dashboardv2/public/js/utils/Helper.js b/dashboardv2/public/js/utils/Helper.js
index dd7b0b2..88323c8 100644
--- a/dashboardv2/public/js/utils/Helper.js
+++ b/dashboardv2/public/js/utils/Helper.js
@@ -26,6 +26,20 @@ define(['require',
         numberFormatWithComa: function(number) {
             return d3.format(',')(number);
         },
+        numberFormatWithBytes: function(number) {
+            if (number > -1) {
+                if (number === 0) {
+                    return "0 Bytes";
+                }
+                var i = number == 0 ? 0 : Math.floor(Math.log(number) / Math.log(1024));
+                if (i > 8) {
+                    return _.numberFormatWithComa(number);
+                }
+                return Number((number / Math.pow(1024, i)).toFixed(2)) + " " + ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][i];
+            } else {
+                return number;
+            }
+        },
         isEmptyArray: function(val) {
             if (val && _.isArray(val)) {
                 return _.isEmpty(val);
diff --git a/dashboardv2/public/js/views/site/Statistics.js b/dashboardv2/public/js/views/site/Statistics.js
index 2b8bd1f..75e11b0 100644
--- a/dashboardv2/public/js/views/site/Statistics.js
+++ b/dashboardv2/public/js/views/site/Statistics.js
@@ -384,7 +384,8 @@ define(['require',
                     var memoryTable = CommonViewFunction.propertyTable({
                         scope: this,
                         formatStringVal: true,
-                        valueObject: systemMemoryData
+                        valueObject: systemMemoryData,
+                        numberFormat: _.numberFormatWithBytes
                     });
                     that.ui.memoryCard.html(
                         memoryTable);
diff --git a/dashboardv3/public/js/utils/Helper.js b/dashboardv3/public/js/utils/Helper.js
index 9c4bc73..8f97a84 100644
--- a/dashboardv3/public/js/utils/Helper.js
+++ b/dashboardv3/public/js/utils/Helper.js
@@ -27,6 +27,20 @@ define(['require',
         numberFormatWithComa: function(number) {
             return d3.format(',')(number);
         },
+        numberFormatWithBytes: function(number) {
+            if (number > -1) {
+                if (number === 0) {
+                    return "0 Bytes";
+                }
+                var i = number == 0 ? 0 : Math.floor(Math.log(number) / Math.log(1024));
+                if (i > 8) {
+                    return _.numberFormatWithComa(number);
+                }
+                return Number((number / Math.pow(1024, i)).toFixed(2)) + " " + ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][i];
+            } else {
+                return number;
+            }
+        },
         isEmptyArray: function(val) {
             if (val && _.isArray(val)) {
                 return _.isEmpty(val);
diff --git a/dashboardv3/public/js/views/site/Statistics.js b/dashboardv3/public/js/views/site/Statistics.js
index 2b8bd1f..75e11b0 100644
--- a/dashboardv3/public/js/views/site/Statistics.js
+++ b/dashboardv3/public/js/views/site/Statistics.js
@@ -384,7 +384,8 @@ define(['require',
                     var memoryTable = CommonViewFunction.propertyTable({
                         scope: this,
                         formatStringVal: true,
-                        valueObject: systemMemoryData
+                        valueObject: systemMemoryData,
+                        numberFormat: _.numberFormatWithBytes
                     });
                     that.ui.memoryCard.html(
                         memoryTable);


[atlas] 05/05: ATLAS-3792:- New UI: makes it mandate to apply an attribute filter when "Filters" is selected even if the user just wants to select "Show Deleted Entities"

Posted by kb...@apache.org.
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

commit 7d6f9cd60a4ed1cd9020885f8964c365955a5ffa
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Thu May 21 21:57:55 2020 +0530

    ATLAS-3792:- New UI: makes it mandate to apply an attribute filter when "Filters" is selected even if the user just wants to select "Show Deleted Entities"
    
    (cherry picked from commit b9f4ae790accee9fa0e97d963038165742f88a72)
---
 .../public/js/views/search/SearchDefaultLayoutView.js        | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
index 21b1f55..fe9aac8 100644
--- a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
@@ -338,10 +338,16 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
                 filterPopupStatus();
 
                 function searchAttribute() {
-                    if (queryBuilderRef.data("queryBuilder")) {
-                        var rule = queryBuilderRef.queryBuilder("getRules");
+                    var queryBuilderObj = queryBuilderRef.data("queryBuilder");
+                    if (queryBuilderObj) {
+                        var ruleWithInvalid = queryBuilderObj.getRules({ allow_invalid: true }),
+                            rule = queryBuilderObj.getRules();
+                        rule ? that.updateFilterOptions(rule, filtertype, isTag) : isFilterValidate = false;
+                        if (ruleWithInvalid && ruleWithInvalid.rules.length === 1 && ruleWithInvalid.rules[0].id === null) {
+                            isFilterValidate = true;
+                            queryBuilderObj.clearErrors();
+                        }
                     }
-                    rule ? that.updateFilterOptions(rule, filtertype, isTag) : isFilterValidate = false;
                 }
 
                 function filterPopupStatus() {


[atlas] 04/05: ATLAS-3793:- UI: Entity detail page improvement for label, user-define properties, BM panel

Posted by kb...@apache.org.
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

commit 70aa94a579b56bba2e38853f32934e6dc806446f
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Thu May 21 21:01:38 2020 +0530

    ATLAS-3793:- UI: Entity detail page improvement for label, user-define properties, BM panel
    
    (cherry picked from commit 62451d62a01bf62e2bc50ec7d9585365329086a6)
---
 dashboardv2/public/css/scss/panel.scss             |  2 +-
 .../entity/EntityBusinessMetaDataView_tmpl.html    |  2 +-
 .../entity/EntityLabelDefineView_tmpl.html         | 11 ++++-----
 .../entity/EntityUserDefineItemView_tmpl.html      |  4 +++-
 .../entity/EntityUserDefineView_tmpl.html          | 24 ++++---------------
 .../js/views/entity/EntityBusinessMetaDataView.js  | 28 +++++++++++++++-------
 .../js/views/entity/EntityLabelDefineView.js       | 10 +++++++-
 .../js/views/entity/EntityUserDefineItemView.js    | 18 +++++++++++---
 .../public/js/views/entity/EntityUserDefineView.js | 26 ++++++++++++++++----
 .../entity/EntityBusinessMetaDataView_tmpl.html    |  2 +-
 .../entity/EntityLabelDefineView_tmpl.html         | 11 ++++-----
 .../entity/EntityUserDefineItemView_tmpl.html      |  4 +++-
 .../entity/EntityUserDefineView_tmpl.html          | 24 ++++---------------
 dashboardv3/public/js/utils/Utils.js               |  9 ++++---
 .../js/views/entity/EntityBusinessMetaDataView.js  | 28 +++++++++++++++-------
 .../js/views/entity/EntityLabelDefineView.js       | 10 +++++++-
 .../js/views/entity/EntityUserDefineItemView.js    | 18 +++++++++++---
 .../public/js/views/entity/EntityUserDefineView.js | 26 ++++++++++++++++----
 18 files changed, 163 insertions(+), 94 deletions(-)

diff --git a/dashboardv2/public/css/scss/panel.scss b/dashboardv2/public/css/scss/panel.scss
index a8908e3..9a94221 100644
--- a/dashboardv2/public/css/scss/panel.scss
+++ b/dashboardv2/public/css/scss/panel.scss
@@ -143,9 +143,9 @@
 .panel-default.custom-panel>.panel-actions {
     float: right;
     margin-top: 15px;
+    margin-right: 10px;
 
     button {
-        margin-right: 10px;
         margin-top: -4px;
     }
 }
diff --git a/dashboardv2/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html b/dashboardv2/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html
index 0e4c2aa..fd00abf 100644
--- a/dashboardv2/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html
+++ b/dashboardv2/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html
@@ -15,7 +15,7 @@
  * limitations under the License.
 -->
 <div class="panel panel-default custom-panel expand_collapse_panel-icon">
-    <div class="panel-heading" data-toggle="collapse" href="#businessMetadataCollapse" aria-expanded="false" style="width: 70%;">
+    <div class="panel-heading main-parent collapsed" data-toggle="collapse" href="#businessMetadataCollapse" aria-expanded="false" style="width: 70%;">
         <h4 class="panel-title">
             <a>Business Metadata</a>
         </h4>
diff --git a/dashboardv2/public/js/templates/entity/EntityLabelDefineView_tmpl.html b/dashboardv2/public/js/templates/entity/EntityLabelDefineView_tmpl.html
index f122fe9..d3ca9ad 100644
--- a/dashboardv2/public/js/templates/entity/EntityLabelDefineView_tmpl.html
+++ b/dashboardv2/public/js/templates/entity/EntityLabelDefineView_tmpl.html
@@ -17,7 +17,7 @@
 <div class="panel-group" id="accordion">
     <div class="panel panel-default custom-panel expand_collapse_panel-icon" data-id="userDefineLabel">
         {{#ifCond labels.length "===" 0}}
-        <div class="panel-heading collapsed" data-toggle="collapse" href={{div_1.anchor}} aria-expanded="false" style="width: 70%">
+        <div class="panel-heading collapsed" data-toggle="collapse" href={{div_1.anchor}} {{#ifCond swapItem "===" true}} aria-expanded="true" {{else}} aria-expanded="false" {{/ifCond}} style="width: 70%">
             <h4 class="panel-title">
                 <a>Labels </a>
             </h4>
@@ -38,12 +38,13 @@
         {{#ifCond readOnlyEntity "===" false}}
         <div class="panel-actions">
             {{#ifCond swapItem "!==" true}}
-            <button class="btn btn-action btn-sm" data-id="addLabels" {{#ifCond labels.length "===" 0}} data-original-title="Add User-Defined Labels" {{else}} data-original-title="Edit User-Defined Labels" {{/ifCond}}>
+            <button class="btn btn-action btn-sm" data-id="addLabels">
                 {{#ifCond labels.length "===" 0}} Add {{else}} Edit {{/ifCond}}
             </button>
             {{/ifCond}}
             {{#ifCond saveLabels "===" true}}
-            <button class="btn btn-action btn-sm" data-id="saveLabels" data-original-title="Save User-Defined Labels">Save</button>
+            <button class="btn btn-action btn-sm" data-id="saveLabels">Save</button>
+            <button class="btn btn-action btn-sm" data-id="cancel">Cancel</button>
             {{/ifCond}}
         </div>
         {{/ifCond}}
@@ -56,9 +57,7 @@
                         <select class="form-control" data-id="addLabelOptions" multiple="multiple"></select>
                         {{else}}
                         <div class="badge-container">
-                            {{#each labels}}
-                            <label class="btn btn-action btn-sm btn-blue no-pointer">{{this}}</label>
-                            {{/each}}
+                            No labels have been created yet. To add a labels, click <a href="javascript:void(0)" data-id="addLabels">here</a>
                         </div>
                         {{/ifCond}}
                     </div>
diff --git a/dashboardv2/public/js/templates/entity/EntityUserDefineItemView_tmpl.html b/dashboardv2/public/js/templates/entity/EntityUserDefineItemView_tmpl.html
index 439943d..edc6ba2 100644
--- a/dashboardv2/public/js/templates/entity/EntityUserDefineItemView_tmpl.html
+++ b/dashboardv2/public/js/templates/entity/EntityUserDefineItemView_tmpl.html
@@ -41,7 +41,9 @@
             <p class="errorMsg" data-id="charSupportMsg"></p>
         </td>
     </tr>
+    {{#if allValueRemovedUpdate}}
+    All properties has been removed. To add a property, click <a href="javascript:void(0)" data-id="addItem">here</a>{{else}}
     {{#ifCond items.length "===" 0}}
     No properties have been created yet. To add a property, click <a href="javascript:void(0)" data-id="addItem">here</a>
-    {{/ifCond}}
+    {{/ifCond}}{{/if}}
 </table>
\ No newline at end of file
diff --git a/dashboardv2/public/js/templates/entity/EntityUserDefineView_tmpl.html b/dashboardv2/public/js/templates/entity/EntityUserDefineView_tmpl.html
index 8c90c5a..4434300 100644
--- a/dashboardv2/public/js/templates/entity/EntityUserDefineView_tmpl.html
+++ b/dashboardv2/public/js/templates/entity/EntityUserDefineView_tmpl.html
@@ -17,7 +17,7 @@
 <div class="panel-group" id="accordion">
     <div class="panel panel-default custom-panel expand_collapse_panel-icon" data-id="userDefine">
         {{#ifCond customAttibutes.length "===" 0}}
-        <div class="panel-heading collapsed" data-toggle="collapse" href={{divId_1.anchor}} aria-expanded="false" style="width: 70%">
+        <div class="panel-heading collapsed" data-toggle="collapse" href={{divId_1.anchor}} {{#ifCond swapItem "===" true}} aria-expanded="true" {{else}} aria-expanded="false" {{/ifCond}} style="width: 70%">
             <h4 class="panel-title">
                 <a>User-defined properties </a>
             </h4>
@@ -38,12 +38,13 @@
         {{#ifCond readOnlyEntity "===" false}}
         <div class="panel-actions">
             {{#ifCond swapItem "!==" true}}
-            <button class="btn btn-action btn-sm" data-id="addAttr" {{#ifCond customAttibutes.length "===" 0}} data-original-title="Add User-defined properties" {{else}} data-original-title="Edit User-defined properties" {{/ifCond}}>
+            <button class="btn btn-action btn-sm" data-id="addAttr">
                 {{#ifCond customAttibutes.length "===" 0}} Add {{else}} Edit {{/ifCond}}
             </button>
             {{/ifCond}}
             {{#ifCond saveAttrItems "===" true}}
-            <button class="btn btn-action btn-sm" data-id="saveAttrItems" data-original-title="Save User-defined properties">Save</button>
+            <button class="btn btn-action btn-sm" data-id="saveAttrItems">Save</button>
+            <button class="btn btn-action btn-sm" data-id="cancel">Cancel</button>
             {{/ifCond}}
         </div>
         {{/ifCond}}
@@ -55,22 +56,7 @@
                         {{#ifCond swapItem "===" true}}
                         <div id="r_entityUserDefinedItemView"></div>
                         {{else}}
-                        <div class="entity-detail-table">
-                            <table class="table">
-                                <tbody>
-                                    {{#each customAttibutes}}
-                                    <tr>
-                                        <td>
-                                            <div class="scroll-y">{{key}}</div>
-                        </div>
-                        </td>
-                        <td>
-                            <div class="scroll-y">{{value}}</div>
-                        </td>
-                        </tr>
-                        {{/each}}
-                        </tbody>
-                        </table>
+                        No properties have been created yet. To add a property, click <a href="javascript:void(0)" data-id="addItem">here</a>
                     </div>
                     {{/ifCond}}
                 </div>
diff --git a/dashboardv2/public/js/views/entity/EntityBusinessMetaDataView.js b/dashboardv2/public/js/views/entity/EntityBusinessMetaDataView.js
index 5bf0e28..0adabed 100644
--- a/dashboardv2/public/js/views/entity/EntityBusinessMetaDataView.js
+++ b/dashboardv2/public/js/views/entity/EntityBusinessMetaDataView.js
@@ -111,15 +111,15 @@ define([
             this.panelOpenClose();
         },
         panelOpenClose: function() {
-            var collection = this.editMode ? this.collection : this.actualCollection;
+            var collection = this.editMode ? this.collection : this.actualCollection,
+                headingEl = this.$el.find(".panel-heading.main-parent");
             if (collection && collection.length === 0) {
-                this.$el.find(".panel-heading").addClass("collapsed").attr('aria-expanded',false);
-                this.$el.find(".panel-collapse.collapse").removeClass("in");
                 this.ui.addBusinessMetadata.text("Add");
             } else {
                 this.ui.addBusinessMetadata.text("Edit");
-                this.$el.find(".panel-heading").removeClass("collapsed").attr('aria-expanded',true);
-                this.$el.find(".panel-collapse.collapse").addClass("in");
+                if (headingEl.hasClass("collapsed")) {
+                    headingEl.click();
+                }
             }
         },
         validate: function() {
@@ -164,12 +164,14 @@ define([
                 type: "POST",
                 success: function(data) {
                     Utils.notifySuccess({
-                        content: "One or more Business Metadada attributes" + Messages.getAbbreviationMsg(false, 'editSuccessMessage')
+                        content: "One or more Business Metadada attributes" + Messages.getAbbreviationMsg(true, 'editSuccessMessage')
                     });
                     that.entity.businessAttributes = data;
-                    this.editMode = false;
+                    that.ui.businessMetadataTree.html("");
+                    that.editMode = false;
                     that.fetchCollection();
                     that.onCancel();
+
                 },
                 complete: function(model, response) {
                     //that.hideLoader();
@@ -239,7 +241,11 @@ define([
                 });
                 li += that.associateAttributePanel(obj, attrLi);
             });
-            this.ui.businessMetadataTree.html(li);
+            var html = li;
+            if (html === "") {
+                html = '<div class="col-md-12"> No business metadata have been created yet. To add a business metadata, click <a href="javascript:void(0)" data-id="addBusinessMetadata">here</a></div>';
+            }
+            this.ui.businessMetadataTree.html(html);
         },
         associateAttributePanel: function(obj, tableBody) {
             return '<div class="panel panel-default custom-panel expand_collapse_panel-icon no-border business-metadata-detail-attr">' +
@@ -252,7 +258,11 @@ define([
                 '</div></div>';
         },
         onRender: function() {
-            this.panelOpenClose();
+            if (this.actualCollection && this.actualCollection.length) {
+                this.$el.find(".panel-heading.main-parent").removeClass("collapsed").attr("aria-expanded", "true");
+                this.$el.find("#businessMetadataCollapse").addClass("in").removeAttr("style");
+                this.ui.addBusinessMetadata.text("Edit");
+            }
             this.renderBusinessMetadata();
         }
     });
diff --git a/dashboardv2/public/js/views/entity/EntityLabelDefineView.js b/dashboardv2/public/js/views/entity/EntityLabelDefineView.js
index 678a039..23bcc9f 100644
--- a/dashboardv2/public/js/views/entity/EntityLabelDefineView.js
+++ b/dashboardv2/public/js/views/entity/EntityLabelDefineView.js
@@ -44,13 +44,15 @@ define(['require',
         ui: {
             addLabelOptions: "[data-id='addLabelOptions']",
             addLabels: "[data-id='addLabels']",
-            saveLabels: "[data-id='saveLabels']"
+            saveLabels: "[data-id='saveLabels']",
+            cancel: "[data-id='cancel']"
         },
         events: function() {
             var events = {};
             events["change " + this.ui.addLabelOptions] = 'onChangeLabelChange';
             events["click " + this.ui.addLabels] = 'handleBtnClick';
             events["click " + this.ui.saveLabels] = 'saveUserDefinedLabels';
+            events["click " + this.ui.cancel] = 'onCancelClick';
             return events;
         },
         initialize: function(options) {
@@ -140,6 +142,12 @@ define(['require',
             }
             this.render();
         },
+        onCancelClick: function() {
+            this.labels = this.entityModel.get("labels") || [];
+            this.swapItem = false;
+            this.saveLabels = false;
+            this.render();
+        },
         saveUserDefinedLabels: function() {
             var that = this;
             var entityJson = that.entityModel.toJSON();
diff --git a/dashboardv2/public/js/views/entity/EntityUserDefineItemView.js b/dashboardv2/public/js/views/entity/EntityUserDefineItemView.js
index d4db707..bcc0845 100644
--- a/dashboardv2/public/js/views/entity/EntityUserDefineItemView.js
+++ b/dashboardv2/public/js/views/entity/EntityUserDefineItemView.js
@@ -29,7 +29,8 @@ define(['require',
 
         templateHelpers: function() {
             return {
-                items: this.items
+                items: this.items,
+                allValueRemovedUpdate: this.allValueRemovedUpdate
             };
         },
 
@@ -62,11 +63,13 @@ define(['require',
             if (options.items.length === 0) {
                 this.items = [{ key: "", value: "" }];
             } else {
-                this.items = options.items;
+                this.items = $.extend(true, [], options.items);
             }
+            this.updateParentButtonState = options.updateButtonState;
         },
         onRender: function() {},
         onAddItemClick: function(e) {
+            this.allValueRemovedUpdate = false;
             var el = e.currentTarget;
             this.items.splice(parseInt(el.dataset.index) + 1, 0, { key: "", value: "" });
             this.render();
@@ -74,7 +77,16 @@ define(['require',
         onDeleteItemClick: function(e) {
             var el = e.currentTarget;
             this.items.splice(el.dataset.index, 1);
-            this.render();
+            this.allValueRemovedUpdate = false;
+            if (this.items.length === 0) {
+                var updated = this.updateParentButtonState();
+                if (updated === false) {
+                    this.allValueRemovedUpdate = true;
+                    this.render();
+                }
+            } else {
+                this.render();
+            }
         },
         onItemKeyChange: function(e) {
             var el = e.currentTarget;
diff --git a/dashboardv2/public/js/views/entity/EntityUserDefineView.js b/dashboardv2/public/js/views/entity/EntityUserDefineView.js
index 38d32c2..c76000b 100644
--- a/dashboardv2/public/js/views/entity/EntityUserDefineView.js
+++ b/dashboardv2/public/js/views/entity/EntityUserDefineView.js
@@ -42,14 +42,16 @@ define(['require',
         },
         ui: {
             addAttr: "[data-id='addAttr']",
-            editAttr: "[data-id='editAttr']",
-            saveAttrItems: "[data-id='saveAttrItems']"
+            saveAttrItems: "[data-id='saveAttrItems']",
+            cancel: "[data-id='cancel']",
+            addItem: "[data-id='addItem']"
         },
         events: function() {
             var events = {};
             events["click " + this.ui.addAttr] = 'onAddAttrClick';
-            events["click " + this.ui.editAttr] = 'onEditAttrClick';
+            events["click " + this.ui.addItem] = 'onAddAttrClick';
             events["click " + this.ui.saveAttrItems] = 'onEditAttrClick';
+            events["click " + this.ui.cancel] = 'onCancelClick';
             return events;
         },
         initialize: function(options) {
@@ -66,9 +68,8 @@ define(['require',
         onRender: function() {},
         renderEntityUserDefinedItems: function() {
             var that = this;
-
             require(['views/entity/EntityUserDefineItemView'], function(EntityUserDefineItemView) {
-                that.itemView = new EntityUserDefineItemView({ items: that.customAttibutes });
+                that.itemView = new EntityUserDefineItemView({ items: that.customAttibutes, updateButtonState: that.updateButtonState.bind(that) });
                 that.REntityUserDefinedItemView.show(that.itemView);
             });
         },
@@ -106,6 +107,21 @@ define(['require',
             this.initialCall = this.customAttibutes.length > 0 ? false : true;
             this.setAttributeModal(this.itemView);
         },
+        updateButtonState: function() {
+            if (this.customAttibutes.length === 0) {
+                this.swapItem = false;
+                this.saveAttrItems = false;
+                this.render();
+            } else {
+                return false;
+            }
+        },
+        onCancelClick: function() {
+            this.initialCall = false;
+            this.swapItem = false;
+            this.saveAttrItems = false;
+            this.render();
+        },
         structureAttributes: function(list) {
             var obj = {}
             list.map(function(o) {
diff --git a/dashboardv3/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html b/dashboardv3/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html
index 0e4c2aa..fd00abf 100644
--- a/dashboardv3/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html
+++ b/dashboardv3/public/js/templates/entity/EntityBusinessMetaDataView_tmpl.html
@@ -15,7 +15,7 @@
  * limitations under the License.
 -->
 <div class="panel panel-default custom-panel expand_collapse_panel-icon">
-    <div class="panel-heading" data-toggle="collapse" href="#businessMetadataCollapse" aria-expanded="false" style="width: 70%;">
+    <div class="panel-heading main-parent collapsed" data-toggle="collapse" href="#businessMetadataCollapse" aria-expanded="false" style="width: 70%;">
         <h4 class="panel-title">
             <a>Business Metadata</a>
         </h4>
diff --git a/dashboardv3/public/js/templates/entity/EntityLabelDefineView_tmpl.html b/dashboardv3/public/js/templates/entity/EntityLabelDefineView_tmpl.html
index f122fe9..d3ca9ad 100644
--- a/dashboardv3/public/js/templates/entity/EntityLabelDefineView_tmpl.html
+++ b/dashboardv3/public/js/templates/entity/EntityLabelDefineView_tmpl.html
@@ -17,7 +17,7 @@
 <div class="panel-group" id="accordion">
     <div class="panel panel-default custom-panel expand_collapse_panel-icon" data-id="userDefineLabel">
         {{#ifCond labels.length "===" 0}}
-        <div class="panel-heading collapsed" data-toggle="collapse" href={{div_1.anchor}} aria-expanded="false" style="width: 70%">
+        <div class="panel-heading collapsed" data-toggle="collapse" href={{div_1.anchor}} {{#ifCond swapItem "===" true}} aria-expanded="true" {{else}} aria-expanded="false" {{/ifCond}} style="width: 70%">
             <h4 class="panel-title">
                 <a>Labels </a>
             </h4>
@@ -38,12 +38,13 @@
         {{#ifCond readOnlyEntity "===" false}}
         <div class="panel-actions">
             {{#ifCond swapItem "!==" true}}
-            <button class="btn btn-action btn-sm" data-id="addLabels" {{#ifCond labels.length "===" 0}} data-original-title="Add User-Defined Labels" {{else}} data-original-title="Edit User-Defined Labels" {{/ifCond}}>
+            <button class="btn btn-action btn-sm" data-id="addLabels">
                 {{#ifCond labels.length "===" 0}} Add {{else}} Edit {{/ifCond}}
             </button>
             {{/ifCond}}
             {{#ifCond saveLabels "===" true}}
-            <button class="btn btn-action btn-sm" data-id="saveLabels" data-original-title="Save User-Defined Labels">Save</button>
+            <button class="btn btn-action btn-sm" data-id="saveLabels">Save</button>
+            <button class="btn btn-action btn-sm" data-id="cancel">Cancel</button>
             {{/ifCond}}
         </div>
         {{/ifCond}}
@@ -56,9 +57,7 @@
                         <select class="form-control" data-id="addLabelOptions" multiple="multiple"></select>
                         {{else}}
                         <div class="badge-container">
-                            {{#each labels}}
-                            <label class="btn btn-action btn-sm btn-blue no-pointer">{{this}}</label>
-                            {{/each}}
+                            No labels have been created yet. To add a labels, click <a href="javascript:void(0)" data-id="addLabels">here</a>
                         </div>
                         {{/ifCond}}
                     </div>
diff --git a/dashboardv3/public/js/templates/entity/EntityUserDefineItemView_tmpl.html b/dashboardv3/public/js/templates/entity/EntityUserDefineItemView_tmpl.html
index 74dcd91..b1c8a03 100644
--- a/dashboardv3/public/js/templates/entity/EntityUserDefineItemView_tmpl.html
+++ b/dashboardv3/public/js/templates/entity/EntityUserDefineItemView_tmpl.html
@@ -41,7 +41,9 @@
             <p class="errorMsg" data-id="charSupportMsg"></p>
         </td>
     </tr>
+    {{#if allValueRemovedUpdate}}
+    All properties has been removed. To add a property, click <a href="javascript:void(0)" data-id="addItem">here</a>{{else}}
     {{#ifCond items.length "===" 0}}
     No properties have been created yet. To add a property, click <a href="javascript:void(0)" data-id="addItem">here</a>
-    {{/ifCond}}
+    {{/ifCond}}{{/if}}
 </table>
\ No newline at end of file
diff --git a/dashboardv3/public/js/templates/entity/EntityUserDefineView_tmpl.html b/dashboardv3/public/js/templates/entity/EntityUserDefineView_tmpl.html
index 8c90c5a..4434300 100644
--- a/dashboardv3/public/js/templates/entity/EntityUserDefineView_tmpl.html
+++ b/dashboardv3/public/js/templates/entity/EntityUserDefineView_tmpl.html
@@ -17,7 +17,7 @@
 <div class="panel-group" id="accordion">
     <div class="panel panel-default custom-panel expand_collapse_panel-icon" data-id="userDefine">
         {{#ifCond customAttibutes.length "===" 0}}
-        <div class="panel-heading collapsed" data-toggle="collapse" href={{divId_1.anchor}} aria-expanded="false" style="width: 70%">
+        <div class="panel-heading collapsed" data-toggle="collapse" href={{divId_1.anchor}} {{#ifCond swapItem "===" true}} aria-expanded="true" {{else}} aria-expanded="false" {{/ifCond}} style="width: 70%">
             <h4 class="panel-title">
                 <a>User-defined properties </a>
             </h4>
@@ -38,12 +38,13 @@
         {{#ifCond readOnlyEntity "===" false}}
         <div class="panel-actions">
             {{#ifCond swapItem "!==" true}}
-            <button class="btn btn-action btn-sm" data-id="addAttr" {{#ifCond customAttibutes.length "===" 0}} data-original-title="Add User-defined properties" {{else}} data-original-title="Edit User-defined properties" {{/ifCond}}>
+            <button class="btn btn-action btn-sm" data-id="addAttr">
                 {{#ifCond customAttibutes.length "===" 0}} Add {{else}} Edit {{/ifCond}}
             </button>
             {{/ifCond}}
             {{#ifCond saveAttrItems "===" true}}
-            <button class="btn btn-action btn-sm" data-id="saveAttrItems" data-original-title="Save User-defined properties">Save</button>
+            <button class="btn btn-action btn-sm" data-id="saveAttrItems">Save</button>
+            <button class="btn btn-action btn-sm" data-id="cancel">Cancel</button>
             {{/ifCond}}
         </div>
         {{/ifCond}}
@@ -55,22 +56,7 @@
                         {{#ifCond swapItem "===" true}}
                         <div id="r_entityUserDefinedItemView"></div>
                         {{else}}
-                        <div class="entity-detail-table">
-                            <table class="table">
-                                <tbody>
-                                    {{#each customAttibutes}}
-                                    <tr>
-                                        <td>
-                                            <div class="scroll-y">{{key}}</div>
-                        </div>
-                        </td>
-                        <td>
-                            <div class="scroll-y">{{value}}</div>
-                        </td>
-                        </tr>
-                        {{/each}}
-                        </tbody>
-                        </table>
+                        No properties have been created yet. To add a property, click <a href="javascript:void(0)" data-id="addItem">here</a>
                     </div>
                     {{/ifCond}}
                 </div>
diff --git a/dashboardv3/public/js/utils/Utils.js b/dashboardv3/public/js/utils/Utils.js
index 28a0bfd..7b957da 100644
--- a/dashboardv3/public/js/utils/Utils.js
+++ b/dashboardv3/public/js/utils/Utils.js
@@ -240,10 +240,12 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
     }
     Utils.defaultErrorHandler = function(model, error, options) {
         var skipDefaultError = null,
-            defaultErrorMessage = null;
+            defaultErrorMessage = null,
+            isHtml = null;
         if (options) {
             skipDefaultError = options.skipDefaultError;
             defaultErrorMessage = options.defaultErrorMessage;
+            isHtml = options.isHtml;
         }
         var redirectToLoginPage = function() {
             Utils.localStorage.setValue("last_ui_load", "v2");
@@ -266,13 +268,13 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
                     });
                 }
             } else if (skipDefaultError !== true) {
-                Utils.serverErrorHandler(error, defaultErrorMessage);
+                Utils.serverErrorHandler(error, defaultErrorMessage, isHtml);
             }
         } else if (skipDefaultError !== true) {
             Utils.serverErrorHandler(error, defaultErrorMessage);
         }
     };
-    Utils.serverErrorHandler = function(response, defaultErrorMessage) {
+    Utils.serverErrorHandler = function(response, defaultErrorMessage, isHtml) {
         var responseJSON = response ? response.responseJSON : response,
             message = defaultErrorMessage ? defaultErrorMessage : Messages.defaultErrorMessage
         if (response && responseJSON) {
@@ -281,6 +283,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
         var existingError = $(".ui-pnotify-container.alert-danger .ui-pnotify-text").text();
         if (existingError !== message) {
             Utils.notifyError({
+                html:isHtml,
                 content: message
             });
         }
diff --git a/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
index 3fd5a13..0adabed 100644
--- a/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
+++ b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
@@ -111,15 +111,15 @@ define([
             this.panelOpenClose();
         },
         panelOpenClose: function() {
-            var collection = this.editMode ? this.collection : this.actualCollection;
+            var collection = this.editMode ? this.collection : this.actualCollection,
+                headingEl = this.$el.find(".panel-heading.main-parent");
             if (collection && collection.length === 0) {
-                this.$el.find(".panel-heading").addClass("collapsed");
-                this.$el.find(".panel-collapse.collapse").removeClass("in");
                 this.ui.addBusinessMetadata.text("Add");
             } else {
                 this.ui.addBusinessMetadata.text("Edit");
-                this.$el.find(".panel-heading").removeClass("collapsed");
-                this.$el.find(".panel-collapse.collapse").addClass("in");
+                if (headingEl.hasClass("collapsed")) {
+                    headingEl.click();
+                }
             }
         },
         validate: function() {
@@ -164,12 +164,14 @@ define([
                 type: "POST",
                 success: function(data) {
                     Utils.notifySuccess({
-                        content: "One or more Business Metadada attributes" + Messages.getAbbreviationMsg(false, 'editSuccessMessage')
+                        content: "One or more Business Metadada attributes" + Messages.getAbbreviationMsg(true, 'editSuccessMessage')
                     });
                     that.entity.businessAttributes = data;
-                    this.editMode = false;
+                    that.ui.businessMetadataTree.html("");
+                    that.editMode = false;
                     that.fetchCollection();
                     that.onCancel();
+
                 },
                 complete: function(model, response) {
                     //that.hideLoader();
@@ -239,7 +241,11 @@ define([
                 });
                 li += that.associateAttributePanel(obj, attrLi);
             });
-            this.ui.businessMetadataTree.html(li);
+            var html = li;
+            if (html === "") {
+                html = '<div class="col-md-12"> No business metadata have been created yet. To add a business metadata, click <a href="javascript:void(0)" data-id="addBusinessMetadata">here</a></div>';
+            }
+            this.ui.businessMetadataTree.html(html);
         },
         associateAttributePanel: function(obj, tableBody) {
             return '<div class="panel panel-default custom-panel expand_collapse_panel-icon no-border business-metadata-detail-attr">' +
@@ -252,7 +258,11 @@ define([
                 '</div></div>';
         },
         onRender: function() {
-            this.panelOpenClose();
+            if (this.actualCollection && this.actualCollection.length) {
+                this.$el.find(".panel-heading.main-parent").removeClass("collapsed").attr("aria-expanded", "true");
+                this.$el.find("#businessMetadataCollapse").addClass("in").removeAttr("style");
+                this.ui.addBusinessMetadata.text("Edit");
+            }
             this.renderBusinessMetadata();
         }
     });
diff --git a/dashboardv3/public/js/views/entity/EntityLabelDefineView.js b/dashboardv3/public/js/views/entity/EntityLabelDefineView.js
index a3e864d..5e5fd6e 100644
--- a/dashboardv3/public/js/views/entity/EntityLabelDefineView.js
+++ b/dashboardv3/public/js/views/entity/EntityLabelDefineView.js
@@ -44,13 +44,15 @@ define(['require',
         ui: {
             addLabelOptions: "[data-id='addLabelOptions']",
             addLabels: "[data-id='addLabels']",
-            saveLabels: "[data-id='saveLabels']"
+            saveLabels: "[data-id='saveLabels']",
+            cancel: "[data-id='cancel']"
         },
         events: function() {
             var events = {};
             events["change " + this.ui.addLabelOptions] = 'onChangeLabelChange';
             events["click " + this.ui.addLabels] = 'handleBtnClick';
             events["click " + this.ui.saveLabels] = 'saveUserDefinedLabels';
+            events["click " + this.ui.cancel] = 'onCancelClick';
             return events;
         },
         initialize: function(options) {
@@ -140,6 +142,12 @@ define(['require',
             }
             this.render();
         },
+        onCancelClick: function() {
+            this.labels = this.entityModel.get("labels") || [];
+            this.swapItem = false;
+            this.saveLabels = false;
+            this.render();
+        },
         saveUserDefinedLabels: function() {
             var that = this;
             var entityJson = that.entityModel.toJSON();
diff --git a/dashboardv3/public/js/views/entity/EntityUserDefineItemView.js b/dashboardv3/public/js/views/entity/EntityUserDefineItemView.js
index d4db707..bcc0845 100644
--- a/dashboardv3/public/js/views/entity/EntityUserDefineItemView.js
+++ b/dashboardv3/public/js/views/entity/EntityUserDefineItemView.js
@@ -29,7 +29,8 @@ define(['require',
 
         templateHelpers: function() {
             return {
-                items: this.items
+                items: this.items,
+                allValueRemovedUpdate: this.allValueRemovedUpdate
             };
         },
 
@@ -62,11 +63,13 @@ define(['require',
             if (options.items.length === 0) {
                 this.items = [{ key: "", value: "" }];
             } else {
-                this.items = options.items;
+                this.items = $.extend(true, [], options.items);
             }
+            this.updateParentButtonState = options.updateButtonState;
         },
         onRender: function() {},
         onAddItemClick: function(e) {
+            this.allValueRemovedUpdate = false;
             var el = e.currentTarget;
             this.items.splice(parseInt(el.dataset.index) + 1, 0, { key: "", value: "" });
             this.render();
@@ -74,7 +77,16 @@ define(['require',
         onDeleteItemClick: function(e) {
             var el = e.currentTarget;
             this.items.splice(el.dataset.index, 1);
-            this.render();
+            this.allValueRemovedUpdate = false;
+            if (this.items.length === 0) {
+                var updated = this.updateParentButtonState();
+                if (updated === false) {
+                    this.allValueRemovedUpdate = true;
+                    this.render();
+                }
+            } else {
+                this.render();
+            }
         },
         onItemKeyChange: function(e) {
             var el = e.currentTarget;
diff --git a/dashboardv3/public/js/views/entity/EntityUserDefineView.js b/dashboardv3/public/js/views/entity/EntityUserDefineView.js
index 38d32c2..c76000b 100644
--- a/dashboardv3/public/js/views/entity/EntityUserDefineView.js
+++ b/dashboardv3/public/js/views/entity/EntityUserDefineView.js
@@ -42,14 +42,16 @@ define(['require',
         },
         ui: {
             addAttr: "[data-id='addAttr']",
-            editAttr: "[data-id='editAttr']",
-            saveAttrItems: "[data-id='saveAttrItems']"
+            saveAttrItems: "[data-id='saveAttrItems']",
+            cancel: "[data-id='cancel']",
+            addItem: "[data-id='addItem']"
         },
         events: function() {
             var events = {};
             events["click " + this.ui.addAttr] = 'onAddAttrClick';
-            events["click " + this.ui.editAttr] = 'onEditAttrClick';
+            events["click " + this.ui.addItem] = 'onAddAttrClick';
             events["click " + this.ui.saveAttrItems] = 'onEditAttrClick';
+            events["click " + this.ui.cancel] = 'onCancelClick';
             return events;
         },
         initialize: function(options) {
@@ -66,9 +68,8 @@ define(['require',
         onRender: function() {},
         renderEntityUserDefinedItems: function() {
             var that = this;
-
             require(['views/entity/EntityUserDefineItemView'], function(EntityUserDefineItemView) {
-                that.itemView = new EntityUserDefineItemView({ items: that.customAttibutes });
+                that.itemView = new EntityUserDefineItemView({ items: that.customAttibutes, updateButtonState: that.updateButtonState.bind(that) });
                 that.REntityUserDefinedItemView.show(that.itemView);
             });
         },
@@ -106,6 +107,21 @@ define(['require',
             this.initialCall = this.customAttibutes.length > 0 ? false : true;
             this.setAttributeModal(this.itemView);
         },
+        updateButtonState: function() {
+            if (this.customAttibutes.length === 0) {
+                this.swapItem = false;
+                this.saveAttrItems = false;
+                this.render();
+            } else {
+                return false;
+            }
+        },
+        onCancelClick: function() {
+            this.initialCall = false;
+            this.swapItem = false;
+            this.saveAttrItems = false;
+            this.render();
+        },
         structureAttributes: function(list) {
             var obj = {}
             list.map(function(o) {


[atlas] 02/05: ATLAS-3728:- UI: Show uploaded data details (status)

Posted by kb...@apache.org.
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

commit 937e31f571bbf366a3b46d2da4467aad76ca3368
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Thu May 21 20:48:39 2020 +0530

    ATLAS-3728:- UI: Show uploaded data details (status)
    
    (cherry picked from commit 2228d752714b8edeea2ccf0aba660f69e765e6fa)
---
 dashboardv2/public/css/scss/theme.scss             | 34 +++++++++++++++++
 .../BusinessMetadataAttributeItemView_tmpl.html    |  5 ++-
 .../js/templates/import/ImportLayoutView_tmpl.html |  5 ++-
 .../public/js/views/import/ImportLayoutView.js     | 44 ++++++++++++++++++++--
 dashboardv3/public/css/scss/theme.scss             | 19 ++++++++++
 .../BusinessMetadataAttributeItemView_tmpl.html    |  5 ++-
 .../js/templates/import/ImportLayoutView_tmpl.html |  5 ++-
 .../public/js/views/import/ImportLayoutView.js     | 44 ++++++++++++++++++++--
 8 files changed, 151 insertions(+), 10 deletions(-)

diff --git a/dashboardv2/public/css/scss/theme.scss b/dashboardv2/public/css/scss/theme.scss
index da4c370..6646a45 100644
--- a/dashboardv2/public/css/scss/theme.scss
+++ b/dashboardv2/public/css/scss/theme.scss
@@ -709,4 +709,38 @@ td.searchTableName:hover {
     .modal-body {
         background: $color_white_lilac_approx;
     }
+}
+
+.help-btn {
+    cursor: pointer;
+    font-size: 20px;
+}
+
+.back-button {
+    display: inline-block;
+    float: left;
+    position: absolute;
+    left: 4px;
+    top: 9px;
+    font-size: 38px;
+    color: #bfbfbf;
+    cursor: pointer;
+
+    &:hover {
+        color: $gray;
+    }
+}
+
+.modal-header {
+    .back-button {
+        margin-left: 10px;
+        top: 9px;
+        font-size: 38px;
+    }
+
+    .modal-name {
+        font-size: 22px;
+        margin-top: 5px;
+        margin-left: 20px;
+    }
 }
\ No newline at end of file
diff --git a/dashboardv2/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html b/dashboardv2/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html
index 4b2437d..55b4969 100644
--- a/dashboardv2/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html
+++ b/dashboardv2/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html
@@ -46,7 +46,7 @@
     </div>
     <div class="form-group">
         <label class="control-label col-sm-3 required" for="type">Search Weight</label>
-        <div class="col-sm-8">
+        <div class="col-sm-6">
             <select class="form-control searchWeightSelector" data-id="searchWeightSelector">
                 <option>0</option>
                 <option>1</option>
@@ -61,6 +61,9 @@
                 <option>10</option>
             </select>
         </div>
+        <label class="control-label">
+            <i class="fa fa-question-circle help-btn" title="<span><i class='fa fa-arrow-up'></i> the search weight for the attribute,<i class='fa fa-arrow-up'></i> the entity in the topmost search results when searched for by that attribute</span><h6>Applicable Ranges</h6><ul style='padding:0px'><li>Quick search: <b>0 - 10</b></li><li>Suggestion: <b>8 - 10</b></li></ul>" data-html="true"></i>
+        </label>
     </div>
     <div class="form-group" data-id="multiValueSelect">
         <label class="control-label col-sm-3" for="multiValSelect">Enable Multivalues</label>
diff --git a/dashboardv2/public/js/templates/import/ImportLayoutView_tmpl.html b/dashboardv2/public/js/templates/import/ImportLayoutView_tmpl.html
index 5bb9ab5..2199d28 100644
--- a/dashboardv2/public/js/templates/import/ImportLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/import/ImportLayoutView_tmpl.html
@@ -14,4 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<form id="importGlossary" class="dropzone single-file-center"></form>
\ No newline at end of file
+<form data-id="importGlossary" class="dropzone single-file-center"></form>
+<div data-id="errorContainer" class="hide">
+    <ol data-id="errorDetails"></ol>
+</div>
\ No newline at end of file
diff --git a/dashboardv2/public/js/views/import/ImportLayoutView.js b/dashboardv2/public/js/views/import/ImportLayoutView.js
index 81e4d33..b1b7aab 100644
--- a/dashboardv2/public/js/views/import/ImportLayoutView.js
+++ b/dashboardv2/public/js/views/import/ImportLayoutView.js
@@ -37,7 +37,11 @@ define([
             regions: {},
 
             /** ui selector cache */
-            ui: {},
+            ui: {
+                errorContainer: "[data-id='errorContainer']",
+                importGlossary: "[data-id='importGlossary']",
+                errorDetails: "[data-id='errorDetails']"
+            },
             /** ui events hash */
             events: function() {
                 var events = {};
@@ -66,8 +70,15 @@ define([
                 this.modal.on("closeModal", function() {
                     that.modal.trigger("cancel");
                 });
+                this.bindEvents();
+            },
+            bindEvents: function() {
+                var that = this;
+                $('body').on('click', '.importBackBtn', function() {
+                    var modalTitle = that.isGlossary ? "Import Glossary" : "Import Business Metadata";
+                    that.toggleErrorAndDropZoneView({ title: modalTitle, isErrorView: false });
+                });
             },
-            bindEvents: function() {},
             onRender: function() {
                 var that = this;
                 this.dropzone = null;
@@ -81,7 +92,7 @@ define([
                 }
                 var headers = {};
                 headers[CommonViewFunction.restCsrfCustomHeader] = '""';
-                this.$("#importGlossary").dropzone({
+                this.ui.importGlossary.dropzone({
                     url: that.isGlossary ? UrlLinks.glossaryImportUrl() : UrlLinks.businessMetadataImportUrl(),
                     clickable: true,
                     acceptedFiles: ".csv,.xls,.xlsx",
@@ -104,8 +115,19 @@ define([
                     success: function(file, response, responseObj) {
                         var success = true;
                         if (response.failedImportInfoList && response.failedImportInfoList.length) {
+                            var errorStr = '',
+                                notificationMsg = '';
                             success = false;
+                            that.ui.errorDetails.empty();
                             Utils.defaultErrorHandler(null, file.xhr, { defaultErrorMessage: response.failedImportInfoList[0].remarks });
+                            if (response.failedImportInfoList.length > 1) {
+                                var modalTitle = '<div class="back-button importBackBtn" title="Back to import file"><i class="fa fa-angle-left "></i> </div> <div class="modal-name">Error Details</div>';
+                                _.each(response.failedImportInfoList, function(err_obj) {
+                                    errorStr += '<li>' + err_obj.remarks + '</li>';
+                                });
+                                that.ui.errorDetails.append(errorStr);
+                                that.toggleErrorAndDropZoneView({ title: modalTitle, isErrorView: true });
+                            }
                         }
                         if (success) {
                             that.modal.trigger("cancel");
@@ -124,6 +146,22 @@ define([
                     dictDefaultMessage: "Drop files here or click to upload.",
                     headers: headers
                 });
+            },
+            toggleErrorAndDropZoneView: function(options) {
+                var that = this;
+                if (options) {
+                    that.modal.$el.find('.modal-title').html(options.title);
+                    if (options.isErrorView) {
+                        that.ui.importGlossary.addClass("hide");
+                        that.ui.errorContainer.removeClass("hide");
+                        that.modal.$el.find("button.ok").addClass('hide');
+                    } else {
+                        that.ui.importGlossary.removeClass("hide");
+                        that.ui.errorContainer.addClass("hide");
+                        that.modal.$el.find("button.ok").removeClass('hide');
+                        that.ui.errorDetails.empty();
+                    }
+                }
             }
         }
     );
diff --git a/dashboardv3/public/css/scss/theme.scss b/dashboardv3/public/css/scss/theme.scss
index 22b63ae..dbb225b 100644
--- a/dashboardv3/public/css/scss/theme.scss
+++ b/dashboardv3/public/css/scss/theme.scss
@@ -62,6 +62,20 @@ body {
     }
 }
 
+.modal-header {
+    .back-button {
+        margin-left: 10px;
+        top: 9px;
+        font-size: 38px;
+    }
+
+    .modal-name {
+        font-size: 22px;
+        margin-top: 5px;
+        margin-left: 20px;
+    }
+}
+
 
 .atlas-page-header {
     height: 70px;
@@ -829,4 +843,9 @@ td.searchTableName:hover {
     .modal-body {
         background: $color_white_lilac_approx;
     }
+}
+
+.help-btn {
+    cursor: pointer;
+    font-size: 20px;
 }
\ No newline at end of file
diff --git a/dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html
index 4b2437d..55b4969 100644
--- a/dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html
+++ b/dashboardv3/public/js/templates/business_metadata/BusinessMetadataAttributeItemView_tmpl.html
@@ -46,7 +46,7 @@
     </div>
     <div class="form-group">
         <label class="control-label col-sm-3 required" for="type">Search Weight</label>
-        <div class="col-sm-8">
+        <div class="col-sm-6">
             <select class="form-control searchWeightSelector" data-id="searchWeightSelector">
                 <option>0</option>
                 <option>1</option>
@@ -61,6 +61,9 @@
                 <option>10</option>
             </select>
         </div>
+        <label class="control-label">
+            <i class="fa fa-question-circle help-btn" title="<span><i class='fa fa-arrow-up'></i> the search weight for the attribute,<i class='fa fa-arrow-up'></i> the entity in the topmost search results when searched for by that attribute</span><h6>Applicable Ranges</h6><ul style='padding:0px'><li>Quick search: <b>0 - 10</b></li><li>Suggestion: <b>8 - 10</b></li></ul>" data-html="true"></i>
+        </label>
     </div>
     <div class="form-group" data-id="multiValueSelect">
         <label class="control-label col-sm-3" for="multiValSelect">Enable Multivalues</label>
diff --git a/dashboardv3/public/js/templates/import/ImportLayoutView_tmpl.html b/dashboardv3/public/js/templates/import/ImportLayoutView_tmpl.html
index 5bb9ab5..2199d28 100644
--- a/dashboardv3/public/js/templates/import/ImportLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/import/ImportLayoutView_tmpl.html
@@ -14,4 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<form id="importGlossary" class="dropzone single-file-center"></form>
\ No newline at end of file
+<form data-id="importGlossary" class="dropzone single-file-center"></form>
+<div data-id="errorContainer" class="hide">
+    <ol data-id="errorDetails"></ol>
+</div>
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/import/ImportLayoutView.js b/dashboardv3/public/js/views/import/ImportLayoutView.js
index 81e4d33..b1b7aab 100644
--- a/dashboardv3/public/js/views/import/ImportLayoutView.js
+++ b/dashboardv3/public/js/views/import/ImportLayoutView.js
@@ -37,7 +37,11 @@ define([
             regions: {},
 
             /** ui selector cache */
-            ui: {},
+            ui: {
+                errorContainer: "[data-id='errorContainer']",
+                importGlossary: "[data-id='importGlossary']",
+                errorDetails: "[data-id='errorDetails']"
+            },
             /** ui events hash */
             events: function() {
                 var events = {};
@@ -66,8 +70,15 @@ define([
                 this.modal.on("closeModal", function() {
                     that.modal.trigger("cancel");
                 });
+                this.bindEvents();
+            },
+            bindEvents: function() {
+                var that = this;
+                $('body').on('click', '.importBackBtn', function() {
+                    var modalTitle = that.isGlossary ? "Import Glossary" : "Import Business Metadata";
+                    that.toggleErrorAndDropZoneView({ title: modalTitle, isErrorView: false });
+                });
             },
-            bindEvents: function() {},
             onRender: function() {
                 var that = this;
                 this.dropzone = null;
@@ -81,7 +92,7 @@ define([
                 }
                 var headers = {};
                 headers[CommonViewFunction.restCsrfCustomHeader] = '""';
-                this.$("#importGlossary").dropzone({
+                this.ui.importGlossary.dropzone({
                     url: that.isGlossary ? UrlLinks.glossaryImportUrl() : UrlLinks.businessMetadataImportUrl(),
                     clickable: true,
                     acceptedFiles: ".csv,.xls,.xlsx",
@@ -104,8 +115,19 @@ define([
                     success: function(file, response, responseObj) {
                         var success = true;
                         if (response.failedImportInfoList && response.failedImportInfoList.length) {
+                            var errorStr = '',
+                                notificationMsg = '';
                             success = false;
+                            that.ui.errorDetails.empty();
                             Utils.defaultErrorHandler(null, file.xhr, { defaultErrorMessage: response.failedImportInfoList[0].remarks });
+                            if (response.failedImportInfoList.length > 1) {
+                                var modalTitle = '<div class="back-button importBackBtn" title="Back to import file"><i class="fa fa-angle-left "></i> </div> <div class="modal-name">Error Details</div>';
+                                _.each(response.failedImportInfoList, function(err_obj) {
+                                    errorStr += '<li>' + err_obj.remarks + '</li>';
+                                });
+                                that.ui.errorDetails.append(errorStr);
+                                that.toggleErrorAndDropZoneView({ title: modalTitle, isErrorView: true });
+                            }
                         }
                         if (success) {
                             that.modal.trigger("cancel");
@@ -124,6 +146,22 @@ define([
                     dictDefaultMessage: "Drop files here or click to upload.",
                     headers: headers
                 });
+            },
+            toggleErrorAndDropZoneView: function(options) {
+                var that = this;
+                if (options) {
+                    that.modal.$el.find('.modal-title').html(options.title);
+                    if (options.isErrorView) {
+                        that.ui.importGlossary.addClass("hide");
+                        that.ui.errorContainer.removeClass("hide");
+                        that.modal.$el.find("button.ok").addClass('hide');
+                    } else {
+                        that.ui.importGlossary.removeClass("hide");
+                        that.ui.errorContainer.addClass("hide");
+                        that.modal.$el.find("button.ok").removeClass('hide');
+                        that.ui.errorDetails.empty();
+                    }
+                }
             }
         }
     );