|
@@ -37,18 +37,18 @@ define([ "require", "backbone", "hbs!tmpl/graph/LineageLayoutView_tmpl", "collec
|
|
},
|
|
},
|
|
events: function() {
|
|
events: function() {
|
|
var events = {};
|
|
var events = {};
|
|
- return events["click " + this.ui.checkHideProcess] = "onCheckUnwantedEntity", events["click " + this.ui.checkDeletedEntity] = "onCheckUnwantedEntity",
|
|
|
|
- events["change " + this.ui.selectDepth] = "onSelectDepthChange", events["click " + this.ui.filterToggler] = "onClickFilterToggler",
|
|
|
|
- events["click " + this.ui.boxClose] = "toggleBoxPanel", events["click " + this.ui.settingToggler] = "onClickSettingToggler",
|
|
|
|
- events["click " + this.ui.lineageFullscreenToggler] = "onClickLineageFullscreenToggler",
|
|
|
|
- events["click " + this.ui.searchToggler] = "onClickSearchToggler", events["click " + this.ui.saveSvg] = "onClickSaveSvg",
|
|
|
|
- events["click " + this.ui.resetLineage] = "onClickResetLineage", events["click " + this.ui.onZoomIn] = "onClickZoomIn",
|
|
|
|
- events["click " + this.ui.onZoomOut] = "onClickZoomOut", events["change " + this.ui.labelFullName] = "onClickLabelFullName",
|
|
|
|
|
|
+ return events["click " + this.ui.checkHideProcess] = "onCheckUnwantedEntity", events["click " + this.ui.checkDeletedEntity] = "onCheckUnwantedEntity",
|
|
|
|
+ events["change " + this.ui.selectDepth] = "onSelectDepthChange", events["click " + this.ui.filterToggler] = "onClickFilterToggler",
|
|
|
|
+ events["click " + this.ui.boxClose] = "toggleBoxPanel", events["click " + this.ui.settingToggler] = "onClickSettingToggler",
|
|
|
|
+ events["click " + this.ui.lineageFullscreenToggler] = "onClickLineageFullscreenToggler",
|
|
|
|
+ events["click " + this.ui.searchToggler] = "onClickSearchToggler", events["click " + this.ui.saveSvg] = "onClickSaveSvg",
|
|
|
|
+ events["click " + this.ui.resetLineage] = "onClickResetLineage", events["click " + this.ui.onZoomIn] = "onClickZoomIn",
|
|
|
|
+ events["click " + this.ui.onZoomOut] = "onClickZoomOut", events["change " + this.ui.labelFullName] = "onClickLabelFullName",
|
|
events;
|
|
events;
|
|
},
|
|
},
|
|
initialize: function(options) {
|
|
initialize: function(options) {
|
|
- _.extend(this, _.pick(options, "processCheck", "guid", "entity", "entityName", "entityDefCollection", "actionCallBack", "fetchCollection", "attributeDefs")),
|
|
|
|
- this.collection = new VLineageList(), this.typeMap = {}, this.apiGuid = {}, this.edgeCall,
|
|
|
|
|
|
+ _.extend(this, _.pick(options, "processCheck", "guid", "entity", "entityName", "entityDefCollection", "actionCallBack", "fetchCollection", "attributeDefs")),
|
|
|
|
+ this.collection = new VLineageList(), this.typeMap = {}, this.apiGuid = {}, this.edgeCall,
|
|
this.filterObj = {
|
|
this.filterObj = {
|
|
isProcessHideCheck: !1,
|
|
isProcessHideCheck: !1,
|
|
isDeletedEntityHideCheck: !1,
|
|
isDeletedEntityHideCheck: !1,
|
|
@@ -58,8 +58,8 @@ define([ "require", "backbone", "hbs!tmpl/graph/LineageLayoutView_tmpl", "collec
|
|
}, this.labelFullText = !1;
|
|
}, this.labelFullText = !1;
|
|
},
|
|
},
|
|
onRender: function() {
|
|
onRender: function() {
|
|
- this.ui.searchToggler.prop("disabled", !0), this.$graphButtonsEl = this.$(".graph-button-group button, select[data-id='selectDepth']"),
|
|
|
|
- this.fetchGraphData(), this.layoutRendered && this.layoutRendered(), this.processCheck && this.hideCheckForProcess(),
|
|
|
|
|
|
+ this.ui.searchToggler.prop("disabled", !0), this.$graphButtonsEl = this.$(".graph-button-group button, select[data-id='selectDepth']"),
|
|
|
|
+ this.fetchGraphData(), this.layoutRendered && this.layoutRendered(), this.processCheck && this.hideCheckForProcess(),
|
|
this.ui.selectDepth.select2({
|
|
this.ui.selectDepth.select2({
|
|
data: _.sortBy([ 3, 6, 9, 12, 15, 18, 21 ]),
|
|
data: _.sortBy([ 3, 6, 9, 12, 15, 18, 21 ]),
|
|
tags: !0,
|
|
tags: !0,
|
|
@@ -72,7 +72,7 @@ define([ "require", "backbone", "hbs!tmpl/graph/LineageLayoutView_tmpl", "collec
|
|
},
|
|
},
|
|
onClickLineageFullscreenToggler: function(e) {
|
|
onClickLineageFullscreenToggler: function(e) {
|
|
var icon = $(e.currentTarget).find("i"), panel = $(e.target).parents(".tab-pane").first();
|
|
var icon = $(e.currentTarget).find("i"), panel = $(e.target).parents(".tab-pane").first();
|
|
- icon.toggleClass("fa-expand fa-compress"), icon.hasClass("fa-expand") ? icon.parent("button").attr("data-original-title", "Full Screen") : icon.parent("button").attr("data-original-title", "Default View"),
|
|
|
|
|
|
+ icon.toggleClass("fa-expand fa-compress"), icon.hasClass("fa-expand") ? icon.parent("button").attr("data-original-title", "Full Screen") : icon.parent("button").attr("data-original-title", "Default View"),
|
|
panel.toggleClass("fullscreen-mode");
|
|
panel.toggleClass("fullscreen-mode");
|
|
var node = this.$("svg").parent()[0].getBoundingClientRect();
|
|
var node = this.$("svg").parent()[0].getBoundingClientRect();
|
|
this.LineageHelperRef.updateOptions({
|
|
this.LineageHelperRef.updateOptions({
|
|
@@ -81,13 +81,13 @@ define([ "require", "backbone", "hbs!tmpl/graph/LineageLayoutView_tmpl", "collec
|
|
}), this.calculateLineageDetailPanelHeight();
|
|
}), this.calculateLineageDetailPanelHeight();
|
|
},
|
|
},
|
|
onCheckUnwantedEntity: function(e) {
|
|
onCheckUnwantedEntity: function(e) {
|
|
- "checkHideProcess" === $(e.target).data("id") ? this.filterObj.isProcessHideCheck = e.target.checked : this.filterObj.isDeletedEntityHideCheck = e.target.checked,
|
|
|
|
|
|
+ "checkHideProcess" === $(e.target).data("id") ? this.filterObj.isProcessHideCheck = e.target.checked : this.filterObj.isDeletedEntityHideCheck = e.target.checked,
|
|
this.LineageHelperRef.refresh();
|
|
this.LineageHelperRef.refresh();
|
|
},
|
|
},
|
|
toggleBoxPanel: function(options) {
|
|
toggleBoxPanel: function(options) {
|
|
var el = options && options.el;
|
|
var el = options && options.el;
|
|
options && options.nodeDetailToggler, options.currentTarget;
|
|
options && options.nodeDetailToggler, options.currentTarget;
|
|
- this.$el.find(".show-box-panel").removeClass("show-box-panel"), el && el.addClass && el.addClass("show-box-panel"),
|
|
|
|
|
|
+ this.$el.find(".show-box-panel").removeClass("show-box-panel"), el && el.addClass && el.addClass("show-box-panel"),
|
|
this.$("circle.node-detail-highlight").removeClass("node-detail-highlight");
|
|
this.$("circle.node-detail-highlight").removeClass("node-detail-highlight");
|
|
},
|
|
},
|
|
toggleLoader: function(element) {
|
|
toggleLoader: function(element) {
|
|
@@ -159,10 +159,10 @@ define([ "require", "backbone", "hbs!tmpl/graph/LineageLayoutView_tmpl", "collec
|
|
if (!that.isDestroyed) {
|
|
if (!that.isDestroyed) {
|
|
data.legends = !options || options.legends;
|
|
data.legends = !options || options.legends;
|
|
var relationsReverse = data.relations ? data.relations.reverse() : null, lineageMaxRelationCount = 9e3;
|
|
var relationsReverse = data.relations ? data.relations.reverse() : null, lineageMaxRelationCount = 9e3;
|
|
- relationsReverse.length > lineageMaxRelationCount && (data.relations = relationsReverse.splice(relationsReverse.length - lineageMaxRelationCount, relationsReverse.length - 1),
|
|
|
|
|
|
+ relationsReverse.length > lineageMaxRelationCount && (data.relations = relationsReverse.splice(relationsReverse.length - lineageMaxRelationCount, relationsReverse.length - 1),
|
|
Utils.notifyInfo({
|
|
Utils.notifyInfo({
|
|
content: "Lineage exceeds display parameters and hence only upto 9000 relationships from this lineage can be displayed"
|
|
content: "Lineage exceeds display parameters and hence only upto 9000 relationships from this lineage can be displayed"
|
|
- })), that.lineageRelationshipLength = data.relations.length, that.createGraph(data),
|
|
|
|
|
|
+ })), that.lineageRelationshipLength = data.relations.length, that.createGraph(data),
|
|
that.renderLineageTypeSearch(data);
|
|
that.renderLineageTypeSearch(data);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -239,7 +239,7 @@ define([ "require", "backbone", "hbs!tmpl/graph/LineageLayoutView_tmpl", "collec
|
|
});
|
|
});
|
|
},
|
|
},
|
|
noLineage: function() {
|
|
noLineage: function() {
|
|
- this.$(".fontLoader").hide(), this.$(".depth-container").hide(), this.$("svg").html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No lineage data found</text>'),
|
|
|
|
|
|
+ this.$(".fontLoader").hide(), this.$(".depth-container").hide(), this.$("svg").html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No lineage data found</text>'),
|
|
this.actionCallBack && this.actionCallBack();
|
|
this.actionCallBack && this.actionCallBack();
|
|
},
|
|
},
|
|
hideCheckForProcess: function() {
|
|
hideCheckForProcess: function() {
|
|
@@ -253,7 +253,7 @@ define([ "require", "backbone", "hbs!tmpl/graph/LineageLayoutView_tmpl", "collec
|
|
_.isEmpty(data) || _.each(data.guidEntityMap, function(obj, index) {
|
|
_.isEmpty(data) || _.each(data.guidEntityMap, function(obj, index) {
|
|
var nodeData = that.LineageHelperRef.getNode(obj.guid);
|
|
var nodeData = that.LineageHelperRef.getNode(obj.guid);
|
|
(that.filterObj.isProcessHideCheck || that.filterObj.isDeletedEntityHideCheck) && nodeData && (nodeData.isProcess || nodeData.isDeleted) || (typeStr += '<option value="' + obj.guid + '">' + obj.displayText + "</option>");
|
|
(that.filterObj.isProcessHideCheck || that.filterObj.isDeletedEntityHideCheck) && nodeData && (nodeData.isProcess || nodeData.isDeleted) || (typeStr += '<option value="' + obj.guid + '">' + obj.displayText + "</option>");
|
|
- }), that.ui.lineageTypeSearch.html(typeStr), that.initilizelineageTypeSearch(),
|
|
|
|
|
|
+ }), that.ui.lineageTypeSearch.html(typeStr), that.initilizelineageTypeSearch(),
|
|
resolve();
|
|
resolve();
|
|
} catch (e) {
|
|
} catch (e) {
|
|
console.log(e), reject(e);
|
|
console.log(e), reject(e);
|
|
@@ -272,7 +272,7 @@ define([ "require", "backbone", "hbs!tmpl/graph/LineageLayoutView_tmpl", "collec
|
|
guid: selectedNode
|
|
guid: selectedNode
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- }), this.searchNodeObj.selectedNode && (this.ui.lineageTypeSearch.val(this.searchNodeObj.selectedNode),
|
|
|
|
|
|
+ }), this.searchNodeObj.selectedNode && (this.ui.lineageTypeSearch.val(this.searchNodeObj.selectedNode),
|
|
this.ui.lineageTypeSearch.trigger("change.select2"));
|
|
this.ui.lineageTypeSearch.trigger("change.select2"));
|
|
},
|
|
},
|
|
updateRelationshipDetails: function(options) {
|
|
updateRelationshipDetails: function(options) {
|
|
@@ -281,19 +281,19 @@ define([ "require", "backbone", "hbs!tmpl/graph/LineageLayoutView_tmpl", "collec
|
|
var typeName = initialData.typeName || guid, attributeDefs = initialData && initialData.entityDef ? initialData.entityDef.attributeDefs : null;
|
|
var typeName = initialData.typeName || guid, attributeDefs = initialData && initialData.entityDef ? initialData.entityDef.attributeDefs : null;
|
|
this.$("[data-id='typeName']").text(typeName), this.entityModel = new VEntity({});
|
|
this.$("[data-id='typeName']").text(typeName), this.entityModel = new VEntity({});
|
|
var config = {
|
|
var config = {
|
|
- guid: "guid",
|
|
|
|
- typeName: "typeName",
|
|
|
|
- name: "name",
|
|
|
|
- qualifiedName: "qualifiedName",
|
|
|
|
- owner: "owner",
|
|
|
|
- createTime: "createTime",
|
|
|
|
- status: "status",
|
|
|
|
- classificationNames: "classifications",
|
|
|
|
- meanings: "term"
|
|
|
|
|
|
+ guid: "编号",
|
|
|
|
+ typeName: "类型名称",
|
|
|
|
+ name: "名称",
|
|
|
|
+ qualifiedName: "限定名称",
|
|
|
|
+ owner: "所有者",
|
|
|
|
+ createTime: "创建时间",
|
|
|
|
+ status: "状态",
|
|
|
|
+ classificationNames: "分类",
|
|
|
|
+ meanings: "术语"
|
|
}, data = {};
|
|
}, data = {};
|
|
_.each(config, function(valKey, key) {
|
|
_.each(config, function(valKey, key) {
|
|
var val = initialData[key];
|
|
var val = initialData[key];
|
|
- _.isUndefined(val) && initialData.attributes && initialData.attributes[key] && (val = initialData.attributes[key]),
|
|
|
|
|
|
+ _.isUndefined(val) && initialData.attributes && initialData.attributes[key] && (val = initialData.attributes[key]),
|
|
val && (data[valKey] = val);
|
|
val && (data[valKey] = val);
|
|
}), this.ui.nodeDetailTable.html(CommonViewFunction.propertyTable({
|
|
}), this.ui.nodeDetailTable.html(CommonViewFunction.propertyTable({
|
|
scope: this,
|
|
scope: this,
|
|
@@ -305,9 +305,9 @@ define([ "require", "backbone", "hbs!tmpl/graph/LineageLayoutView_tmpl", "collec
|
|
},
|
|
},
|
|
calculateLineageDetailPanelHeight: function() {
|
|
calculateLineageDetailPanelHeight: function() {
|
|
var $parentContainer = $("#tab-lineage .resizeGraph"), $panel = $parentContainer.find(".fix-box"), $parentHeight = $parentContainer.find(".fix-box, tbody").removeAttr("style").height() - 48, $tBody = $panel.find("tbody"), panelHeight = $tBody.height() + 100;
|
|
var $parentContainer = $("#tab-lineage .resizeGraph"), $panel = $parentContainer.find(".fix-box"), $parentHeight = $parentContainer.find(".fix-box, tbody").removeAttr("style").height() - 48, $tBody = $panel.find("tbody"), panelHeight = $tBody.height() + 100;
|
|
- $parentHeight < panelHeight && (panelHeight = $parentHeight), $panel.css("height", panelHeight + "px"),
|
|
|
|
|
|
+ $parentHeight < panelHeight && (panelHeight = $parentHeight), $panel.css("height", panelHeight + "px"),
|
|
$tBody.css("height", "100%");
|
|
$tBody.css("height", "100%");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
return LineageLayoutView;
|
|
return LineageLayoutView;
|
|
-});
|
|
|
|
|
|
+});
|