Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 b44b6ed9e -> 66a770304


ATLAS-2713: Glossary UI: enable assign button only when correct object-type is 
selected

Signed-off-by: Madhan Neethiraj <[email protected]>
(cherry picked from commit c950c9bdefc258d83dfbaed2087fb3e3cc062e62)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/66a77030
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/66a77030
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/66a77030

Branch: refs/heads/branch-1.0
Commit: 66a770304230050492d79b381fe55fad6a0d04bc
Parents: b44b6ed
Author: kevalbhatt <[email protected]>
Authored: Wed May 23 17:37:37 2018 +0530
Committer: Madhan Neethiraj <[email protected]>
Committed: Wed May 23 17:16:46 2018 -0700

----------------------------------------------------------------------
 dashboardv2/public/js/views/glossary/AssignTermLayoutView.js | 8 +++++++-
 dashboardv2/public/js/views/glossary/GlossaryLayoutView.js   | 7 ++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/66a77030/dashboardv2/public/js/views/glossary/AssignTermLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/glossary/AssignTermLayoutView.js 
b/dashboardv2/public/js/views/glossary/AssignTermLayoutView.js
index 69aa4d0..76c9bde 100644
--- a/dashboardv2/public/js/views/glossary/AssignTermLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/AssignTermLayoutView.js
@@ -87,6 +87,7 @@ define(['require',
                     "mainClass": "wizard-modal"
                 });
                 this.modal.open();
+                this.modal.$el.find('button.ok').attr("disabled", true);
                 this.modal.on('closeModal', function() {
                     that.modal.trigger('cancel');
                     if (that.assignTermError && that.hideLoader) {
@@ -99,8 +100,13 @@ define(['require',
                 this.modal.on('ok', function() {
                     that.assignTerm();
                 });
+                this.bindEvents();
+            },
+            bindEvents: function() {
+                this.listenTo(this.glossaryCollection, "node_selected", 
function(skip) {
+                    this.modal.$el.find('button.ok').attr("disabled", false);
+                }, this);
             },
-            bindEvents: function() {},
             onRender: function() {
                 this.renderGlossaryTree();
                 var that = this;

http://git-wip-us.apache.org/repos/asf/atlas/blob/66a77030/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js 
b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
index cda2ea5..0dcd4a3 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
@@ -256,7 +256,11 @@ define(['require',
                     var objGuid = options.objGuid,
                         node = options.node,
                         index = options.index;
-                    if (!that.guid) {
+                    if (that.isAssignView) {
+                        return {
+                            'opened': true
+                        }
+                    } else if (!that.guid) {
                         that.query[that.viewType].isNodeNotFoundAtLoad = false;
                         var selectedItem = {
                             "type": "Glossary",
@@ -461,6 +465,7 @@ define(['require',
                             .on("select_node.jstree", function(e, data) {
                                 if (that.isAssignView) {
                                     that.glossary.selectedItem = 
data.node.original;
+                                    
that.glossaryCollection.trigger("node_selected");
                                 } else {
                                     var popoverClassName = (type == "term" ? 
'.termPopover' : '.categoryPopover'),
                                         currentClickedPopoverEl = "";

Reply via email to