Commit a3fd6441 by kevalbhatt Committed by Madhan Neethiraj

ATLAS-3828: UI: renamed Classification system-attribute 'status' to 'entityStatus'

parent e590092c
......@@ -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"
};
......
......@@ -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]
})
......
......@@ -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();
......
......@@ -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"
};
......
......@@ -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]
})
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment