Commit 6d51ddec by kevalbhatt Committed by Madhan Neethiraj

ATLAS-2600: Glossary UI update for add/update/remove of classifications to terms

parent 2237a895
...@@ -372,6 +372,21 @@ div.columnmanager-dropdown-container { ...@@ -372,6 +372,21 @@ div.columnmanager-dropdown-container {
} }
.stack-modal[aria-role="alertdialog"] { .stack-modal[aria-role="alertdialog"] {
&.width-600 {
width: 600px !important;
left: calc(50% - 250px) !important;
margin-left: 0 !important;
}
&.width-500 {
width: 500px !important;
left: calc(50% - 216px) !important;
margin-left: 0 !important;
}
&.width-400 {
width: 400px !important;
left: calc(50% - 183px);
margin-left: 0 !important;
}
.alert.ui-pnotify-container { .alert.ui-pnotify-container {
color: $color_ironside_gray_approx; color: $color_ironside_gray_approx;
background-color: $white; background-color: $white;
...@@ -430,6 +445,7 @@ div.columnmanager-dropdown-container { ...@@ -430,6 +445,7 @@ div.columnmanager-dropdown-container {
.fa-color { .fa-color {
color: $color_keppel_approx color: $color_keppel_approx
} }
.w30{
.w30 {
width: 30% !important; width: 30% !important;
} }
\ No newline at end of file
...@@ -47,7 +47,11 @@ define([ ...@@ -47,7 +47,11 @@ define([
this.bindCommonEvents(); this.bindCommonEvents();
this.listenTo(this, 'route', this.postRouteExecute, this); this.listenTo(this, 'route', this.postRouteExecute, this);
this.searchVent = new Backbone.Wreqr.EventAggregator(); this.searchVent = new Backbone.Wreqr.EventAggregator();
this.glossaryCollection = new VGlossaryList([], {}); this.glossaryCollection = new VGlossaryList([], {
comparator: function(item) {
return item.get("displayName");
}
});
this.preFetchedCollectionLists = { this.preFetchedCollectionLists = {
'entityDefCollection': this.entityDefCollection, 'entityDefCollection': this.entityDefCollection,
'typeHeaders': this.typeHeaders, 'typeHeaders': this.typeHeaders,
...@@ -221,7 +225,7 @@ define([ ...@@ -221,7 +225,7 @@ define([
if (Utils.getUrlState.isTagTab()) { if (Utils.getUrlState.isTagTab()) {
App.rSideNav.currentView.RTagLayoutView.currentView.manualRender(); App.rSideNav.currentView.RTagLayoutView.currentView.manualRender();
} else if (Utils.getUrlState.isGlossaryTab()) { } else if (Utils.getUrlState.isGlossaryTab()) {
App.rSideNav.currentView.RGlossaryLayoutView.currentView.manualRender(_.extend({}, paramObj)); App.rSideNav.currentView.RGlossaryLayoutView.currentView.manualRender(_.extend({ isTrigger: true }, paramObj));
} }
} }
...@@ -263,7 +267,7 @@ define([ ...@@ -263,7 +267,7 @@ define([
} }
App.rSideNav.currentView.selectTab(); App.rSideNav.currentView.selectTab();
if (paramObj) { if (paramObj) {
isinitialView = (paramObj.type || (paramObj.dslChecked == "true" ? "" : paramObj.tag) || (paramObj.query ? paramObj.query.trim() : "")).length === 0; isinitialView = (paramObj.type || (paramObj.dslChecked == "true" ? "" : (paramObj.tag || paramObj.term)) || (paramObj.query ? paramObj.query.trim() : "")).length === 0;
} }
App.rNContent.show(new SearchDetailLayoutView( App.rNContent.show(new SearchDetailLayoutView(
_.extend({ _.extend({
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</button> </button>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group termBox">
<span class="control-label-sm-pr pull-left">Term:</span> <span class="control-label-sm-pr pull-left">Term:</span>
<div class="pull-left" data-id="termList"> <div class="pull-left" data-id="termList">
<button class="btn btn-action btn-sm" title="Add Term" data-id="addTerm"> <button class="btn btn-action btn-sm" title="Add Term" data-id="addTerm">
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2 {{#if create}}required{{/if}}" for="name">Name</label> <label class="control-label col-sm-2 {{#if create}}required{{/if}}" for="name">Name</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input class="form-control" name="displayName" value="{{displayName}}" data-id="displayName" placeholder="Display Name(required)" autofocus/> <input class="form-control" name="displayName" value="{{displayName}}" data-id="displayName" placeholder="Name(required)" autofocus/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -35,6 +35,14 @@ ...@@ -35,6 +35,14 @@
</div> </div>
{{#if isTermView}} {{#if isTermView}}
<div class="form-group clearfix"> <div class="form-group clearfix">
<span class="control-label-sm-pr pull-left">Classifications:</span>
<div class="pull-left" data-id="tagList">
<button class="btn btn-action btn-sm" title="Add Classification" data-id="addTag">
<i class="fa fa-plus"> </i>
</button>
</div>
</div>
<div class="form-group clearfix">
<span class="control-label-sm-pr pull-left">Categories:</span> <span class="control-label-sm-pr pull-left">Categories:</span>
<div class="pull-left" data-id="categoryList"> <div class="pull-left" data-id="categoryList">
<button class="btn btn-action btn-sm" title="Add Category" data-id="addCategory"> <button class="btn btn-action btn-sm" title="Add Category" data-id="addCategory">
...@@ -51,17 +59,35 @@ ...@@ -51,17 +59,35 @@
</button> </button>
</div> </div>
</div> </div>
{{/if}} {{#if isTermView}}
<div class="row">
<div class="col-sm-12 default-tab">
<ul class="nav nav-tabs" data-id="tab-list">
<li role="entities" class="tab active"><a href="#tab-entities" aria-controls="tab-entities" role="tab" data-toggle="tab">Entities</a></li>
<li role="classification"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Classifications</a></li>
</ul>
</div>
</div>
{{/if}} {{/if}}
</div> </div>
</div> </div>
<div class="container-fluid gray-bg"> <div class="container-fluid gray-bg">
<div class="row"> {{#if isTermView}}
<div class="col-sm-custom"> <div class="tab-content">
<div id="tab-entities" role="entities" class="tab-pane active animated fadeIn">
<div id="r_searchResultLayoutView"> <div id="r_searchResultLayoutView">
<div class="fontLoader" style="display: block;min-height: 50px;position:relative;margin-top: 25px;"> <div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-tagTable" role="classification" class="tab-pane animated fadeIn">
<div id="r_tagTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{{/if}}
</div> </div>
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
--> -->
<div class="col-sm-12 add-seperator"> <div class="col-sm-12 {{#unless isAssignView}}add-seperator{{/unless}}">
<div class="row"> <div class="row">
{{#unless isAssignView}} {{#unless isAssignView}}
<div class="col-sm-8 no-padding" style="margin-top: 5px;"> <div class="col-sm-8 no-padding" style="margin-top: 5px;">
......
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
<div class="srchType clearfix"> <div class="srchType clearfix">
<span class="srchTitle">Search By Type</span> <span class="srchTitle">Search By Type</span>
<div class=""> <div class="">
<div class="col-sm-10 no-padding temFilter"> <div class="col-sm-10 no-padding typeFilter">
<select data-id="typeLOV"></select> <select data-id="typeLOV"></select>
</div> </div>
<div class="col-sm-2 no-padding temFilterBtn"> <div class="col-sm-2 no-padding typeFilterBtn">
<button type="button" class="btn btn-action btn-md pull-right typeLOV active" title="Entity Attribute Filter" data-id="typeAttrFilter"><i class="fa fa-filter"></i></button> <button type="button" class="btn btn-action btn-md pull-right typeLOV active" title="Entity Attribute Filter" data-id="typeAttrFilter"><i class="fa fa-filter"></i></button>
</div> </div>
</div> </div>
...@@ -55,6 +55,14 @@ ...@@ -55,6 +55,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="srchType termBox clearfix">
<span class="srchTitle">Search By Term</span>
<div class="">
<div class="col-sm-12 no-padding">
<select data-id="termLOV"></select>
</div>
</div>
</div>
<div class="srchType"> <div class="srchType">
<span class="srchTitle searchText">Search By Text</span> <span class="srchTitle searchText">Search By Text</span>
<input type="text" class="form-control" data-id="searchInput" placeholder="Search by text" style="margin: 5px 0px;"> <input type="text" class="form-control" data-id="searchInput" placeholder="Search by text" style="margin: 5px 0px;">
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
--> -->
<div class=""> <div class="position-relative">
<div class="tableOverlay"></div> <div class="tableOverlay"></div>
<!-- Not for table Loader its only for initial loading --> <!-- Not for table Loader its only for initial loading -->
<div class="fontLoader" style="z-index:999"> <div class="fontLoader" style="z-index:999">
...@@ -32,21 +32,18 @@ ...@@ -32,21 +32,18 @@
<div class="inline" data-id="colManager"></div> <div class="inline" data-id="colManager"></div>
<div class="inline" data-id="containerCheckBox" style="display: none;"> <div class="inline" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="historicalentities"> <label class="checkbox-inline btn" for="historicalentities">
<input type="checkbox" data-id="checkDeletedEntity" data-value="includeDE" <input type="checkbox" data-id="checkDeletedEntity" data-value="includeDE" id="historicalentities" />
id="historicalentities"/>
<b>Show historical entities</b></label> <b>Show historical entities</b></label>
</div> </div>
{{#ifCond fromView '!==' "glossary"}}
<div class="inline" data-id="containerCheckBox" style="display: none;"> <div class="inline" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="subclassifications"> <label class="checkbox-inline btn" for="subclassifications">
<input type="checkbox" data-id="checkSubClassification" data-value="excludeSC" id="subclassifications"/> <input type="checkbox" data-id="checkSubClassification" data-value="excludeSC" id="subclassifications" />
<b>Exclude sub-classifications</b></label> <b>Exclude sub-classifications</b></label>
</div> </div>
{{/ifCond}}
{{#ifCond fromView '!==' "classification"}} {{#ifCond fromView '!==' "classification"}}
<div class="inline" data-id="containerCheckBox" style="display: none;"> <div class="inline" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="subtypes"> <label class="checkbox-inline btn" for="subtypes">
<input type="checkbox" data-id="checkSubType" data-value="excludeST" id="subtypes"/> <input type="checkbox" data-id="checkSubType" data-value="excludeST" id="subtypes" />
<b>Exclude sub-types</b></label> <b>Exclude sub-types</b></label>
</div> </div>
{{/ifCond}} {{/ifCond}}
......
...@@ -66,7 +66,7 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq ...@@ -66,7 +66,7 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
var getPopoverEl = function(e) { var getPopoverEl = function(e) {
return $(e.target).parent().data("bs.popover") || $(e.target).data("bs.popover") || $(e.target).parents('.popover').length; return $(e.target).parent().data("bs.popover") || $(e.target).data("bs.popover") || $(e.target).parents('.popover').length;
} }
$('body').on('click DOMMouseScroll mousewheel', function(e) { $(document).on('click DOMMouseScroll mousewheel', function(e) {
if (e.originalEvent) { if (e.originalEvent) {
// Do action if it is triggered by a human. // Do action if it is triggered by a human.
//e.isImmediatePropagationStopped(); //e.isImmediatePropagationStopped();
......
...@@ -124,7 +124,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -124,7 +124,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
var modal = {}; var modal = {};
if (options && options.modal) { if (options && options.modal) {
var myStack = { "dir1": "down", "dir2": "right", "push": "top", 'modal': true }; var myStack = { "dir1": "down", "dir2": "right", "push": "top", 'modal': true };
modal['addclass'] = 'stack-modal'; modal['addclass'] = 'stack-modal ' + (options.modalClass ? modalClass : 'width-500');
modal['stack'] = myStack; modal['stack'] = myStack;
} }
notify(_.extend({ notify(_.extend({
...@@ -133,7 +133,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -133,7 +133,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
confirm: { confirm: {
confirm: true, confirm: true,
buttons: [{ buttons: [{
text: 'cancel', text: options.cancelText || 'Cancel',
addClass: 'btn-action btn-md', addClass: 'btn-action btn-md',
click: function(notice) { click: function(notice) {
options.cancel(notice); options.cancel(notice);
...@@ -141,7 +141,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -141,7 +141,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
} }
}, },
{ {
text: 'Ok', text: options.okText || 'Ok',
addClass: 'btn-atlas btn-md', addClass: 'btn-atlas btn-md',
click: function(notice) { click: function(notice) {
options.ok(notice); options.ok(notice);
...@@ -439,19 +439,19 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -439,19 +439,19 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
return returnObj; return returnObj;
} }
Utils.showTitleLoader = function(loaderEl, titleBoxEl) { Utils.showTitleLoader = function(loaderEl, titleBoxEl) {
loaderEl.css({ loaderEl.css ? loaderEl.css({
'display': 'block', 'display': 'block',
'position': 'relative', 'position': 'relative',
'height': '85px', 'height': '85px',
'marginTop': '85px', 'marginTop': '85px',
'marginLeft': '50%', 'marginLeft': '50%',
'left': '0%' 'left': '0%'
}); }) : null;
titleBoxEl.hide(); titleBoxEl.hide ? titleBoxEl.hide() : null;
} }
Utils.hideTitleLoader = function(loaderEl, titleBoxEl) { Utils.hideTitleLoader = function(loaderEl, titleBoxEl) {
loaderEl.hide(); loaderEl.hide ? loaderEl.hide() : null;
titleBoxEl.fadeIn(); titleBoxEl.fadeIn ? titleBoxEl.fadeIn() : null;
} }
Utils.findAndMergeRefEntity = function(attributeObject, referredEntities) { Utils.findAndMergeRefEntity = function(attributeObject, referredEntities) {
var mergeObject = function(obj) { var mergeObject = function(obj) {
...@@ -477,6 +477,28 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -477,6 +477,28 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}); });
} }
} }
Utils.getNestedSuperTypes = function(options) {
var data = options.data,
collection = options.collection,
superTypes = [];
var getData = function(data, collection) {
superTypes = superTypes.concat(data.superTypes);
if (data.superTypes && data.superTypes.length) {
_.each(data.superTypes, function(superTypeName) {
if (collection.fullCollection) {
var collectionData = collection.fullCollection.findWhere({ name: superTypeName }).toJSON();
} else {
var collectionData = collection.findWhere({ name: superTypeName }).toJSON();
}
return getData(collectionData, collection);
});
}
}
getData(data, collection);
return _.uniq(superTypes);
}
Utils.getNestedSuperTypeObj = function(options) { Utils.getNestedSuperTypeObj = function(options) {
var flag = 0, var flag = 0,
data = options.data, data = options.data,
...@@ -513,7 +535,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -513,7 +535,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
} }
} }
getData(data, collection); getData(data, collection);
return attributeDefs return attributeDefs;
} }
Utils.getProfileTabType = function(profileData, skipData) { Utils.getProfileTabType = function(profileData, skipData) {
......
...@@ -102,7 +102,7 @@ define(['require', ...@@ -102,7 +102,7 @@ define(['require',
ajaxOptions = { ajaxOptions = {
success: function(rModel, response) { success: function(rModel, response) {
Utils.notifySuccess({ Utils.notifySuccess({
content: (that.isCategoryView ? "Term" : "Category") + " is associated successfully " content: (that.isCategoryView || that.isEntityView ? "Term" : "Category") + " is associated successfully "
}); });
that.modal.trigger('closeModal'); that.modal.trigger('closeModal');
if (that.callback) { if (that.callback) {
......
...@@ -41,7 +41,6 @@ define(['require', ...@@ -41,7 +41,6 @@ define(['require',
/** ui selector cache */ /** ui selector cache */
ui: { ui: {
"qualifiedName": "[data-id='qualifiedName']",
"displayName": "[data-id='displayName']", "displayName": "[data-id='displayName']",
"shortDescription": "[data-id='shortDescription']", "shortDescription": "[data-id='shortDescription']",
"longDescription": "[data-id='longDescription']", "longDescription": "[data-id='longDescription']",
......
...@@ -155,6 +155,8 @@ define(['require', ...@@ -155,6 +155,8 @@ define(['require',
.links(data.links) .links(data.links)
.size([width, height]) .size([width, height])
.linkDistance(200) .linkDistance(200)
.gravity(0.0)
.friction(0.1)
.charge(function(d) { .charge(function(d) {
var charge = -500; var charge = -500;
if (d.index === 0) charge = 100 if (d.index === 0) charge = 100
...@@ -390,12 +392,10 @@ define(['require', ...@@ -390,12 +392,10 @@ define(['require',
}); });
node.attr("transform", function(d) { node.attr("transform", function(d) {
// if (d && d.value && d.value.guid == that.guid) { if (d && d.value && d.value.guid == that.guid) {
// Center fixed node d.x = (width / 2)
// var damper = 0.1; d.y = (height / 2)
// d.x = (width / 2) }
// d.y = (height / 2)
// }
return "translate(" + d.x + "," + d.y + ")"; return "translate(" + d.x + "," + d.y + ")";
}); });
} }
......
...@@ -57,7 +57,7 @@ define(['require', ...@@ -57,7 +57,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'profileData', 'guid', 'value', 'typeName', 'entityDetail', 'typeHeaders', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection')); _.extend(this, _.pick(options, 'profileData', 'guid', 'value', 'typeName', 'entityDetail', 'typeHeaders', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection', 'glossaryCollection'));
if (this.typeName === "hive_db" || this.typeName === "hbase_namespace") { if (this.typeName === "hive_db" || this.typeName === "hbase_namespace") {
this.profileData = { attributes: true }; this.profileData = { attributes: true };
} }
...@@ -80,7 +80,7 @@ define(['require', ...@@ -80,7 +80,7 @@ define(['require',
var value = _.extend({}, that.value, { var value = _.extend({}, that.value, {
'guid': that.guid, 'guid': that.guid,
'searchType': 'relationship', 'searchType': 'relationship',
'profileDBView' : true, 'profileDBView': true,
'typeName': that.typeName 'typeName': that.typeName
}); });
that.RProfileTableOrColumnLayoutView.show(new SearchResultLayoutView({ that.RProfileTableOrColumnLayoutView.show(new SearchResultLayoutView({
...@@ -89,6 +89,7 @@ define(['require', ...@@ -89,6 +89,7 @@ define(['require',
'entityDefCollection': that.entityDefCollection, 'entityDefCollection': that.entityDefCollection,
'enumDefCollection': that.enumDefCollection, 'enumDefCollection': that.enumDefCollection,
'isDisable': true, 'isDisable': true,
'glossaryCollection': that.glossaryCollection,
'classificationDefCollection': that.classificationDefCollection 'classificationDefCollection': that.classificationDefCollection
})); }));
}); });
......
...@@ -283,34 +283,19 @@ define(['require', ...@@ -283,34 +283,19 @@ define(['require',
var that = this, var that = this,
tagName = $(e.target).data("name"), tagName = $(e.target).data("name"),
guid = $(e.target).data("guid"), guid = $(e.target).data("guid"),
assetName = $(e.target).data("assetname"), assetName = $(e.target).data("assetname");
modal = CommonViewFunction.deleteTagModel({ CommonViewFunction.deleteTag({
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + assetName + " ?</b></div>", tagName: tagName,
titleMessage: Messages.removeTag, guid: guid,
buttonText: "Remove" msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + assetName + " ?</b></div>",
}); titleMessage: Messages.removeTag,
okText: "Remove",
if (modal) {
modal.on('ok', function() {
that.deleteTagData({
'tagName': tagName,
'guid': guid
});
});
modal.on('closeModal', function() {
modal.trigger('cancel');
});
}
},
deleteTagData: function(options) {
var that = this;
CommonViewFunction.deleteTag(_.extend({}, options, {
showLoader: that.showLoader.bind(that), showLoader: that.showLoader.bind(that),
hideLoader: that.hideLoader.bind(that), hideLoader: that.hideLoader.bind(that),
callback: function() { callback: function() {
that.fetchCollection(); that.fetchCollection();
} }
})); });
}, },
onCheckDeletedEntity: function(e) { onCheckDeletedEntity: function(e) {
if (e.target.checked) { if (e.target.checked) {
......
...@@ -103,7 +103,7 @@ define(['require', ...@@ -103,7 +103,7 @@ define(['require',
} else { } else {
this.triggerUrl({ this.triggerUrl({
url: '#!/glossary/' + scope.find('i').data('termguid'), url: '#!/glossary/' + scope.find('i').data('termguid'),
urlParams: { gType: "term" }, urlParams: { gType: "term", viewType: "term", fromView: "entity" },
mergeBrowserUrl: false, mergeBrowserUrl: false,
trigger: true, trigger: true,
updateTabState: null updateTabState: null
...@@ -476,7 +476,7 @@ define(['require', ...@@ -476,7 +476,7 @@ define(['require',
if (value.searchType) { if (value.searchType) {
this.searchCollection.url = UrlLinks.searchApiUrl(value.searchType); this.searchCollection.url = UrlLinks.searchApiUrl(value.searchType);
} }
_.extend(this.searchCollection.queryParams, { 'limit': this.limit, 'offset': this.offset, 'query': _.trim(value.query), 'typeName': value.type || null, 'classification': value.tag || null, 'termName': that.termName || null }); _.extend(this.searchCollection.queryParams, { 'limit': this.limit, 'offset': this.offset, 'query': _.trim(value.query), 'typeName': value.type || null, 'classification': value.tag || null, 'termName': value.term || null });
if (value.profileDBView && value.typeName && value.guid) { if (value.profileDBView && value.typeName && value.guid) {
var profileParam = {}; var profileParam = {};
profileParam['guid'] = value.guid; profileParam['guid'] = value.guid;
...@@ -851,12 +851,13 @@ define(['require', ...@@ -851,12 +851,13 @@ define(['require',
formatter: _.extend({}, Backgrid.CellFormatter.prototype, { formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) { fromRaw: function(rawValue, model) {
var obj = model.toJSON(); var obj = model.toJSON();
if (obj.status && Enums.entityStateReadOnly[obj.status]) { if (!(obj.typeName.startsWith("__AtlasGlossary"))) {
return '<div class="readOnly">' + CommonViewFunction.termForTable(obj); + '</div>'; if (obj.status && Enums.entityStateReadOnly[obj.status]) {
} else { return '<div class="readOnly">' + CommonViewFunction.termForTable(obj); + '</div>';
return CommonViewFunction.termForTable(obj); } else {
return CommonViewFunction.termForTable(obj);
}
} }
} }
}) })
}; };
...@@ -936,23 +937,20 @@ define(['require', ...@@ -936,23 +937,20 @@ define(['require',
var that = this, var that = this,
tagName = $(e.target).data("name"), tagName = $(e.target).data("name"),
guid = $(e.target).data("guid"), guid = $(e.target).data("guid"),
assetName = $(e.target).data("assetname"), assetName = $(e.target).data("assetname");
modal = CommonViewFunction.deleteTagModel({ CommonViewFunction.deleteTag({
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + assetName + " ?</b></div>", tagName: tagName,
titleMessage: Messages.removeTag, guid: guid,
buttonText: "Remove" msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + assetName + " ?</b></div>",
}); titleMessage: Messages.removeTag,
if (modal) { okText: "Remove",
modal.on('ok', function() { showLoader: that.showLoader.bind(that),
that.deleteTagData({ hideLoader: that.hideLoader.bind(that),
'tagName': tagName, callback: function() {
'guid': guid that.fetchCollection();
}); }
}); });
modal.on('closeModal', function() {
modal.trigger('cancel');
});
}
}, },
onClickTermCross: function(e) { onClickTermCross: function(e) {
var $el = $(e.target), var $el = $(e.target),
...@@ -979,16 +977,6 @@ define(['require', ...@@ -979,16 +977,6 @@ define(['require',
} }
}); });
}, },
deleteTagData: function(options) {
var that = this;
CommonViewFunction.deleteTag(_.extend({}, options, {
showLoader: that.showLoader.bind(that),
hideLoader: that.hideLoader.bind(that),
callback: function() {
that.fetchCollection();
}
}));
},
onClicknextData: function() { onClicknextData: function() {
this.offset = this.offset + this.limit; this.offset = this.offset + this.limit;
_.extend(this.searchCollection.queryParams, { _.extend(this.searchCollection.queryParams, {
......
...@@ -44,7 +44,7 @@ define(['require', ...@@ -44,7 +44,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'tag', 'value', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'enumDefCollection')); _.extend(this, _.pick(options, 'tag', 'value', 'glossaryCollection', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'enumDefCollection'));
this.collection = this.classificationDefCollection; this.collection = this.classificationDefCollection;
}, },
bindEvents: function() {}, bindEvents: function() {},
...@@ -67,6 +67,7 @@ define(['require', ...@@ -67,6 +67,7 @@ define(['require',
tagCollection: that.collection, tagCollection: that.collection,
enumDefCollection: that.enumDefCollection, enumDefCollection: that.enumDefCollection,
classificationDefCollection: that.classificationDefCollection, classificationDefCollection: that.classificationDefCollection,
glossaryCollection: that.glossaryCollection,
fromView: "classification" fromView: "classification"
})); }));
} }
......
...@@ -54,7 +54,7 @@ define(['require', ...@@ -54,7 +54,7 @@ define(['require',
this.addModalView(e); this.addModalView(e);
}; };
events["click " + this.ui.deleteTag] = function(e) { events["click " + this.ui.deleteTag] = function(e) {
this.deleteTagDataModal(e); this.onClickTagCross(e);
}; };
events["click " + this.ui.editTag] = function(e) { events["click " + this.ui.editTag] = function(e) {
this.editTagDataModal(e); this.editTagDataModal(e);
...@@ -79,7 +79,7 @@ define(['require', ...@@ -79,7 +79,7 @@ define(['require',
this.tagCollection = new VTagList(); this.tagCollection = new VTagList();
var that = this, var that = this,
tags = _.toArray(this.collectionObject.classifications); tags = _.toArray(this.collectionObject.classifications);
this.tagCollection.set(tags); this.tagCollection.fullCollection.reset(tags);
this.commonTableOptions = { this.commonTableOptions = {
collection: this.tagCollection, collection: this.tagCollection,
includeFilter: false, includeFilter: false,
...@@ -191,28 +191,15 @@ define(['require', ...@@ -191,28 +191,15 @@ define(['require',
}); });
}); });
}, },
deleteTagDataModal: function(e) { onClickTagCross: function(e) {
var that = this, var that = this,
tagName = $(e.currentTarget).data("name"), tagName = $(e.currentTarget).data("name");
modal = CommonViewFunction.deleteTagModel({ CommonViewFunction.deleteTag({
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + this.entityName + "?</b></div>", tagName: tagName,
titleMessage: Messages.removeTag, guid: that.guid,
buttonText: "Remove", msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + this.entityName + "?</b></div>",
}); titleMessage: Messages.removeTag,
okText: "Remove",
modal.on('ok', function() {
that.deleteTagData({
'tagName': tagName,
'guid': that.guid
});
});
modal.on('closeModal', function() {
modal.trigger('cancel');
});
},
deleteTagData: function(options) {
var that = this;
CommonViewFunction.deleteTag(_.extend({}, options, {
showLoader: function() { showLoader: function() {
that.$('.fontLoader').show(); that.$('.fontLoader').show();
that.$('.tableOverlay').show(); that.$('.tableOverlay').show();
...@@ -226,9 +213,8 @@ define(['require', ...@@ -226,9 +213,8 @@ define(['require',
if (that.fetchCollection) { if (that.fetchCollection) {
that.fetchCollection(); that.fetchCollection();
} }
} }
})); });
}, },
editTagDataModal: function(e) { editTagDataModal: function(e) {
var that = this, var that = this,
...@@ -256,12 +242,12 @@ define(['require', ...@@ -256,12 +242,12 @@ define(['require',
unPropagatedTags = []; unPropagatedTags = [];
e.stopPropagation(); e.stopPropagation();
if (e.target.checked) { if (e.target.checked) {
that.tagCollection.reset(tags); that.tagCollection.fullCollection.reset(tags);
} else { } else {
unPropagatedTags = _.filter(tags, function(val) { unPropagatedTags = _.filter(tags, function(val) {
return that.guid === val.entityGuid; return that.guid === val.entityGuid;
}); });
that.tagCollection.reset(unPropagatedTags); that.tagCollection.fullCollection.reset(unPropagatedTags);
} }
} }
}); });
......
...@@ -76,7 +76,7 @@ define(['require', ...@@ -76,7 +76,7 @@ define(['require',
tagName: null tagName: null
} }
}; };
if (this.value && this.value.viewType) { if (Utils.getUrlState.isTagTab() && this.value && this.value.viewType) {
this.viewType = this.value.viewType; this.viewType = this.value.viewType;
} }
this.query[this.viewType].tagName = this.tag; this.query[this.viewType].tagName = this.tag;
......
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