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