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 <[email protected]>
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() {

Reply via email to