Repository: incubator-atlas Updated Branches: refs/heads/master 9e1f36637 -> 857561a39
ATLAS-736 UI - BUG :: displaying timestamp values for hive_db description (kevalbhatt18 via yhemanth) Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/857561a3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/857561a3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/857561a3 Branch: refs/heads/master Commit: 857561a392543a7ff8a422b3ace413690abadf3d Parents: 9e1f366 Author: Hemanth Yamijala <[email protected]> Authored: Tue May 17 19:10:04 2016 +0530 Committer: Hemanth Yamijala <[email protected]> Committed: Tue May 17 19:10:04 2016 +0530 ---------------------------------------------------------------------- dashboardv2/public/css/override.css | 14 ++- dashboardv2/public/index.html | 1 - .../public/js/utils/CommonViewFunction.js | 66 ++++++++++++ .../js/views/asset/AssetPageLayoutView.js | 101 ++++++------------- .../public/js/views/schema/SchemaLayoutView.js | 58 +++-------- dashboardv2/public/js/views/site/Header.js | 3 +- .../js/views/tag/TagDetailTableLayoutView.js | 53 +++------- .../public/js/views/tag/addTagModalView.js | 10 +- release-log.txt | 1 + 9 files changed, 149 insertions(+), 158 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/857561a3/dashboardv2/public/css/override.css ---------------------------------------------------------------------- diff --git a/dashboardv2/public/css/override.css b/dashboardv2/public/css/override.css index 4c452cc..e3ebb10 100644 --- a/dashboardv2/public/css/override.css +++ b/dashboardv2/public/css/override.css @@ -66,10 +66,18 @@ padding: 3px 6px; margin: 0px 3px 3px 0px; cursor: pointer; + float: left; } -#old .tagList a i.fa { + +#old .tagList a i.fa[data-id="delete"] { margin-left: 5px; } + +#old .scrollTagList .list-group-item { + word-break: break-all; +} + + /* #old .tagList a { max-width: 100px; @@ -190,7 +198,7 @@ color: #fff !important; float: right; } -.breadcrumb-dropdown .popover.bottom -{ + +.breadcrumb-dropdown .popover.bottom { margin-top: 35px; } http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/857561a3/dashboardv2/public/index.html ---------------------------------------------------------------------- diff --git a/dashboardv2/public/index.html b/dashboardv2/public/index.html index c2f15c9..fc7cfd0 100644 --- a/dashboardv2/public/index.html +++ b/dashboardv2/public/index.html @@ -39,7 +39,6 @@ <link rel="stylesheet" href="js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css"> <link rel="stylesheet" href="js/libs/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.css"> - <link href='https://fonts.googleapis.com/css?family=Raleway:400,400italic,600,600italic,700,700italic' rel='stylesheet' type='text/css'> <link href="css/bootstrap-sidebar.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/857561a3/dashboardv2/public/js/utils/CommonViewFunction.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js new file mode 100644 index 0000000..0ad8504 --- /dev/null +++ b/dashboardv2/public/js/utils/CommonViewFunction.js @@ -0,0 +1,66 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +define(['require', 'utils/Utils', 'modules/Modal'], function(require, Utils, Modal) { + 'use strict'; + + var CommonViewFunction = {}; + CommonViewFunction.deleteTagModel = function(tagName) { + var msg = "<b>Tag: - </b>"; + if (tagName) { + msg = "<b>Tag: " + tagName + "</b>"; + } + var modal = new Modal({ + title: 'Are you sure you want to delete ?', + okText: 'Delete', + htmlContent: msg, + cancelText: "Cancel", + allowCancel: true, + okCloses: true, + showFooter: true, + }).open(); + return modal; + }; + CommonViewFunction.deleteTag = function(options) { + require(['models/VTag'], function(VTag) { + var tagModel = new VTag(); + if (options && options.guid && options.tagName) + tagModel.deleteTag(options.guid, options.tagName, { + beforeSend: function() {}, + success: function(data) { + Utils.notifySuccess({ + content: "Tag " + options.tagName + " has been deleted successfully" + }); + options.collection.fetch({ reset: true }); + }, + error: function(error, data, status) { + var message = "Tag " + options.tagName + " could not be deleted"; + if (error && error.responseText) { + var data = JSON.parse(error.responseText); + message = data.error; + } + Utils.notifyError({ + content: message + }); + }, + complete: function() {} + }); + }); + }; + return CommonViewFunction; +}); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/857561a3/dashboardv2/public/js/views/asset/AssetPageLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/asset/AssetPageLayoutView.js b/dashboardv2/public/js/views/asset/AssetPageLayoutView.js index c86fef4..6334790 100644 --- a/dashboardv2/public/js/views/asset/AssetPageLayoutView.js +++ b/dashboardv2/public/js/views/asset/AssetPageLayoutView.js @@ -23,7 +23,8 @@ define(['require', 'models/VEntity', 'utils/Utils', 'utils/Globals', -], function(require, Backbone, AssetPageLayoutViewTmpl, Modal, VEntity, Utils, Globals) { + 'utils/CommonViewFunction' +], function(require, Backbone, AssetPageLayoutViewTmpl, Modal, VEntity, Utils, Globals, CommonViewFunction) { 'use strict'; var AssetPageLayoutView = Backbone.Marionette.LayoutView.extend( @@ -188,13 +189,16 @@ define(['require', columns: columns, includeOrderAbleColumns: true }))); - if (that.fetchList <= 0) { - that.$('.fontLoader').hide(); - that.$('.entityTable').show(); - } + }); }, + checkTableFetch: function() { + if (this.fetchList <= 0) { + this.$('.fontLoader').hide(); + this.$('.entityTable').show(); + } + }, getEntityTableColumns: function() { var that = this, col = {}; @@ -206,8 +210,8 @@ define(['require', } else { var modelJSON = this.searchCollection.toJSON()[0]; _.keys(modelJSON).map(function(key) { - if (key.indexOf("$") == -1 && typeof modelJSON[key] != "object") { - if (typeof modelJSON[key] == "string" || typeof modelJSON[key] == "number") { + if (key.indexOf("$") == -1 && (typeof modelJSON[key] != "object" || modelJSON[key] === null)) { + if (typeof modelJSON[key] == "string" || typeof modelJSON[key] == "number" || modelJSON[key] === null) { if (typeof modelJSON[key] == "number" && key != "createTime") { return; } @@ -218,6 +222,9 @@ define(['require', orderable: true, formatter: _.extend({}, Backgrid.CellFormatter.prototype, { fromRaw: function(rawValue, model) { + if (rawValue == null) { + return null; + } if (model.get('createTime') == rawValue) { return new Date(rawValue); } @@ -249,27 +256,11 @@ define(['require', _.keys(model.get('$traits$')).map(function(key) { atags += '<a data-id="tagClick">' + traits[key].$typeName$ + '<i class="fa fa-times" data-id="delete" data-name="' + traits[key].$typeName$ + '" data-guid="' + model.get('$id$').id + '" ></i></a>'; }); - return '<div class="tagList">' + atags + '</div>'; - } - }) - }; - col['addTag'] = { - label: "Tools", - cell: "Html", - editable: false, - sortable: false, - orderable: true, - formatter: _.extend({}, Backgrid.CellFormatter.prototype, { - fromRaw: function(rawValue, model) { - if (model.get('$id$')) { - return '<a href="javascript:void(0)" data-id="addTag" class="addTagGuid" data-guid="' + model.get('$id$').id + '" ><i class="fa fa-tag"></i></a>'; - } else { - return '<a href="javascript:void(0)" data-id="addTag"><i class="fa fa-tag"></i></a>'; - - } + return '<div class="tagList">' + atags + '<a data-id="addTag" data-guid="' + model.get('$id$').id + '"><i class="fa fa-plus"></i></a></div>'; } }) }; + that.checkTableFetch(); return this.searchCollection.constructor.getTableCols(col, this.searchCollection); } } else { @@ -311,11 +302,7 @@ define(['require', beforeSend: function() {}, success: function(data) { --that.fetchList - if (that.fetchList <= 0) { - that.$('.fontLoader').hide(); - that.$('.entityTable').show(); - - } + that.checkTableFetch(); if (data.definition && data.definition.values && data.definition.values.name) { return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name); } else { @@ -336,10 +323,7 @@ define(['require', beforeSend: function() {}, success: function(data) { --that.fetchList - if (that.fetchList <= 0) { - that.$('.fontLoader').hide(); - that.$('.entityTable').show(); - } + that.checkTableFetch(); if (data.definition && data.definition.values && data.definition.values.name) { return that.$('td a[data-id="' + guid + '"]').html(data.definition.values.name); } else { @@ -367,47 +351,28 @@ define(['require', guid: that.$(e.currentTarget).data("guid"), modalCollection: that.searchCollection }); - // view.saveTagData = function() { - //override saveTagData function - // } }); }, onClickTagCross: function(e) { - var tagName = $(e.target).data("name"); - var that = this; - require([ - 'modules/Modal' - ], function(Modal) { - var modal = new Modal({ - title: 'Are you sure you want to delete ?', - okText: 'Delete', - htmlContent: "<b>Tag: " + tagName + "</b>", - cancelText: "Cancel", - allowCancel: true, - okCloses: true, - showFooter: true, - }).open(); - modal.on('ok', function() { - that.deleteTagData(e); - }); - modal.on('closeModal', function() { - modal.trigger('cancel'); - }); + var tagName = $(e.target).data("name"), + that = this, + modal = CommonViewFunction.deleteTagModel(tagName); + modal.on('ok', function() { + that.deleteTagData(e); + }); + modal.on('closeModal', function() { + modal.trigger('cancel'); }); }, deleteTagData: function(e) { var that = this, - tagName = $(e.target).data("name"); - var guid = $(e.target).data("guid"); - require(['models/VTag'], function(VTag) { - var tagModel = new VTag(); - tagModel.deleteTag(guid, tagName, { - beforeSend: function() {}, - success: function(data) { - that.searchCollection.fetch({ reset: true }); - }, - error: function(error, data, status) {}, - complete: function() {} + tagName = $(e.target).data("name"), + guid = $(e.target).data("guid"); + require(['utils/CommonViewFunction'], function(CommonViewFunction) { + CommonViewFunction.deleteTag({ + 'tagName': tagName, + 'guid': guid, + 'collection': that.searchCollection }); }); } http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/857561a3/dashboardv2/public/js/views/schema/SchemaLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/schema/SchemaLayoutView.js b/dashboardv2/public/js/views/schema/SchemaLayoutView.js index 35487a5..de558a7 100644 --- a/dashboardv2/public/js/views/schema/SchemaLayoutView.js +++ b/dashboardv2/public/js/views/schema/SchemaLayoutView.js @@ -21,7 +21,8 @@ define(['require', 'hbs!tmpl/schema/SchemaTableLayoutView_tmpl', 'collection/VSchemaList', 'utils/Utils', -], function(require, Backbone, SchemaTableLayoutViewTmpl, VSchemaList, Utils) { + 'utils/CommonViewFunction' +], function(require, Backbone, SchemaTableLayoutViewTmpl, VSchemaList, Utils, CommonViewFunction) { 'use strict'; var SchemaTableLayoutView = Backbone.Marionette.LayoutView.extend( @@ -115,7 +116,6 @@ define(['require', }); }, getSchemaTableColumns: function() { - var that = this; return this.schemaCollection.constructor.getTableCols({ name: { label: "Name", @@ -152,18 +152,7 @@ define(['require', _.keys(model.get('$traits$')).map(function(key) { atags += '<a data-id="tagClick">' + traits[key].$typeName$ + '<i class="fa fa-times" data-id="delete" data-name="' + traits[key].$typeName$ + '" data-guid="' + model.get('$id$').id + '" ></i></a>'; }); - return '<div class="tagList">' + atags + '</div>'; - } - }) - }, - addTag: { - label: "Tools", - cell: "Html", - editable: false, - sortable: false, - formatter: _.extend({}, Backgrid.CellFormatter.prototype, { - fromRaw: function(rawValue, model) { - return '<a href="javascript:void(0);" data-id="addTag" data-guid="' + model.get('$id$').id + '"><i class="fa fa-tag"></i></a>'; + return '<div class="tagList">' + atags + '<a data-id="addTag" data-guid="' + model.get('$id$').id + '"><i class="fa fa-plus"></i></a></div>'; } }) } @@ -177,47 +166,28 @@ define(['require', guid: that.$(e.currentTarget).data("guid"), modalCollection: that.schemaCollection }); - // view.saveTagData = function() { - //override saveTagData function - // } }); }, onClickTagCross: function(e) { var tagName = $(e.target).data("name"); var that = this; - require([ - 'modules/Modal' - ], function(Modal) { - var modal = new Modal({ - title: 'Are you sure you want to delete ?', - okText: 'Delete', - htmlContent: "<b>Tag: " + tagName + "</b>", - cancelText: "Cancel", - allowCancel: true, - okCloses: true, - showFooter: true, - }).open(); - modal.on('ok', function() { - that.deleteTagData(e); - }); - modal.on('closeModal', function() { - modal.trigger('cancel'); - }); + var modal = CommonViewFunction.deleteTagModel(tagName); + modal.on('ok', function() { + that.deleteTagData(e); + }); + modal.on('closeModal', function() { + modal.trigger('cancel'); }); }, deleteTagData: function(e) { var that = this, tagName = $(e.target).data("name"); var guid = $(e.target).data("guid"); - require(['models/VTag'], function(VTag) { - var tagModel = new VTag(); - tagModel.deleteTag(guid, tagName, { - beforeSend: function() {}, - success: function(data) { - that.schemaCollection.fetch({ reset: true }); - }, - error: function(error, data, status) {}, - complete: function() {} + require(['utils/CommonViewFunction'], function(CommonViewFunction) { + CommonViewFunction.deleteTag({ + 'tagName': tagName, + 'guid': guid, + 'collection': that.schemaCollection }); }); } http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/857561a3/dashboardv2/public/js/views/site/Header.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/site/Header.js b/dashboardv2/public/js/views/site/Header.js index 500bd91..dffdf79 100644 --- a/dashboardv2/public/js/views/site/Header.js +++ b/dashboardv2/public/js/views/site/Header.js @@ -33,8 +33,9 @@ define(['require', initialize: function(options) { var url = window.location.href.split("/"); this.urlType = url[url.length - 1]; + var urlText = this.urlType.split("?")[0]; /*if we us only old ui then uncomment this condition*/ - if (this.urlType == "") { + if (urlText == "" || urlText == "index.html" || urlText == "assetPage") { this.urlType = "assetPage"; } }, http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/857561a3/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js index c5e1ace..76bf842 100644 --- a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js +++ b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js @@ -18,8 +18,9 @@ define(['require', 'backbone', - 'hbs!tmpl/tag/TagDetailTableLayoutView_tmpl' -], function(require, Backbone, TagDetailTableLayoutView_tmpl) { + 'hbs!tmpl/tag/TagDetailTableLayoutView_tmpl', + 'utils/CommonViewFunction' +], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction) { 'use strict'; var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend( @@ -79,8 +80,7 @@ define(['require', var stringArr = []; tagValue = ""; _.each(keyValue.values, function(val, key) { - - var attrName = "<span>" + key + ":" + val + "</span>"; + var attrName = "<span>" + key + " : " + val + "</span>"; stringArr.push(attrName); }); tagValue += stringArr.join(", "); @@ -99,47 +99,26 @@ define(['require', guid: that.guid, modalCollection: that.collection }); - // view.saveTagData = function() { - //override saveTagData function - // } }); }, deleteTagDataModal: function(e) { - var tagName = $(e.currentTarget).data("name"); - var that = this; - require([ - 'modules/Modal' - ], function(Modal) { - var modal = new Modal({ - title: 'Are you sure you want to delete ?', - okText: 'Delete', - htmlContent: "<b>Tag: " + tagName + "</b>", - cancelText: "Cancel", - allowCancel: true, - okCloses: true, - showFooter: true, - }).open(); - modal.on('ok', function() { - that.deleteTagData(e); - }); - modal.on('closeModal', function() { - modal.trigger('cancel'); - }); + var tagName = $(e.currentTarget).data("name"), + that = this, + modal = CommonViewFunction.deleteTagModel(tagName); + modal.on('ok', function() { + that.deleteTagData(e); + }); + modal.on('closeModal', function() { + modal.trigger('cancel'); }); }, deleteTagData: function(e) { var that = this, tagName = $(e.currentTarget).data("name"); - require(['models/VTag'], function(VTag) { - var tagModel = new VTag(); - tagModel.deleteTag(that.guid, tagName, { - beforeSend: function() {}, - success: function(data) { - that.collection.fetch({ reset: true }); - }, - error: function(error, data, status) {}, - complete: function() {} - }); + CommonViewFunction.deleteTag({ + 'tagName': tagName, + 'guid': that.guid, + 'collection': that.collection }); } }); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/857561a3/dashboardv2/public/js/views/tag/addTagModalView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/tag/addTagModalView.js b/dashboardv2/public/js/views/tag/addTagModalView.js index d663ae2..d7e7c67 100644 --- a/dashboardv2/public/js/views/tag/addTagModalView.js +++ b/dashboardv2/public/js/views/tag/addTagModalView.js @@ -132,16 +132,18 @@ define(['require', success: function(data) { that.modalCollection.fetch({ reset: true }); Utils.notifySuccess({ - content: "Tag " + tagName + " has been added to entity" + content: "Tag " + tagName + " has been added successfully" }); }, error: function(error, data, status) { + var message = "Tag " + tagName + " could not be added"; if (error && error.responseText) { var data = JSON.parse(error.responseText); - Utils.notifyError({ - content: data.error - }); + message = data.error; } + Utils.notifyError({ + content: message + }); }, complete: function() {} }); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/857561a3/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index dcaeecd..b600fff 100644 --- a/release-log.txt +++ b/release-log.txt @@ -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-736 UI - BUG :: displaying timestamp values for hive_db description (kevalbhatt18 via yhemanth) ATLAS-784 Configure config.store.uri for Falcon hook IT (yhemanth) ATLAS-645 FieldMapping.output() results in stack overflow when instances reference each other (dkantor via shwethags) ATLAS-733 UI: "undefined" XHR request is made for every entity GET page request. (kevalbhatt18 via yhemanth)
