This is an automated email from the ASF dual-hosted git repository. nbonte 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 de82208 ATLAS-4138:UI:While adding Classification to an entity, if user select and deselect the 'Apply Validity Period' checkbox immediately, it keeps on showing pop-up with text 'Please fill the details' Fixed de82208 is described below commit de82208bf630d9e7ed8d02ccf8ddc8d6a47d46ec Author: prasad pawar <prasad.pa...@freestoneinfotech.com> AuthorDate: Fri Feb 5 17:59:23 2021 +0530 ATLAS-4138:UI:While adding Classification to an entity, if user select and deselect the 'Apply Validity Period' checkbox immediately, it keeps on showing pop-up with text 'Please fill the details' Fixed Signed-off-by: Nikhil Bonte <nbo...@apache.org> (cherry picked from commit e616779727e64d632b1414ecea08de3239ac3bac) --- dashboardv2/public/js/utils/Helper.js | 26 +++++++++++++--------- dashboardv2/public/js/views/tag/AddTagModalView.js | 12 +++++----- .../js/views/tag/TagAttributeDetailLayoutView.js | 2 +- dashboardv3/public/js/utils/Helper.js | 26 +++++++++++++--------- dashboardv3/public/js/views/tag/AddTagModalView.js | 12 +++++----- .../js/views/tag/TagAttributeDetailLayoutView.js | 2 +- 6 files changed, 46 insertions(+), 34 deletions(-) diff --git a/dashboardv2/public/js/utils/Helper.js b/dashboardv2/public/js/utils/Helper.js index 050dfd5..b78077f 100644 --- a/dashboardv2/public/js/utils/Helper.js +++ b/dashboardv2/public/js/utils/Helper.js @@ -128,17 +128,21 @@ define(['require', $(this).blur(); }); $('body').on('keyup input', '.modal-body', function(e) { - var $this = $(this), - $footerButton = $this.parents(".modal").find('.modal-footer button.ok'), - requiredInputField = _.filter($this.find('input'), function($e) { - if ($e.getAttribute('placeholder') && $e.getAttribute('placeholder').indexOf('require') >= 0) { - return ($e.value.trim() == ""); - } - }); - if (requiredInputField.length > 0) { - $footerButton.attr("disabled", "true"); - } else { - $footerButton.removeAttr("disabled"); + var target = e.target, + isGlossary = (e.target.dataset.id === "searchTerm" || e.target.dataset.id === "searchCategory") ? true : false; // assign term/category modal + if ((target.type === "text" || target.type === "textarea") && !isGlossary) { + var $this = $(this), + $footerButton = $this.parents(".modal").find('.modal-footer button.ok'), + requiredInputField = _.filter($this.find('input'), function($e) { + if ($e.getAttribute('placeholder') && $e.getAttribute('placeholder').indexOf('require') >= 0) { + return ($e.value.trim() == ""); + } + }); + if (requiredInputField.length > 0) { + $footerButton.attr("disabled", "true"); + } else { + $footerButton.removeAttr("disabled"); + } } }); if ($.fn.select2) { diff --git a/dashboardv2/public/js/views/tag/AddTagModalView.js b/dashboardv2/public/js/views/tag/AddTagModalView.js index b623936..5c5581b 100644 --- a/dashboardv2/public/js/views/tag/AddTagModalView.js +++ b/dashboardv2/public/js/views/tag/AddTagModalView.js @@ -136,12 +136,14 @@ define(['require', this.modal.open(); this.modal.$el.find('button.ok').attr("disabled", true); this.on('ok', function() { - if (this.validateValues()) { - if (this.hideLoader) { - this.hideLoader(); + if (this.ui.checkTimeZone.is(':checked')) { + if (this.validateValues()) { + if (this.hideLoader) { + this.hideLoader(); + }; + return; }; - return; - }; + } that.modal.$el.find('button.ok').showButtonLoader(); var tagName = this.tagModel ? this.tagModel.typeName : this.ui.addTagOptions.val(), tagAttributes = {}, diff --git a/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js b/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js index 00861f5..4c40389 100644 --- a/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js +++ b/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js @@ -147,7 +147,7 @@ define(['require', var validate = true; this.modal.$el.find(".attributeInput").each(function() { - if ($(this).val() === "") { + if ($(this).val().trim() === "") { $(this).css('borderColor', "red") validate = false; } diff --git a/dashboardv3/public/js/utils/Helper.js b/dashboardv3/public/js/utils/Helper.js index acb549c..ed2fcc0 100644 --- a/dashboardv3/public/js/utils/Helper.js +++ b/dashboardv3/public/js/utils/Helper.js @@ -134,17 +134,21 @@ define(['require', $(this).blur(); }); $('body').on('keyup input', '.modal-body', function(e) { - var $this = $(this), - $footerButton = $this.parents(".modal").find('.modal-footer button.ok'), - requiredInputField = _.filter($this.find('input'), function($e) { - if ($e.getAttribute('placeholder') && $e.getAttribute('placeholder').indexOf('require') >= 0) { - return ($e.value.trim() == ""); - } - }); - if (requiredInputField.length > 0) { - $footerButton.attr("disabled", "true"); - } else { - $footerButton.removeAttr("disabled"); + var target = e.target, + isGlossary = (e.target.dataset.id === "searchTerm" || e.target.dataset.id === "searchCategory") ? true : false; // assign term/category modal + if ((target.type === "text" || target.type === "textarea") && !isGlossary) { + var $this = $(this), + $footerButton = $this.parents(".modal").find('.modal-footer button.ok'), + requiredInputField = _.filter($this.find('input'), function($e) { + if ($e.getAttribute('placeholder') && $e.getAttribute('placeholder').indexOf('require') >= 0) { + return ($e.value.trim() == ""); + } + }); + if (requiredInputField.length > 0) { + $footerButton.attr("disabled", "true"); + } else { + $footerButton.removeAttr("disabled"); + } } }); $.fn.select2.amd.define("TagHideDeleteButtonAdapter", [ diff --git a/dashboardv3/public/js/views/tag/AddTagModalView.js b/dashboardv3/public/js/views/tag/AddTagModalView.js index b623936..5c5581b 100644 --- a/dashboardv3/public/js/views/tag/AddTagModalView.js +++ b/dashboardv3/public/js/views/tag/AddTagModalView.js @@ -136,12 +136,14 @@ define(['require', this.modal.open(); this.modal.$el.find('button.ok').attr("disabled", true); this.on('ok', function() { - if (this.validateValues()) { - if (this.hideLoader) { - this.hideLoader(); + if (this.ui.checkTimeZone.is(':checked')) { + if (this.validateValues()) { + if (this.hideLoader) { + this.hideLoader(); + }; + return; }; - return; - }; + } that.modal.$el.find('button.ok').showButtonLoader(); var tagName = this.tagModel ? this.tagModel.typeName : this.ui.addTagOptions.val(), tagAttributes = {}, diff --git a/dashboardv3/public/js/views/tag/TagAttributeDetailLayoutView.js b/dashboardv3/public/js/views/tag/TagAttributeDetailLayoutView.js index 4800241..20220f2 100644 --- a/dashboardv3/public/js/views/tag/TagAttributeDetailLayoutView.js +++ b/dashboardv3/public/js/views/tag/TagAttributeDetailLayoutView.js @@ -151,7 +151,7 @@ define(['require', var validate = true; this.modal.$el.find(".attributeInput").each(function() { - if ($(this).val() === "") { + if ($(this).val().trim() === "") { $(this).css('borderColor', "red") validate = false; }