This is an automated email from the ASF dual-hosted git repository.
ppawar 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 c3d654b69 ATLAS-4778: BusinessMetadata string attribute value persists
</p> as prefix and suffix
c3d654b69 is described below
commit c3d654b695823768b1b253a855898ebe6e6268bc
Author: Farhan Khan <[email protected]>
AuthorDate: Tue Aug 22 09:30:28 2023 +0530
ATLAS-4778: BusinessMetadata string attribute value persists </p> as prefix
and suffix
Signed-off-by: Prasad Pawar <[email protected]>
---
dashboardv2/public/js/utils/CommonViewFunction.js | 3 +-
.../js/views/search/SearchResultLayoutView.js | 37 ++++++++++++++++++++++
dashboardv3/public/js/utils/CommonViewFunction.js | 3 +-
.../js/views/search/SearchResultLayoutView.js | 37 ++++++++++++++++++++++
4 files changed, 78 insertions(+), 2 deletions(-)
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js
b/dashboardv2/public/js/utils/CommonViewFunction.js
index bb545057d..727dc2c6b 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -127,7 +127,8 @@ define(['require', 'utils/Utils', 'modules/Modal',
'utils/Messages', 'utils/Enum
newVal = numberFormat(newVal);
}
}
- return getHighlightedString(_.escape(newVal));
+ newVal = (options && options.isEditorValue) ? newVal :
_.escape(newVal);
+ return getHighlightedString(newVal);
}
} else {
return getEmptyString(key);
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index 282ca55ba..03b9d5947 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -195,6 +195,7 @@ define(['require',
if (platform.name === "IE") {
this.isTableDropDisable = true;
}
+ this.businessMetadataAttributes = [];
},
bindEvents: function() {
var that = this;
@@ -581,6 +582,7 @@ define(['require',
}
}
this.downloadSearchResultsParams.searchParameters =
apiObj.data;
+ this.generateBusinessMetadataAttrList();
},
tableRender: function(options) {
var that = this,
@@ -693,6 +695,39 @@ define(['require',
params.attributeLabelMap = {};
}
},
+ generateBusinessMetadataAttrList: function() {
+ var def = this.entityDefCollection.fullCollection.find({
+ name: this.value.type,
+ }),
+ businessAttributeDefs,
+ that = this;
+ businessAttributeDefs = def.get('businessAttributeDefs');
+ if (businessAttributeDefs) {
+ _.each(
+ businessAttributeDefs,
+ function(businessMetadata, businessMetadataName) {
+ _.each(businessMetadata, function(attr, index) {
+ that.businessMetadataAttributes.push({
+ name: businessMetadataName + '.' +
attr.name,
+ type: attr.typeName
+ });
+ });
+ }
+ );
+ }
+ },
+ checkIsEditorValue: function(key) {
+ var isEditorKey = false;
+ if (this.businessMetadataAttributes.length) {
+ _.each(this.businessMetadataAttributes, function(attr) {
+ if (attr.name === key && attr.type === "string") {
+ isEditorKey = true;
+ return;
+ };
+ });
+ }
+ return isEditorKey;
+ },
getColumnOrder: function(arr) {
var obj = {};
for (var i = 0; i < arr.length; ++i) {
@@ -985,6 +1020,7 @@ define(['require',
}
}
tempObj.valueObject[key] =
modelObj.attributes[key];
+ tempObj['isEditorValue'] =
that.checkIsEditorValue(key);
var tablecolumn =
CommonViewFunction.propertyTable(tempObj);
if
(_.isArray(modelObj.attributes[key])) {
var column = $("<div>" +
tablecolumn + "</div>")
@@ -1057,6 +1093,7 @@ define(['require',
'valueObject': {},
'isTable': false
};
+ tempObj['isEditorValue'] =
that.checkIsEditorValue(key);
tempObj.valueObject[key] =
modelObj[key];
return
CommonViewFunction.propertyTable(tempObj);
}
diff --git a/dashboardv3/public/js/utils/CommonViewFunction.js
b/dashboardv3/public/js/utils/CommonViewFunction.js
index 452595d7f..a66937ff0 100644
--- a/dashboardv3/public/js/utils/CommonViewFunction.js
+++ b/dashboardv3/public/js/utils/CommonViewFunction.js
@@ -127,7 +127,8 @@ define(['require', 'utils/Utils', 'modules/Modal',
'utils/Messages', 'utils/Enum
newVal = numberFormat(newVal);
}
}
- return getHighlightedString(_.escape(newVal));
+ newVal = (options && options.isEditorValue) ? newVal :
_.escape(newVal);
+ return getHighlightedString(newVal);
}
} else {
return getEmptyString(key);
diff --git a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
index 5189f08d8..2d3d212a1 100644
--- a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
@@ -202,6 +202,7 @@ define(['require',
if (platform.name === "IE") {
this.isTableDropDisable = true;
}
+ this.businessMetadataAttributes = [];
},
bindEvents: function() {
var that = this;
@@ -596,6 +597,7 @@ define(['require',
}
}
this.downloadSearchResultsParams.searchParameters =
apiObj.data;
+ this.generateBusinessMetadataAttrList();
},
tableRender: function(options) {
var that = this,
@@ -705,6 +707,39 @@ define(['require',
params.attributeLabelMap = {};
}
},
+ generateBusinessMetadataAttrList: function() {
+ var def = this.entityDefCollection.fullCollection.find({
+ name: this.value.type,
+ }),
+ businessAttributeDefs,
+ that = this;
+ businessAttributeDefs = def.get('businessAttributeDefs');
+ if (businessAttributeDefs) {
+ _.each(
+ businessAttributeDefs,
+ function(businessMetadata, businessMetadataName) {
+ _.each(businessMetadata, function(attr, index) {
+ that.businessMetadataAttributes.push({
+ name: businessMetadataName + '.' +
attr.name,
+ type: attr.typeName
+ });
+ });
+ }
+ );
+ }
+ },
+ checkIsEditorValue: function(key) {
+ var isEditorKey = false;
+ if (this.businessMetadataAttributes.length) {
+ _.each(this.businessMetadataAttributes, function(attr) {
+ if (attr.name === key && attr.type === "string") {
+ isEditorKey = true;
+ return;
+ };
+ });
+ }
+ return isEditorKey;
+ },
getColumnOrder: function(arr) {
var obj = {};
for (var i = 0; i < arr.length; ++i) {
@@ -996,6 +1031,7 @@ define(['require',
}
}
tempObj.valueObject[key] =
modelObj.attributes[key];
+ tempObj['isEditorValue'] =
that.checkIsEditorValue(key);
var tablecolumn =
CommonViewFunction.propertyTable(tempObj);
if
(_.isArray(modelObj.attributes[key])) {
var column = $("<div>" +
tablecolumn + "</div>")
@@ -1068,6 +1104,7 @@ define(['require',
'valueObject': {},
'isTable': false
};
+ tempObj['isEditorValue'] =
that.checkIsEditorValue(key);
tempObj.valueObject[key] =
modelObj[key];
return
CommonViewFunction.propertyTable(tempObj);
}