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
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 70a2cd9 ATLAS-3743: Date type value is shown as timestamp instead of
date, in BM audit/technical properties.
70a2cd9 is described below
commit 70a2cd90def3ab5ab5508945dc305ac7631f3f05
Author: kevalbhatt <[email protected]>
AuthorDate: Mon Nov 2 13:51:29 2020 +0530
ATLAS-3743: Date type value is shown as timestamp instead of date, in BM
audit/technical properties.
(cherry picked from commit 53ae712a095930ebf008e70ece4a7a351030acf3)
---
.../js/views/audit/CreateAuditTableLayoutView.js | 18 ++++++++++++++++--
.../js/views/audit/CreateAuditTableLayoutView.js | 18 ++++++++++++++++--
2 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
index e7d5d8b..41ad4ac 100644
--- a/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
@@ -124,11 +124,25 @@ define(['require',
var name = ((name ? name : this.entityName));
that.updateName(name);
if (parseDetailsObject) {
- var attributesDetails =
parseDetailsObject.attributes,
+ var attributesDetails = $.extend(true, {},
parseDetailsObject.attributes),
customAttr =
parseDetailsObject.customAttributes,
labelsDetails =
parseDetailsObject.labels,
- relationshipAttributes =
parseDetailsObject.relationshipAttributes;
+ relationshipAttributes =
parseDetailsObject.relationshipAttributes,
+ bmAttributesDeails =
that.entity.businessAttributes ?
that.entity.businessAttributes[parseDetailsObject.typeName] : null;
if (attributesDetails) {
+ if (bmAttributesDeails) {
+
_.each(Object.keys(attributesDetails), function(key) {
+ if
(bmAttributesDeails[key].typeName.toLowerCase().indexOf("date") > -1) {
+ if
(attributesDetails[key].length) { // multiple date values
+ attributesDetails[key]
= _.map(attributesDetails[key], function(dateValue) {
+ return
Utils.formatDate({ date: dateValue })
+ });
+ } else {
+ attributesDetails[key]
= Utils.formatDate({ date: attributesDetails[key] });
+ }
+ }
+ })
+ }
that.ui.attributeDetails.removeClass('hide');
that.action.indexOf("Classification")
=== -1 ? that.ui.panelAttrHeading.html("Technical properties ") :
that.ui.panelAttrHeading.html("Properties ");
var attrTable =
that.createTableWithValues(attributesDetails);
diff --git a/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
b/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
index e7d5d8b..41ad4ac 100644
--- a/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
+++ b/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
@@ -124,11 +124,25 @@ define(['require',
var name = ((name ? name : this.entityName));
that.updateName(name);
if (parseDetailsObject) {
- var attributesDetails =
parseDetailsObject.attributes,
+ var attributesDetails = $.extend(true, {},
parseDetailsObject.attributes),
customAttr =
parseDetailsObject.customAttributes,
labelsDetails =
parseDetailsObject.labels,
- relationshipAttributes =
parseDetailsObject.relationshipAttributes;
+ relationshipAttributes =
parseDetailsObject.relationshipAttributes,
+ bmAttributesDeails =
that.entity.businessAttributes ?
that.entity.businessAttributes[parseDetailsObject.typeName] : null;
if (attributesDetails) {
+ if (bmAttributesDeails) {
+
_.each(Object.keys(attributesDetails), function(key) {
+ if
(bmAttributesDeails[key].typeName.toLowerCase().indexOf("date") > -1) {
+ if
(attributesDetails[key].length) { // multiple date values
+ attributesDetails[key]
= _.map(attributesDetails[key], function(dateValue) {
+ return
Utils.formatDate({ date: dateValue })
+ });
+ } else {
+ attributesDetails[key]
= Utils.formatDate({ date: attributesDetails[key] });
+ }
+ }
+ })
+ }
that.ui.attributeDetails.removeClass('hide');
that.action.indexOf("Classification")
=== -1 ? that.ui.panelAttrHeading.html("Technical properties ") :
that.ui.panelAttrHeading.html("Properties ");
var attrTable =
that.createTableWithValues(attributesDetails);