You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2020/04/01 12:54:59 UTC
[atlas] branch branch-2.0 updated (e71d6c2 -> bf63f0f)
This is an automated email from the ASF dual-hosted git repository.
kbhatt pushed a change to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git.
from e71d6c2 ATLAS-3711 : UI: Classification/Term modal should close after create/update/delete response
new 003bdb5 ATLAS-3706 : UI: Audit change for Business metadata/labels/user-define property
new bf63f0f ATLAS-3710 : [Business Metadata] Missing Business Metadata attribute info in list view
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../audit/CreateAuditTableLayoutView_tmpl.html | 2 +-
dashboardv2/public/js/utils/Enums.js | 6 +-
.../js/views/audit/CreateAuditTableLayoutView.js | 138 ++++++++++----------
.../js/views/detail_page/DetailPageLayoutView.js | 6 +
.../js/views/entity/EntityLabelDefineView.js | 5 +-
.../public/js/views/entity/EntityUserDefineView.js | 5 +-
dashboardv3/public/css/scss/business-metadata.scss | 24 ++++
dashboardv3/public/css/scss/table.scss | 1 +
.../audit/CreateAuditTableLayoutView_tmpl.html | 2 +-
dashboardv3/public/js/utils/Enums.js | 4 +-
.../js/views/audit/CreateAuditTableLayoutView.js | 139 +++++++++++----------
.../BusinessMetadataAttrTableLayoutView.js | 35 +++++-
.../BusinessMetadataAttributeItemView.js | 4 +-
.../BusinessMetadataTableLayoutView.js | 14 ++-
.../js/views/detail_page/DetailPageLayoutView.js | 6 +
.../js/views/entity/EntityBusinessMetaDataView.js | 18 ++-
.../js/views/entity/EntityLabelDefineView.js | 5 +-
.../public/js/views/entity/EntityUserDefineView.js | 5 +-
18 files changed, 271 insertions(+), 148 deletions(-)
[atlas] 02/02: ATLAS-3710 : [Business Metadata] Missing Business
Metadata attribute info in list view
Posted by kb...@apache.org.
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 bf63f0f400b37a31d07b98a668358a278a8e822f
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Wed Apr 1 18:08:24 2020 +0530
ATLAS-3710 : [Business Metadata] Missing Business Metadata attribute info in list view
(cherry picked from commit 2fbfb5572e3ae7e71e71b70e391844d98293599a)
---
dashboardv3/public/css/scss/business-metadata.scss | 24 +++++++++++++++
.../BusinessMetadataAttrTableLayoutView.js | 35 +++++++++++++++++++++-
.../BusinessMetadataAttributeItemView.js | 4 +--
.../BusinessMetadataTableLayoutView.js | 14 ++++++---
.../js/views/entity/EntityBusinessMetaDataView.js | 18 +++++++----
5 files changed, 83 insertions(+), 12 deletions(-)
diff --git a/dashboardv3/public/css/scss/business-metadata.scss b/dashboardv3/public/css/scss/business-metadata.scss
index ecfddf7..f1f7427 100644
--- a/dashboardv3/public/css/scss/business-metadata.scss
+++ b/dashboardv3/public/css/scss/business-metadata.scss
@@ -172,4 +172,28 @@
.select2-results__option[aria-selected=true] {
display: none;
}
+}
+
+.business-metadata-detail-attr {
+ margin-bottom: 0px;
+ box-shadow: none;
+
+ .panel-heading {
+ color: #686868 !important;
+ font-size: 13px;
+ padding: 0;
+
+ .panel-title {
+ font-size: 14px;
+
+ a:hover {
+ color: #686868 !important;
+ opacity: 1 !important;
+ }
+ }
+ }
+
+ .btn-group>button {
+ color: #686868 !important;
+ }
}
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttrTableLayoutView.js b/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttrTableLayoutView.js
index 7164801..ff2c02c 100644
--- a/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttrTableLayoutView.js
+++ b/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttrTableLayoutView.js
@@ -163,7 +163,7 @@ define(['require',
editable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
- return model.get('name');
+ return _.escape(model.get('name'));
}
})
},
@@ -177,6 +177,39 @@ define(['require',
}
})
},
+ searchWeight: {
+ label: "Search Weight",
+ cell: "String",
+ editable: false
+ },
+ enableMultipleValue: {
+ label: "Enable Multivalues",
+ cell: "html",
+ editable: false,
+ formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+ fromRaw: function(rawValue, model) {
+ var enableMultipleValue = '';
+ if (model.get('typeName').indexOf('array<') > -1) {
+ enableMultipleValue = 'checked';
+ }
+ return '<input type="checkbox" class="form-check-input multi-value-select" data-id="multiValueSelectStatus" ' + enableMultipleValue + ' disabled="disabled">';
+ }
+ })
+ },
+ maxStrLength: {
+ label: "Max Length",
+ cell: "html",
+ editable: false,
+ formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+ fromRaw: function(rawValue, model) {
+ var maxString = "NA";
+ if (model.get('typeName').indexOf('string') > -1) {
+ maxString = model.get('options').maxStrLength || maxString;
+ }
+ return maxString;
+ }
+ })
+ },
options: {
label: "Entity Type(s)",
cell: "html",
diff --git a/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttributeItemView.js b/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttributeItemView.js
index 99ea135..85c64d0 100644
--- a/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttributeItemView.js
+++ b/dashboardv3/public/js/views/business_metadata/BusinessMetadataAttributeItemView.js
@@ -172,8 +172,8 @@ define(['require',
this.ui.entityTypeSelector.on('select2:open', function(e) { // to make selected option disable in dropdown added remove-from-list class
$('.select2-dropdown--below').addClass('remove-from-list');
});
- if (this.model.get("searchWeight") && this.model.get("searchWeight") != -1) {
- searchWeightValue = this.model.get("searchWeight");
+ if (this.model.get("searchWeight")) {
+ searchWeightValue = this.model.get("searchWeight") === -1 ? 0 : this.model.get("searchWeight");
}
if (this.model.get("options")) {
stringLengthValue = this.model.get("options").maxStrLength || '50';
diff --git a/dashboardv3/public/js/views/business_metadata/BusinessMetadataTableLayoutView.js b/dashboardv3/public/js/views/business_metadata/BusinessMetadataTableLayoutView.js
index 7aa22d9..cef16bf 100644
--- a/dashboardv3/public/js/views/business_metadata/BusinessMetadataTableLayoutView.js
+++ b/dashboardv3/public/js/views/business_metadata/BusinessMetadataTableLayoutView.js
@@ -247,13 +247,15 @@ define(['require',
var attrValues = '',
attrTable = $('table'),
attrTableBody = $('tbody'),
- attrTableHeading = "<thead><td style='display:table-cell'><b>Attribute</b></td><td style='display:table-cell'><b>Type</b></td><td style='display:table-cell'><b>Applicable Type(s)</b></td><td style='display:table-cell'><b>Action</b></td></thead>",
+ attrTableHeading = "<thead><td style='display:table-cell'><b>Attribute</b></td><td style='display:table-cell'><b>Type</b></td><td style='display:table-cell'><b>Search Weight</b></td><td style='display:table-cell'><b>Enable Multivalues</b></td><td style='display:table-cell'><b>Max Length</b></td><td style='display:table-cell'><b>Applicable Type(s)</b></td><td style='display:table-cell'><b>Action</b></td></thead>",
attrRow = '',
attrTableDetails = '';
if (model.attributes && model.attributes.attributeDefs.length) {
_.each(model.attributes.attributeDefs, function(attrObj) {
var applicableEntityTypes = '',
- typeName = attrObj.typeName;
+ typeName = attrObj.typeName,
+ multiSelect = '',
+ maxString = 'NA';
if (attrObj.options && attrObj.options.applicableEntityTypes) {
var entityTypes = JSON.parse(attrObj.options.applicableEntityTypes);
_.each(entityTypes, function(values) {
@@ -262,8 +264,13 @@ define(['require',
}
if (typeName.includes('array')) {
typeName = _.escape(typeName);
+ multiSelect = 'checked';
}
- attrRow += "<tr> <td style='display:table-cell'>" + _.escape(attrObj.name) + "</td><td style='display:table-cell'>" + typeName + "</td><td style='display:table-cell'>" + applicableEntityTypes + "</td><td style='display:table-cell'> <div class='btn btn-action btn-sm' style='margin-left:0px;' data-id='attributeEdit' data-guid='" + model.get('guid') + "' data-name ='" + _.escape(attrObj.name) + "' data-action='attributeEdit' >Edit</div> </td></tr> ";
+ if (typeName.includes('string') && attrObj.options && attrObj.options.maxStrLength) {
+ maxString = attrObj.options.maxStrLength;
+ }
+
+ attrRow += "<tr> <td style='display:table-cell'>" + _.escape(attrObj.name) + "</td><td style='display:table-cell'>" + typeName + "</td><td style='display:table-cell'>" + _.escape(attrObj.searchWeight) + "</td><td style='display:table-cell'><input type='checkbox' class='form-check-input multi-value-select' " + multiSelect + " disabled='disabled'> </td><td style='display:table-cell'>" + maxString + "</td><td style='display:table-cell'>" + applicableEntit [...]
});
var adminText = '<div class="row"><div class="col-sm-12 attr-details"><table style="padding: 50px;">' + attrTableHeading + attrRow + '</table></div></div>';
$(el).append($('<div>').html(adminText));
@@ -271,7 +278,6 @@ define(['require',
var adminText = '<div class="row"><div class="col-sm-12 attr-details"><h5 class="text-center"> No attributes to show.</h5></div></div>';
$(el).append($('<div>').html(adminText));
}
-
}
},
name: {
diff --git a/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
index bfc1e2c..3fd5a13 100644
--- a/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
+++ b/dashboardv3/public/js/views/entity/EntityBusinessMetaDataView.js
@@ -215,7 +215,8 @@ define([
this.collection.unshift(modelObj);
},
renderBusinessMetadata: function() {
- var li = ""
+ var that = this,
+ li = ""
this.actualCollection.forEach(function(obj) {
var attrLi = "";
_.each(obj.attributes, function(val, key) {
@@ -236,13 +237,20 @@ define([
attrLi += "<tr><td>" + _.escape(key) + " (" + _.escape(val.typeName) + ")</td><td>" + _.escape(newVal) + "</td></tr>";
}
});
- li += "<ul class='business-metadata-tree-parent'><li class='table'>" + _.escape(obj.get("__internal_UI_businessMetadataName")) + "</li>" +
- "<li class='business-metadata-tree-child entity-detail-table'>" +
- "<table class='table'>" + attrLi + "</table>" +
- "</li></ul>";
+ li += that.associateAttributePanel(obj, attrLi);
});
this.ui.businessMetadataTree.html(li);
},
+ associateAttributePanel: function(obj, tableBody) {
+ return '<div class="panel panel-default custom-panel expand_collapse_panel-icon no-border business-metadata-detail-attr">' +
+ '<div class="panel-heading" data-toggle="collapse" href="#' + _.escape(obj.get("__internal_UI_businessMetadataName")) + '" aria-expanded="true" style="width: 70%;">' +
+ '<h4 class="panel-title"> <a>' + _.escape(obj.get("__internal_UI_businessMetadataName")) + '</a></h4>' +
+ '<div class="btn-group pull-left"> <button type="button" title="Collapse"><i class="ec-icon fa"></i></button></div>' +
+ '</div>' +
+ '<div id="' + _.escape(obj.get("__internal_UI_businessMetadataName")) + '" class="panel-collapse collapse in">' +
+ '<div class="panel-body"><table class="table">' + tableBody + '</table></div>' +
+ '</div></div>';
+ },
onRender: function() {
this.panelOpenClose();
this.renderBusinessMetadata();
[atlas] 01/02: ATLAS-3706 : UI: Audit change for Business
metadata/labels/user-define property
Posted by kb...@apache.org.
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 003bdb5e9bfbddd5f2021b5d8bdafe824d9e730e
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Wed Apr 1 14:51:55 2020 +0530
ATLAS-3706 : UI: Audit change for Business metadata/labels/user-define property
(cherry picked from commit 95923fba04e99c9bcf4af70fe8faf834c802fdf9)
---
.../audit/CreateAuditTableLayoutView_tmpl.html | 2 +-
dashboardv2/public/js/utils/Enums.js | 6 +-
.../js/views/audit/CreateAuditTableLayoutView.js | 138 ++++++++++----------
.../js/views/detail_page/DetailPageLayoutView.js | 6 +
.../js/views/entity/EntityLabelDefineView.js | 5 +-
.../public/js/views/entity/EntityUserDefineView.js | 5 +-
dashboardv3/public/css/scss/table.scss | 1 +
.../audit/CreateAuditTableLayoutView_tmpl.html | 2 +-
dashboardv3/public/js/utils/Enums.js | 4 +-
.../js/views/audit/CreateAuditTableLayoutView.js | 139 +++++++++++----------
.../js/views/detail_page/DetailPageLayoutView.js | 6 +
.../js/views/entity/EntityLabelDefineView.js | 5 +-
.../public/js/views/entity/EntityUserDefineView.js | 5 +-
13 files changed, 188 insertions(+), 136 deletions(-)
diff --git a/dashboardv2/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
index 1934339..c496f21 100644
--- a/dashboardv2/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<h4 style="word-break: break-word;">Name: <span data-id="name"></span></h4>
+<h4 style="word-break: break-word;" data-id="name"></h4>
<div class="panel-group server-stats-container statsContainer " id="accordion">
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide" data-id="detailsAttribute">
<div class="panel-heading" data-toggle="collapse" href="#detailAttributeTableCollapse" aria-expanded="true">
diff --git a/dashboardv2/public/js/utils/Enums.js b/dashboardv2/public/js/utils/Enums.js
index e5cba08..e2d8cd2 100644
--- a/dashboardv2/public/js/utils/Enums.js
+++ b/dashboardv2/public/js/utils/Enums.js
@@ -38,7 +38,9 @@ define(['require'], function(require) {
TERM_DELETE: "Term Deleted",
LABEL_ADD: "Label(s) Added",
LABEL_DELETE: "Label(s) Deleted",
- ENTITY_PURGE: "Entity Purged"
+ ENTITY_PURGE: "Entity Purged",
+ BUSINESS_ATTRIBUTE_ADD: "Business Attribute(s) Added",
+ BUSINESS_ATTRIBUTE_DELETE: "Business Attribute(s) Deleted"
}
Enums.entityStateReadOnly = {
@@ -212,4 +214,4 @@ define(['require'], function(require) {
1: "true"
};
return Enums;
-});
+});
\ No newline at end of file
diff --git a/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
index 43fb114..a820616 100644
--- a/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
@@ -82,7 +82,7 @@ define(['require',
},
updateName: function(name) {
- this.ui.name.text(name);
+ this.ui.name.html("<span>Name: </span><span>" + name + "</span>");
},
noDetailsShow: function() {
this.ui.noData.removeClass('hide');
@@ -91,73 +91,85 @@ define(['require',
var that = this,
table = "";
var detailObj = this.entityModel.get('details');
- if (detailObj && detailObj.search(':') >= 0) {
- var parseDetailsObject = detailObj.split(':');
- if (parseDetailsObject.length > 1) {
- parseDetailsObject.shift();
- var auditData = parseDetailsObject.join(":");
- }
- try {
- parseDetailsObject = JSON.parse(auditData);
- var skipAttribute = parseDetailsObject.typeName ? "guid" : null,
- name = Utils.getName(parseDetailsObject, null, skipAttribute);
- if (name == "-") {
- name = _.escape(parseDetailsObject.typeName);
+ if (detailObj) {
+ if (detailObj.search(':') >= 0) {
+ var parseDetailsObject = detailObj.split(':'),
+ type = "",
+ auditData = "";
+ if (parseDetailsObject.length > 1) {
+ type = parseDetailsObject[0];
+ parseDetailsObject.shift();
+ auditData = parseDetailsObject.join(":");
}
- var name = ((name ? name : this.entityName));
- that.updateName(name);
- if (parseDetailsObject) {
- var attributesDetails = parseDetailsObject.attributes,
- customAttr = parseDetailsObject.customAttributes,
- labelsDetails = parseDetailsObject.labels,
- relationshipAttributes = parseDetailsObject.relationshipAttributes;
- if (attributesDetails) {
- 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);
- that.ui.attributeCard.html(
- attrTable);
- }
- if (!_.isEmpty(customAttr)) {
- that.ui.customAttributeDetails.removeClass('hide');
- var customAttrTable = that.createTableWithValues(customAttr);
- that.ui.customAttrCard.html(
- customAttrTable);
- }
- if (!_.isEmpty(labelsDetails)) {
- this.ui.labelsDetailsTable.removeClass('hide');
- var labelsTable = '';
- _.each(labelsDetails, function(value, key, list) {
- labelsTable += "<label class='label badge-default'>" + value + "</label>";
- });
- that.ui.labelCard.html(
- labelsTable);
- }
- if (!_.isEmpty(relationshipAttributes)) {
- that.ui.relationShipAttributeDetails.removeClass('hide');
- var relationshipAttrTable = that.createTableWithValues(relationshipAttributes);
- that.ui.relationshipAttrCard.html(
- relationshipAttrTable);
- }
- if (!attributesDetails && !customAttr && !labelsDetails && !relationshipAttributes) {
- that.ui.detailsAttribute.removeClass('hide');
- var attrDetailTable = that.createTableWithValues(parseDetailsObject);
- that.ui.attributeDetailCard.html(
- attrDetailTable);
+ if (auditData.search('{') === -1) {
+ if (type.trim() === "Added labels" || type.trim() === "Deleted labels") {
+ this.updateName(auditData.trim().split(" ").join(","));
+ } else {
+ this.updateName(auditData);
}
} else {
- that.noDetailsShow();
- }
- } catch (err) {
- if (_.isArray(parseDetailsObject)) {
- var name = _.escape(parseDetailsObject[0]);
+ try {
+ parseDetailsObject = JSON.parse(auditData);
+ var skipAttribute = parseDetailsObject.typeName ? "guid" : null,
+ name = Utils.getName(parseDetailsObject, null, skipAttribute);
+ if (name == "-") {
+ name = _.escape(parseDetailsObject.typeName);
+ }
+ var name = ((name ? name : this.entityName));
+ that.updateName(name);
+ if (parseDetailsObject) {
+ var attributesDetails = parseDetailsObject.attributes,
+ customAttr = parseDetailsObject.customAttributes,
+ labelsDetails = parseDetailsObject.labels,
+ relationshipAttributes = parseDetailsObject.relationshipAttributes;
+ if (attributesDetails) {
+ 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);
+ that.ui.attributeCard.html(
+ attrTable);
+ }
+ if (!_.isEmpty(customAttr)) {
+ that.ui.customAttributeDetails.removeClass('hide');
+ var customAttrTable = that.createTableWithValues(customAttr);
+ that.ui.customAttrCard.html(
+ customAttrTable);
+ }
+ if (!_.isEmpty(labelsDetails)) {
+ this.ui.labelsDetailsTable.removeClass('hide');
+ var labelsTable = '';
+ _.each(labelsDetails, function(value, key, list) {
+ labelsTable += "<label class='label badge-default'>" + value + "</label>";
+ });
+ that.ui.labelCard.html(
+ labelsTable);
+ }
+ if (!_.isEmpty(relationshipAttributes)) {
+ that.ui.relationShipAttributeDetails.removeClass('hide');
+ var relationshipAttrTable = that.createTableWithValues(relationshipAttributes);
+ that.ui.relationshipAttrCard.html(
+ relationshipAttrTable);
+ }
+ if (!attributesDetails && !customAttr && !labelsDetails && !relationshipAttributes) {
+ that.ui.detailsAttribute.removeClass('hide');
+ var attrDetailTable = that.createTableWithValues(parseDetailsObject);
+ that.ui.attributeDetailCard.html(
+ attrDetailTable);
+ }
+ } else {
+ that.noDetailsShow();
+ }
+ } catch (err) {
+ if (_.isArray(parseDetailsObject)) {
+ var name = _.escape(parseDetailsObject[0]);
+ }
+ that.updateName(name);
+ that.noDetailsShow();
+ }
}
- that.updateName(name);
- that.noDetailsShow();
+ } else if (detailObj == "Deleted entity" || detailObj == "Purged entity") {
+ this.entityName ? this.updateName(this.entityName) : (this.ui.name.hide() && this.ui.noData.removeClass("hide"));
}
-
- } else if (detailObj == "Deleted entity") {
- that.updateName(this.entityName);
}
}
});
diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
index eca3b55..ccb8fad 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -170,6 +170,9 @@ define(['require',
if (collectionJSON) {
this.name = Utils.getName(collectionJSON);
if (collectionJSON.attributes) {
+ if (collectionJSON.typeName) {
+ collectionJSON.attributes.typeName = _.escape(collectionJSON.typeName);
+ }
if (this.name && collectionJSON.typeName) {
this.name = this.name + ' (' + _.escape(collectionJSON.typeName) + ')';
}
@@ -244,6 +247,9 @@ define(['require',
})(),
editEntity: this.editEntity || false
}
+ obj["renderAuditTableLayoutView"] = function() {
+ that.renderAuditTableLayoutView(obj);
+ };
this.renderEntityDetailTableLayoutView(obj);
this.renderEntityUserDefineView(obj);
this.renderEntityLabelDefineView(obj);
diff --git a/dashboardv2/public/js/views/entity/EntityLabelDefineView.js b/dashboardv2/public/js/views/entity/EntityLabelDefineView.js
index b4f4a51..678a039 100644
--- a/dashboardv2/public/js/views/entity/EntityLabelDefineView.js
+++ b/dashboardv2/public/js/views/entity/EntityLabelDefineView.js
@@ -55,7 +55,7 @@ define(['require',
},
initialize: function(options) {
var self = this;
- _.extend(this, _.pick(options, 'entity', 'customFilter'));
+ _.extend(this, _.pick(options, 'entity', 'customFilter', 'renderAuditTableLayoutView'));
this.swapItem = false, this.saveLabels = false;
this.readOnlyEntity = this.customFilter === undefined ? Enums.entityStateReadOnly[this.entity.status] : this.customFilter;
this.entityModel = new VEntity(this.entity);
@@ -164,6 +164,9 @@ define(['require',
that.swapItem = false;
that.saveLabels = false;
that.render();
+ if (that.renderAuditTableLayoutView) {
+ that.renderAuditTableLayoutView();
+ }
},
error: function(e) {
that.ui.saveLabels && that.ui.saveLabels.length > 0 && that.ui.saveLabels[0].setAttribute("disabled", false);
diff --git a/dashboardv2/public/js/views/entity/EntityUserDefineView.js b/dashboardv2/public/js/views/entity/EntityUserDefineView.js
index 1cb0d8c..38d32c2 100644
--- a/dashboardv2/public/js/views/entity/EntityUserDefineView.js
+++ b/dashboardv2/public/js/views/entity/EntityUserDefineView.js
@@ -53,7 +53,7 @@ define(['require',
return events;
},
initialize: function(options) {
- _.extend(this, _.pick(options, 'entity', 'customFilter'));
+ _.extend(this, _.pick(options, 'entity', 'customFilter', 'renderAuditTableLayoutView'));
this.userDefineAttr = this.entity && this.entity.customAttributes || [];
this.initialCall = false;
this.swapItem = false, this.saveAttrItems = false;
@@ -136,6 +136,9 @@ define(['require',
that.swapItem = false;
that.saveAttrItems = false;
that.render();
+ if (that.renderAuditTableLayoutView) {
+ that.renderAuditTableLayoutView();
+ }
},
error: function(e) {
that.initialCall = false;
diff --git a/dashboardv3/public/css/scss/table.scss b/dashboardv3/public/css/scss/table.scss
index 5f49be2..a294102 100644
--- a/dashboardv3/public/css/scss/table.scss
+++ b/dashboardv3/public/css/scss/table.scss
@@ -254,6 +254,7 @@ td {
.auditStatusContainer {
display: flex;
+ flex-wrap: wrap;
justify-content: center;
}
diff --git a/dashboardv3/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html b/dashboardv3/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
index 10cc697..3cdbc7f 100644
--- a/dashboardv3/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<h4 class="entity-name" style="word-break: break-word;" data-id="nameContainer">Name: <span data-id="name"></span></h4>
+<h4 style="word-break: break-word;" data-id="name"></h4>
<div class="panel-group server-stats-container auditStatusContainer clearfix" id="accordion">
<div class="panel panel-default custom-panel expand_collapse_panel-icon hide col-sm-5" data-id="detailsAttribute">
<div class="panel-heading" data-toggle="collapse" href="#detailAttributeTableCollapse" aria-expanded="true">
diff --git a/dashboardv3/public/js/utils/Enums.js b/dashboardv3/public/js/utils/Enums.js
index ef93b77..e2d8cd2 100644
--- a/dashboardv3/public/js/utils/Enums.js
+++ b/dashboardv3/public/js/utils/Enums.js
@@ -38,7 +38,9 @@ define(['require'], function(require) {
TERM_DELETE: "Term Deleted",
LABEL_ADD: "Label(s) Added",
LABEL_DELETE: "Label(s) Deleted",
- ENTITY_PURGE: "Entity Purged"
+ ENTITY_PURGE: "Entity Purged",
+ BUSINESS_ATTRIBUTE_ADD: "Business Attribute(s) Added",
+ BUSINESS_ATTRIBUTE_DELETE: "Business Attribute(s) Deleted"
}
Enums.entityStateReadOnly = {
diff --git a/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js b/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
index f7db536..a820616 100644
--- a/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
+++ b/dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
@@ -39,7 +39,6 @@ define(['require',
ui: {
auditValue: "[data-id='auditValue']",
name: "[data-id='name']",
- nameContainer: "[data-id='nameContainer']",
noData: "[data-id='noData']",
tableAudit: "[data-id='tableAudit']",
auditHeaderValue: "[data-id='auditHeaderValue']",
@@ -83,7 +82,7 @@ define(['require',
},
updateName: function(name) {
- this.ui.name.text(name);
+ this.ui.name.html("<span>Name: </span><span>" + name + "</span>");
},
noDetailsShow: function() {
this.ui.noData.removeClass('hide');
@@ -92,73 +91,85 @@ define(['require',
var that = this,
table = "";
var detailObj = this.entityModel.get('details');
- if (detailObj && detailObj.search(':') >= 0) {
- var parseDetailsObject = detailObj.split(':');
- if (parseDetailsObject.length > 1) {
- parseDetailsObject.shift();
- var auditData = parseDetailsObject.join(":");
- }
- try {
- parseDetailsObject = JSON.parse(auditData);
- var skipAttribute = parseDetailsObject.typeName ? "guid" : null,
- name = Utils.getName(parseDetailsObject, null, skipAttribute);
- if (name == "-") {
- name = _.escape(parseDetailsObject.typeName);
+ if (detailObj) {
+ if (detailObj.search(':') >= 0) {
+ var parseDetailsObject = detailObj.split(':'),
+ type = "",
+ auditData = "";
+ if (parseDetailsObject.length > 1) {
+ type = parseDetailsObject[0];
+ parseDetailsObject.shift();
+ auditData = parseDetailsObject.join(":");
}
- var name = ((name ? name : this.entityName));
- that.updateName(name);
- if (parseDetailsObject) {
- var attributesDetails = parseDetailsObject.attributes,
- customAttr = parseDetailsObject.customAttributes,
- labelsDetails = parseDetailsObject.labels,
- relationshipAttributes = parseDetailsObject.relationshipAttributes;
- if (attributesDetails) {
- 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);
- that.ui.attributeCard.html(
- attrTable);
- }
- if (!_.isEmpty(customAttr)) {
- that.ui.customAttributeDetails.removeClass('hide');
- var customAttrTable = that.createTableWithValues(customAttr);
- that.ui.customAttrCard.html(
- customAttrTable);
- }
- if (!_.isEmpty(labelsDetails)) {
- this.ui.labelsDetailsTable.removeClass('hide');
- var labelsTable = '';
- _.each(labelsDetails, function(value, key, list) {
- labelsTable += "<label class='label badge-default'>" + value + "</label>";
- });
- that.ui.labelCard.html(
- labelsTable);
- }
- if (!_.isEmpty(relationshipAttributes)) {
- that.ui.relationShipAttributeDetails.removeClass('hide');
- var relationshipAttrTable = that.createTableWithValues(relationshipAttributes);
- that.ui.relationshipAttrCard.html(
- relationshipAttrTable);
- }
- if (!attributesDetails && !customAttr && !labelsDetails && !relationshipAttributes) {
- that.ui.detailsAttribute.removeClass('hide');
- var attrDetailTable = that.createTableWithValues(parseDetailsObject);
- that.ui.attributeDetailCard.html(
- attrDetailTable);
+ if (auditData.search('{') === -1) {
+ if (type.trim() === "Added labels" || type.trim() === "Deleted labels") {
+ this.updateName(auditData.trim().split(" ").join(","));
+ } else {
+ this.updateName(auditData);
}
} else {
- that.noDetailsShow();
- }
- } catch (err) {
- if (_.isArray(parseDetailsObject)) {
- var name = _.escape(parseDetailsObject[0]);
+ try {
+ parseDetailsObject = JSON.parse(auditData);
+ var skipAttribute = parseDetailsObject.typeName ? "guid" : null,
+ name = Utils.getName(parseDetailsObject, null, skipAttribute);
+ if (name == "-") {
+ name = _.escape(parseDetailsObject.typeName);
+ }
+ var name = ((name ? name : this.entityName));
+ that.updateName(name);
+ if (parseDetailsObject) {
+ var attributesDetails = parseDetailsObject.attributes,
+ customAttr = parseDetailsObject.customAttributes,
+ labelsDetails = parseDetailsObject.labels,
+ relationshipAttributes = parseDetailsObject.relationshipAttributes;
+ if (attributesDetails) {
+ 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);
+ that.ui.attributeCard.html(
+ attrTable);
+ }
+ if (!_.isEmpty(customAttr)) {
+ that.ui.customAttributeDetails.removeClass('hide');
+ var customAttrTable = that.createTableWithValues(customAttr);
+ that.ui.customAttrCard.html(
+ customAttrTable);
+ }
+ if (!_.isEmpty(labelsDetails)) {
+ this.ui.labelsDetailsTable.removeClass('hide');
+ var labelsTable = '';
+ _.each(labelsDetails, function(value, key, list) {
+ labelsTable += "<label class='label badge-default'>" + value + "</label>";
+ });
+ that.ui.labelCard.html(
+ labelsTable);
+ }
+ if (!_.isEmpty(relationshipAttributes)) {
+ that.ui.relationShipAttributeDetails.removeClass('hide');
+ var relationshipAttrTable = that.createTableWithValues(relationshipAttributes);
+ that.ui.relationshipAttrCard.html(
+ relationshipAttrTable);
+ }
+ if (!attributesDetails && !customAttr && !labelsDetails && !relationshipAttributes) {
+ that.ui.detailsAttribute.removeClass('hide');
+ var attrDetailTable = that.createTableWithValues(parseDetailsObject);
+ that.ui.attributeDetailCard.html(
+ attrDetailTable);
+ }
+ } else {
+ that.noDetailsShow();
+ }
+ } catch (err) {
+ if (_.isArray(parseDetailsObject)) {
+ var name = _.escape(parseDetailsObject[0]);
+ }
+ that.updateName(name);
+ that.noDetailsShow();
+ }
}
- that.updateName(name);
- that.noDetailsShow();
+ } else if (detailObj == "Deleted entity" || detailObj == "Purged entity") {
+ this.entityName ? this.updateName(this.entityName) : (this.ui.name.hide() && this.ui.noData.removeClass("hide"));
}
-
- } else if (detailObj == "Deleted entity" || detailObj == "Purged entity") {
- this.entityName ? that.updateName(this.entityName) : this.ui.nameContainer.empty().append("<h4 class='text-center'><i>No Records Found!</i></h4>");
}
}
});
diff --git a/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
index 37bfc0e..9863962 100644
--- a/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
@@ -176,6 +176,9 @@ define(['require',
if (collectionJSON) {
this.name = Utils.getName(collectionJSON);
if (collectionJSON.attributes) {
+ if (collectionJSON.typeName) {
+ collectionJSON.attributes.typeName = _.escape(collectionJSON.typeName);
+ }
if (this.name && collectionJSON.typeName) {
this.name = this.name + ' (' + _.escape(collectionJSON.typeName) + ')';
}
@@ -252,6 +255,9 @@ define(['require',
})(),
editEntity: this.editEntity || false
}
+ obj["renderAuditTableLayoutView"] = function() {
+ that.renderAuditTableLayoutView(obj);
+ };
this.renderEntityDetailTableLayoutView(obj);
this.renderEntityUserDefineView(obj);
this.renderEntityLabelDefineView(obj);
diff --git a/dashboardv3/public/js/views/entity/EntityLabelDefineView.js b/dashboardv3/public/js/views/entity/EntityLabelDefineView.js
index 19c3e7e..a3e864d 100644
--- a/dashboardv3/public/js/views/entity/EntityLabelDefineView.js
+++ b/dashboardv3/public/js/views/entity/EntityLabelDefineView.js
@@ -55,7 +55,7 @@ define(['require',
},
initialize: function(options) {
var self = this;
- _.extend(this, _.pick(options, 'entity', 'customFilter'));
+ _.extend(this, _.pick(options, 'entity', 'customFilter', 'renderAuditTableLayoutView'));
this.swapItem = false, this.saveLabels = false;
this.readOnlyEntity = this.customFilter === undefined ? Enums.entityStateReadOnly[this.entity.status] : this.customFilter;
this.entityModel = new VEntity(this.entity);
@@ -164,6 +164,9 @@ define(['require',
that.swapItem = false;
that.saveLabels = false;
that.render();
+ if (that.renderAuditTableLayoutView) {
+ that.renderAuditTableLayoutView();
+ }
},
error: function(e) {
that.ui.saveLabels.attr("disabled", false);
diff --git a/dashboardv3/public/js/views/entity/EntityUserDefineView.js b/dashboardv3/public/js/views/entity/EntityUserDefineView.js
index 1cb0d8c..38d32c2 100644
--- a/dashboardv3/public/js/views/entity/EntityUserDefineView.js
+++ b/dashboardv3/public/js/views/entity/EntityUserDefineView.js
@@ -53,7 +53,7 @@ define(['require',
return events;
},
initialize: function(options) {
- _.extend(this, _.pick(options, 'entity', 'customFilter'));
+ _.extend(this, _.pick(options, 'entity', 'customFilter', 'renderAuditTableLayoutView'));
this.userDefineAttr = this.entity && this.entity.customAttributes || [];
this.initialCall = false;
this.swapItem = false, this.saveAttrItems = false;
@@ -136,6 +136,9 @@ define(['require',
that.swapItem = false;
that.saveAttrItems = false;
that.render();
+ if (that.renderAuditTableLayoutView) {
+ that.renderAuditTableLayoutView();
+ }
},
error: function(e) {
that.initialCall = false;