Commit bb789550 by Keval Bhatt Committed by Suma Shivaprasad

ATLAS-1071 : Regression - UI - Details Button under Audits Tab is not working.

parent 6078c9ae
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"noty": "^2.3.8", "noty": "^2.3.8",
"requirejs": "^2.1.16", "requirejs": "^2.1.16",
"requirejs-text": "^2.0.12", "requirejs-text": "^2.0.12",
"select2": "^4.0.2", "select2": "^4.0.3",
"underscore": "^1.8.3" "underscore": "^1.8.3"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -198,7 +198,9 @@ define(function(require) { ...@@ -198,7 +198,9 @@ define(function(require) {
if (cb) { if (cb) {
self.on('ok', cb); self.on('ok', cb);
} }
$el.one('shown.bs.modal', function() {
self.trigger('shownModal');
});
return this; return this;
}, },
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
{{#if create}} {{#if create}}
<span class="row-margin-bottom">Select tags to inherit attributes(optional)</span> <span class="row-margin-bottom">Select tags to inherit attributes(optional)</span>
<p class="attributeText">Attributes define additional properties for the tag</p> <p class="attributeText">Attributes define additional properties for the tag</p>
<select class="form-control tagList" data-id="parentTag" multiple="multiple"></select> <select class="form-control" data-id="parentTagList" multiple="multiple"></select>
{{/if}} {{/if}}
</div> </div>
</form> </form>
...@@ -223,9 +223,10 @@ define(['require', ...@@ -223,9 +223,10 @@ define(['require',
'modules/Modal', 'modules/Modal',
'views/audit/CreateAuditTableLayoutView', 'views/audit/CreateAuditTableLayoutView',
], function(Modal, CreateAuditTableLayoutView) { ], function(Modal, CreateAuditTableLayoutView) {
var collectionModel = that.entityCollection.findWhere({ 'eventKey': $(e.currentTarget).data('modalid') }); var eventModel = that.entityCollection.findWhere({ 'eventKey': $(e.currentTarget).data('modalid') }).toJSON(),
collectionModel = new that.entityCollection.model(eventModel),
view = new CreateAuditTableLayoutView({ guid: that.guid, entityModel: collectionModel, action: that.action });
that.action = $(e.target).data("action"); that.action = $(e.target).data("action");
var view = new CreateAuditTableLayoutView({ guid: that.guid, model: collectionModel, action: that.action });
var modal = new Modal({ var modal = new Modal({
title: that.action, title: that.action,
content: view, content: view,
......
...@@ -53,7 +53,7 @@ define(['require', ...@@ -53,7 +53,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'guid', 'model', 'action')); _.extend(this, _.pick(options, 'globalVent', 'guid', 'entityModel', 'action'));
}, },
bindEvents: function() {}, bindEvents: function() {},
onRender: function() { onRender: function() {
...@@ -62,8 +62,8 @@ define(['require', ...@@ -62,8 +62,8 @@ define(['require',
auditTableGenerate: function() { auditTableGenerate: function() {
var that = this, var that = this,
table = ""; table = "";
if (this.model.get('details').search('{') >= 0) { if (this.entityModel.get('details').search('{') >= 0) {
var appendedString = "{" + this.model.get('details') + "}"; var appendedString = "{" + this.entityModel.get('details') + "}";
var auditData = appendedString.split('"')[0].split(':')[0].split("{")[1]; var auditData = appendedString.split('"')[0].split(':')[0].split("{")[1];
var detailsObject = JSON.parse(appendedString.replace("{" + auditData + ":", '{"' + auditData + '":'))[auditData]; var detailsObject = JSON.parse(appendedString.replace("{" + auditData + ":", '{"' + auditData + '":'))[auditData];
//Append string for JSON parse //Append string for JSON parse
...@@ -84,7 +84,7 @@ define(['require', ...@@ -84,7 +84,7 @@ define(['require',
} }
} }
} else if (this.action == Globals.auditAction.TAG_DELETE) { } else if (this.action == Globals.auditAction.TAG_DELETE) {
var appendedString = this.model.get('details').split(':'); var appendedString = this.entityModel.get('details').split(':');
this.ui.auditHeaderValue.html('<th>Tag</th>'); this.ui.auditHeaderValue.html('<th>Tag</th>');
this.ui.auditValue.html("<tr><td>" + appendedString[1] + "</td></tr>"); this.ui.auditValue.html("<tr><td>" + appendedString[1] + "</td></tr>");
} }
......
...@@ -42,7 +42,7 @@ define(['require', ...@@ -42,7 +42,7 @@ define(['require',
/** ui selector cache */ /** ui selector cache */
ui: { ui: {
tagName: "[data-id='tagName']", tagName: "[data-id='tagName']",
parentTag: "[data-id='parentTag']", parentTag: "[data-id='parentTagList']",
description: "[data-id='description']", description: "[data-id='description']",
title: "[data-id='title']" title: "[data-id='title']"
}, },
...@@ -74,17 +74,13 @@ define(['require', ...@@ -74,17 +74,13 @@ define(['require',
} }
}, },
tagCollectionList: function() { tagCollectionList: function() {
var str = '',
that = this;
this.ui.parentTag.empty(); this.ui.parentTag.empty();
var str = ''; this.tagCollection.each(function(val) {
for (var i = 0; i < this.tagCollection.fullCollection.models.length; i++) { str += '<option>' + val.get("tags") + '</option>';
var tags = this.tagCollection.fullCollection.models[i].get("tags");
str += '<option>' + tags + '</option>';
this.ui.parentTag.html(str);
}
this.ui.parentTag.select2({
placeholder: "Search Tags",
allowClear: true
}); });
that.ui.parentTag.html(str);
} }
}); });
return CreateTagLayoutView; return CreateTagLayoutView;
......
...@@ -202,6 +202,13 @@ define(['require', ...@@ -202,6 +202,13 @@ define(['require',
modal.$el.find('button.ok').attr("disabled", "true"); modal.$el.find('button.ok').attr("disabled", "true");
} }
}); });
modal.on('shownModal', function() {
view.ui.parentTag.select2({
multiple: true,
placeholder: "Search Tags",
allowClear: true
});
})
modal.on('ok', function() { modal.on('ok', function() {
that.onCreateButton(view); that.onCreateButton(view);
}); });
......
...@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES: ...@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
ALL CHANGES: ALL CHANGES:
ATLAS-1071 Regression - UI - Details Button under Audits Tab is not working.(kevalbhatt18 via sumasai)
ATLAS-965 Old lineage still exists after dropping tables and re-creating tables with same name. (shwethags via sumasai) ATLAS-965 Old lineage still exists after dropping tables and re-creating tables with same name. (shwethags via sumasai)
ATLAS-1048 TestMetadata.py test in distro project fails on Windows (jnhagelb via shwethags) ATLAS-1048 TestMetadata.py test in distro project fails on Windows (jnhagelb via shwethags)
ATLAS-1026 StoreBackedTypeCache issues (dkantor via shwethags) ATLAS-1026 StoreBackedTypeCache issues (dkantor 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