You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2020/06/11 19:04:58 UTC
[atlas] branch master updated: ATLAS-3828: UI: renamed
Classification system-attribute 'status' to 'entityStatus'
This is an automated email from the ASF dual-hosted git repository.
madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new a3fd644 ATLAS-3828: UI: renamed Classification system-attribute 'status' to 'entityStatus'
a3fd644 is described below
commit a3fd6441b872c000ea523d433fca7d076fb173d9
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Thu Jun 11 22:29:50 2020 +0530
ATLAS-3828: UI: renamed Classification system-attribute 'status' to 'entityStatus'
Signed-off-by: Madhan Neethiraj <ma...@apache.org>
---
dashboardv2/public/js/utils/Enums.js | 1 +
.../public/js/views/search/QueryBuilderView.js | 8 ++++--
.../public/js/views/search/SearchLayoutView.js | 31 +++++++++++++++++++---
dashboardv3/public/js/utils/Enums.js | 1 +
.../public/js/views/search/QueryBuilderView.js | 8 ++++--
.../js/views/search/SearchDefaultLayoutView.js | 26 ++++++++++++++----
6 files changed, 63 insertions(+), 12 deletions(-)
diff --git a/dashboardv2/public/js/utils/Enums.js b/dashboardv2/public/js/utils/Enums.js
index 3b86450..24ec36b 100644
--- a/dashboardv2/public/js/utils/Enums.js
+++ b/dashboardv2/public/js/utils/Enums.js
@@ -211,6 +211,7 @@ define(['require'], function(require) {
"__modifiedBy": "Last Modified User",
"__propagatedClassificationNames": "Propagated Classification(s)",
"__state": "Status",
+ "__entityStatus": "Entity Status",
"__timestamp": "Created Timestamp",
"__typeName": "Type Name"
};
diff --git a/dashboardv2/public/js/views/search/QueryBuilderView.js b/dashboardv2/public/js/views/search/QueryBuilderView.js
index 83b8ac9..dc36ffe 100644
--- a/dashboardv2/public/js/views/search/QueryBuilderView.js
+++ b/dashboardv2/public/js/views/search/QueryBuilderView.js
@@ -139,7 +139,7 @@ define(['require',
return obj;
}
/* Status / __state */
- if (isSystemAttr && attrObj.name === "Status" || isSystemAttr && attrObj.name === "__state") {
+ if (isSystemAttr && attrObj.name === "Status" || isSystemAttr && attrObj.name === "__state" || isSystemAttr && attrObj.name === "__entityStatus") {
obj.label = (Enums.systemAttributes[attrObj.name] ? Enums.systemAttributes[attrObj.name] : _.escape(attrObj.name.capitalize())) + " (enum)";
obj['input'] = 'select';
obj['values'] = ['ACTIVE', 'DELETED'];
@@ -356,12 +356,16 @@ define(['require',
"__createdBy": 5,
"__modifiedBy": 6,
"__isIncomplete": 7,
- "__state": 8,
"__classificationNames": 9,
"__propagatedClassificationNames": 10,
"__labels": 11,
"__customAttributes": 12,
}
+ if (that.type) {
+ sortMap["__state"] = 8;
+ } else {
+ sortMap["__entityStatus"] = 8;
+ }
this.systemAttrArr = _.sortBy(this.systemAttrArr, function(obj) {
return sortMap[obj.name]
})
diff --git a/dashboardv2/public/js/views/search/SearchLayoutView.js b/dashboardv2/public/js/views/search/SearchLayoutView.js
index 07ed112..e740d8d 100644
--- a/dashboardv2/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchLayoutView.js
@@ -133,6 +133,8 @@ define(['require',
} else {
this.setInitialEntityVal = true;
}
+ this.tagEntityCheck = false;
+ this.typeEntityCheck = false;
this.bindEvents();
},
renderSaveSearch: function() {
@@ -447,9 +449,6 @@ define(['require',
function getIdFromRuleObject(rule) {
_.map(rule.rules, function(obj, key) {
- if (obj.id === "__state") {
- that.value.includeDE = (obj.value === "ACTIVE" && obj.operator === "=") || (obj.value === "DELETED" && obj.operator === "!=") ? false : true;
- }
if (_.has(obj, 'condition')) {
return getIdFromRuleObject(obj);
} else {
@@ -471,6 +470,32 @@ define(['require',
}
this.searchTableColumns[this.value.type] = _.sortBy(_.union(this.searchTableColumns[this.value.type], getIdFromRuleObject(rule)));
}
+ if (rule.rules) {
+ if (!isTag && !that.tagEntityCheck) {
+ var state = _.find(rule.rules, { id: "__state" });
+ if (state) {
+ that.typeEntityCheck = (state.value === "ACTIVE" && state.operator === "=") || (state.value === "DELETED" && state.operator === "!=") ? false : true;
+ that.value.includeDE = that.typeEntityCheck;
+ } else if (that.typeEntityCheck) {
+ that.typeEntityCheck = false;
+ if (!that.tagEntityCheck) {
+ that.value.includeDE = false;
+ }
+ }
+ }
+ if (isTag && !that.typeEntityCheck) {
+ var entityStatus = _.find(rule.rules, { id: "__entityStatus" });
+ if (entityStatus) {
+ that.tagEntityCheck = (entityStatus.value === "ACTIVE" && entityStatus.operator === "=") || (entityStatus.value === "DELETED" && entityStatus.operator === "!=") ? false : true;
+ that.value.includeDE = that.tagEntityCheck
+ } else if (that.tagEntityCheck) {
+ that.tagEntityCheck = false;
+ if (!that.typeEntityCheck) {
+ that.value.includeDE = false;
+ }
+ }
+ }
+ }
this.attrModal.modal.close();
if ($(e.currentTarget).hasClass('search')) {
this.findSearchResult();
diff --git a/dashboardv3/public/js/utils/Enums.js b/dashboardv3/public/js/utils/Enums.js
index 3b86450..24ec36b 100644
--- a/dashboardv3/public/js/utils/Enums.js
+++ b/dashboardv3/public/js/utils/Enums.js
@@ -211,6 +211,7 @@ define(['require'], function(require) {
"__modifiedBy": "Last Modified User",
"__propagatedClassificationNames": "Propagated Classification(s)",
"__state": "Status",
+ "__entityStatus": "Entity Status",
"__timestamp": "Created Timestamp",
"__typeName": "Type Name"
};
diff --git a/dashboardv3/public/js/views/search/QueryBuilderView.js b/dashboardv3/public/js/views/search/QueryBuilderView.js
index 83b8ac9..dc36ffe 100644
--- a/dashboardv3/public/js/views/search/QueryBuilderView.js
+++ b/dashboardv3/public/js/views/search/QueryBuilderView.js
@@ -139,7 +139,7 @@ define(['require',
return obj;
}
/* Status / __state */
- if (isSystemAttr && attrObj.name === "Status" || isSystemAttr && attrObj.name === "__state") {
+ if (isSystemAttr && attrObj.name === "Status" || isSystemAttr && attrObj.name === "__state" || isSystemAttr && attrObj.name === "__entityStatus") {
obj.label = (Enums.systemAttributes[attrObj.name] ? Enums.systemAttributes[attrObj.name] : _.escape(attrObj.name.capitalize())) + " (enum)";
obj['input'] = 'select';
obj['values'] = ['ACTIVE', 'DELETED'];
@@ -356,12 +356,16 @@ define(['require',
"__createdBy": 5,
"__modifiedBy": 6,
"__isIncomplete": 7,
- "__state": 8,
"__classificationNames": 9,
"__propagatedClassificationNames": 10,
"__labels": 11,
"__customAttributes": 12,
}
+ if (that.type) {
+ sortMap["__state"] = 8;
+ } else {
+ sortMap["__entityStatus"] = 8;
+ }
this.systemAttrArr = _.sortBy(this.systemAttrArr, function(obj) {
return sortMap[obj.name]
})
diff --git a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
index fe9aac8..c588a8d 100644
--- a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
@@ -133,6 +133,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
this.hidenFilter = false;
this.tagAttributeLength = 0;
this.entityAttributeLength = 0;
+ this.tagEntityCheck = false;
+ this.typeEntityCheck = false;
},
bindEvents: function() {},
onRender: function() {
@@ -247,6 +249,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
businessMetadataDefCollection: that.options.businessMetadataDefCollection,
searchTableFilters: that.checkEntityFilter(that.options)
};
+ this.tagEntityCheck = false;
+ this.typeEntityCheck = false;
if (that.options.value) {
this.ui.checkDeletedEntity.prop('checked', this.options.value.includeDE ? this.options.value.includeDE : false);
this.ui.checkSubClassification.prop('checked', this.options.value.excludeSC ? this.options.value.excludeSC : false);
@@ -347,6 +351,22 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
isFilterValidate = true;
queryBuilderObj.clearErrors();
}
+ if (rule && rule.rules) {
+ if (!that.tagEntityCheck) {
+ var state = _.find(rule.rules, { id: "__state" });
+ if (state) {
+ that.typeEntityCheck = (state.value === "ACTIVE" && state.operator === "=") || (state.value === "DELETED" && state.operator === "!=") ? false : true;
+ that.options.value.includeDE = that.typeEntityCheck;
+ }
+ }
+ if (!that.typeEntityCheck) {
+ var entityStatus = _.find(rule.rules, { id: "__entityStatus" });
+ if (entityStatus) {
+ that.tagEntityCheck = (entityStatus.value === "ACTIVE" && entityStatus.operator === "=") || (entityStatus.value === "DELETED" && entityStatus.operator === "!=") ? false : true;
+ that.options.value.includeDE = that.tagEntityCheck
+ }
+ }
+ }
}
}
@@ -365,9 +385,6 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
var that = this,
col = new Set();
_.map(rule.rules, function(obj, key) {
- if (obj.id === "__state") {
- that.options.value.includeDE = (obj.value === "ACTIVE" && obj.operator === "=") || (obj.value === "DELETED" && obj.operator === "!=") ? false : true;
- }
if (_.has(obj, "condition")) {
return that.getIdFromRuleObj(obj);
} else {
@@ -417,7 +434,6 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
},
updatedUrl;
-
if (this.options.value) {
if (this.options.value.tag) {
params["tag"] = this.options.value.tag;
@@ -435,7 +451,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
if (columnList) {
params["attributes"] = columnList.join(",");
}
- params["includeDE"] = _.isUndefinedNull(this.options.value.includeDE) ? false : this.options.value.includeDE;
+ params['includeDE'] = _.isUndefinedNull(this.options.value.includeDE) ? false : this.options.value.includeDE;
params["excludeST"] = _.isUndefinedNull(this.options.value.excludeST) ? false : this.options.value.excludeST;
params["excludeSC"] = _.isUndefinedNull(this.options.value.excludeSC) ? false : this.options.value.excludeSC;
}