[1/2] atlas git commit: ATLAS-2951: UI : Show entity specific icon for the lineage node
Repository: atlas Updated Branches: refs/heads/branch-1.0 07f026ee3 -> 44b2bfc66 http://git-wip-us.apache.org/repos/asf/atlas/blob/44b2bfc6/dashboardv2/public/js/views/graph/LineageLayoutView.js -- diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js b/dashboardv2/public/js/views/graph/LineageLayoutView.js index 4e81143..1edffbc 100644 --- a/dashboardv2/public/js/views/graph/LineageLayoutView.js +++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js @@ -26,8 +26,9 @@ define(['require', 'd3-tip', 'utils/Enums', 'utils/UrlLinks', +'utils/Globals', 'platform' -], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, Utils, dagreD3, d3Tip, Enums, UrlLinks, platform) { +], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, Utils, dagreD3, d3Tip, Enums, UrlLinks, Globals, platform) { 'use strict'; var LineageLayoutView = Backbone.Marionette.LayoutView.extend( @@ -44,14 +45,19 @@ define(['require', ui: { graph: ".graph", checkHideProcess: "[data-id='checkHideProcess']", -selectDepth: 'select[data-id="selectDepth"]' +checkDeletedEntity: "[data-id='checkDeletedEntity']", +selectDepth: 'select[data-id="selectDepth"]', +fltrTogler: '[data-id="fltr-togler"]', +lineageFilterPanel: '.lineage-fltr-panel' }, /** ui events hash */ events: function() { var events = {}; -events["click " + this.ui.checkHideProcess] = 'onCheckHideProcess'; +events["click " + this.ui.checkHideProcess] = 'onCheckUnwantedEntity'; +events["click " + this.ui.checkDeletedEntity] = 'onCheckUnwantedEntity'; events['change ' + this.ui.selectDepth] = 'onSelectDepthChange'; +events["click " + this.ui.fltrTogler] = 'onClickFiltrTogler'; return events; }, @@ -69,6 +75,7 @@ define(['require', this.edgeCall; this.filterObj = { isProcessHideCheck: false, +isDeletedEntityHideCheck: false, depthCount: '' }; }, @@ -114,13 +121,21 @@ define(['require', onShow: function() { this.$('.fontLoader').show(); }, -onCheckHideProcess: function(e) { +onCheckUnwantedEntity: function(e) { var data = $.extend(true, {}, this.lineageData); this.fromToObj = {}; this.initializeGraph(); -this.filterObj.isProcessHideCheck = e.target.checked; +if ($(e.target).data("id") === "checkHideProcess") { +this.filterObj.isProcessHideCheck = e.target.checked; +} else { +this.filterObj.isDeletedEntityHideCheck = e.target.checked; +} this.generateData(data.relations, data.guidEntityMap); }, +onClickFiltrTogler: function() { +var lineageFilterPanel = this.ui.lineageFilterPanel; +$(lineageFilterPanel).toggleClass("show-filter-panel"); +}, onSelectDepthChange: function(e, options) { this.initializeGraph(); @@ -132,6 +147,8 @@ define(['require', var that = this, queryParam = options && options.queryParam || {}; this.fromToObj = {}; +this.$('.fontLoader').show(); +this.$('svg>g').hide(); this.collection.getLineage(this.guid, { skipDefaultError: true, queryParam: queryParam, @@ -147,6 +164,10 @@ define(['require', cust_error: function(model, response) { that.lineageData = []; that.noLineage(); +}, +complete: function() { +that.$('.fontLoader').hide(); +that.$('svg>g').show(); } }) }, @@ -170,6 +191,29 @@ define(['require', return _.contains(Utils.getNestedSuperTypes({ data: entityDef.toJSON(), collection: that.entityDefCollection }), "Process") } +function isDeleted(status) { +return Enums.entityStateReadOnly[status]; +} + +function isNodeToBeUpdated(node) { +if (that.filterObj.isProcessHideCheck) { +return isProcess(node.typeName); +} else if (that.filterObj.isDeletedEntityHideCheck) { +return isDeleted(node.status); +
[1/2] atlas git commit: ATLAS-2951: UI : Show entity specific icon for the lineage node
Repository: atlas Updated Branches: refs/heads/master b919d3d09 -> a5e5cec61 http://git-wip-us.apache.org/repos/asf/atlas/blob/a5e5cec6/dashboardv2/public/js/views/graph/LineageLayoutView.js -- diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js b/dashboardv2/public/js/views/graph/LineageLayoutView.js index 4e81143..1edffbc 100644 --- a/dashboardv2/public/js/views/graph/LineageLayoutView.js +++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js @@ -26,8 +26,9 @@ define(['require', 'd3-tip', 'utils/Enums', 'utils/UrlLinks', +'utils/Globals', 'platform' -], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, Utils, dagreD3, d3Tip, Enums, UrlLinks, platform) { +], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, Utils, dagreD3, d3Tip, Enums, UrlLinks, Globals, platform) { 'use strict'; var LineageLayoutView = Backbone.Marionette.LayoutView.extend( @@ -44,14 +45,19 @@ define(['require', ui: { graph: ".graph", checkHideProcess: "[data-id='checkHideProcess']", -selectDepth: 'select[data-id="selectDepth"]' +checkDeletedEntity: "[data-id='checkDeletedEntity']", +selectDepth: 'select[data-id="selectDepth"]', +fltrTogler: '[data-id="fltr-togler"]', +lineageFilterPanel: '.lineage-fltr-panel' }, /** ui events hash */ events: function() { var events = {}; -events["click " + this.ui.checkHideProcess] = 'onCheckHideProcess'; +events["click " + this.ui.checkHideProcess] = 'onCheckUnwantedEntity'; +events["click " + this.ui.checkDeletedEntity] = 'onCheckUnwantedEntity'; events['change ' + this.ui.selectDepth] = 'onSelectDepthChange'; +events["click " + this.ui.fltrTogler] = 'onClickFiltrTogler'; return events; }, @@ -69,6 +75,7 @@ define(['require', this.edgeCall; this.filterObj = { isProcessHideCheck: false, +isDeletedEntityHideCheck: false, depthCount: '' }; }, @@ -114,13 +121,21 @@ define(['require', onShow: function() { this.$('.fontLoader').show(); }, -onCheckHideProcess: function(e) { +onCheckUnwantedEntity: function(e) { var data = $.extend(true, {}, this.lineageData); this.fromToObj = {}; this.initializeGraph(); -this.filterObj.isProcessHideCheck = e.target.checked; +if ($(e.target).data("id") === "checkHideProcess") { +this.filterObj.isProcessHideCheck = e.target.checked; +} else { +this.filterObj.isDeletedEntityHideCheck = e.target.checked; +} this.generateData(data.relations, data.guidEntityMap); }, +onClickFiltrTogler: function() { +var lineageFilterPanel = this.ui.lineageFilterPanel; +$(lineageFilterPanel).toggleClass("show-filter-panel"); +}, onSelectDepthChange: function(e, options) { this.initializeGraph(); @@ -132,6 +147,8 @@ define(['require', var that = this, queryParam = options && options.queryParam || {}; this.fromToObj = {}; +this.$('.fontLoader').show(); +this.$('svg>g').hide(); this.collection.getLineage(this.guid, { skipDefaultError: true, queryParam: queryParam, @@ -147,6 +164,10 @@ define(['require', cust_error: function(model, response) { that.lineageData = []; that.noLineage(); +}, +complete: function() { +that.$('.fontLoader').hide(); +that.$('svg>g').show(); } }) }, @@ -170,6 +191,29 @@ define(['require', return _.contains(Utils.getNestedSuperTypes({ data: entityDef.toJSON(), collection: that.entityDefCollection }), "Process") } +function isDeleted(status) { +return Enums.entityStateReadOnly[status]; +} + +function isNodeToBeUpdated(node) { +if (that.filterObj.isProcessHideCheck) { +return isProcess(node.typeName); +} else if (that.filterObj.isDeletedEntityHideCheck) { +return isDeleted(node.status); +