Commit b9642b62 by kevalbhatt Committed by Sarath Subramanian

ATLAS-3030: UI : Allow to search the node in the lineage graph

parent f103e143
...@@ -38,6 +38,12 @@ ...@@ -38,6 +38,12 @@
stroke: $color_mountain_mist_approx; stroke: $color_mountain_mist_approx;
fill: $white; fill: $white;
stroke-width: 1.5px; stroke-width: 1.5px;
&.serach-rect {
stroke: $color_keppel_approx;
fill: transparent;
stroke-width: 2.5px
}
} }
.label { .label {
...@@ -276,6 +282,7 @@ g.type-TK>rect { ...@@ -276,6 +282,7 @@ g.type-TK>rect {
.lineage-fltr-panel, .lineage-fltr-panel,
.lineage-search-panel { .lineage-search-panel {
position: absolute; position: absolute;
top: 45px;
border: 1px solid #ccc; border: 1px solid #ccc;
width: 250px; width: 250px;
max-height: 99%; max-height: 99%;
...@@ -445,6 +452,11 @@ span#zoom_in { ...@@ -445,6 +452,11 @@ span#zoom_in {
position: relative; position: relative;
width: 100%; width: 100%;
height: 64vh; height: 64vh;
overflow: hidden !important;
&.auto-height {
height: auto !important;
}
} }
.active.fullscreen-mode { .active.fullscreen-mode {
...@@ -472,3 +484,21 @@ span#zoom_in { ...@@ -472,3 +484,21 @@ span#zoom_in {
padding: 10px !important; padding: 10px !important;
} }
} }
@keyframes zoominoutsinglefeatured {
0% {
transform: scale(1, 1);
}
50% {
transform: scale(1.2, 1.2);
}
100% {
transform: scale(1, 1);
}
}
.wobble {
animation: zoominoutsinglefeatured 1s 5;
}
\ No newline at end of file
...@@ -189,6 +189,7 @@ require.config({ ...@@ -189,6 +189,7 @@ require.config({
require(['App', require(['App',
'router/Router', 'router/Router',
'utils/Helper',
'utils/CommonViewFunction', 'utils/CommonViewFunction',
'utils/Globals', 'utils/Globals',
'utils/UrlLinks', 'utils/UrlLinks',
...@@ -198,7 +199,7 @@ require(['App', ...@@ -198,7 +199,7 @@ require(['App',
'bootstrap', 'bootstrap',
'd3', 'd3',
'select2' 'select2'
], function(App, Router, CommonViewFunction, Globals, UrlLinks, VEntityList, VTagList) { ], function(App, Router, Helper, CommonViewFunction, Globals, UrlLinks, VEntityList, VTagList) {
var that = this; var that = this;
this.asyncFetchCounter = 6; this.asyncFetchCounter = 6;
this.entityDefCollection = new VEntityList(); this.entityDefCollection = new VEntityList();
......
...@@ -103,6 +103,7 @@ define([ ...@@ -103,6 +103,7 @@ define([
this.postRouteExecute(); this.postRouteExecute();
}, },
preRouteExecute: function() { preRouteExecute: function() {
$(".tooltip").tooltip("hide");
// console.log("Pre-Route Change Operations can be performed here !!"); // console.log("Pre-Route Change Operations can be performed here !!");
}, },
postRouteExecute: function(name, args) { postRouteExecute: function(name, args) {
......
...@@ -46,11 +46,32 @@ ...@@ -46,11 +46,32 @@
</div> </div>
</div> </div>
</div> </div>
<div class="lineage-search-panel">
<div class="header clearfix">
<h4>Search</h4>
<span data-id="search-togler" style="margin: 7px" class="btn btn-action btn-sm fltr-togler"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<div class="col-sm-12 no-padding">
<div class="srchType clearfix">
<label class="srchTitle">Search Lineage Entity: </label>
<div class="">
<div class="col-sm-12 no-padding temFilter">
<select data-id="typeSearch"></select>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="graph-button-group pull-right"> <div class="graph-button-group pull-right">
<div> <div>
<button type="button" data-id="fltr-togler" class="btn btn-action btn-gray btn-sm"><i class="fa fa-filter"></i></button> <button type="button" data-id="fltr-togler" class="btn btn-action btn-gray btn-sm"><i class="fa fa-filter"></i></button>
</div> </div>
<div> <div>
<button type="button" data-id="search-togler" class="btn btn-action btn-gray btn-sm"><i class="fa fa-search"></i></button>
</div>
<div>
<button type="button" data-id="fullScreen-toggler" class="btn btn-action btn-gray btn-sm fullscreen_lineage"><i class="fa fa-expand"></i></button> <button type="button" data-id="fullScreen-toggler" class="btn btn-action btn-gray btn-sm fullscreen_lineage"><i class="fa fa-expand"></i></button>
</div> </div>
<div class="btn-group"> <div class="btn-group">
...@@ -61,12 +82,14 @@ ...@@ -61,12 +82,14 @@
<div class="fontLoader"> <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<canvas width="960" height="500" style="display:none; position: absolute;"></canvas>
<div class="legends pull-left" style="height: 25px; padding: 2px;"> <div class="legends pull-left" style="height: 25px; padding: 2px;">
<span style="margin-right: 8px; color:#fb4200;"><i class="fa fa-circle-o fa-fw" aria-hidden="true"></i>Current Entity</span> <span style="margin-right: 8px; color:#fb4200;"><i class="fa fa-circle-o fa-fw" aria-hidden="true"></i>Current Entity</span>
<span style="margin-right: 8px; color:#df9b00;"><i class="fa fa-long-arrow-right fa-fw" aria-hidden="true"></i>Lineage</span> <span style="margin-right: 8px; color:#df9b00;"><i class="fa fa-long-arrow-right fa-fw" aria-hidden="true"></i>Lineage</span>
<span style="margin-right: 8px; color:#fb4200;"><i class="fa fa-long-arrow-right fa-fw" aria-hidden="true"></i>Impact</span> <span style="margin-right: 8px; color:#fb4200;"><i class="fa fa-long-arrow-right fa-fw" aria-hidden="true"></i>Impact</span>
</div> </div>
<svg width="100%" height="calc(100% - 28px)" viewBox="0 0 854 330" enable-background="new 0 0 854 330" xml:space="preserve"></svg> <!-- <svg width="100%" height="calc(100% - 28px)" preserveAspectRatio="xMidYMid meet" viewBox="0 0 854 330" enable-background="new 0 0 854 330" xml:space="preserve"></svg> -->
<svg width="{{width}}" height="{{height}}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"></svg>
<div class="lineage-details node-details"> <div class="lineage-details node-details">
<span data-id="close" style="margin: 7px;position: absolute;right: 0" class="btn btn-action btn-sm fltr-togler"><i class="fa fa-close"></i></span> <span data-id="close" style="margin: 7px;position: absolute;right: 0" class="btn btn-action btn-sm fltr-togler"><i class="fa fa-close"></i></span>
<h4 class="title"><span data-id="typeName"></span></h4> <h4 class="title"><span data-id="typeName"></span></h4>
......
...@@ -76,9 +76,21 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob ...@@ -76,9 +76,21 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
valueObject = options.valueObject, valueObject = options.valueObject,
extractJSON = options.extractJSON, extractJSON = options.extractJSON,
isTable = _.isUndefined(options.isTable) ? true : options.isTable, isTable = _.isUndefined(options.isTable) ? true : options.isTable,
attributeDefs = options.attributeDefs; attributeDefs = options.attributeDefs,
numberFormat = options.numberFormat;
var table = "", var table = "",
getValue = function(val) {
if (val && numberFormat) {
if (_.isNumber(val)) {
return numberFormat(val);
} else if (!_.isNaN(parseInt(val))) {
return numberFormat(val);
}
} else {
return val;
}
},
fetchInputOutputValue = function(id, defEntity) { fetchInputOutputValue = function(id, defEntity) {
var that = this; var that = this;
scope.entityModel.getEntityHeader(id, { scope.entityModel.getEntityHeader(id, {
...@@ -95,7 +107,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob ...@@ -95,7 +107,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
id = data.guid; id = data.guid;
} }
if (value.length > 0) { if (value.length > 0) {
scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + value + '</a>'); scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + getValue(value) + '</a>');
} else { } else {
scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + _.escape(id) + '</a>'); scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/' + id + '">' + _.escape(id) + '</a>');
} }
...@@ -137,7 +149,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob ...@@ -137,7 +149,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
if (_.isString(inputOutputField) || _.isBoolean(inputOutputField) || _.isNumber(inputOutputField)) { if (_.isString(inputOutputField) || _.isBoolean(inputOutputField) || _.isNumber(inputOutputField)) {
var tempVarfor$check = inputOutputField.toString(); var tempVarfor$check = inputOutputField.toString();
if (tempVarfor$check.indexOf("$") == -1) { if (tempVarfor$check.indexOf("$") == -1) {
valueOfArray.push('<span class="json-string">' + _.escape(inputOutputField) + '</span>'); valueOfArray.push('<span class="json-string">' + getValue(_.escape(inputOutputField)) + '</span>');
} }
} else if (_.isObject(inputOutputField) && !id) { } else if (_.isObject(inputOutputField) && !id) {
var attributesList = inputOutputField; var attributesList = inputOutputField;
...@@ -233,7 +245,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob ...@@ -233,7 +245,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
val = _.escape(keyValue); val = _.escape(keyValue);
} }
if (isTable) { if (isTable) {
var htmlTag = '<div class="scroll-y">' + val + '</div>'; var htmlTag = '<div class="scroll-y">' + getValue(val) + '</div>';
if (_.isObject(valueObject[key])) { if (_.isObject(valueObject[key])) {
var matchedLinkString = val.match(/href|value-loader\w*/g), var matchedLinkString = val.match(/href|value-loader\w*/g),
matchedJson = val.match(/json-value|json-string\w*/g), matchedJson = val.match(/json-value|json-string\w*/g),
......
/**
* 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',
'd3',
'marionette'
], function(require, Utils, d3) {
'use strict';
_.mixin({
numberFormatWithComa: function(number) {
return d3.format(',')(number);
},
isEmptyArray: function(val) {
if (val && _.isArray(val)) {
return _.isEmpty(val);
} else {
return false;
}
},
startsWith: function(str, matchStr) {
if (str && matchStr && _.isString(str) && _.isString(matchStr)) {
return str.lastIndexOf(matchStr, 0) === 0
} else {
return;
}
},
isUndefinedNull: function(val) {
if (_.isUndefined(val) || _.isNull(val)) {
return true
} else {
return false;
}
},
trim: function(val) {
if (val && val.trim) {
return val.trim();
} else {
return val;
}
},
isTypePrimitive: function(type) {
if (type === "int" || type === "byte" || type === "short" || type === "long" || type === "float" || type === "double" || type === "string" || type === "boolean" || type === "date") {
return true;
}
return false;
}
});
var getPopoverEl = function(e) {
return $(e.target).parent().data("bs.popover") || $(e.target).data("bs.popover") || $(e.target).parents('.popover').length;
}
$(document).on('click DOMMouseScroll mousewheel', function(e) {
if (e.originalEvent) {
// Do action if it is triggered by a human.
//e.isImmediatePropagationStopped();
var isPopOverEl = getPopoverEl(e)
if (!isPopOverEl) {
$('.popover').popover('hide');
} else if (isPopOverEl.$tip) {
$('.popover').not(isPopOverEl.$tip).popover('hide');
}
}
});
$('body').on('hidden.bs.popover', function(e) {
$(e.target).data("bs.popover").inState = { click: false, hover: false, focus: false }
});
$('body').on('show.bs.popover', '[data-js="popover"]', function() {
$('.popover').not(this).popover('hide');
});
$('body').on('keypress', 'input.number-input,.number-input .select2-search__field', function(e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
return false;
}
});
$('body').on('keypress', 'input.number-input-negative,.number-input-negative .select2-search__field', function(e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
if (e.which == 45) {
if (this.value.length) {
return false;
}
} else {
return false;
}
}
});
$('body').on('keypress', 'input.number-input-exponential,.number-input-exponential .select2-search__field', function(e) {
if ((e.which != 8 && e.which != 0) && (e.which < 48 || e.which > 57) && (e.which != 69 && e.which != 101 && e.which != 43 && e.which != 45 && e.which != 46 && e.which != 190)) {
return false;
}
});
$("body").on('click', '.dropdown-menu.dropdown-changetitle li a', function() {
$(this).parents('li').find(".btn:first-child").html($(this).text() + ' <span class="caret"></span>');
});
$("body").on('click', '.btn', function() {
$(this).blur();
});
$.fn.select2.amd.define("ServiceTypeFilterDropdownAdapter", [
"select2/utils",
"select2/dropdown",
"select2/dropdown/attachBody",
"select2/dropdown/attachContainer",
"select2/dropdown/search",
"select2/dropdown/minimumResultsForSearch",
"select2/dropdown/closeOnSelect",
],
function(Utils, Dropdown, AttachBody, AttachContainer, Search, MinimumResultsForSearch, CloseOnSelect) {
// Decorate Dropdown with Search functionalities
var dropdownWithSearch = Utils.Decorate(Utils.Decorate(Dropdown, CloseOnSelect), Search);
dropdownWithSearch.prototype.render = function() {
// Copy and modify default search render method
var $rendered = Dropdown.prototype.render.call(this);
// Add ability for a placeholder in the search box
var placeholder = this.options.get("placeholderForSearch") || "";
var $search = $(
'<span class="select2-search select2-search--dropdown"><div class="row">' +
'<div class="col-md-10"><input class="select2-search__field" placeholder="' + placeholder + '" type="search"' +
' tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off"' +
' spellcheck="false" role="textbox" /></div>' +
'<div class="col-md-2"><button type="button" style="margin-left: -20px" class="btn btn-action btn-sm filter " title="Entity Attribute Filter"><i class="fa fa-filter"></i></button></div>' +
'</div></span>'
);
if (!this.options.options.getFilterBox) {
throw "In order to render the filter options adapter needed getFilterBox function"
}
var $Filter = $('<ul class="type-filter-ul"></ul>');
this.$Filter = $Filter;
this.$Filter.append(this.options.options.getFilterBox());
this.$Filter.hide();
this.$searchContainer = $search;
if ($Filter.find('input[type="checkbox"]:checked').length) {
$search.find('button.filter').addClass('active');
} else {
$search.find('button.filter').removeClass('active');
}
this.$search = $search.find('input');
$rendered.prepend($search);
$rendered.append($Filter);
return $rendered;
};
var oldDropdownWithSearchBindRef = dropdownWithSearch.prototype.bind;
dropdownWithSearch.prototype.bind = function(container, $container) {
var self = this;
oldDropdownWithSearchBindRef.call(this, container, $container);
var self = this;
this.$Filter.on('click', 'li', function() {
var itemCallback = self.options.options.onFilterItemSelect;
itemCallback && itemCallback(this);
})
this.$searchContainer.find('button.filter').click(function() {
container.$dropdown.find('.select2-search').hide(150);
container.$dropdown.find('.select2-results').hide(150);
self.$Filter.html(self.options.options.getFilterBox());
self.$Filter.show();
});
this.$Filter.on('click', 'button.filterDone', function() {
container.$dropdown.find('.select2-search').show(150);
container.$dropdown.find('.select2-results').show(150);
self.$Filter.hide();
var filterSubmitCallback = self.options.options.onFilterSubmit;
filterSubmitCallback && filterSubmitCallback({
filterVal: _.map(self.$Filter.find('input[type="checkbox"]:checked'), function(item) {
return $(item).data('value')
})
});
});
container.$element.on('hideFilter', function() {
container.$dropdown.find('.select2-search').show();
container.$dropdown.find('.select2-results').show();
self.$Filter.hide();
});
}
// Decorate the dropdown+search with necessary containers
var adapter = Utils.Decorate(dropdownWithSearch, AttachContainer);
adapter = Utils.Decorate(adapter, AttachBody);
return adapter;
});
// For placeholder support
if (!('placeholder' in HTMLInputElement.prototype)) {
var originalRender = Backbone.Marionette.LayoutView.prototype.render;
Backbone.Marionette.LayoutView.prototype.render = function() {
originalRender.apply(this, arguments);
this.$('input, textarea').placeholder();
}
}
$('body').on('click', 'pre.code-block .expand-collapse-button', function(e) {
var $el = $(this).parents('.code-block');
if ($el.hasClass('shrink')) {
$el.removeClass('shrink');
} else {
$el.addClass('shrink');
}
});
// For adding tooltip globally
$('body').tooltip({
selector: '[title]',
placement: 'bottom',
container: 'body'
});
})
\ No newline at end of file
...@@ -48,188 +48,6 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq ...@@ -48,188 +48,6 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
}) })
]); ]);
} }
_.mixin({
isEmptyArray: function(val) {
if (val && _.isArray(val)) {
return _.isEmpty(val);
} else {
return false;
}
},
startsWith: function(str, matchStr) {
if (str && matchStr && _.isString(str) && _.isString(matchStr)) {
return str.lastIndexOf(matchStr, 0) === 0
} else {
return;
}
},
isUndefinedNull: function(val) {
if (_.isUndefined(val) || _.isNull(val)) {
return true
} else {
return false;
}
},
trim: function(val) {
if (val && val.trim) {
return val.trim();
} else {
return val;
}
},
isTypePrimitive: function(type) {
if (type === "int" || type === "byte" || type === "short" || type === "long" || type === "float" || type === "double" || type === "string" || type === "boolean" || type === "date") {
return true;
}
return false;
}
});
var getPopoverEl = function(e) {
return $(e.target).parent().data("bs.popover") || $(e.target).data("bs.popover") || $(e.target).parents('.popover').length;
}
$(document).on('click DOMMouseScroll mousewheel', function(e) {
if (e.originalEvent) {
// Do action if it is triggered by a human.
//e.isImmediatePropagationStopped();
var isPopOverEl = getPopoverEl(e)
if (!isPopOverEl) {
$('.popover').popover('hide');
} else if (isPopOverEl.$tip) {
$('.popover').not(isPopOverEl.$tip).popover('hide');
}
}
});
$('body').on('hidden.bs.popover', function(e) {
$(e.target).data("bs.popover").inState = { click: false, hover: false, focus: false }
});
$('body').on('show.bs.popover', '[data-js="popover"]', function() {
$('.popover').not(this).popover('hide');
});
$('body').on('keypress', 'input.number-input,.number-input .select2-search__field', function(e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
return false;
}
});
$('body').on('keypress', 'input.number-input-negative,.number-input-negative .select2-search__field', function(e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
if (e.which == 45) {
if (this.value.length) {
return false;
}
} else {
return false;
}
}
});
$('body').on('keypress', 'input.number-input-exponential,.number-input-exponential .select2-search__field', function(e) {
if ((e.which != 8 && e.which != 0) && (e.which < 48 || e.which > 57) && (e.which != 69 && e.which != 101 && e.which != 43 && e.which != 45 && e.which != 46 && e.which != 190)) {
return false;
}
});
$("body").on('click', '.dropdown-menu.dropdown-changetitle li a', function() {
$(this).parents('li').find(".btn:first-child").html($(this).text() + ' <span class="caret"></span>');
});
$("body").on('click', '.btn', function() {
$(this).blur();
});
$.fn.select2.amd.define("ServiceTypeFilterDropdownAdapter", [
"select2/utils",
"select2/dropdown",
"select2/dropdown/attachBody",
"select2/dropdown/attachContainer",
"select2/dropdown/search",
"select2/dropdown/minimumResultsForSearch",
"select2/dropdown/closeOnSelect",
],
function(Utils, Dropdown, AttachBody, AttachContainer, Search, MinimumResultsForSearch, CloseOnSelect) {
// Decorate Dropdown with Search functionalities
var dropdownWithSearch = Utils.Decorate(Utils.Decorate(Dropdown, CloseOnSelect), Search);
dropdownWithSearch.prototype.render = function() {
// Copy and modify default search render method
var $rendered = Dropdown.prototype.render.call(this);
// Add ability for a placeholder in the search box
var placeholder = this.options.get("placeholderForSearch") || "";
var $search = $(
'<span class="select2-search select2-search--dropdown"><div class="row">' +
'<div class="col-md-10"><input class="select2-search__field" placeholder="' + placeholder + '" type="search"' +
' tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off"' +
' spellcheck="false" role="textbox" /></div>' +
'<div class="col-md-2"><button type="button" style="margin-left: -20px" class="btn btn-action btn-sm filter " title="Entity Attribute Filter"><i class="fa fa-filter"></i></button></div>' +
'</div></span>'
);
if (!this.options.options.getFilterBox) {
throw "In order to render the filter options adapter needed getFilterBox function"
}
var $Filter = $('<ul class="type-filter-ul"></ul>');
this.$Filter = $Filter;
this.$Filter.append(this.options.options.getFilterBox());
this.$Filter.hide();
this.$searchContainer = $search;
if ($Filter.find('input[type="checkbox"]:checked').length) {
$search.find('button.filter').addClass('active');
} else {
$search.find('button.filter').removeClass('active');
}
this.$search = $search.find('input');
$rendered.prepend($search);
$rendered.append($Filter);
return $rendered;
};
var oldDropdownWithSearchBindRef = dropdownWithSearch.prototype.bind;
dropdownWithSearch.prototype.bind = function(container, $container) {
var self = this;
oldDropdownWithSearchBindRef.call(this, container, $container);
var self = this;
this.$Filter.on('click', 'li', function() {
var itemCallback = self.options.options.onFilterItemSelect;
itemCallback && itemCallback(this);
})
this.$searchContainer.find('button.filter').click(function() {
container.$dropdown.find('.select2-search').hide(150);
container.$dropdown.find('.select2-results').hide(150);
self.$Filter.html(self.options.options.getFilterBox());
self.$Filter.show();
});
this.$Filter.on('click', 'button.filterDone', function() {
container.$dropdown.find('.select2-search').show(150);
container.$dropdown.find('.select2-results').show(150);
self.$Filter.hide();
var filterSubmitCallback = self.options.options.onFilterSubmit;
filterSubmitCallback && filterSubmitCallback({
filterVal: _.map(self.$Filter.find('input[type="checkbox"]:checked'), function(item) {
return $(item).data('value')
})
});
});
container.$element.on('hideFilter', function() {
container.$dropdown.find('.select2-search').show();
container.$dropdown.find('.select2-results').show();
self.$Filter.hide();
});
}
// Decorate the dropdown+search with necessary containers
var adapter = Utils.Decorate(dropdownWithSearch, AttachContainer);
adapter = Utils.Decorate(adapter, AttachBody);
return adapter;
});
// For placeholder support
if (!('placeholder' in HTMLInputElement.prototype)) {
var originalRender = Backbone.Marionette.LayoutView.prototype.render;
Backbone.Marionette.LayoutView.prototype.render = function() {
originalRender.apply(this, arguments);
this.$('input, textarea').placeholder();
}
}
String.prototype.trunc = String.prototype.trunc || String.prototype.trunc = String.prototype.trunc ||
function(n) { function(n) {
......
...@@ -763,14 +763,5 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -763,14 +763,5 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
this.attr(attributeName, firstString); this.attr(attributeName, firstString);
} }
} }
$('body').on('click', 'pre.code-block .expand-collapse-button', function(e) {
var $el = $(this).parents('.code-block');
if ($el.hasClass('shrink')) {
$el.removeClass('shrink');
} else {
$el.addClass('shrink');
}
});
return Utils; return Utils;
}); });
\ No newline at end of file
...@@ -70,8 +70,8 @@ define(['require', ...@@ -70,8 +70,8 @@ define(['require',
success: function(data) { success: function(data) {
var data = _.first(data.toJSON()), var data = _.first(data.toJSON()),
no_records = '<tr class="empty text-center"><td colspan="2"><span>No records found!</span></td></tr>', no_records = '<tr class="empty text-center"><td colspan="2"><span>No records found!</span></td></tr>',
activeEntityTable = _.isEmpty(data.entity.entityActive) ? no_records : CommonViewFunction.propertyTable({ scope: that, valueObject: data.entity.entityActive }), activeEntityTable = _.isEmpty(data.entity.entityActive) ? no_records : CommonViewFunction.propertyTable({ scope: that, valueObject: data.entity.entityActive, numberFormat: _.numberFormatWithComa }),
deleteEntityTable = _.isEmpty(data.entity.entityDeleted) ? no_records : CommonViewFunction.propertyTable({ scope: that, valueObject: data.entity.entityDeleted }); deleteEntityTable = _.isEmpty(data.entity.entityDeleted) ? no_records : CommonViewFunction.propertyTable({ scope: that, valueObject: data.entity.entityDeleted, numberFormat: _.numberFormatWithComa });
var totalActive = 0, var totalActive = 0,
totalDeleted = 0; totalDeleted = 0;
if (data.entity && data.general.entityCount) { if (data.entity && data.general.entityCount) {
...@@ -84,8 +84,8 @@ define(['require', ...@@ -84,8 +84,8 @@ define(['require',
} }
that.ui.entityActive.html(activeEntityTable); that.ui.entityActive.html(activeEntityTable);
that.ui.entityDelete.html(deleteEntityTable); that.ui.entityDelete.html(deleteEntityTable);
that.ui.entityActiveHeader.html("&nbsp;(" + (totalActive - totalDeleted) + ")"); that.ui.entityActiveHeader.html("&nbsp;(" + _.numberFormatWithComa((totalActive - totalDeleted)) + ")");
that.ui.entityDeletedHeader.html("&nbsp;(" + totalDeleted + ")"); that.ui.entityDeletedHeader.html("&nbsp;(" + _.numberFormatWithComa(totalDeleted) + ")");
} }
}); });
} }
......
...@@ -390,7 +390,7 @@ define(['require', ...@@ -390,7 +390,7 @@ define(['require',
val.entityGuid === that.id ? tag['self'].push(val) : tag['propagated'].push(val); val.entityGuid === that.id ? tag['self'].push(val) : tag['propagated'].push(val);
}); });
_.each(tag.self, function(val) { _.each(tag.self, function(val) {
tagData += '<span class="btn btn-action btn-sm btn-icon btn-blue" title=' + val.typeName + ' data-id="tagClick"><span>' + val.typeName + '</span><i class="fa fa-close" data-id="deleteTag" data-type="tag" title="Remove Tag"></i></span>'; tagData += '<span class="btn btn-action btn-sm btn-icon btn-blue" data-id="tagClick"><span title=' + val.typeName + ' >' + val.typeName + '</span><i class="fa fa-close" data-id="deleteTag" data-type="tag" title="Remove Tag"></i></span>';
}); });
_.each(tag.propagated, function(val) { _.each(tag.propagated, function(val) {
var crossButton = '<i class="fa fa-close" data-id="deleteTag" data-entityguid="' + val.entityGuid + '" data-type="tag" title="Remove Tag"></i>'; var crossButton = '<i class="fa fa-close" data-id="deleteTag" data-entityguid="' + val.entityGuid + '" data-type="tag" title="Remove Tag"></i>';
......
...@@ -465,11 +465,11 @@ define(['require', ...@@ -465,11 +465,11 @@ define(['require',
var name = Utils.getName(model.toJSON(), 'name'); var name = Utils.getName(model.toJSON(), 'name');
if (model.get('category') == 'ENTITY' && (serviceTypeToBefiltered && serviceTypeToBefiltered.length ? _.contains(serviceTypeToBefiltered, model.get('serviceType')) : true)) { if (model.get('category') == 'ENTITY' && (serviceTypeToBefiltered && serviceTypeToBefiltered.length ? _.contains(serviceTypeToBefiltered, model.get('serviceType')) : true)) {
var entityCount = (that.entityCountObj.entity.entityActive[name] + (that.entityCountObj.entity.entityDeleted[name] ? that.entityCountObj.entity.entityDeleted[name] : 0)); var entityCount = (that.entityCountObj.entity.entityActive[name] + (that.entityCountObj.entity.entityDeleted[name] ? that.entityCountObj.entity.entityDeleted[name] : 0));
typeStr += '<option value="' + (name) + '" data-name="' + (name) + '">' + (name) + ' ' + (entityCount ? "(" + entityCount + ")" : '') + '</option>'; typeStr += '<option value="' + (name) + '" data-name="' + (name) + '">' + (name) + ' ' + (entityCount ? "(" + _.numberFormatWithComa(entityCount) + ")" : '') + '</option>';
} }
if (isTypeOnly == undefined && model.get('category') == 'CLASSIFICATION') { if (isTypeOnly == undefined && model.get('category') == 'CLASSIFICATION') {
var tagEntityCount = that.entityCountObj.tag.tagEntities[name]; var tagEntityCount = that.entityCountObj.tag.tagEntities[name];
tagStr += '<option value="' + (name) + '" data-name="' + (name) + '">' + (name) + ' ' + (tagEntityCount ? "(" + tagEntityCount + ")" : '') + '</option>'; tagStr += '<option value="' + (name) + '" data-name="' + (name) + '">' + (name) + ' ' + (tagEntityCount ? "(" + _.numberFormatWithComa(tagEntityCount) + ")" : '') + '</option>';
} }
}); });
if (_.isUndefined(isTypeOnly)) { if (_.isUndefined(isTypeOnly)) {
......
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