Commit ffd2e2b5 by kevalbhatt Committed by nixonrodrigues

ATLAS-3657 : UI: changes for entity purge audits

parent 506ffc97
...@@ -67,14 +67,24 @@ ...@@ -67,14 +67,24 @@
} }
} }
.business-metadata-details { .business-metadata-details,
.admin-details {
.expandable .attr-details { .expandable .attr-details {
max-height: 300px; max-height: 300px;
overflow: auto; overflow: auto;
margin-left: 30px; margin-left: 30px;
width: calc(100% - 30px); width: calc(100% - 30px);
} }
.admin-type-dropdown {
width: 100px;
}
.expandable .admin-attr-details {
max-height: 100px;
margin-left: 20px;
width: calc(100% - 27px);
}
} }
.tab-pane { .tab-pane {
......
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
overflow-x: hidden; overflow-x: hidden;
} }
.purge-details { .admin-details {
.tab-pane.active { .tab-pane.active {
min-height: 400px; min-height: 400px;
} }
......
...@@ -54,6 +54,14 @@ define(['require', ...@@ -54,6 +54,14 @@ define(['require',
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
},
getAdminData: function(options) {
var url = UrlLinks.adminApiUrl();
options = _.extend({
contentType: 'application/json',
dataType: 'json'
}, options);
return this.constructor.nonCrudOperation.call(this, url, 'POST', options);
} }
}, },
//Static Class Members //Static Class Members
......
...@@ -486,7 +486,7 @@ define([ ...@@ -486,7 +486,7 @@ define([
var that = this; var that = this;
require(["views/site/Header", "views/site/SideNavLayoutView", 'views/administrator/AdministratorLayoutView'], function(Header, SideNavLayoutView, AdministratorLayoutView) { require(["views/site/Header", "views/site/SideNavLayoutView", 'views/administrator/AdministratorLayoutView'], function(Header, SideNavLayoutView, AdministratorLayoutView) {
var value = Utils.getUrlState.getQueryParams(), var value = Utils.getUrlState.getQueryParams(),
paramObj = _.extend({ value: value, guid: null }, that.preFetchedCollectionLists); paramObj = _.extend({ value: value, guid: null }, that.preFetchedCollectionLists, that.sharedObj);
that.renderViewIfNotExists(that.getHeaderOptions(Header)); that.renderViewIfNotExists(that.getHeaderOptions(Header));
that.renderViewIfNotExists({ that.renderViewIfNotExists({
view: App.rSideNav, view: App.rSideNav,
......
...@@ -22,11 +22,12 @@ ...@@ -22,11 +22,12 @@
<ul class="nav nav-tabs" data-id="tab-list"> <ul class="nav nav-tabs" data-id="tab-list">
<li role="businessMetadata" class="tab active"><a href="#tab-businessMetadata" aria-controls="tab-businessMetadata" role="tab" data-toggle="tab">Business Metadata</a></li> <li role="businessMetadata" class="tab active"><a href="#tab-businessMetadata" aria-controls="tab-businessMetadata" role="tab" data-toggle="tab">Business Metadata</a></li>
<li role="enum"><a href="#tab-enum" aria-controls="tab-enum" role="tab" data-toggle="tab">Enumerations</a></li> <li role="enum"><a href="#tab-enum" aria-controls="tab-enum" role="tab" data-toggle="tab">Enumerations</a></li>
<li role="admin"><a href="#tab-admin" aria-controls="tab-admin" role="tab" data-toggle="tab">Audits</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<div> <div>
<div class="tab-content purge-details"> <div class="tab-content admin-details">
<div id="tab-businessMetadata" role="businessMetadata" class="tab-pane active animated fadeIn"> <div id="tab-businessMetadata" role="businessMetadata" class="tab-pane active animated fadeIn">
<div id="r_businessMetadataTableLayoutView"> <div id="r_businessMetadataTableLayoutView">
</div> </div>
...@@ -35,6 +36,10 @@ ...@@ -35,6 +36,10 @@
<div id="r_enumTableLayoutView"> <div id="r_enumTableLayoutView">
</div> </div>
</div> </div>
<div id="tab-admin" role="admin" class="tab-pane animated fadeIn">
<div id="r_adminTableLayoutView">
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -14,107 +14,65 @@ ...@@ -14,107 +14,65 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
--> -->
<div class="page-title clearfix"> <div class="tab-content admin-details">
<!-- <div class="fontLoader"> <div id="tab-audit" role="adminaudit">
<i class="fa fa-refresh fa-spin-custom"></i> <div id="r_auditTableLayoutView">
</div> --> <div class="fontLoader-relative">
<div class="row"> <i class="fa fa-refresh fa-spin-custom"></i>
<div class="col-sm-12 default-tab"> </div>
<ul class="nav nav-tabs" data-id="tab-list"> <div class="position-relative">
<li role="purgeaudit" class="tab active"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li> <div class="tableOverlay"></div>
<li role="namespace"><a href="#tab-namespace" aria-controls="tab-namespace" role="tab" data-toggle="tab">Namespace</a></li> <!-- Not for table Loader its only for initial loading -->
</ul> <div class="fontLoader">
</div>
</div>
</div>
<div>
<div class="tab-content purge-details">
<div id="tab-audit" role="purgeaudit" class="tab-pane active animated fadeIn">
<div id="r_auditTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<div class="position-relative"> <div class="attributeResultContainer form-group ">
<div class="tableOverlay"></div> <button class="btn-action btn-sm attribute-filter-text" data-id='adminAttrFilter'> <i class="fa fa-angle-right"></i> Filters</button>
<!-- Not for table Loader its only for initial loading --> <div class="attribute-filter-container hide">
<div class="fontLoader"> <div class="panel panel-default expand_collapse_panel-icon" data-id="adminRegion">
<i class="fa fa-refresh fa-spin-custom"></i> <div class="panel-heading" data-toggle="collapse" href="#collapseAdmin" aria-expanded="true">
</div> <h4 class="panel-title">
<div class="attributeResultContainer form-group "> <a>Admin</a>
<button class="btn-action btn-sm attribute-filter-text" data-id='purgeAttrFilter'> <i class="fa fa-angle-right"></i> Filters</button> </h4>
<div class="attribute-filter-container hide"> <div class="btn-group pull-right">
<div class="panel panel-default expand_collapse_panel-icon" data-id="purgeRegion"> <button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
<div class="panel-heading" data-toggle="collapse" href="#collapsePurge" aria-expanded="true">
<h4 class="panel-title">
<a>Purge</a>
</h4>
<div class="btn-group pull-right">
<button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
</div>
</div> </div>
<div id="collapsePurge" class="panel-collapse collapse in"> </div>
<div class="panel-body"> <div id="collapseAdmin" class="panel-collapse collapse in">
<div id='r_attributeQueryBuilderPurge' class='attribute-querybuilder'> <div class="panel-body">
<div class='fontLoader'><i class='fa fa-refresh fa-spin-custom'></i></div> <div id='r_attributeQueryBuilderAdmin' class='attribute-querybuilder'>
</div> <div class='fontLoader'><i class='fa fa-refresh fa-spin-custom'></i></div>
</div> </div>
</div> </div>
</div> </div>
<div class='attribute-result-footer'>
<div type="ok" class="btn btn-atlas ok search" data-id='attrApply'>Apply</div>
<div type="ok" class="btn btn-atlas ok" data-id='attrClose'>Close</div>
</div>
</div> </div>
<div class="pull-right"> <div class='attribute-result-footer'>
<select class="pull-right form-controlrow-margin-bottom" data-id="purgeType"></select> <div type="ok" class="btn btn-atlas ok search" data-id='attrApply'>Apply</div>
<div type="ok" class="btn btn-atlas ok" data-id='attrClose'>Close</div>
</div> </div>
</div> </div>
<div class='attr-filter-overlay hide'></div> <div class="pull-right admin-type-dropdown">
<div class="auditTable" style="display: none"> <select class="pull-right form-controlrow-margin-bottom" data-id="adminType"></select>
<div id="r_purgeAuditTableLayoutView"></div>
<div>
<span class="labelShowRecord pull-left" data-id="pageRecordText"></span>
</div>
<div class="pagination-box">
<div class="backgrid-paginator pull-right">
<ul>
<li>
<button type="button" data-id="previousAuditData" title="Previous" disabled=true>
<i class="fa fa-angle-left" aria-hidden="true"></i>
</button>
</li>
<li class="active">
<a href="javascript:void(0)" data-id="activePage"></a>
</li>
<li>
<button type="button" data-id="nextAuditData" title="Next">
<i class="fa fa-angle-right" aria-hidden="true"></i>
</button>
</li>
</ul>
</div>
</div>
</div> </div>
</div> </div>
</div> <div class="auditTable" style="display: none">
<div class="no-data" data-id="showDefault"> <div class='attr-filter-overlay hide'></div>
<div class="position-relative thick-border"> <div id="r_adminAuditTableLayoutView"></div>
<div style="padding-top: 20px; " class="table-responsive tableBorder">
<table class="table table-hover backgrid table-quickMenu">
<tbody>
<tr class="empty">
<td colspan="16"><span>No Records found!</span></td>
</tr>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> </div>
<div id="tab-namespace" role="namespace" class="tab-pane animated fadeIn"> <div class="no-data" data-id="showDefault">
<div id="r_namespaceTableLayoutView"> <div class="position-relative thick-border">
<div style="padding-top: 20px; " class="table-responsive tableBorder">
<table class="table table-hover backgrid table-quickMenu">
<tbody>
<tr class="empty">
<td colspan="16"><span>No Records found!</span></td>
</tr>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
--> -->
<h4 class="entity-name" style="word-break: break-word;">Name: <span data-id="name"></span></h4> <h4 class="entity-name" style="word-break: break-word;" data-id="nameContainer">Name: <span data-id="name"></span></h4>
<div class="panel-group server-stats-container auditStatusContainer clearfix" id="accordion"> <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 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"> <div class="panel-heading" data-toggle="collapse" href="#detailAttributeTableCollapse" aria-expanded="true">
......
...@@ -212,4 +212,4 @@ define(['require'], function(require) { ...@@ -212,4 +212,4 @@ define(['require'], function(require) {
1: "true" 1: "true"
}; };
return Enums; return Enums;
}); });
\ No newline at end of file
...@@ -227,8 +227,8 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require ...@@ -227,8 +227,8 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
sessionApiUrl: function() { sessionApiUrl: function() {
return this.baseUrl + '/admin/session'; return this.baseUrl + '/admin/session';
}, },
purgeApiUrl: function() { adminApiUrl: function() {
return this.baseUrl + '/admin/audit'; return this.baseUrl + '/admin/audits';
} }
}); });
......
...@@ -411,6 +411,12 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -411,6 +411,12 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
matchString: "detailPage" matchString: "detailPage"
}); });
}, },
isPurgePage: function(url) {
return this.checkTabUrl({
url: url,
matchString: "purge"
});
},
getLastValue: function() { getLastValue: function() {
return this.getQueryUrl().lastValue; return this.getQueryUrl().lastValue;
}, },
......
...@@ -38,7 +38,8 @@ define(['require', ...@@ -38,7 +38,8 @@ define(['require',
/** Layout sub regions */ /** Layout sub regions */
regions: { regions: {
RBusinessMetadataTableLayoutView: "#r_businessMetadataTableLayoutView", RBusinessMetadataTableLayoutView: "#r_businessMetadataTableLayoutView",
REnumTableLayoutView: '#r_enumTableLayoutView' REnumTableLayoutView: '#r_enumTableLayoutView',
RAdminTableLayoutView: '#r_adminTableLayoutView'
}, },
/** ui selector cache */ /** ui selector cache */
...@@ -67,7 +68,7 @@ define(['require', ...@@ -67,7 +68,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'guid', 'entityDefCollection', 'businessMetadataDefCollection', 'enumDefCollection')); _.extend(this, _.pick(options, 'value', 'entityDefCollection', 'businessMetadataDefCollection', 'enumDefCollection', 'searchTableFilters'));
}, },
onShow: function() { onShow: function() {
...@@ -79,6 +80,7 @@ define(['require', ...@@ -79,6 +80,7 @@ define(['require',
}, },
bindEvents: function() { bindEvents: function() {
this.renderEnumLayoutView(); this.renderEnumLayoutView();
this.renderAdminLayoutView();
}, },
onRender: function() { onRender: function() {
this.renderBusinessMetadataLayoutView(); this.renderBusinessMetadataLayoutView();
...@@ -99,6 +101,15 @@ define(['require', ...@@ -99,6 +101,15 @@ define(['require',
}); });
that.REnumTableLayoutView.show(view); that.REnumTableLayoutView.show(view);
}); });
},
renderAdminLayoutView: function(obj) {
var that = this;
require(["views/audit/AdminAuditTableLayoutView"], function(AdminAuditTableLayoutView) {
var view = new AdminAuditTableLayoutView({
searchTableFilters: that.searchTableFilters
});
that.RAdminTableLayoutView.show(view);
});
} }
}); });
return AdministratorLayoutView; return AdministratorLayoutView;
......
...@@ -39,6 +39,7 @@ define(['require', ...@@ -39,6 +39,7 @@ define(['require',
ui: { ui: {
auditValue: "[data-id='auditValue']", auditValue: "[data-id='auditValue']",
name: "[data-id='name']", name: "[data-id='name']",
nameContainer: "[data-id='nameContainer']",
noData: "[data-id='noData']", noData: "[data-id='noData']",
tableAudit: "[data-id='tableAudit']", tableAudit: "[data-id='tableAudit']",
auditHeaderValue: "[data-id='auditHeaderValue']", auditHeaderValue: "[data-id='auditHeaderValue']",
...@@ -156,8 +157,8 @@ define(['require', ...@@ -156,8 +157,8 @@ define(['require',
that.noDetailsShow(); that.noDetailsShow();
} }
} else if (detailObj == "Deleted entity") { } else if (detailObj == "Deleted entity" || detailObj == "Purged entity") {
that.updateName(this.entityName ? this.entityName : "Entity"); this.entityName ? that.updateName(this.entityName) : this.ui.nameContainer.empty().append("<h4 class='text-center'><i>No Records Found!</i></h4>");
} }
} }
}); });
......
...@@ -54,9 +54,8 @@ define(['require', ...@@ -54,9 +54,8 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'attrObj', 'value', 'typeHeaders', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection', 'tag', 'type', 'searchTableFilters', 'systemAttrArr')); _.extend(this, _.pick(options, 'attrObj', 'value', 'typeHeaders', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection', 'businessMetadataDefCollection', 'tag', 'type', 'searchTableFilters', 'systemAttrArr', 'adminAttrFilters'));
this.attrObj = _.sortBy(this.attrObj, 'name'); this.attrObj = _.sortBy(this.attrObj, 'name');
//this.systemAttrArr = _.sortBy(this.systemAttrArr, 'name');
this.filterType = this.tag ? 'tagFilters' : 'entityFilters'; this.filterType = this.tag ? 'tagFilters' : 'entityFilters';
}, },
bindEvents: function() {}, bindEvents: function() {},
...@@ -312,70 +311,82 @@ define(['require', ...@@ -312,70 +311,82 @@ define(['require',
onRender: function() { onRender: function() {
var that = this, var that = this,
filters = [], filters = [],
isGroupView = false, isGroupView = true,
placeHolder = '--Select Attribute--'; placeHolder = '--Select Attribute--';
if (this.attrObj.length > 0 && this.systemAttrArr.length > 0) { var rules_widgets = null;
isGroupView = true; if (this.adminAttrFilters) {
} else if (this.attrObj.length === 0 || this.systemAttrArr.length === 0) { filters = this.adminAttrFilters;
isGroupView = false; rules_widgets = CommonViewFunction.attributeFilter.extractUrl({ "value": this.searchTableFilters ? this.searchTableFilters["adminAttrFilters"] : null, "formatDate": true });;
} } else {
if (this.attrObj.length === 0) { if (this.value) {
placeHolder = '--Select System Attribute--'; var rules_widgets = CommonViewFunction.attributeFilter.extractUrl({ "value": this.searchTableFilters[this.filterType][(this.tag ? this.value.tag : this.value.type)], "formatDate": true });
}
if (this.value) {
var rules_widgets = CommonViewFunction.attributeFilter.extractUrl({ "value": this.searchTableFilters[this.filterType][(this.tag ? this.value.tag : this.value.type)], "formatDate": true });
}
_.each(this.attrObj, function(obj) {
var type = that.tag ? 'Classification' : 'Entity';
var returnObj = that.getObjDef(obj, rules_widgets, isGroupView, 'Select ' + type + ' Attribute');
if (returnObj) {
filters.push(returnObj);
}
});
var sortMap = {
"__guid": 1,
"__typeName": 2,
"__timestamp": 3,
"__modificationTimestamp": 4,
"__createdBy": 5,
"__modifiedBy": 6,
"__isIncomplete": 7,
"__state": 8,
"__classificationNames": 9,
"__propagatedClassificationNames": 10,
"__labels": 11,
"__customAttributes": 12,
}
this.systemAttrArr = _.sortBy(this.systemAttrArr, function(obj) {
return sortMap[obj.name]
})
_.each(this.systemAttrArr, function(obj) {
var returnObj = that.getObjDef(obj, rules_widgets, isGroupView, 'Select System Attribute', true);
if (returnObj) {
filters.push(returnObj);
} }
}); _.each(this.attrObj, function(obj) {
if (this.type) { var type = that.tag ? that.value.tag : that.value.type;
var entityDef = this.entityDefCollection.fullCollection.find({ name: that.options.applicableType }), var returnObj = that.getObjDef(obj, rules_widgets, isGroupView, (type + ' Attribute'));
businessMetadataAttributeDefs = null; if (returnObj) {
if (entityDef) { filters.push(returnObj);
BusinessMetadataAttributeDefs = entityDef.get("businessAttributeDefs"); }
});
var sortMap = {
"__guid": 1,
"__typeName": 2,
"__timestamp": 3,
"__modificationTimestamp": 4,
"__createdBy": 5,
"__modifiedBy": 6,
"__isIncomplete": 7,
"__state": 8,
"__classificationNames": 9,
"__propagatedClassificationNames": 10,
"__labels": 11,
"__customAttributes": 12,
} }
if (BusinessMetadataAttributeDefs) { this.systemAttrArr = _.sortBy(this.systemAttrArr, function(obj) {
_.each(BusinessMetadataAttributeDefs, function(attributes, key) { return sortMap[obj.name]
var sortedAttributes = _.sortBy(attributes, function(obj) { })
return obj.name; _.each(this.systemAttrArr, function(obj) {
}); var returnObj = that.getObjDef(obj, rules_widgets, isGroupView, 'System Attribute', true);
if (returnObj) {
filters.push(returnObj);
}
});
if (this.type) {
var pushBusinessMetadataFilter = function(sortedAttributes, businessMetadataKey) {
_.each(sortedAttributes, function(attrDetails) { _.each(sortedAttributes, function(attrDetails) {
var returnObj = that.getObjDef(attrDetails, rules_widgets, isGroupView, 'Select Business Metadata Attribute', true); var returnObj = that.getObjDef(attrDetails, rules_widgets, isGroupView, 'Business Metadata Attribute', true);
if (returnObj) { if (returnObj) {
returnObj.id = key + "." + returnObj.id; returnObj.id = businessMetadataKey + "." + returnObj.id;
returnObj.label = key + ": " + returnObj.label; returnObj.label = businessMetadataKey + ": " + returnObj.label;
returnObj.data = { 'entityType': "businessMetadata" }; returnObj.data = { 'entityType': "businessMetadata" };
filters.push(returnObj); filters.push(returnObj);
} }
}); });
}); };
if (this.value.type == "_ALL_ENTITY_TYPES") {
this.businessMetadataDefCollection.each(function(model) {
var sortedAttributes = model.get('attributeDefs');
sortedAttributes = _.sortBy(sortedAttributes, function(obj) {
return obj.name;
});
pushBusinessMetadataFilter(sortedAttributes, model.get('name'));
})
} else {
var entityDef = this.entityDefCollection.fullCollection.find({ name: this.value.type }),
businessMetadataAttributeDefs = null;
if (entityDef) {
businessMetadataAttributeDefs = entityDef.get("businessAttributeDefs");
}
if (businessMetadataAttributeDefs) {
_.each(businessMetadataAttributeDefs, function(attributes, key) {
var sortedAttributes = _.sortBy(attributes, function(obj) {
return obj.name;
});
pushBusinessMetadataFilter(sortedAttributes, key);
});
}
}
} }
} }
filters = _.uniq(filters, 'id'); filters = _.uniq(filters, 'id');
......
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