Commit ffd2e2b5 by kevalbhatt Committed by nixonrodrigues

ATLAS-3657 : UI: changes for entity purge audits

parent 506ffc97
......@@ -67,14 +67,24 @@
}
}
.business-metadata-details {
.business-metadata-details,
.admin-details {
.expandable .attr-details {
max-height: 300px;
overflow: auto;
margin-left: 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 {
......
......@@ -249,7 +249,7 @@
overflow-x: hidden;
}
.purge-details {
.admin-details {
.tab-pane.active {
min-height: 400px;
}
......
......@@ -54,6 +54,14 @@ define(['require',
} catch (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
......
......@@ -486,7 +486,7 @@ define([
var that = this;
require(["views/site/Header", "views/site/SideNavLayoutView", 'views/administrator/AdministratorLayoutView'], function(Header, SideNavLayoutView, AdministratorLayoutView) {
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({
view: App.rSideNav,
......
......@@ -22,11 +22,12 @@
<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="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>
</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="r_businessMetadataTableLayoutView">
</div>
......@@ -35,6 +36,10 @@
<div id="r_enumTableLayoutView">
</div>
</div>
<div id="tab-admin" role="admin" class="tab-pane animated fadeIn">
<div id="r_adminTableLayoutView">
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -14,107 +14,65 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div class="page-title clearfix">
<!-- <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div> -->
<div class="row">
<div class="col-sm-12 default-tab">
<ul class="nav nav-tabs" data-id="tab-list">
<li role="purgeaudit" class="tab active"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li>
<li role="namespace"><a href="#tab-namespace" aria-controls="tab-namespace" role="tab" data-toggle="tab">Namespace</a></li>
</ul>
</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">
<div class="tab-content admin-details">
<div id="tab-audit" role="adminaudit">
<div id="r_auditTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="position-relative">
<div class="tableOverlay"></div>
<!-- Not for table Loader its only for initial loading -->
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="position-relative">
<div class="tableOverlay"></div>
<!-- Not for table Loader its only for initial loading -->
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="attributeResultContainer form-group ">
<button class="btn-action btn-sm attribute-filter-text" data-id='purgeAttrFilter'> <i class="fa fa-angle-right"></i> Filters</button>
<div class="attribute-filter-container hide">
<div class="panel panel-default expand_collapse_panel-icon" data-id="purgeRegion">
<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 class="attributeResultContainer form-group ">
<button class="btn-action btn-sm attribute-filter-text" data-id='adminAttrFilter'> <i class="fa fa-angle-right"></i> Filters</button>
<div class="attribute-filter-container hide">
<div class="panel panel-default expand_collapse_panel-icon" data-id="adminRegion">
<div class="panel-heading" data-toggle="collapse" href="#collapseAdmin" aria-expanded="true">
<h4 class="panel-title">
<a>Admin</a>
</h4>
<div class="btn-group pull-right">
<button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
</div>
<div id="collapsePurge" class="panel-collapse collapse in">
<div class="panel-body">
<div id='r_attributeQueryBuilderPurge' class='attribute-querybuilder'>
<div class='fontLoader'><i class='fa fa-refresh fa-spin-custom'></i></div>
</div>
</div>
<div id="collapseAdmin" class="panel-collapse collapse in">
<div class="panel-body">
<div id='r_attributeQueryBuilderAdmin' class='attribute-querybuilder'>
<div class='fontLoader'><i class='fa fa-refresh fa-spin-custom'></i></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 class="pull-right">
<select class="pull-right form-controlrow-margin-bottom" data-id="purgeType"></select>
<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 class='attr-filter-overlay hide'></div>
<div class="auditTable" style="display: none">
<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 class="pull-right admin-type-dropdown">
<select class="pull-right form-controlrow-margin-bottom" data-id="adminType"></select>
</div>
</div>
</div>
<div class="no-data" data-id="showDefault">
<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 class="auditTable" style="display: none">
<div class='attr-filter-overlay hide'></div>
<div id="r_adminAuditTableLayoutView"></div>
</div>
</div>
</div>
<div id="tab-namespace" role="namespace" class="tab-pane animated fadeIn">
<div id="r_namespaceTableLayoutView">
<div class="no-data" data-id="showDefault">
<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>
\ No newline at end of file
......@@ -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;">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 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">
......
......@@ -212,4 +212,4 @@ define(['require'], function(require) {
1: "true"
};
return Enums;
});
});
\ No newline at end of file
......@@ -227,8 +227,8 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
sessionApiUrl: function() {
return this.baseUrl + '/admin/session';
},
purgeApiUrl: function() {
return this.baseUrl + '/admin/audit';
adminApiUrl: function() {
return this.baseUrl + '/admin/audits';
}
});
......
......@@ -411,6 +411,12 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
matchString: "detailPage"
});
},
isPurgePage: function(url) {
return this.checkTabUrl({
url: url,
matchString: "purge"
});
},
getLastValue: function() {
return this.getQueryUrl().lastValue;
},
......
......@@ -38,7 +38,8 @@ define(['require',
/** Layout sub regions */
regions: {
RBusinessMetadataTableLayoutView: "#r_businessMetadataTableLayoutView",
REnumTableLayoutView: '#r_enumTableLayoutView'
REnumTableLayoutView: '#r_enumTableLayoutView',
RAdminTableLayoutView: '#r_adminTableLayoutView'
},
/** ui selector cache */
......@@ -67,7 +68,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'guid', 'entityDefCollection', 'businessMetadataDefCollection', 'enumDefCollection'));
_.extend(this, _.pick(options, 'value', 'entityDefCollection', 'businessMetadataDefCollection', 'enumDefCollection', 'searchTableFilters'));
},
onShow: function() {
......@@ -79,6 +80,7 @@ define(['require',
},
bindEvents: function() {
this.renderEnumLayoutView();
this.renderAdminLayoutView();
},
onRender: function() {
this.renderBusinessMetadataLayoutView();
......@@ -99,6 +101,15 @@ define(['require',
});
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;
......
......@@ -39,6 +39,7 @@ 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']",
......@@ -156,8 +157,8 @@ define(['require',
that.noDetailsShow();
}
} else if (detailObj == "Deleted entity") {
that.updateName(this.entityName ? this.entityName : "Entity");
} 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>");
}
}
});
......
......@@ -54,9 +54,8 @@ define(['require',
* @constructs
*/
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.systemAttrArr = _.sortBy(this.systemAttrArr, 'name');
this.filterType = this.tag ? 'tagFilters' : 'entityFilters';
},
bindEvents: function() {},
......@@ -312,70 +311,82 @@ define(['require',
onRender: function() {
var that = this,
filters = [],
isGroupView = false,
isGroupView = true,
placeHolder = '--Select Attribute--';
if (this.attrObj.length > 0 && this.systemAttrArr.length > 0) {
isGroupView = true;
} else if (this.attrObj.length === 0 || this.systemAttrArr.length === 0) {
isGroupView = false;
}
if (this.attrObj.length === 0) {
placeHolder = '--Select System Attribute--';
}
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);
var rules_widgets = null;
if (this.adminAttrFilters) {
filters = this.adminAttrFilters;
rules_widgets = CommonViewFunction.attributeFilter.extractUrl({ "value": this.searchTableFilters ? this.searchTableFilters["adminAttrFilters"] : null, "formatDate": true });;
} else {
if (this.value) {
var rules_widgets = CommonViewFunction.attributeFilter.extractUrl({ "value": this.searchTableFilters[this.filterType][(this.tag ? this.value.tag : this.value.type)], "formatDate": true });
}
});
if (this.type) {
var entityDef = this.entityDefCollection.fullCollection.find({ name: that.options.applicableType }),
businessMetadataAttributeDefs = null;
if (entityDef) {
BusinessMetadataAttributeDefs = entityDef.get("businessAttributeDefs");
_.each(this.attrObj, function(obj) {
var type = that.tag ? that.value.tag : that.value.type;
var returnObj = that.getObjDef(obj, rules_widgets, isGroupView, (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,
}
if (BusinessMetadataAttributeDefs) {
_.each(BusinessMetadataAttributeDefs, function(attributes, key) {
var sortedAttributes = _.sortBy(attributes, function(obj) {
return obj.name;
});
this.systemAttrArr = _.sortBy(this.systemAttrArr, function(obj) {
return sortMap[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) {
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) {
returnObj.id = key + "." + returnObj.id;
returnObj.label = key + ": " + returnObj.label;
returnObj.id = businessMetadataKey + "." + returnObj.id;
returnObj.label = businessMetadataKey + ": " + returnObj.label;
returnObj.data = { 'entityType': "businessMetadata" };
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');
......
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