Commit 74eafd3e by Hemanth Yamijala

ATLAS-817 Asset details page -- generate schema dynamically based on…

ATLAS-817 Asset details page -- generate schema dynamically based on attributeDefinitions (kevalbhatt18 via yhemanth)
parent 353ea964
......@@ -17,7 +17,7 @@
*/
body {
font-family: 'Raleway', sans-serif;
font-family: 'Source Sans Pro', sans-serif;
background-color: #f6f7fb;
color: #686868;
}
......
......@@ -28,7 +28,7 @@ $color_star_dust_approx: #9a9a9a;
$color_mirage_approx: #1c1e2a;
$concrete: #f2f2f2;
//fonts
$font_0: Raleway;
$font_0: Source Sans Pro;
$font_1: sans-serif;
$font_2: FontAwesome;
//fonts
......@@ -123,10 +123,20 @@ hr {
border-top: 1px solid #1c1e2a
}
th {
text-transform: capitalize;
}
ul {
list-style: none;
}
.table {
.table {
width: auto;
}
}
.close {
font-size: 2em;
}
......
......@@ -70,3 +70,11 @@
border: 1px #DDDDDD solid;
}
.select2-container--default .select2-selection--multiple {
background-color: $color_white_lilac_approx !important;
border: 1px #e8e9ee solid !important;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border-color: #8fa5b1 !important;
}
......@@ -74,7 +74,7 @@ ul.tabs li.tab {
letter-spacing: 0.8px;
border-bottom: 1px solid $color_mirage_approx;
a {
font-size: 12px;
font-size: 14px;
font-weight: 600;
color: $white;
display: block;
......
......@@ -81,10 +81,6 @@
border-color: $color_bali_hai_approx;
}
.tagList {
margin-top: 10px;
}
.select2-container {
width: 100% !important;
/*margin:15px 0px;*/
......@@ -108,7 +104,7 @@
padding: 5px 10px;
border: 1px $tag_color solid;
color: $tag_color;
font-size: 12px;
font-size: 14px;
text-transform: uppercase;
border-radius: 4px;
margin-right: 3px;
......@@ -151,12 +147,12 @@
}
.addTagText {
font-size: 12px;
font-size: 14px;
font-weight: 600;
}
.addTagPlus {
font-size: 12px;
font-size: 14px;
font-weight: 600;
}
......@@ -180,12 +176,13 @@
color: $action_gray;
border-radius: 4px;
}
.inputAttribute {
display: inline-block;
padding: 5px 10px;
border: 1px $action_gray solid;
color: $action_gray;
font-size: 12px;
font-size: 14px;
text-transform: uppercase;
border-radius: 4px;
margin-right: 3px;
......@@ -203,3 +200,13 @@
background-color: $action_gray;
}
}
form-control .tagInpput {
margin-bottom: 15px;
margin-top: 15px;
}
// .select2-container--default .select2-selection--multiple {
// background-color: #f6f7fb;
// border: 1px #e8e9ee solid;
// }
......@@ -63,7 +63,7 @@
padding: 6px 12px;
background-color: $color_havelock_blue_approx;
color: $white;
font-size: 12px;
font-size: 14px;
text-transform: uppercase;
//Instead of the line below you could use @include border-radius($radius, $vertical-radius)
border-radius: 4px;
......
......@@ -40,7 +40,7 @@
<link rel="stylesheet" href="js/libs/select2/css/select2.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 href='https://fonts.googleapis.com/css?family=Raleway:400,400italic,600,600italic,700,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro: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">
......
......@@ -37,6 +37,7 @@ define(['require',
if (!this.modelAttrName) {
throw new Error("this.modelAttrName not defined for " + this);
}
this.keyList = resp[this.modelAttrName].dataType.attributeDefinitions;
var arr = [];
resp[this.modelAttrName].rows.forEach(function(d) {
arr.push(d);
......
......@@ -22,7 +22,7 @@ define(['require',
], function(require, Globals, VBaseModel) {
'use strict';
var VCatalog = VBaseModel.extend({
urlRoot: Globals.baseURL + '/api/atlas/v1/taxonomies/taxonomy1',
urlRoot: Globals.baseURL + '/api/atlas/v1/taxonomies',
defaults: {},
......
......@@ -33,9 +33,6 @@ define([
'!/taxonomy/detailCatalog/(*url)': 'detailCatalog',
'!/search/searchResult': 'searchResult',
'!/detailPage/:id': 'detailPage',
'!/detailPage/:id': 'detailPage',
'!/detailPage/:id': 'detailPage',
'!/tag': 'commonAction',
'!/taxonomy': 'commonAction',
'!/search': 'commonAction',
......@@ -120,13 +117,15 @@ define([
} else {
var view = App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView;
if (view.dblClick == false && view.singleClick == false && !Globals.saveApplicationState.tabState.stateChanged) {
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender(url,true);
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender(url, true);
view.dblClick == false;
}/* else if (view.firstManualClick) {
}
/* else if (view.firstManualClick) {
view.firstManualClick = false;
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender(url);
}*/ else if (view.singleClick) {
}*/
else if (view.singleClick) {
view.singleClick = false;
}
App.rSideNav.currentView.selectTab();
......@@ -184,6 +183,7 @@ define([
'tag': tagName
}));
} else {
App.rSideNav.currentView.RTagLayoutView.currentView.manualRender(tagName);
App.rSideNav.currentView.selectTab();
}
......@@ -213,7 +213,7 @@ define([
if (Utils.getUrlState.isTagTab()) {
App.rSideNav.currentView.RTagLayoutView.currentView.manualRender();
} else if (Utils.getUrlState.isTaxonomyTab()) {
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender(undefined,true);
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender(undefined, true);
}
}
App.rNContent.$el.html('');
......
......@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<table class="table table-bordered table-striped">
<table class="table table-quickMenu">
<thead>
<tr>
<th>Key</th>
......
......@@ -19,7 +19,7 @@
</ol>
<header class="clearfix">
<div class="btn-group pull-right">
<a href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="user-dropdown">Hello Micheal <i class="fa fa-user user-circle"></i></a>
<a href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="user-dropdown"><i class="fa fa-user user-circle"></i></a>
<ul class="dropdown-menu">
<!-- <li><a href="#">Edit Profile</a></li>
<li><a href="#">Change Password</a></li> -->
......
......@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<table class="table table-bordered table-striped">
<table class="table table-quickMenu">
<thead>
<tr>
<th>Key</th>
......
......@@ -14,4 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div id="r_tagLayoutView"></div>
......@@ -17,7 +17,7 @@
<div class="row row-margin-bottom">
<div class="col-sm-12">
<div class="form-group">
<input type="text" class="form-control" name="name" data-id="attributeId" placeholder="Attribute name" required="" value={{name}}>
<input type="text" class="form-control row-margin-top" name="name" data-id="attributeId" placeholder="Attribute name" required="" value={{name}}>
</div>
</div>
</div>
......@@ -17,6 +17,7 @@
<div class="page-title clearfix">
<h1><span data-id="title"></span>
<!-- <small>8 Asset</small><button data-id="editButton" class="hide btn btn-default pull-right editbutton" data-id="editText"><i class="fa fa-pencil"></i></button>--></h1>
<p data-id="description"></p>
<div data-id="showAttribute">
</div>
<div class="dropdown addTag-dropdown" data-id="addTagListBtn">
......
......@@ -15,9 +15,12 @@
* limitations under the License.
-->
<div>
<!-- <button class="add-tag btn btn-success pull-right" data-id="addTag" style="margin-bottom:10px">Add Tag</button> -->
<!-- <button class="add-tag btn btn-success pull-right" data-id="addTag" style="margin-bottom:10px">Add Tag</button> -->
</div>
<table class="table table-bordered table-striped">
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<table class="table table-quickMenu">
<thead>
<tr>
<th>Tag</th>
......
......@@ -17,8 +17,11 @@
<form name="tagDefinitionform" class="css-form">
<!-- <h4 style="margin-bottom:30px"></h4> -->
<div class="form-group">
<input class="form-control" data-id="tagName" placeholder="Create tag">
<input class="form-control row-margin-bottom" data-id="tagName" placeholder="Create tag">
</input>
<select class="form-control tagList" data-id="parentTag" multiple></select>
<input class="form-control row-margin-bottom" data-id="description" placeholder="Description">
</input>
<span class="row-margin-bottom">Parent Tag</span>
<select class="form-control tagList" data-id="parentTag" multiple="multiple"></select>
</div>
</form>
......@@ -46,7 +46,13 @@ define(['require', 'utils/Utils', 'modules/Modal'], function(require, Utils, Mod
Utils.notifySuccess({
content: "Tag " + options.tagName + " has been deleted successfully"
});
if (options.callback) {
options.callback();
}
if (options.collection) {
options.collection.fetch({ reset: true });
}
},
error: function(error, data, status) {
var message = "Tag " + options.tagName + " could not be deleted";
......
......@@ -151,7 +151,7 @@ define(['require', 'utils/Globals'], function(require, Globals) {
if (options.mergeBrowserUrl) {
var param = Utils.getUrlState.getQueryParams();
if (param) {
options.urlParams = _.extend(param, options.urlParams);
options.urlParams = $.extend(param, options.urlParams);
}
}
if (options.urlParams) {
......@@ -163,7 +163,7 @@ define(['require', 'utils/Globals'], function(require, Globals) {
options.url += urlParams;
}
if (options.updateTabState) {
_.extend(Globals.saveApplicationState.tabState, options.updateTabState());
$.extend(Globals.saveApplicationState.tabState, options.updateTabState());
}
Backbone.history.navigate(options.url, { trigger: options.trigger != undefined ? options.trigger : true });
}
......
......@@ -90,7 +90,7 @@ define(['require',
globalVent: that.globalVent,
columns: cols,
gridOpts: {
className: "table table-bordered table-hover table-condensed backgrid table-quickMenu",
className: "table table-quickMenu",
},
})));
});
......
......@@ -187,7 +187,8 @@ define(['require',
}
}
}
parentLi = '<div class="tools"><i class="fa fa-refresh fa-spin-custom taxanomyloader"></i><i class="fa fa-ellipsis-h termPopover"></i></div><a href="javascript:void(0)" data-href=' + hrefUrl + '>' + model.get('name') + '</a>';
var name = model.get('name').split('.');
parentLi = '<div class="tools"><i class="fa fa-refresh fa-spin-custom taxanomyloader"></i><i class="fa fa-ellipsis-h termPopover"></i></div><a href="javascript:void(0)" data-href="' + hrefUrl + '">' + name[name.length - 1] + '</a>';
});
if (href) {
that.fetchCollection(href);
......@@ -199,7 +200,8 @@ define(['require',
function createTerm() {
_.each(that.chiledCollection.fullCollection.models, function(model, key) {
chiledLi += '<li class="children"><div class="tools"><i class="fa fa-refresh fa-spin-custom taxanomyloader"></i><i class="fa fa-ellipsis-h termPopover" ></i></div><a href="javascript:void(0)" data-href=/api' + model.get('href').split("/api")[1] + '>' + model.get('name') + '</a></li>';
var name = model.get('name').split('.');
chiledLi += '<li class="children"><div class="tools"><i class="fa fa-refresh fa-spin-custom taxanomyloader"></i><i class="fa fa-ellipsis-h termPopover" ></i></div><a href="javascript:void(0)" data-href="/api' + model.get('href').split("/api")[1] + '">' + name[name.length - 1] + '</a></li>';
});
that.ui.chiledList.html(chiledLi);
}
......
......@@ -76,7 +76,7 @@ define(['require',
}
};
events["click " + this.ui.tagClick] = function(e) {
if (!e.target.nodeName.toLocaleLowerCase() == "i") {
if (e.target.nodeName.toLocaleLowerCase() != "i") {
Utils.setUrl({
url: '#!/tag/tagAttribute/' + e.currentTarget.textContent,
mergeBrowserUrl: false,
......@@ -161,7 +161,6 @@ define(['require',
onRender: function() {
var that = this;
this.ui.editBox.hide();
this.fetchCollection();
this.ui.appendList.on('click', 'div', function(e) {
if (e.target.nodeName == "INPUT") {
return false;
......@@ -197,7 +196,9 @@ define(['require',
CommonViewFunction.deleteTag({
'tagName': tagName,
'guid': that.id,
'collection': that.collection
callback: function() {
that.fetchCollection();
}
});
},
addTagToTerms: function(tagObject) {
......@@ -236,7 +237,9 @@ define(['require',
var view = new AddTagModalView({
vent: that.vent,
guid: that.id,
modalCollection: that.collection
callback: function() {
that.fetchCollection();
}
});
/*view.saveTagData = function() {
override saveTagData function
......
......@@ -89,15 +89,21 @@ define(['require',
this.listenTo(this.schemaCollection, "reset", function(value) {
this.renderTableLayoutView();
$('.schemaTable').show();
this.$('.fontLoader').hide();
}, this);
this.listenTo(this.schemaCollection, "error", function(value) {
$('.schemaTable').hide();
this.$('.fontLoader').hide();
}, this);
},
onRender: function() {
this.schemaCollection.fetch({ reset: true });
this.renderTableLayoutView();
},
fetchCollection: function() {
this.$('.fontLoader').show();
this.schemaCollection.fetch({ reset: true });
},
renderTableLayoutView: function() {
var that = this;
require(['utils/TableLayout'], function(TableLayout) {
......@@ -106,38 +112,55 @@ define(['require',
globalVent: that.globalVent,
columns: cols,
gridOpts: {
className: "table table-bordered table-hover table-condensed backgrid table-quickMenu",
className: "table table-quickMenu",
},
})));
});
},
getSchemaTableColumns: function() {
var that = this;
return this.schemaCollection.constructor.getTableCols({
name: {
label: "Name",
var col = {};
if (this.schemaCollection.keyList) {
_.each(this.schemaCollection.keyList, function(obj, key) {
col[obj.name] = {
cell: "Html",
editable: false,
sortable: false,
orderable: true,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
if (model) {
if (!_.isArray(rawValue) && _.isObject(rawValue)) {
if (rawValue.id) {
return '<div><a href="#!/detailPage/' + rawValue.id + '">' + rawValue.$typeName$ + '</a></div>';
} else {
return rawValue.$typeName$;
}
} else if (_.isArray(rawValue)) {
var links = "";
_.each(rawValue, function(val, key) {
if (val.id) {
links += '<div><a href="#!/detailPage/' + val.id + '">' + val.$typeName$ + '</a></div>';
} else {
links += '<div>' + val.$typeName$ + '</div>';
}
});
return links;
} else if (model.get('$id$') && model.get('$id$').id && model.get('name') == rawValue) {
return '<div><a href="#!/detailPage/' + model.get('$id$').id + '">' + rawValue + '</a></div>';
} else {
return rawValue;
}
} else {
return rawValue;
}
}
})
},
comment: {
label: "Comment",
cell: "html",
editable: false,
sortable: false
},
type: {
label: "DataType",
cell: "html",
editable: false,
sortable: false
},
tag: {
};
});
col['tag'] = {
label: "Tags",
cell: "Html",
editable: false,
......@@ -152,16 +175,20 @@ define(['require',
return '<div class="tagList">' + atags + '<a href="javascript:void(0);" class="inputTag" data-id="addTag" data-guid="' + model.get('$id$').id + '"><i style="right:0" class="fa fa-plus"></i></a></div>';
}
})
};
}
}, this.schemaCollection);
return this.schemaCollection.constructor.getTableCols(col, this.schemaCollection);
},
onClickSchemaTag: function(e) {
var that = this;
require(['views/tag/addTagModalView'], function(AddTagModalView) {
var view = new AddTagModalView({
vent: that.vent,
guid: that.$(e.currentTarget).data("guid"),
modalCollection: that.schemaCollection
callback: function() {
that.fetchCollection();
}
});
// view.saveTagData = function() {
//override saveTagData function
......@@ -186,7 +213,9 @@ define(['require',
CommonViewFunction.deleteTag({
'tagName': tagName,
'guid': guid,
'collection': that.tagCollection
callback: function() {
that.fetchCollection();
}
});
}
});
......
......@@ -51,11 +51,15 @@ define(['require',
},
renderSearchResultLayoutView: function() {
var that = this;
require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) {
var value = {
var value = {};
if (that.value) {
value = {
'query': that.value.query,
'searchType': that.value.searchType
};
}
that.RSearchResultLayoutView.show(new SearchResultLayoutView({
value: value,
tag: that.tag
......
......@@ -36,7 +36,8 @@ define(['require',
ui: {
tagName: "[data-id='tagName']",
parentTag: "[data-id='parentTag']"
parentTag: "[data-id='parentTag']",
description: "[data-id='description']"
},
/** ui events hash */
events: function() {
......@@ -63,12 +64,16 @@ define(['require',
tagCollectionList: function() {
this.ui.parentTag.empty();
var str = '<option selected="true" style="display:none;"></option>';
var str = '';
for (var i = 0; i < this.tagCollection.fullCollection.models.length; i++) {
var tags = this.tagCollection.fullCollection.models[i].get("tags");
str += '<option>' + tags + '</option>';
this.ui.parentTag.html(str);
}
this.ui.parentTag.select2({
placeholder: "Select parent Tag",
allowClear: true
});
},
fetchCollection: function() {
$.extend(this.tagCollection.queryParams, { type: 'TRAIT' });
......
......@@ -44,6 +44,7 @@ define(['require',
addTagListBtn: '[data-id="addTagListBtn"]',
addTagtext: '[data-id="addTagtext"]',
addTagPlus: '[data-id="addTagPlus"]',
description: '[data-id="description"]',
},
/** ui events hash */
events: function() {
......@@ -70,6 +71,10 @@ define(['require',
attributeData = "";
_.each(this.tagCollection.models, function(attr) {
var traitTypes = attr.get("traitTypes");
if (traitTypes[0].typeDescription != null) {
var descriptionValue = traitTypes[0].typeDescription;
that.ui.description.html(descriptionValue);
}
_.each(traitTypes[0].attributeDefinitions, function(value, key) {
attributeData += '<span class="inputAttribute">' + value.name + '</span>';
});
......@@ -79,6 +84,13 @@ define(['require',
that.ui.addTagPlus.show();
}
that.ui.showAttribute.html(attributeData);
}, this);
this.listenTo(this.tagCollection, 'error', function(error, response) {
if (response.responseJSON && response.responseJSON.error) {
Utils.notifyError({
content: response.responseJSON.error
});
}
}, this);
},
......
......@@ -122,7 +122,10 @@ define(['require',
CommonViewFunction.deleteTag({
'tagName': tagName,
'guid': that.guid,
'collection': that.collection
callback: function() {
that.$('.fontLoader').show();
that.collection.fetch({ reset: true });
}
});
}
});
......
......@@ -41,7 +41,7 @@ define(['require',
createTag: "[data-id='createTag']",
tags: "[data-id='tags']",
offLineSearchTag: "[data-id='offlineSearchTag']",
deleteTerm: "[data-id='deleteTerm']",
deleteTerm: "[data-id='deleteTerm']"
},
/** ui events hash */
......@@ -77,7 +77,6 @@ define(['require',
var that = this;
this.listenTo(this.tagCollection, "reset", function() {
this.tagsAndTypeGenerator('tagCollection');
this.createTagAction();
}, this);
this.ui.tagsParent.on('click', 'li.parent-node a', function() {
that.setUrl(this.getAttribute("href"));
......@@ -104,29 +103,45 @@ define(['require',
this.tagCollection.fetch({ reset: true });
},
manualRender: function(tagName) {
this.setValues(tagName);
this.tag = tagName;
if (!this.createTag) {
this.setValues(true);
}
},
setValues: function(tagName) {
setValues: function(manual) {
if (Utils.getUrlState.isTagTab() || Utils.getUrlState.isInitial()) {
if (!this.tag && !tagName) {
if (!this.tag) {
this.selectFirst = false;
this.ui.tagsParent.find('li').first().addClass('active');
Utils.setUrl({
url: this.ui.tagsParent.find('li a').first().attr("href"),
mergeBrowserUrl: false,
trigger: true
trigger: true,
updateTabState: function() {
return { tagUrl: this.url, stateChanged: true };
}
});
} else {
Utils.setUrl({
url: Utils.getUrlState.getQueryUrl().hash,
updateTabState: function() {
return { tagUrl: this.url, stateChanged: true };
}
});
var tag = Utils.getUrlState.getLastValue();
if (tagName) {
tag = tagName;
} else if (this.tag) {
if (this.tag) {
tag = this.tag;
}
this.ui.tagsParent.find('li').removeClass('active');
this.ui.tagsParent.find('li').filter(function() {
var target = this.ui.tagsParent.find('li').filter(function() {
return $(this).text() === tag;
}).addClass('active');
if (this.createTag || !manual) {
$('#sidebar-wrapper').animate({
scrollTop: target.offset().top - 100
}, 500);
}
}
}
},
......@@ -137,7 +152,7 @@ define(['require',
var tagName = model.get("tags");
if (searchString) {
if (tagName.search(new RegExp(searchString, "i")) != -1) {
str = '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-trash-o" data-id="deleteTerm"></i></div><a href="#!/tag/tagAttribute/' + tagName + '">' + tagName + '</a></li>' + str;
str = '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + tagName + '">' + tagName + '</a></li>' + str;
} else {
return;
}
......@@ -148,6 +163,10 @@ define(['require',
});
this.ui.tagsParent.empty().html(str);
this.setValues();
this.createTagAction();
if (this.createTag) {
this.createTag = false;
}
},
......@@ -186,23 +205,23 @@ define(['require',
onCreateButton: function(ref) {
var that = this;
this.name = ref.ui.tagName.val();
if (ref.ui.parentTag.val().length <= 1 && ref.ui.parentTag.val()[0] == "") {
this.description = ref.ui.description.val();
var superTypes = [];
} else {
var superTypes = ref.ui.parentTag.val();
if (ref.ui.parentTag.val() && ref.ui.parentTag.val()) {
superTypes = ref.ui.parentTag.val();
}
this.json.traitTypes[0] = {
attributeDefinitions: this.collection.toJSON(),
typeName: this.name,
typeDescription: null,
typeDescription: this.description,
superTypes: superTypes,
hierarchicalMetaTypeName: "org.apache.atlas.typesystem.types.TraitType"
};
new this.tagCollection.model().set(this.json).save(null, {
success: function(model, response) {
that.createTag = true;
that.fetchCollections();
that.setUrl('#!/tag/tagAttribute/' + ref.ui.tagName.val());
that.setUrl('#!/tag/tagAttribute/' + ref.ui.tagName.val(), true);
Utils.notifySuccess({
content: that.name + " has been created"
});
......@@ -218,7 +237,7 @@ define(['require',
});
},
setUrl: function(url) {
setUrl: function(url, create) {
Utils.setUrl({
url: url,
mergeBrowserUrl: false,
......
......@@ -45,7 +45,7 @@ define(['require',
*/
initialize: function(options) {
var that = this;
_.extend(this, _.pick(options, 'vent', 'modalCollection', 'guid'));
_.extend(this, _.pick(options, 'vent', 'modalCollection', 'guid', 'callback'));
this.collection = new VTagList();
this.commonCollection = new VCommonList();
this.modal = new Modal({
......@@ -79,7 +79,7 @@ define(['require',
}, this);
},
tagsCollection: function() {
var str = '<option selected="true" style="display:none;"></option>';
var str = '<option selected="selected" disabled="disabled">-- Select Tag --</option>';
for (var i = 0; i < this.collection.fullCollection.models.length; i++) {
var tags = this.collection.fullCollection.models[i].get("tags");
str += '<option>' + tags + '</option>';
......@@ -135,18 +135,25 @@ define(['require',
data: JSON.stringify(json),
beforeSend: function() {},
success: function(data) {
that.modalCollection.fetch({ reset: true });
Utils.notifySuccess({
content: "Tag " + tagName + " has been added to entity"
});
if (that.callback) {
that.callback();
}
if (that.modalCollection) {
that.modalCollection.fetch({ reset: true });
}
},
error: function(error, data, status) {
var message = "Tag " + tagName + " could not be added";
if (error && error.responseText) {
var data = JSON.parse(error.responseText);
message = data.error;
}
Utils.notifyError({
content: data.error
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-817 Asset details page -- generate schema dynamically based on attributeDefinitions (kevalbhatt18 via yhemanth)
ATLAS-495 Atlas Ranger Authorization Plugin (nixonrodrigues via shwethags)
ATLAS-805 Quickstart is failing if run after queries to the business taxonomy API (jspeidel via shwethags)
ATLAS-774 Better error handling from login.jsp (nixonrodrigues via shwethags)
......
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