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 @@
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;
}
......@@ -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">
......
/**
* 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',
'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
});
});
}
......
......@@ -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
});
});
}
......
......@@ -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";
}
},
......
......@@ -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
});
}
});
......
......@@ -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() {}
});
......
......@@ -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)
......
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