Commit a05107a0 by Hemanth Yamijala

ATLAS-658 Improve Lineage with Backbone porting (kevalbhatt18 via yhemanth)

parent aaf2971a
...@@ -691,7 +691,7 @@ ul[data-id=branchList] li { ...@@ -691,7 +691,7 @@ ul[data-id=branchList] li {
max-width: 140px; max-width: 140px;
} }
.appndList { .appendList {
max-height: 200px; max-height: 200px;
overflow: auto; overflow: auto;
max-width: 140px; max-width: 140px;
...@@ -720,7 +720,54 @@ text { ...@@ -720,7 +720,54 @@ text {
} }
.edgePath path { .edgePath path {
stroke: #333; stroke: #000;
stroke-width: 1.5px; /* stroke-width: 1.5px;*/
}
.node .label {
fill: #868686;
}
.branchChildDiv {
padding-left: 15px;
} }
.branchListParentInput .form-control {
border-right: none;
box-shadow: none;
border-radius: 4px;
}
.branchListParentInput .input-group-addon {
background-color: #fff;
}
.branchListParentInput {
padding-bottom: 18px;
display: list-item;
}
.backButton {
display: block;
width: 35px;
height: 35px;
line-height: 46px;
text-align: center;
background-color: #323544;
color: #fff;
position: fixed;
left: 5px;
top: 90px;
font-size: 11px;
}
.backButton:hover,
.backButton:active {
color: #fff;
}
.zoomButtonGroup {
position: absolute;
top: 4px;
right: 5px;
}
...@@ -32,9 +32,7 @@ define(['require', ...@@ -32,9 +32,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function() { initialize: function() {},
},
bindErrorEvents: function() { bindErrorEvents: function() {
this.bind("error", Utils.defaultErrorHandler); this.bind("error", Utils.defaultErrorHandler);
}, },
...@@ -45,9 +43,7 @@ define(['require', ...@@ -45,9 +43,7 @@ define(['require',
firstPage: 0, firstPage: 0,
pageSize: Globals.settings.PAGE_SIZE pageSize: Globals.settings.PAGE_SIZE
}, },
mode: 'client', mode: 'client',
/** /**
* override the parseRecords of PageableCollection for our use * override the parseRecords of PageableCollection for our use
*/ */
...@@ -57,7 +53,7 @@ define(['require', ...@@ -57,7 +53,7 @@ define(['require',
query: resp.query, query: resp.query,
queryType: resp.queryType, queryType: resp.queryType,
requestId: resp.requestId requestId: resp.requestId
} };
try { try {
if (!this.modelAttrName) { if (!this.modelAttrName) {
throw new Error("this.modelAttrName not defined for " + this); throw new Error("this.modelAttrName not defined for " + this);
...@@ -119,18 +115,14 @@ define(['require', ...@@ -119,18 +115,14 @@ define(['require',
'name': k 'name': k
}, defaults, v); }, defaults, v);
}); });
return retCols; return retCols;
}, },
nonCrudOperation: function(url, requestMethod, options) { nonCrudOperation: function(url, requestMethod, options) {
return Backbone.sync.call(this, null, this, _.extend({ return Backbone.sync.call(this, null, this, _.extend({
url: url, url: url,
type: requestMethod type: requestMethod
}, options)); }, options));
} }
}); });
return BaseCollection; return BaseCollection;
}); });
...@@ -45,6 +45,5 @@ define(['require', ...@@ -45,6 +45,5 @@ define(['require',
tableCols: {} tableCols: {}
} }
); );
return VCommonList; return VCommonList;
}); });
...@@ -39,8 +39,8 @@ define(['require', ...@@ -39,8 +39,8 @@ define(['require',
} }
var arr = []; var arr = [];
resp[this.modelAttrName].rows.forEach(function(d) { resp[this.modelAttrName].rows.forEach(function(d) {
arr.push(d) arr.push(d);
}) });
return arr; return arr;
} catch (e) { } catch (e) {
console.log(e); console.log(e);
......
...@@ -41,8 +41,8 @@ define(['require', ...@@ -41,8 +41,8 @@ define(['require',
resp[this.modelAttrName].forEach(function(d) { resp[this.modelAttrName].forEach(function(d) {
arr.push({ arr.push({
tags: d tags: d
}) });
}) });
return arr; return arr;
} catch (e) { } catch (e) {
console.log(e); console.log(e);
......
...@@ -55,7 +55,7 @@ define(['require', ...@@ -55,7 +55,7 @@ define(['require',
Handlebars.registerHelper('toHumanDate', function(val) { Handlebars.registerHelper('toHumanDate', function(val) {
if (!val) return ""; if (!val) return "";
return val //localization.formatDate(val, 'f'); return val;//localization.formatDate(val, 'f');
}); });
Handlebars.registerHelper('tt', function(str) { Handlebars.registerHelper('tt', function(str) {
//return localization.tt(str); //return localization.tt(str);
......
...@@ -27,20 +27,15 @@ ...@@ -27,20 +27,15 @@
{{/if}} {{/if}}
</h4> </h4>
</div> </div>
{{/if}} {{/if}} {{#if contentWithFooter}} {{else}}
{{#if contentWithFooter}}
{{else}}
<div class="modal-body">{{content}}</div> <div class="modal-body">{{content}}</div>
{{#if showFooter}} {{#if showFooter}}
<div class="modal-footer" > <div class="modal-footer">
<a href="#" class="btn ok btn-success">{{tt okText}}</a> <button class="btn ok btn-success">{{tt okText}}</button>
{{#if allowCancel}} {{#if allowCancel}} {{#if cancelText}}
{{#if cancelText}} <button class="btn btn-default cancel">{{tt cancelText}}</button>
<a href="#" class="btn btn-default cancel">{{tt cancelText}}</a> {{/if}} {{/if}}
{{/if}}
{{/if}}
</div> </div>
{{/if}} {{/if}} {{/if}}
{{/if}}
</div> </div>
</div> </div>
...@@ -15,10 +15,7 @@ ...@@ -15,10 +15,7 @@
* limitations under the License. * limitations under the License.
--> -->
<div class="col-sm-12"> <div class="col-sm-12">
<ol class="breadcrumb"> <a href="javascript:void(0);" class="backButton" data-id="backButton" title="Back To Result"><i class="fa fa-chevron-left fa-2x"></i></a>
<li><a href="#!/dashboard/assetPage">Home</a></li>
<li class="active breadcrumbName"></li>
</ol>
<div class="panel panel-default lineageLayout" style="display:none"> <div class="panel panel-default lineageLayout" style="display:none">
<div id="r_lineageLayoutView"></div> <div id="r_lineageLayoutView"></div>
</div> </div>
......
...@@ -27,7 +27,11 @@ ...@@ -27,7 +27,11 @@
</div> --> </div> -->
<div class="graph" id="tree-container"> <div class="graph" id="tree-container">
</div> </div>
<div> <div style="position:relative">
<svg width=100% height=350> </svg> <svg width=100% height=350></svg>
<div class="zoomButtonGroup">
<button class="zoomButton" id="zoom_in">+</button>
<button class="zoomButton" id="zoom_out">-</button>
</div>
</div> </div>
</div> </div>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4">Tag definition</label> <label class="control-label col-sm-4">Tag definition</label>
<div class="col-sm-8 input-spacing"> <div class="col-sm-8 input-spacing">
<select class="form-control" data-id="addTagOptions" id="addTagID" required> <select class="form-control" data-id="addTagOptions" required>
</select> </select>
</div> </div>
</div> </div>
......
...@@ -16,9 +16,28 @@ ...@@ -16,9 +16,28 @@
* limitations under the License. * limitations under the License.
*/ */
define(['require', 'backgrid'], function(require) { define(['require', 'backgrid', 'asBreadcrumbs'], function(require) {
'use strict'; 'use strict';
$.asBreadcrumbs.prototype.generateChildrenInfo = function() {
var self = this;
this.$children.each(function() {
var $this = $(this);
self.childrenInfo.push({
$this: $this,
outerWidth: $this.outerWidth(),
$content: $(self.options.dropdownContent($this))
});
});
if (this.options.overflow === "left") {
this.childrenInfo.reverse();
}
this.childrenLength = this.childrenInfo.length;
};
String.prototype.trunc = String.prototype.trunc ||
function(n) {
return (this.length > n) ? this.substr(0, n - 1) + '...' : this;
};
/* /*
* HtmlCell renders any html code * HtmlCell renders any html code
* @class Backgrid.HtmlCell * @class Backgrid.HtmlCell
...@@ -71,7 +90,5 @@ define(['require', 'backgrid'], function(require) { ...@@ -71,7 +90,5 @@ define(['require', 'backgrid'], function(require) {
this.delegateEvents(); this.delegateEvents();
return this; return this;
} }
}); });
}); });
...@@ -96,20 +96,20 @@ ...@@ -96,20 +96,20 @@
return { found: false, 'value': value }; return { found: false, 'value': value };
}, },
getLocalStorage: function(key, value) { getLocalStorage: function(key, value) {
var keyValue = localStorage.getItem(key) var keyValue = localStorage.getItem(key);
if (!keyValue || keyValue == "undefined") { if (!keyValue || keyValue == "undefined") {
return this.setLocalStorage(key, value); return this.setLocalStorage(key, value);
} else { } else {
return { found: true, 'value': keyValue }; return { found: true, 'value': keyValue };
} }
} }
} };
Utils.cookie = { Utils.cookie = {
setCookie: function(cname, cvalue) { setCookie: function(cname, cvalue) {
//var d = new Date(); //var d = new Date();
//d.setTime(d.getTime() + (exdays*24*60*60*1000)); //d.setTime(d.getTime() + (exdays*24*60*60*1000));
//var expires = "expires=" + d.toGMTString(); //var expires = "expires=" + d.toGMTString();
document.cookie = cname + "=" + cvalue + "; " document.cookie = cname + "=" + cvalue + "; ";
return { found: false, 'value': cvalue }; return { found: false, 'value': cvalue };
}, },
getCookie: function(findString) { getCookie: function(findString) {
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
return setCookie(key, value); return setCookie(key, value);
} }
} }
} };
Utils.getQueryParams = function(qs) { Utils.getQueryParams = function(qs) {
qs = qs.split('+').join(' '); qs = qs.split('+').join(' ');
var params = {}, var params = {},
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
} }
return params; return params;
} };
Utils.setUrl = function(options) { Utils.setUrl = function(options) {
if (options) { if (options) {
...@@ -150,11 +150,11 @@ ...@@ -150,11 +150,11 @@
var hashUrl = window.location.hash.split("?"); var hashUrl = window.location.hash.split("?");
if (hashUrl.length > 1) { if (hashUrl.length > 1) {
var param = Utils.getQueryParams(hashUrl[1]); var param = Utils.getQueryParams(hashUrl[1]);
options.urlParams = _.extend(param, options.urlParams) options.urlParams = _.extend(param, options.urlParams);
} }
} }
if (options.urlParams) { if (options.urlParams) {
var urlParams = "?" var urlParams = "?";
_.each(options.urlParams, function(value, key, obj) { _.each(options.urlParams, function(value, key, obj) {
urlParams += key + "=" + value + "&"; urlParams += key + "=" + value + "&";
}); });
...@@ -163,6 +163,6 @@ ...@@ -163,6 +163,6 @@
} }
Backbone.history.navigate(options.url, { trigger: options.trigger != undefined ? options.trigger : true }); Backbone.history.navigate(options.url, { trigger: options.trigger != undefined ? options.trigger : true });
} }
} };
return Utils; return Utils;
}); });
\ No newline at end of file
...@@ -79,7 +79,7 @@ define(['require', ...@@ -79,7 +79,7 @@ define(['require',
_.extend(this, _.pick(options, 'globalVent', 'collection', 'vent')); _.extend(this, _.pick(options, 'globalVent', 'collection', 'vent'));
this.entityModel = new VEntity(); this.entityModel = new VEntity();
this.searchCollection = this.collection; this.searchCollection = this.collection;
this.fetchList = 0 this.fetchList = 0;
this.commonTableOptions = { this.commonTableOptions = {
collection: this.searchCollection, collection: this.searchCollection,
includeFilter: false, includeFilter: false,
...@@ -297,11 +297,11 @@ define(['require', ...@@ -297,11 +297,11 @@ define(['require',
var modelObject = model.toJSON(); var modelObject = model.toJSON();
if (modelObject.$typeName$ && modelObject.instanceInfo) { if (modelObject.$typeName$ && modelObject.instanceInfo) {
var guid = model.toJSON().instanceInfo.guid; var guid = model.toJSON().instanceInfo.guid;
++that.fetchList ++that.fetchList;
model.getEntity(guid, { model.getEntity(guid, {
beforeSend: function() {}, beforeSend: function() {},
success: function(data) { success: function(data) {
--that.fetchList --that.fetchList;
that.checkTableFetch(); that.checkTableFetch();
if (data.definition && data.definition.values && data.definition.values.name) { if (data.definition && data.definition.values && data.definition.values.name) {
return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name); return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name);
...@@ -318,11 +318,11 @@ define(['require', ...@@ -318,11 +318,11 @@ define(['require',
return '<a href="#!/dashboard/detailPage/' + guid + '" data-id="' + guid + '"></a>'; return '<a href="#!/dashboard/detailPage/' + guid + '" data-id="' + guid + '"></a>';
} else if (!modelObject.$typeName$) { } else if (!modelObject.$typeName$) {
var guid = model.toJSON().guid; var guid = model.toJSON().guid;
++that.fetchList ++that.fetchList;
model.getEntity(guid, { model.getEntity(guid, {
beforeSend: function() {}, beforeSend: function() {},
success: function(data) { success: function(data) {
--that.fetchList --that.fetchList;
that.checkTableFetch(); that.checkTableFetch();
if (data.definition && data.definition.values && data.definition.values.name) { if (data.definition && data.definition.values && data.definition.values.name) {
return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name); return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name);
......
...@@ -37,10 +37,15 @@ define(['require', ...@@ -37,10 +37,15 @@ define(['require',
RLineageLayoutView: "#r_lineageLayoutView", RLineageLayoutView: "#r_lineageLayoutView",
}, },
/** ui selector cache */ /** ui selector cache */
ui: {}, ui: {
backButton: "[data-id='backButton']"
},
/** ui events hash */ /** ui events hash */
events: function() { events: function() {
var events = {}; var events = {};
events['click ' + this.ui.backButton] = function() {
Backbone.history.history.back();
};
return events; return events;
}, },
/** /**
......
...@@ -39,7 +39,6 @@ define(['require', ...@@ -39,7 +39,6 @@ define(['require',
/** ui selector cache */ /** ui selector cache */
ui: { ui: {
tagClick: '[data-id="tagClick"]', tagClick: '[data-id="tagClick"]',
DetailValue: "[data-id='detailValue']",
addTag: "[data-id='addTag']", addTag: "[data-id='addTag']",
}, },
/** ui events hash */ /** ui events hash */
......
...@@ -81,10 +81,10 @@ define(['require', ...@@ -81,10 +81,10 @@ define(['require',
tagsAndTypeGenerator: function(collection, element, searchString) { tagsAndTypeGenerator: function(collection, element, searchString) {
if (element == "listType") { if (element == "listType") {
var searchType = "dsl"; var searchType = "dsl";
var icon = "fa fa-cogs" var icon = "fa fa-cogs";
} else { } else {
var searchType = "fulltext"; var searchType = "fulltext";
var icon = "fa fa-tags" var icon = "fa fa-tags";
} }
var str = ''; var str = '';
_.each(this[collection].fullCollection.models, function(model) { _.each(this[collection].fullCollection.models, function(model) {
......
...@@ -34,9 +34,10 @@ define(['require', ...@@ -34,9 +34,10 @@ define(['require',
addTagOptions: "[data-id='addTagOptions']", addTagOptions: "[data-id='addTagOptions']",
tagAttribute: "[data-id='tagAttribute']" tagAttribute: "[data-id='tagAttribute']"
}, },
events: { events: function() {
'change #addTagID': 'onChangeTagDefination' var events = {};
events["change " + this.ui.addTagOptions] = 'onChangeTagDefination';
return events;
}, },
/** /**
* intialize a new AddTagModel Layout * intialize a new AddTagModel Layout
...@@ -47,19 +48,20 @@ define(['require', ...@@ -47,19 +48,20 @@ define(['require',
_.extend(this, _.pick(options, 'vent', 'modalCollection', 'guid')); _.extend(this, _.pick(options, 'vent', 'modalCollection', 'guid'));
this.collection = new VTagList(); this.collection = new VTagList();
this.commonCollection = new VCommonList(); this.commonCollection = new VCommonList();
var modal = new Modal({ this.modal = new Modal({
title: 'Add Tag', title: 'Add Tag',
content: this, content: this,
okText: 'Save', okText: 'Save',
cancelText: "Cancel", cancelText: "Cancel",
allowCancel: true, allowCancel: true,
}).open(); }).open();
var saveBtn = this.modal.$el.find('.btn-success');
saveBtn[0].setAttribute('disabled', true);
this.on('ok', function() { this.on('ok', function() {
that.saveTagData(); that.saveTagData();
}); });
this.on('closeModal', function() { this.on('closeModal', function() {
modal.trigger('cancel'); this.modal.trigger('cancel');
}); });
this.bindEvents(); this.bindEvents();
}, },
...@@ -77,14 +79,17 @@ define(['require', ...@@ -77,14 +79,17 @@ define(['require',
}, this); }, this);
}, },
tagsCollection: function() { tagsCollection: function() {
var str = '<option selected="true" style="display:none;"></option>';
for (var i = 0; i < this.collection.fullCollection.models.length; i++) { for (var i = 0; i < this.collection.fullCollection.models.length; i++) {
var tags = this.collection.fullCollection.models[i].get("tags"); var tags = this.collection.fullCollection.models[i].get("tags");
var str = '<option>' + tags + '</option>'; str += '<option>' + tags + '</option>';
this.ui.addTagOptions.append(str); this.ui.addTagOptions.html(str);
} }
}, },
onChangeTagDefination: function() { onChangeTagDefination: function() {
this.ui.tagAttribute.empty(); this.ui.tagAttribute.empty();
var saveBtn = this.modal.$el.find('.btn-success');
saveBtn.prop("disabled", false);
var tagname = this.ui.addTagOptions.val(); var tagname = this.ui.addTagOptions.val();
this.fetchTagSubData(tagname); this.fetchTagSubData(tagname);
}, },
......
...@@ -138,7 +138,6 @@ define(['require', ...@@ -138,7 +138,6 @@ define(['require',
content: that.name + " has been created" content: that.name + " has been created"
}); });
that.collection.reset(); that.collection.reset();
}, },
error: function(model, response) { error: function(model, response) {
if (response.responseJSON && response.responseJSON.error) { if (response.responseJSON && response.responseJSON.error) {
......
...@@ -21,6 +21,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset ...@@ -21,6 +21,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags) ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES: ALL CHANGES:
ATLAS-658 Improve Lineage with Backbone porting (kevalbhatt18 via yhemanth)
ATLAS-491 Business Catalog / Taxonomy (jspeidel via yhemanth) ATLAS-491 Business Catalog / Taxonomy (jspeidel via yhemanth)
ATLAS-713 Entity lineage based on entity id (shwethags) ATLAS-713 Entity lineage based on entity id (shwethags)
ATLAS-736 UI - BUG :: displaying timestamp values for hive_db description (kevalbhatt18 via yhemanth) ATLAS-736 UI - BUG :: displaying timestamp values for hive_db description (kevalbhatt18 via yhemanth)
......
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