Commit 770b8274 by gutkaBinit Committed by nixonrodrigues

ATLAS-3076 UI : Relationship Tab improvements.

parent debbc0ae
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="btn-group pull-left"> <div class="btn-group pull-left">
<span class="pull-left">Graph</span> <span class="pull-left">Graph</span>
<label class="switch pull-left"> <label class="switch pull-left">
<input type="checkbox" class="switch-input" name="relationshipViewToggle" value="text"> <input type="checkbox" checked class="switch-input" name="relationshipViewToggle" value="text">
<span class="switch-slider"></span> <span class="switch-slider"></span>
</label> </label>
<span class="pull-left">Table</span> <span class="pull-left">Table</span>
...@@ -29,21 +29,21 @@ ...@@ -29,21 +29,21 @@
<button type="button" id="zoom_out" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom Out" data-id="refreshBtn"> <i class="fa fa-search-minus"></i></button> <button type="button" id="zoom_out" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom Out" data-id="refreshBtn"> <i class="fa fa-search-minus"></i></button>
</div> </div>
</div> </div>
<div class="white-bg no-padding relationship-box" data-id='relationshipSVG'> <div class="white-bg no-padding relationship-box invisible" data-id='relationshipSVG'>
<div class="fontLoader"> <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<svg width="100%" height="100%" viewBox="0 0 854 330" enable-background="new 0 0 854 330" xml:space="preserve"></svg> <svg width="100%" height="100%" viewBox="0 0 854 330" enable-background="new 0 0 854 330" xml:space="preserve"></svg>
<div class="box-panel size-lg slide-from-left relationship-node-details"> <div class="box-panel size-lg slide-from-left relationship-node-details">
<div class="header clearfix"> <div class="header clearfix">
<h4><span data-id="typeName"></span></h4> <h4><span data-id="typeName"></span></h4>
<span data-id="box-close" class="btn btn-sm btn-close"><i class="fa fa-close"></i></span> <span data-id="box-close" class="btn btn-sm btn-close"><i class="fa fa-close"></i></span>
</div> </div>
<div class="body"> <div class="body">
<div class="col-md-12"> <div class="col-md-12">
<input data-id="searchNode" class="form-control form-group" placeholder="Search Entities" /> <input data-id="searchNode" class="form-control form-group" placeholder="Search Entities" />
<ul data-id="entityList" class="entity-list"></ul> <ul data-id="entityList" class="entity-list"></ul>
</div> </div>
</div> </div>
</div> </div>
<!-- <div class="relationship-details"> <!-- <div class="relationship-details">
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</div> --> </div> -->
</div> </div>
<div> <div>
<table class="table table-quickMenu" data-id="relationshipDetailTable" style="display: none;"> <table class="table table-quickMenu" data-id="relationshipDetailTable">
<thead> <thead>
<tr> <tr>
<th>Key</th> <th>Key</th>
......
...@@ -227,6 +227,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob ...@@ -227,6 +227,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
return; return;
} }
var keyValue = valueObject[key]; var keyValue = valueObject[key];
var count = _.isArray(keyValue) ? (keyValue.length) : 0;
var defEntity = _.find(attributeDefs, { name: key }); var defEntity = _.find(attributeDefs, { name: key });
if (defEntity && defEntity.typeName) { if (defEntity && defEntity.typeName) {
var defEntityType = defEntity.typeName.toLocaleLowerCase(); var defEntityType = defEntity.typeName.toLocaleLowerCase();
...@@ -263,7 +264,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob ...@@ -263,7 +264,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
htmlTag = '<pre class="shrink code-block ' + (isMatchJSONStringIsSingle ? 'fixed-height' : '') + '">' + expandCollapseButton + '<code>' + val + '</code></pre>'; htmlTag = '<pre class="shrink code-block ' + (isMatchJSONStringIsSingle ? 'fixed-height' : '') + '">' + expandCollapseButton + '<code>' + val + '</code></pre>';
} }
} }
table += '<tr><td>' + _.escape(key) + '</td><td>' + htmlTag + '</td></tr>'; var textToDisplay = count > 0 ? ' (' + getValue(count) + ')' : '';
table += '<tr><td>' + _.escape(key) + textToDisplay + '</td><td>' + htmlTag + '</td></tr>';
} else { } else {
table += '<div>' + val + '</div>'; table += '<div>' + val + '</div>';
} }
......
...@@ -95,7 +95,9 @@ define(['require', ...@@ -95,7 +95,9 @@ define(['require',
} }
return { nodes: nodes, links: links }; return { nodes: nodes, links: links };
}, },
onRender: function() {}, onRender: function() {
this.$el.addClass('auto-height');
},
onShow: function(argument) { onShow: function(argument) {
if (this.graphData && _.isEmpty(this.graphData.links)) { if (this.graphData && _.isEmpty(this.graphData.links)) {
this.noRelationship(); this.noRelationship();
...@@ -458,18 +460,17 @@ define(['require', ...@@ -458,18 +460,17 @@ define(['require',
}, },
createTable: function() { createTable: function() {
this.entityModel = new VEntity({}); this.entityModel = new VEntity({});
var table = CommonViewFunction.propertyTable({ scope: this, valueObject: this.entity.relationshipAttributes, attributeDefs: this.attributeDefs }); var table = CommonViewFunction.propertyTable({ scope: this, valueObject: this.entity.relationshipAttributes, attributeDefs: this.attributeDefs, numberFormat: _.numberFormatWithComa });
this.ui.relationshipDetailValue.html(table); this.ui.relationshipDetailValue.html(table);
}, },
relationshipViewToggle: function(checked) { relationshipViewToggle: function(checked) {
this.ui.relationshipDetailTable.toggleClass('visible invisible');
this.ui.relationshipSVG.toggleClass('visible invisible');
if (checked) { if (checked) {
this.ui.relationshipDetailTable.show();
this.ui.relationshipSVG.hide();
this.ui.zoomControl.hide(); this.ui.zoomControl.hide();
this.$el.addClass('auto-height'); this.$el.addClass('auto-height');
} else { } else {
this.ui.relationshipDetailTable.hide();
this.ui.relationshipSVG.show();
this.ui.zoomControl.show(); this.ui.zoomControl.show();
this.$el.removeClass('auto-height'); this.$el.removeClass('auto-height');
} }
......
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