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

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

commit f048f84e78840387822d5ab5a5678f17756aa0b1
Author: prasad pawar <prasad.pa...@freestoneinfotech.com>
AuthorDate: Fri May 21 19:00:56 2021 +0530

    ATLAS-4283:UI: Description cannot be made blank for classification,fixed
    
    Signed-off-by: nixonrodrigues <ni...@apache.org>
---
 dashboardv2/public/js/templates/tag/CreateTagLayoutView_tmpl.html     | 4 ++--
 dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js       | 2 +-
 dashboardv2/public/js/views/tag/TagLayoutView.js                      | 3 +++
 dashboardv3/public/js/templates/tag/CreateTagLayoutView_tmpl.html     | 4 ++--
 .../public/js/views/search/tree/ClassificationTreeLayoutView.js       | 3 +++
 dashboardv3/public/js/views/tag/TagAttributeDetailLayoutView.js       | 2 +-
 6 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/dashboardv2/public/js/templates/tag/CreateTagLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/tag/CreateTagLayoutView_tmpl.html
index 0f2ba8a..27ea912 100644
--- a/dashboardv2/public/js/templates/tag/CreateTagLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/CreateTagLayoutView_tmpl.html
@@ -28,9 +28,9 @@
         <span class="ellipsis-with-margin control-label text-left col-sm-10" 
data-id="title"></span> {{/if}}
     </div>
     <div class="form-group">
-        <label class="control-label col-sm-2" 
for="description">Description</label>
+        <label class="control-label col-sm-2 required" 
for="description">Description</label>
         <div class="col-sm-10">
-            <input class="form-control" data-id="description" 
value="{{description}}" placeholder="Description" />
+            <input class="form-control" data-id="description" 
value="{{description}}" placeholder="Description(required)" />
         </div>
     </div>
     {{#if create}}
diff --git a/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js 
b/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
index 9b8b90f..8e7e6c3 100644
--- a/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
@@ -276,7 +276,7 @@ define(['require',
                     });
             },
             textAreaChangeEvent: function(view) {
-                if (this.model.get('description') === 
view.ui.description.val()) {
+                if (this.model.get('description') === 
view.ui.description.val() || view.ui.description.val().length == 0) {
                     this.modal.$el.find('button.ok').prop('disabled', true);
                 } else {
                     this.modal.$el.find('button.ok').prop('disabled', false);
diff --git a/dashboardv2/public/js/views/tag/TagLayoutView.js 
b/dashboardv2/public/js/views/tag/TagLayoutView.js
index f408469..9dd15b4 100644
--- a/dashboardv2/public/js/views/tag/TagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagLayoutView.js
@@ -402,6 +402,9 @@ define(['require',
                             allowCancel: true,
                         }).open();
                     modal.$el.find('button.ok').attr("disabled", "true");
+                    view.ui.tagName.on('keyup input', function(e) {
+                        view.ui.description.val(this.value);
+                    });
                     modal.on('shownModal', function() {
                         view.ui.parentTag.select2({
                             multiple: true,
diff --git a/dashboardv3/public/js/templates/tag/CreateTagLayoutView_tmpl.html 
b/dashboardv3/public/js/templates/tag/CreateTagLayoutView_tmpl.html
index 0f2ba8a..27ea912 100644
--- a/dashboardv3/public/js/templates/tag/CreateTagLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/tag/CreateTagLayoutView_tmpl.html
@@ -28,9 +28,9 @@
         <span class="ellipsis-with-margin control-label text-left col-sm-10" 
data-id="title"></span> {{/if}}
     </div>
     <div class="form-group">
-        <label class="control-label col-sm-2" 
for="description">Description</label>
+        <label class="control-label col-sm-2 required" 
for="description">Description</label>
         <div class="col-sm-10">
-            <input class="form-control" data-id="description" 
value="{{description}}" placeholder="Description" />
+            <input class="form-control" data-id="description" 
value="{{description}}" placeholder="Description(required)" />
         </div>
     </div>
     {{#if create}}
diff --git 
a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js 
b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
index 75e53cd..18d3650 100644
--- a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
@@ -686,6 +686,9 @@ define([
                         allowCancel: true
                     }).open();
                 modal.$el.find("button.ok").attr("disabled", "true");
+                view.ui.tagName.on('keyup input', function(e) {
+                    view.ui.description.val(this.value);
+                });
                 modal.on("shownModal", function() {
                     view.ui.parentTag.select2({
                         multiple: true,
diff --git a/dashboardv3/public/js/views/tag/TagAttributeDetailLayoutView.js 
b/dashboardv3/public/js/views/tag/TagAttributeDetailLayoutView.js
index 6e10155..cabf32b 100644
--- a/dashboardv3/public/js/views/tag/TagAttributeDetailLayoutView.js
+++ b/dashboardv3/public/js/views/tag/TagAttributeDetailLayoutView.js
@@ -280,7 +280,7 @@ define(['require',
                     });
             },
             textAreaChangeEvent: function(view) {
-                if (this.model.get('description') === 
view.ui.description.val()) {
+                if (this.model.get('description') === 
view.ui.description.val() || view.ui.description.val().length == 0) {
                     this.modal.$el.find('button.ok').prop('disabled', true);
                 } else {
                     this.modal.$el.find('button.ok').prop('disabled', false);

Reply via email to