Commit 857561a3 by Hemanth Yamijala

ATLAS-736 UI - BUG :: displaying timestamp values for hive_db description…

ATLAS-736 UI - BUG :: displaying timestamp values for hive_db description (kevalbhatt18 via yhemanth)
parent 9e1f3663
...@@ -66,10 +66,18 @@ ...@@ -66,10 +66,18 @@
padding: 3px 6px; padding: 3px 6px;
margin: 0px 3px 3px 0px; margin: 0px 3px 3px 0px;
cursor: pointer; cursor: pointer;
float: left;
} }
#old .tagList a i.fa {
#old .tagList a i.fa[data-id="delete"] {
margin-left: 5px; margin-left: 5px;
} }
#old .scrollTagList .list-group-item {
word-break: break-all;
}
/* /*
#old .tagList a { #old .tagList a {
max-width: 100px; max-width: 100px;
...@@ -190,7 +198,7 @@ ...@@ -190,7 +198,7 @@
color: #fff !important; color: #fff !important;
float: right; float: right;
} }
.breadcrumb-dropdown .popover.bottom
{ .breadcrumb-dropdown .popover.bottom {
margin-top: 35px; margin-top: 35px;
} }
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
<link rel="stylesheet" href="js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css"> <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/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.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/bootstrap-sidebar.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet">
......
/**
* 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;
});
...@@ -23,7 +23,8 @@ define(['require', ...@@ -23,7 +23,8 @@ define(['require',
'models/VEntity', 'models/VEntity',
'utils/Utils', 'utils/Utils',
'utils/Globals', 'utils/Globals',
], function(require, Backbone, AssetPageLayoutViewTmpl, Modal, VEntity, Utils, Globals) { 'utils/CommonViewFunction'
], function(require, Backbone, AssetPageLayoutViewTmpl, Modal, VEntity, Utils, Globals, CommonViewFunction) {
'use strict'; 'use strict';
var AssetPageLayoutView = Backbone.Marionette.LayoutView.extend( var AssetPageLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -188,13 +189,16 @@ define(['require', ...@@ -188,13 +189,16 @@ define(['require',
columns: columns, columns: columns,
includeOrderAbleColumns: true 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() { getEntityTableColumns: function() {
var that = this, var that = this,
col = {}; col = {};
...@@ -206,8 +210,8 @@ define(['require', ...@@ -206,8 +210,8 @@ define(['require',
} else { } else {
var modelJSON = this.searchCollection.toJSON()[0]; var modelJSON = this.searchCollection.toJSON()[0];
_.keys(modelJSON).map(function(key) { _.keys(modelJSON).map(function(key) {
if (key.indexOf("$") == -1 && typeof modelJSON[key] != "object") { if (key.indexOf("$") == -1 && (typeof modelJSON[key] != "object" || modelJSON[key] === null)) {
if (typeof modelJSON[key] == "string" || typeof modelJSON[key] == "number") { if (typeof modelJSON[key] == "string" || typeof modelJSON[key] == "number" || modelJSON[key] === null) {
if (typeof modelJSON[key] == "number" && key != "createTime") { if (typeof modelJSON[key] == "number" && key != "createTime") {
return; return;
} }
...@@ -218,6 +222,9 @@ define(['require', ...@@ -218,6 +222,9 @@ define(['require',
orderable: true, orderable: true,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, { formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) { fromRaw: function(rawValue, model) {
if (rawValue == null) {
return null;
}
if (model.get('createTime') == rawValue) { if (model.get('createTime') == rawValue) {
return new Date(rawValue); return new Date(rawValue);
} }
...@@ -249,27 +256,11 @@ define(['require', ...@@ -249,27 +256,11 @@ define(['require',
_.keys(model.get('$traits$')).map(function(key) { _.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>'; 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>'; return '<div class="tagList">' + atags + '<a data-id="addTag" data-guid="' + model.get('$id$').id + '"><i class="fa fa-plus"></i></a></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>';
}
} }
}) })
}; };
that.checkTableFetch();
return this.searchCollection.constructor.getTableCols(col, this.searchCollection); return this.searchCollection.constructor.getTableCols(col, this.searchCollection);
} }
} else { } else {
...@@ -311,11 +302,7 @@ define(['require', ...@@ -311,11 +302,7 @@ define(['require',
beforeSend: function() {}, beforeSend: function() {},
success: function(data) { success: function(data) {
--that.fetchList --that.fetchList
if (that.fetchList <= 0) { that.checkTableFetch();
that.$('.fontLoader').hide();
that.$('.entityTable').show();
}
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);
} else { } else {
...@@ -336,10 +323,7 @@ define(['require', ...@@ -336,10 +323,7 @@ define(['require',
beforeSend: function() {}, beforeSend: function() {},
success: function(data) { success: function(data) {
--that.fetchList --that.fetchList
if (that.fetchList <= 0) { that.checkTableFetch();
that.$('.fontLoader').hide();
that.$('.entityTable').show();
}
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);
} else { } else {
...@@ -367,47 +351,28 @@ define(['require', ...@@ -367,47 +351,28 @@ define(['require',
guid: that.$(e.currentTarget).data("guid"), guid: that.$(e.currentTarget).data("guid"),
modalCollection: that.searchCollection modalCollection: that.searchCollection
}); });
// view.saveTagData = function() {
//override saveTagData function
// }
}); });
}, },
onClickTagCross: function(e) { onClickTagCross: function(e) {
var tagName = $(e.target).data("name"); var tagName = $(e.target).data("name"),
var that = this; that = this,
require([ modal = CommonViewFunction.deleteTagModel(tagName);
'modules/Modal' modal.on('ok', function() {
], function(Modal) { that.deleteTagData(e);
var modal = new Modal({ });
title: 'Are you sure you want to delete ?', modal.on('closeModal', function() {
okText: 'Delete', modal.trigger('cancel');
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');
});
}); });
}, },
deleteTagData: function(e) { deleteTagData: function(e) {
var that = this, var that = this,
tagName = $(e.target).data("name"); tagName = $(e.target).data("name"),
var guid = $(e.target).data("guid"); guid = $(e.target).data("guid");
require(['models/VTag'], function(VTag) { require(['utils/CommonViewFunction'], function(CommonViewFunction) {
var tagModel = new VTag(); CommonViewFunction.deleteTag({
tagModel.deleteTag(guid, tagName, { 'tagName': tagName,
beforeSend: function() {}, 'guid': guid,
success: function(data) { 'collection': that.searchCollection
that.searchCollection.fetch({ reset: true });
},
error: function(error, data, status) {},
complete: function() {}
}); });
}); });
} }
......
...@@ -21,7 +21,8 @@ define(['require', ...@@ -21,7 +21,8 @@ define(['require',
'hbs!tmpl/schema/SchemaTableLayoutView_tmpl', 'hbs!tmpl/schema/SchemaTableLayoutView_tmpl',
'collection/VSchemaList', 'collection/VSchemaList',
'utils/Utils', 'utils/Utils',
], function(require, Backbone, SchemaTableLayoutViewTmpl, VSchemaList, Utils) { 'utils/CommonViewFunction'
], function(require, Backbone, SchemaTableLayoutViewTmpl, VSchemaList, Utils, CommonViewFunction) {
'use strict'; 'use strict';
var SchemaTableLayoutView = Backbone.Marionette.LayoutView.extend( var SchemaTableLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -115,7 +116,6 @@ define(['require', ...@@ -115,7 +116,6 @@ define(['require',
}); });
}, },
getSchemaTableColumns: function() { getSchemaTableColumns: function() {
var that = this;
return this.schemaCollection.constructor.getTableCols({ return this.schemaCollection.constructor.getTableCols({
name: { name: {
label: "Name", label: "Name",
...@@ -152,18 +152,7 @@ define(['require', ...@@ -152,18 +152,7 @@ define(['require',
_.keys(model.get('$traits$')).map(function(key) { _.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>'; 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>'; return '<div class="tagList">' + atags + '<a data-id="addTag" data-guid="' + model.get('$id$').id + '"><i class="fa fa-plus"></i></a></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>';
} }
}) })
} }
...@@ -177,47 +166,28 @@ define(['require', ...@@ -177,47 +166,28 @@ define(['require',
guid: that.$(e.currentTarget).data("guid"), guid: that.$(e.currentTarget).data("guid"),
modalCollection: that.schemaCollection modalCollection: that.schemaCollection
}); });
// view.saveTagData = function() {
//override saveTagData function
// }
}); });
}, },
onClickTagCross: function(e) { onClickTagCross: function(e) {
var tagName = $(e.target).data("name"); var tagName = $(e.target).data("name");
var that = this; var that = this;
require([ var modal = CommonViewFunction.deleteTagModel(tagName);
'modules/Modal' modal.on('ok', function() {
], function(Modal) { that.deleteTagData(e);
var modal = new Modal({ });
title: 'Are you sure you want to delete ?', modal.on('closeModal', function() {
okText: 'Delete', modal.trigger('cancel');
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');
});
}); });
}, },
deleteTagData: function(e) { deleteTagData: function(e) {
var that = this, var that = this,
tagName = $(e.target).data("name"); tagName = $(e.target).data("name");
var guid = $(e.target).data("guid"); var guid = $(e.target).data("guid");
require(['models/VTag'], function(VTag) { require(['utils/CommonViewFunction'], function(CommonViewFunction) {
var tagModel = new VTag(); CommonViewFunction.deleteTag({
tagModel.deleteTag(guid, tagName, { 'tagName': tagName,
beforeSend: function() {}, 'guid': guid,
success: function(data) { 'collection': that.schemaCollection
that.schemaCollection.fetch({ reset: true });
},
error: function(error, data, status) {},
complete: function() {}
}); });
}); });
} }
......
...@@ -33,8 +33,9 @@ define(['require', ...@@ -33,8 +33,9 @@ define(['require',
initialize: function(options) { initialize: function(options) {
var url = window.location.href.split("/"); var url = window.location.href.split("/");
this.urlType = url[url.length - 1]; this.urlType = url[url.length - 1];
var urlText = this.urlType.split("?")[0];
/*if we us only old ui then uncomment this condition*/ /*if we us only old ui then uncomment this condition*/
if (this.urlType == "") { if (urlText == "" || urlText == "index.html" || urlText == "assetPage") {
this.urlType = "assetPage"; this.urlType = "assetPage";
} }
}, },
......
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
define(['require', define(['require',
'backbone', 'backbone',
'hbs!tmpl/tag/TagDetailTableLayoutView_tmpl' 'hbs!tmpl/tag/TagDetailTableLayoutView_tmpl',
], function(require, Backbone, TagDetailTableLayoutView_tmpl) { 'utils/CommonViewFunction'
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction) {
'use strict'; 'use strict';
var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend( var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -79,8 +80,7 @@ define(['require', ...@@ -79,8 +80,7 @@ define(['require',
var stringArr = []; var stringArr = [];
tagValue = ""; tagValue = "";
_.each(keyValue.values, function(val, key) { _.each(keyValue.values, function(val, key) {
var attrName = "<span>" + key + " : " + val + "</span>";
var attrName = "<span>" + key + ":" + val + "</span>";
stringArr.push(attrName); stringArr.push(attrName);
}); });
tagValue += stringArr.join(", "); tagValue += stringArr.join(", ");
...@@ -99,47 +99,26 @@ define(['require', ...@@ -99,47 +99,26 @@ define(['require',
guid: that.guid, guid: that.guid,
modalCollection: that.collection modalCollection: that.collection
}); });
// view.saveTagData = function() {
//override saveTagData function
// }
}); });
}, },
deleteTagDataModal: function(e) { deleteTagDataModal: function(e) {
var tagName = $(e.currentTarget).data("name"); var tagName = $(e.currentTarget).data("name"),
var that = this; that = this,
require([ modal = CommonViewFunction.deleteTagModel(tagName);
'modules/Modal' modal.on('ok', function() {
], function(Modal) { that.deleteTagData(e);
var modal = new Modal({ });
title: 'Are you sure you want to delete ?', modal.on('closeModal', function() {
okText: 'Delete', modal.trigger('cancel');
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');
});
}); });
}, },
deleteTagData: function(e) { deleteTagData: function(e) {
var that = this, var that = this,
tagName = $(e.currentTarget).data("name"); tagName = $(e.currentTarget).data("name");
require(['models/VTag'], function(VTag) { CommonViewFunction.deleteTag({
var tagModel = new VTag(); 'tagName': tagName,
tagModel.deleteTag(that.guid, tagName, { 'guid': that.guid,
beforeSend: function() {}, 'collection': that.collection
success: function(data) {
that.collection.fetch({ reset: true });
},
error: function(error, data, status) {},
complete: function() {}
});
}); });
} }
}); });
......
...@@ -132,16 +132,18 @@ define(['require', ...@@ -132,16 +132,18 @@ define(['require',
success: function(data) { success: function(data) {
that.modalCollection.fetch({ reset: true }); that.modalCollection.fetch({ reset: true });
Utils.notifySuccess({ Utils.notifySuccess({
content: "Tag " + tagName + " has been added to entity" content: "Tag " + tagName + " has been added successfully"
}); });
}, },
error: function(error, data, status) { error: function(error, data, status) {
var message = "Tag " + tagName + " could not be added";
if (error && error.responseText) { if (error && error.responseText) {
var data = JSON.parse(error.responseText); var data = JSON.parse(error.responseText);
Utils.notifyError({ message = data.error;
content: data.error
});
} }
Utils.notifyError({
content: message
});
}, },
complete: function() {} complete: function() {}
}); });
......
...@@ -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-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-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-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) ATLAS-733 UI: "undefined" XHR request is made for every entity GET page request. (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