You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ga...@apache.org on 2016/02/22 06:35:26 UTC
[1/5] incubator-ranger git commit: RANGER-799 : Ranger UI fixes -
partial search not working on Policy listing page
Repository: incubator-ranger
Updated Branches:
refs/heads/ranger-0.5 4b6b64100 -> 082d0f282
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/themejs/1.3.0/bootstrap.min.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/themejs/1.3.0/bootstrap.min.js b/security-admin/src/main/webapp/themejs/1.3.0/bootstrap.min.js
deleted file mode 100644
index 935de7a..0000000
--- a/security-admin/src/main/webapp/themejs/1.3.0/bootstrap.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(a){a(function(){a.support.transition=(function(){var b=(function(){var e=document.createElement("bootstrap"),d={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},c;for(c in d){if(e.style[c]!==undefined){return d[c]}}}());return b&&{end:b}})()})}(window.jQuery);!function(d){var c='[data-dismiss="alert"]',b=function(e){d(e).on("click",c,this.close)};b.prototype.close=function(j){var i=d(this),g=i.attr("data-target"),h;if(!g){g=i.attr("href");g=g&&g.replace(/.*(?=#[^\s]*$)/,"")}h=d(g);j&&j.preventDefault();h.length||(h=i.hasClass("alert")?i:i.parent());h.trigger(j=d.Event("close"));if(j.isDefaultPrevented()){return}h.removeClass("in");function f(){h.trigger("closed").remove()}d.support.transition&&h.hasClass("fade")?h.on(d.support.transition.end,f):f()};var a=d.fn.alert;d.fn.alert=function(e){return this.each(function(){var g=d(this),f=g.data("alert");if(!f){g.data("alert",(f=new b(this
)))}if(typeof e=="string"){f[e].call(g)}})};d.fn.alert.Constructor=b;d.fn.alert.noConflict=function(){d.fn.alert=a;return this};d(document).on("click.alert.data-api",c,b.prototype.close)}(window.jQuery);!function(c){var b=function(e,d){this.$element=c(e);this.options=c.extend({},c.fn.button.defaults,d)};b.prototype.setState=function(g){var i="disabled",e=this.$element,f=e.data(),h=e.is("input")?"val":"html";g=g+"Text";f.resetText||e.data("resetText",e[h]());e[h](f[g]||this.options[g]);setTimeout(function(){g=="loadingText"?e.addClass(i).attr(i,i):e.removeClass(i).removeAttr(i)},0)};b.prototype.toggle=function(){var d=this.$element.closest('[data-toggle="buttons-radio"]');d&&d.find(".active").removeClass("active");this.$element.toggleClass("active")};var a=c.fn.button;c.fn.button=function(d){return this.each(function(){var g=c(this),f=g.data("button"),e=typeof d=="object"&&d;if(!f){g.data("button",(f=new b(this,e)))}if(d=="toggle"){f.toggle()}else{if(d){f.setState(d)}}})};c.fn.button
.defaults={loadingText:"loading..."};c.fn.button.Constructor=b;c.fn.button.noConflict=function(){c.fn.button=a;return this};c(document).on("click.button.data-api","[data-toggle^=button]",function(f){var d=c(f.target);if(!d.hasClass("btn")){d=d.closest(".btn")}d.button("toggle")})}(window.jQuery);!function(b){var c=function(e,d){this.$element=b(e);this.$indicators=this.$element.find(".carousel-indicators");this.options=d;this.options.pause=="hover"&&this.$element.on("mouseenter",b.proxy(this.pause,this)).on("mouseleave",b.proxy(this.cycle,this))};c.prototype={cycle:function(d){if(!d){this.paused=false}if(this.interval){clearInterval(this.interval)}this.options.interval&&!this.paused&&(this.interval=setInterval(b.proxy(this.next,this),this.options.interval));return this},getActiveIndex:function(){this.$active=this.$element.find(".item.active");this.$items=this.$active.parent().children();return this.$items.index(this.$active)},to:function(f){var d=this.getActiveIndex(),e=this;if(f>(th
is.$items.length-1)||f<0){return}if(this.sliding){return this.$element.one("slid",function(){e.to(f)})}if(d==f){return this.pause().cycle()}return this.slide(f>d?"next":"prev",b(this.$items[f]))},pause:function(d){if(!d){this.paused=true}if(this.$element.find(".next, .prev").length&&b.support.transition.end){this.$element.trigger(b.support.transition.end);this.cycle(true)}clearInterval(this.interval);this.interval=null;return this},next:function(){if(this.sliding){return}return this.slide("next")},prev:function(){if(this.sliding){return}return this.slide("prev")},slide:function(k,f){var m=this.$element.find(".item.active"),d=f||m[k](),j=this.interval,l=k=="next"?"left":"right",g=k=="next"?"first":"last",h=this,i;this.sliding=true;j&&this.pause();d=d.length?d:this.$element.find(".item")[g]();i=b.Event("slide",{relatedTarget:d[0],direction:l});if(d.hasClass("active")){return}if(this.$indicators.length){this.$indicators.find(".active").removeClass("active");this.$element.one("slid",fun
ction(){var e=b(h.$indicators.children()[h.getActiveIndex()]);e&&e.addClass("active")})}if(b.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(i);if(i.isDefaultPrevented()){return}d.addClass(k);d[0].offsetWidth;m.addClass(l);d.addClass(l);this.$element.one(b.support.transition.end,function(){d.removeClass([k,l].join(" ")).addClass("active");m.removeClass(["active",l].join(" "));h.sliding=false;setTimeout(function(){h.$element.trigger("slid")},0)})}else{this.$element.trigger(i);if(i.isDefaultPrevented()){return}m.removeClass("active");d.addClass("active");this.sliding=false;this.$element.trigger("slid")}j&&this.cycle();return this}};var a=b.fn.carousel;b.fn.carousel=function(d){return this.each(function(){var h=b(this),g=h.data("carousel"),e=b.extend({},b.fn.carousel.defaults,typeof d=="object"&&d),f=typeof d=="string"?d:e.slide;if(!g){h.data("carousel",(g=new c(this,e)))}if(typeof d=="number"){g.to(d)}else{if(f){g[f]()}else{if(e.interval){g.pause().cycle()}}
}})};b.fn.carousel.defaults={interval:5000,pause:"hover"};b.fn.carousel.Constructor=c;b.fn.carousel.noConflict=function(){b.fn.carousel=a;return this};b(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(j){var i=b(this),f,d=b(i.attr("data-target")||(f=i.attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")),g=b.extend({},d.data(),i.data()),h;d.carousel(g);if(h=i.attr("data-slide-to")){d.data("carousel").pause().to(h).cycle()}j.preventDefault()})}(window.jQuery);!function(b){var c=function(e,d){this.$element=b(e);this.options=b.extend({},b.fn.collapse.defaults,d);if(this.options.parent){this.$parent=b(this.options.parent)}this.options.toggle&&this.toggle()};c.prototype={constructor:c,dimension:function(){var d=this.$element.hasClass("width");return d?"width":"height"},show:function(){var g,d,f,e;if(this.transitioning||this.$element.hasClass("in")){return}g=this.dimension();d=b.camelCase(["scroll",g].join("-"));f=this.$parent&&this.$parent.find("> .accordion-grou
p > .in");if(f&&f.length){e=f.data("collapse");if(e&&e.transitioning){return}f.collapse("hide");e||f.data("collapse",null)}this.$element[g](0);this.transition("addClass",b.Event("show"),"shown");b.support.transition&&this.$element[g](this.$element[0][d])},hide:function(){var d;if(this.transitioning||!this.$element.hasClass("in")){return}d=this.dimension();this.reset(this.$element[d]());this.transition("removeClass",b.Event("hide"),"hidden");this.$element[d](0)},reset:function(d){var e=this.dimension();this.$element.removeClass("collapse")[e](d||"auto")[0].offsetWidth;this.$element[d!==null?"addClass":"removeClass"]("collapse");return this},transition:function(h,e,f){var g=this,d=function(){if(e.type=="show"){g.reset()}g.transitioning=0;g.$element.trigger(f)};this.$element.trigger(e);if(e.isDefaultPrevented()){return}this.transitioning=1;this.$element[h]("in");b.support.transition&&this.$element.hasClass("collapse")?this.$element.one(b.support.transition.end,d):d()},toggle:function()
{this[this.$element.hasClass("in")?"hide":"show"]()}};var a=b.fn.collapse;b.fn.collapse=function(d){return this.each(function(){var g=b(this),f=g.data("collapse"),e=b.extend({},b.fn.collapse.defaults,g.data(),typeof d=="object"&&d);if(!f){g.data("collapse",(f=new c(this,e)))}if(typeof d=="string"){f[d]()}})};b.fn.collapse.defaults={toggle:true};b.fn.collapse.Constructor=c;b.fn.collapse.noConflict=function(){b.fn.collapse=a;return this};b(document).on("click.collapse.data-api","[data-toggle=collapse]",function(i){var h=b(this),d,g=h.attr("data-target")||i.preventDefault()||(d=h.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=b(g).data("collapse")?"toggle":h.data();h[b(g).hasClass("in")?"addClass":"removeClass"]("collapsed");b(g).collapse(f)})}(window.jQuery);!function(f){var b="[data-toggle=dropdown]",a=function(h){var g=f(h).on("click.dropdown.data-api",this.toggle);f("html").on("click.dropdown.data-api",function(){g.parent().removeClass("open")})};a.prototype={constructor:a,toggle:
function(j){var i=f(this),h,g;if(i.is(".disabled, :disabled")){return}h=e(i);g=h.hasClass("open");d();if(!g){if("ontouchstart" in document.documentElement){f('<div class="dropdown-backdrop"/>').insertBefore(f(this)).on("click",d)}h.toggleClass("open")}i.focus();return false},keydown:function(l){var k,m,g,j,i,h;if(!/(38|40|27)/.test(l.keyCode)){return}k=f(this);l.preventDefault();l.stopPropagation();if(k.is(".disabled, :disabled")){return}j=e(k);i=j.hasClass("open");if(!i||(i&&l.keyCode==27)){if(l.which==27){j.find(b).focus()}return k.click()}m=f("[role=menu] li:not(.divider):visible a",j);if(!m.length){return}h=m.index(m.filter(":focus"));if(l.keyCode==38&&h>0){h--}if(l.keyCode==40&&h<m.length-1){h++}if(!~h){h=0}m.eq(h).focus()}};function d(){f(".dropdown-backdrop").remove();f(b).each(function(){e(f(this)).removeClass("open")})}function e(i){var g=i.attr("data-target"),h;if(!g){g=i.attr("href");g=g&&/#/.test(g)&&g.replace(/.*(?=#[^\s]*$)/,"")}h=g&&f(g);if(!h||!h.length){h=i.parent()
}return h}var c=f.fn.dropdown;f.fn.dropdown=function(g){return this.each(function(){var i=f(this),h=i.data("dropdown");if(!h){i.data("dropdown",(h=new a(this)))}if(typeof g=="string"){h[g].call(i)}})};f.fn.dropdown.Constructor=a;f.fn.dropdown.noConflict=function(){f.fn.dropdown=c;return this};f(document).on("click.dropdown.data-api",d).on("click.dropdown.data-api",".dropdown form",function(g){g.stopPropagation()}).on("click.dropdown.data-api",b,a.prototype.toggle).on("keydown.dropdown.data-api",b+", [role=menu]",a.prototype.keydown)}(window.jQuery);!function(c){var b=function(e,d){this.options=d;this.$element=c(e).delegate('[data-dismiss="modal"]',"click.dismiss.modal",c.proxy(this.hide,this));this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};b.prototype={constructor:b,toggle:function(){return this[!this.isShown?"show":"hide"]()},show:function(){var d=this,f=c.Event("show");this.$element.trigger(f);if(this.isShown||f.isDefaultPrevented()){return}this.
isShown=true;this.escape();this.backdrop(function(){var e=c.support.transition&&d.$element.hasClass("fade");if(!d.$element.parent().length){d.$element.appendTo(document.body)}d.$element.show();if(e){d.$element[0].offsetWidth}d.$element.addClass("in").attr("aria-hidden",false);d.enforceFocus();e?d.$element.one(c.support.transition.end,function(){d.$element.focus().trigger("shown")}):d.$element.focus().trigger("shown")})},hide:function(f){f&&f.preventDefault();var d=this;f=c.Event("hide");this.$element.trigger(f);if(!this.isShown||f.isDefaultPrevented()){return}this.isShown=false;this.escape();c(document).off("focusin.modal");this.$element.removeClass("in").attr("aria-hidden",true);c.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var d=this;c(document).on("focusin.modal",function(f){if(d.$element[0]!==f.target&&!d.$element.has(f.target).length){d.$element.focus()}})},escape:function(){var d=this;if(this.isShown&&t
his.options.keyboard){this.$element.on("keyup.dismiss.modal",function(f){f.which==27&&d.hide()})}else{if(!this.isShown){this.$element.off("keyup.dismiss.modal")}}},hideWithTransition:function(){var d=this,e=setTimeout(function(){d.$element.off(c.support.transition.end);d.hideModal()},500);this.$element.one(c.support.transition.end,function(){clearTimeout(e);d.hideModal()})},hideModal:function(){var d=this;this.$element.hide();this.backdrop(function(){d.removeBackdrop();d.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null},backdrop:function(g){var f=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=c.support.transition&&e;this.$backdrop=c('<div class="modal-backdrop '+e+'" />').appendTo(document.body);this.$backdrop.click(this.options.backdrop=="static"?c.proxy(this.$element[0].focus,this.$element[0]):c.proxy(this.hide,this));if(d){this.$backdrop[0].offsetWidth}this.$backdrop.
addClass("in");if(!g){return}d?this.$backdrop.one(c.support.transition.end,g):g()}else{if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");c.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(c.support.transition.end,g):g()}else{if(g){g()}}}}};var a=c.fn.modal;c.fn.modal=function(d){return this.each(function(){var g=c(this),f=g.data("modal"),e=c.extend({},c.fn.modal.defaults,g.data(),typeof d=="object"&&d);if(!f){g.data("modal",(f=new b(this,e)))}if(typeof d=="string"){f[d]()}else{if(e.show){f.show()}}})};c.fn.modal.defaults={backdrop:true,keyboard:true,show:true};c.fn.modal.Constructor=b;c.fn.modal.noConflict=function(){c.fn.modal=a;return this};c(document).on("click.modal.data-api",'[data-toggle="modal"]',function(i){var h=c(this),f=h.attr("href"),d=c(h.attr("data-target")||(f&&f.replace(/.*(?=#[^\s]+$)/,""))),g=d.data("modal")?"toggle":c.extend({remote:!/#/.test(f)&&f},d.data(),h.data());i.preventDefault();d.modal(g).one("hide",function(){h.focus
()})})}(window.jQuery);!function(c){var b=function(e,d){this.init("tooltip",e,d)};b.prototype={constructor:b,init:function(k,h,f){var l,d,j,e,g;this.type=k;this.$element=c(h);this.options=this.getOptions(f);this.enabled=true;j=this.options.trigger.split(" ");for(g=j.length;g--;){e=j[g];if(e=="click"){this.$element.on("click."+this.type,this.options.selector,c.proxy(this.toggle,this))}else{if(e!="manual"){l=e=="hover"?"mouseenter":"focus";d=e=="hover"?"mouseleave":"blur";this.$element.on(l+"."+this.type,this.options.selector,c.proxy(this.enter,this));this.$element.on(d+"."+this.type,this.options.selector,c.proxy(this.leave,this))}}}this.options.selector?(this._options=c.extend({},this.options,{trigger:"manual",selector:""})):this.fixTitle()},getOptions:function(d){d=c.extend({},c.fn[this.type].defaults,this.$element.data(),d);if(d.delay&&typeof d.delay=="number"){d.delay={show:d.delay,hide:d.delay}}return d},enter:function(h){var g=c.fn[this.type].defaults,f={},d;this._options&&c.eac
h(this._options,function(e,i){if(g[e]!=i){f[e]=i}},this);d=c(h.currentTarget)[this.type](f).data(this.type);if(!d.options.delay||!d.options.delay.show){return d.show()}clearTimeout(this.timeout);d.hoverState="in";this.timeout=setTimeout(function(){if(d.hoverState=="in"){d.show()}},d.options.delay.show)},leave:function(f){var d=c(f.currentTarget)[this.type](this._options).data(this.type);if(this.timeout){clearTimeout(this.timeout)}if(!d.options.delay||!d.options.delay.hide){return d.hide()}d.hoverState="out";this.timeout=setTimeout(function(){if(d.hoverState=="out"){d.hide()}},d.options.delay.hide)},show:function(){var i,k,g,j,d,h,f=c.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(f);if(f.isDefaultPrevented()){return}i=this.tip();this.setContent();if(this.options.animation){i.addClass("fade")}d=typeof this.options.placement=="function"?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement;i.detach().css({top:0,left:0,display:"block"})
;this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);k=this.getPosition();g=i[0].offsetWidth;j=i[0].offsetHeight;switch(d){case"bottom":h={top:k.top+k.height,left:k.left+k.width/2-g/2};break;case"top":h={top:k.top-j,left:k.left+k.width/2-g/2};break;case"left":h={top:k.top+k.height/2-j/2,left:k.left-g};break;case"right":h={top:k.top+k.height/2-j/2,left:k.left+k.width};break}this.applyPlacement(h,d);this.$element.trigger("shown")}},applyPlacement:function(g,h){var i=this.tip(),e=i[0].offsetWidth,l=i[0].offsetHeight,d,j,k,f;i.offset(g).addClass(h).addClass("in");d=i[0].offsetWidth;j=i[0].offsetHeight;if(h=="top"&&j!=l){g.top=g.top+l-j;f=true}if(h=="bottom"||h=="top"){k=0;if(g.left<0){k=g.left*-2;g.left=0;i.offset(g);d=i[0].offsetWidth;j=i[0].offsetHeight}this.replaceArrow(k-e+d,d,"left")}else{this.replaceArrow(j-l,j,"top")}if(f){i.offset(g)}},replaceArrow:function(f,e,d){this.arrow().css(d,f?(50*(1-f/e)+"%"):"")},setContent:function(){var e=this.tip()
,d=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](d);e.removeClass("fade in top bottom left right")},hide:function(){var d=this,g=this.tip(),f=c.Event("hide");this.$element.trigger(f);if(f.isDefaultPrevented()){return}g.removeClass("in");function h(){var e=setTimeout(function(){g.off(c.support.transition.end).detach()},500);g.one(c.support.transition.end,function(){clearTimeout(e);g.detach()})}c.support.transition&&this.$tip.hasClass("fade")?h():g.detach();this.$element.trigger("hidden");return this},fixTitle:function(){var d=this.$element;if(d.attr("title")||typeof(d.attr("data-original-title"))!="string"){d.attr("data-original-title",d.attr("title")||"").attr("title","")}},hasContent:function(){return this.getTitle()},getPosition:function(){var d=this.$element[0];return c.extend({},(typeof d.getBoundingClientRect=="function")?d.getBoundingClientRect():{width:d.offsetWidth,height:d.offsetHeight},this.$element.offset())},getTitle:function(){var f,d=this.$e
lement,e=this.options;f=d.attr("data-original-title")||(typeof e.title=="function"?e.title.call(d[0]):e.title);return f},tip:function(){return this.$tip=this.$tip||c(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(f){var d=f?c(f.currentTarget)[this.type](this._options).data(this.type):this;d.tip().hasClass("in")?d.hide():d.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var a=c.fn.tooltip;c.fn.tooltip=function(d){return this.each(function(){var g=c(this),f=g.data("tooltip"),e=typeof d=="object"&&d;if(!f){g.data("tooltip",(f=new b(this,e)))}if(typeof d=="string"){f[d]()}})};c.fn.tooltip.Constructor=b;c.fn.tooltip.defaults={animation:true,
placement:"top",selector:false,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:false,container:false};c.fn.tooltip.noConflict=function(){c.fn.tooltip=a;return this}}(window.jQuery);!function(c){var b=function(e,d){this.init("popover",e,d)};b.prototype=c.extend({},c.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var f=this.tip(),e=this.getTitle(),d=this.getContent();f.find(".popover-title")[this.options.html?"html":"text"](e);f.find(".popover-content")[this.options.html?"html":"text"](d);f.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,d=this.$element,f=this.options;e=(typeof f.content=="function"?f.content.call(d[0]):f.content)||d.attr("data-content");return e},tip:function(){if(!this.$tip){this.$tip=c(this.options.template)}return this.$tip},destroy:function(){this.hide
().$element.off("."+this.type).removeData(this.type)}});var a=c.fn.popover;c.fn.popover=function(d){return this.each(function(){var g=c(this),f=g.data("popover"),e=typeof d=="object"&&d;if(!f){g.data("popover",(f=new b(this,e)))}if(typeof d=="string"){f[d]()}})};c.fn.popover.Constructor=b;c.fn.popover.defaults=c.extend({},c.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'});c.fn.popover.noConflict=function(){c.fn.popover=a;return this}}(window.jQuery);!function(c){function b(g,f){var h=c.proxy(this.process,this),d=c(g).is("body")?c(window):c(g),e;this.options=c.extend({},c.fn.scrollspy.defaults,f);this.$scrollElement=d.on("scroll.scroll-spy.data-api",h);this.selector=(this.options.target||((e=c(g).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,""))||"")+" .nav li > a";this.$body=c("body");this.refresh();this.process()}b.prototype={constructor:
b,refresh:function(){var d=this,e;this.offsets=c([]);this.targets=c([]);e=this.$body.find(this.selector).map(function(){var g=c(this),f=g.data("target")||g.attr("href"),h=/^#\w/.test(f)&&c(f);return(h&&h.length&&[[h.position().top+(!c.isWindow(d.$scrollElement.get(0))&&d.$scrollElement.scrollTop()),f]])||null}).sort(function(g,f){return g[0]-f[0]}).each(function(){d.offsets.push(this[0]);d.targets.push(this[1])})},process:function(){var j=this.$scrollElement.scrollTop()+this.options.offset,f=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,h=f-this.$scrollElement.height(),g=this.offsets,d=this.targets,k=this.activeTarget,e;if(j>=h){return k!=(e=d.last()[0])&&this.activate(e)}for(e=g.length;e--;){k!=d[e]&&j>=g[e]&&(!g[e+1]||j<=g[e+1])&&this.activate(d[e])}},activate:function(f){var e,d;this.activeTarget=f;c(this.selector).parent(".active").removeClass("active");d=this.selector+'[data-target="'+f+'"],'+this.selector+'[href="'+f+'"]';e=c(d).parent("li").addClass("active"
);if(e.parent(".dropdown-menu").length){e=e.closest("li.dropdown").addClass("active")}e.trigger("activate")}};var a=c.fn.scrollspy;c.fn.scrollspy=function(d){return this.each(function(){var g=c(this),f=g.data("scrollspy"),e=typeof d=="object"&&d;if(!f){g.data("scrollspy",(f=new b(this,e)))}if(typeof d=="string"){f[d]()}})};c.fn.scrollspy.Constructor=b;c.fn.scrollspy.defaults={offset:10};c.fn.scrollspy.noConflict=function(){c.fn.scrollspy=a;return this};c(window).on("load",function(){c('[data-spy="scroll"]').each(function(){var d=c(this);d.scrollspy(d.data())})})}(window.jQuery);!function(c){var b=function(d){this.element=c(d)};b.prototype={constructor:b,show:function(){var j=this.element,g=j.closest("ul:not(.dropdown-menu)"),f=j.attr("data-target"),h,d,i;if(!f){f=j.attr("href");f=f&&f.replace(/.*(?=#[^\s]*$)/,"")}if(j.parent("li").hasClass("active")){return}h=g.find(".active:last a")[0];i=c.Event("show",{relatedTarget:h});j.trigger(i);if(i.isDefaultPrevented()){return}d=c(f);this.ac
tivate(j.parent("li"),g);this.activate(d,d.parent(),function(){j.trigger({type:"shown",relatedTarget:h})})},activate:function(f,e,i){var d=e.find("> .active"),h=i&&c.support.transition&&d.hasClass("fade");function g(){d.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");f.addClass("active");if(h){f[0].offsetWidth;f.addClass("in")}else{f.removeClass("fade")}if(f.parent(".dropdown-menu")){f.closest("li.dropdown").addClass("active")}i&&i()}h?d.one(c.support.transition.end,g):g();d.removeClass("in")}};var a=c.fn.tab;c.fn.tab=function(d){return this.each(function(){var f=c(this),e=f.data("tab");if(!e){f.data("tab",(e=new b(this)))}if(typeof d=="string"){e[d]()}})};c.fn.tab.Constructor=b;c.fn.tab.noConflict=function(){c.fn.tab=a;return this};c(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(d){d.preventDefault();c(this).tab("show")})}(window.jQuery);!function(b){var c=function(e,d){this.$element=b(e);this.options=b.extend(
{},b.fn.typeahead.defaults,d);this.matcher=this.options.matcher||this.matcher;this.sorter=this.options.sorter||this.sorter;this.highlighter=this.options.highlighter||this.highlighter;this.updater=this.options.updater||this.updater;this.source=this.options.source;this.$menu=b(this.options.menu);this.shown=false;this.listen()};c.prototype={constructor:c,select:function(){var d=this.$menu.find(".active").attr("data-value");this.$element.val(this.updater(d)).change();return this.hide()},updater:function(d){return d},show:function(){var d=b.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});this.$menu.insertAfter(this.$element).css({top:d.top+d.height,left:d.left}).show();this.shown=true;return this},hide:function(){this.$menu.hide();this.shown=false;return this},lookup:function(e){var d;this.query=this.$element.val();if(!this.query||this.query.length<this.options.minLength){return this.shown?this.hide():this}d=b.isFunction(this.source)?this.source(this.query,b.pr
oxy(this.process,this)):this.source;return d?this.process(d):this},process:function(d){var e=this;d=b.grep(d,function(f){return e.matcher(f)});d=this.sorter(d);if(!d.length){return this.shown?this.hide():this}return this.render(d.slice(0,this.options.items)).show()},matcher:function(d){return ~d.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(f){var g=[],e=[],d=[],h;while(h=f.shift()){if(!h.toLowerCase().indexOf(this.query.toLowerCase())){g.push(h)}else{if(~h.indexOf(this.query)){e.push(h)}else{d.push(h)}}}return g.concat(e,d)},highlighter:function(d){var e=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return d.replace(new RegExp("("+e+")","ig"),function(f,g){return"<strong>"+g+"</strong>"})},render:function(d){var e=this;d=b(d).map(function(f,g){f=b(e.options.item).attr("data-value",g);f.find("a").html(e.highlighter(g));return f[0]});d.first().addClass("active");this.$menu.html(d);return this},next:function(e){var f=this.$menu.find(".active").removeClass
("active"),d=f.next();if(!d.length){d=b(this.$menu.find("li")[0])}d.addClass("active")},prev:function(e){var f=this.$menu.find(".active").removeClass("active"),d=f.prev();if(!d.length){d=this.$menu.find("li").last()}d.addClass("active")},listen:function(){this.$element.on("focus",b.proxy(this.focus,this)).on("blur",b.proxy(this.blur,this)).on("keypress",b.proxy(this.keypress,this)).on("keyup",b.proxy(this.keyup,this));if(this.eventSupported("keydown")){this.$element.on("keydown",b.proxy(this.keydown,this))}this.$menu.on("click",b.proxy(this.click,this)).on("mouseenter","li",b.proxy(this.mouseenter,this)).on("mouseleave","li",b.proxy(this.mouseleave,this))},eventSupported:function(d){var e=d in this.$element;if(!e){this.$element.setAttribute(d,"return;");e=typeof this.$element[d]==="function"}return e},move:function(d){if(!this.shown){return}switch(d.keyCode){case 9:case 13:case 27:d.preventDefault();break;case 38:d.preventDefault();this.prev();break;case 40:d.preventDefault();this.n
ext();break}d.stopPropagation()},keydown:function(d){this.suppressKeyPressRepeat=~b.inArray(d.keyCode,[40,38,9,13,27]);this.move(d)},keypress:function(d){if(this.suppressKeyPressRepeat){return}this.move(d)},keyup:function(d){switch(d.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown){return}this.select();break;case 27:if(!this.shown){return}this.hide();break;default:this.lookup()}d.stopPropagation();d.preventDefault()},focus:function(d){this.focused=true},blur:function(d){this.focused=false;if(!this.mousedover&&this.shown){this.hide()}},click:function(d){d.stopPropagation();d.preventDefault();this.select();this.$element.focus()},mouseenter:function(d){this.mousedover=true;this.$menu.find(".active").removeClass("active");b(d.currentTarget).addClass("active")},mouseleave:function(d){this.mousedover=false;if(!this.focused&&this.shown){this.hide()}}};var a=b.fn.typeahead;b.fn.typeahead=function(d){return this.each(function(){var g=b(this),f=g.data("typ
eahead"),e=typeof d=="object"&&d;if(!f){g.data("typeahead",(f=new c(this,e)))}if(typeof d=="string"){f[d]()}})};b.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1};b.fn.typeahead.Constructor=c;b.fn.typeahead.noConflict=function(){b.fn.typeahead=a;return this};b(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(f){var d=b(this);if(d.data("typeahead")){return}d.typeahead(d.data())})}(window.jQuery);!function(c){var b=function(e,d){this.options=c.extend({},c.fn.affix.defaults,d);this.$window=c(window).on("scroll.affix.data-api",c.proxy(this.checkPosition,this)).on("click.affix.data-api",c.proxy(function(){setTimeout(c.proxy(this.checkPosition,this),1)},this));this.$element=c(e);this.checkPosition()};b.prototype.checkPosition=function(){if(!this.$element.is(":visible")){return}var h=c(document).height(),j=this.$window.scrollTop(),d=this.$element.offset(),k=this.options.offse
t,f=k.bottom,g=k.top,i="affix affix-top affix-bottom",e;if(typeof k!="object"){f=g=k}if(typeof g=="function"){g=k.top()}if(typeof f=="function"){f=k.bottom()}e=this.unpin!=null&&(j+this.unpin<=d.top)?false:f!=null&&(d.top+this.$element.height()>=h-f)?"bottom":g!=null&&j<=g?"top":false;if(this.affixed===e){return}this.affixed=e;this.unpin=e=="bottom"?d.top-j:null;this.$element.removeClass(i).addClass("affix"+(e?"-"+e:""))};var a=c.fn.affix;c.fn.affix=function(d){return this.each(function(){var g=c(this),f=g.data("affix"),e=typeof d=="object"&&d;if(!f){g.data("affix",(f=new b(this,e)))}if(typeof d=="string"){f[d]()}})};c.fn.affix.Constructor=b;c.fn.affix.defaults={offset:0};c.fn.affix.noConflict=function(){c.fn.affix=a;return this};c(window).on("load",function(){c('[data-spy="affix"]').each(function(){var e=c(this),d=e.data();d.offset=d.offset||{};d.offsetBottom&&(d.offset.bottom=d.offsetBottom);d.offsetTop&&(d.offset.top=d.offsetTop);e.affix(d)})})}(window.jQuery);
\ No newline at end of file
[3/5] incubator-ranger git commit: RANGER-799 : Ranger UI fixes -
partial search not working on Policy listing page
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/service/ServiceCreate.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/service/ServiceCreate.js b/security-admin/src/main/webapp/scripts/views/service/ServiceCreate.js
index f3b8d70..0e5d784 100644
--- a/security-admin/src/main/webapp/scripts/views/service/ServiceCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/service/ServiceCreate.js
@@ -49,7 +49,7 @@ define(function(require){
breadCrumbs :function(){
if(this.model.isNew())
- return [XALinks.get('ServiceManager'), XALinks.get('ServiceCreate', {model:this.model})];
+ return [XALinks.get('ServiceManager'), XALinks.get('ServiceCreate')];
else
return [XALinks.get('ServiceManager'), XALinks.get('ServiceEdit')];
},
@@ -85,9 +85,6 @@ define(function(require){
console.log("initialized a ServiceCreate Layout");
_.extend(this, _.pick(options, 'serviceTypeId'));
this.initializeServiceDef();
- /*if(! this.model.isNew()){
- this.setupModel();
- }*/
this.form = new ServiceForm({
model : this.model,
rangerServiceDefModel : this.rangerServiceDefModel,
@@ -119,9 +116,6 @@ define(function(require){
if(!this.editService){
this.ui.btnDelete.hide();
this.ui.btnSave.html('Add');
- } else {
-
- // XAUtil.preventNavigation(localization.tt('dialogMsg.preventNavRepositoryForm'));
}
this.rForm.show(this.form);
this.rForm.$el.dirtyFields();
@@ -176,7 +170,6 @@ define(function(require){
onDelete :function(){
var that = this;
XAUtil.confirmPopup({
- //msg :localize.tt('msg.confirmDelete'),
msg :'Are you sure want to delete ?',
callback : function(){
XAUtil.blockUI();
@@ -192,7 +185,7 @@ define(function(require){
XAUtil.blockUI('unblock');
if ( response && response.responseJSON && response.responseJSON.msgDesc){
XAUtil.notifyError('Error', response.responseJSON.msgDesc);
- }else{
+ } else {
XAUtil.notifyError('Error', 'Error occured while deleting service!');
}
}
@@ -224,7 +217,7 @@ define(function(require){
var div = '<div class="showMore connection-error-font"><br>'+msResponse.messageList[0].message.split('\n').join('<br>')+'</div>'
$(e.delegateTarget).find('.modal-body').append(div)
$(e.currentTarget).html('Show Less..')
- }else{
+ } else {
$(e.delegateTarget).find('.showMore').remove();
$(e.currentTarget).html('Show More..')
}
@@ -234,22 +227,22 @@ define(function(require){
label: "OK",
callback:function(){}
}];
- }else{
+ } else {
popupBtnOpts = [{label: "OK",
callback:function(){}
}];
}
var msgHtml = '<b>Connection Failed.</b></br>'+msResponse.msgDesc;
bootbox.dialog(msgHtml, popupBtnOpts);
- }else{
+ } else {
bootbox.alert("Connection Failed.");
}
- }else{
+ } else {
bootbox.alert("Connection Failed.");
}
- }
- else
+ } else {
bootbox.alert("Connected Successfully.");
+ }
},
error: function (msResponse, options) {
bootbox.alert("Connection Failed.");
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/service/ServiceForm.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/service/ServiceForm.js b/security-admin/src/main/webapp/scripts/views/service/ServiceForm.js
index f073036..92416a2 100644
--- a/security-admin/src/main/webapp/scripts/views/service/ServiceForm.js
+++ b/security-admin/src/main/webapp/scripts/views/service/ServiceForm.js
@@ -46,11 +46,13 @@ define(function(require){
templateData: function(){
var serviceDetail="", serviceConfig="";
_.each(this.schema, function(obj, name){
- if(!_.isUndefined(obj['class']) && obj['class'] == 'serviceConfig')
- serviceConfig += name+",";
- else
- serviceDetail += name+",";
+ if(!_.isUndefined(obj['class']) && obj['class'] == 'serviceConfig'){
+ serviceConfig += name+",";
+ } else {
+ serviceDetail += name+",";
+ }
});
+
return {
serviceDetail : serviceDetail.slice(0,-1),
serviceConfig : serviceConfig.slice(0,-1)
@@ -104,7 +106,7 @@ define(function(require){
var configObj = _.findWhere(this.rangerServiceDefModel.get('configs'),{'name' : name });
if(!_.isUndefined(configObj) && configObj.type == 'bool'){
this.model.set(name, this.getStringFromBoolean(configObj, value))
- }else{
+ } else {
this.model.set(name, value)
if(_.isUndefined(configObj)){
this.extraConfigColl.add(new Backbone.Model({'name' : name, 'value' : value}))
@@ -116,11 +118,11 @@ define(function(require){
setupForm : function() {
if(this.model.isNew()){
this.fields.isEnabled.editor.setValue(XAEnums.ActiveStatus.STATUS_ENABLED.value);
- }else{
- //Set isEnabled Status
+ } else {
+ //Set isEnabled Status
if(XAEnums.ActiveStatus.STATUS_ENABLED.value == this.model.get('isEnabled')){
this.fields.isEnabled.editor.setValue(XAEnums.ActiveStatus.STATUS_ENABLED.value);
- }else{
+ } else {
this.fields.isEnabled.editor.setValue(XAEnums.ActiveStatus.STATUS_DISABLED.value);
}
}
@@ -154,7 +156,7 @@ define(function(require){
if(!_.isNull(obj)){
if(obj.type == 'bool'){
config[obj.name] = that.getBooleanForConfig(obj, that.model);
- }else{
+ } else {
config[obj.name] = _.isNull(that.model.get(obj.name)) ? "" : that.model.get(obj.name).toString();
}
if(!_.isNull(obj.name)) {
@@ -170,7 +172,7 @@ define(function(require){
//Set isEnabled
if(parseInt(this.model.get('isEnabled')) == XAEnums.ActiveStatus.STATUS_ENABLED.value){
this.model.set('isEnabled',true);
- }else{
+ } else {
this.model.set('isEnabled',false);
}
@@ -190,7 +192,7 @@ define(function(require){
var subType = cofigObj.subType.split(':');
if(subType[0].indexOf(model.get(cofigObj.name)) >= 0 ){
return true;
- }else{
+ } else {
return false;
}
},
@@ -198,7 +200,7 @@ define(function(require){
var subType = configObj.subType.split(':');
if(subType[0].toLowerCase().indexOf(value) >= 0 ){
return subType[0].substr(0, subType[0].length - 4);
- }else{
+ } else {
return subType[1].substr(0, subType[0].length - 5);
}
},
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/service/ServiceTableLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/service/ServiceTableLayout.js b/security-admin/src/main/webapp/scripts/views/service/ServiceTableLayout.js
deleted file mode 100644
index 284135b..0000000
--- a/security-admin/src/main/webapp/scripts/views/service/ServiceTableLayout.js
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * 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(function(require){
- 'use strict';
-
- var Backbone = require('backbone');
- var Communicator = require('communicator');
- var App = require('App');
- var XALinks = require('modules/XALinks');
- var XAEnums = require('utils/XAEnums');
- var XAGlobals = require('utils/XAGlobals');
- var localization = require('utils/XALangSupport');
-
- var XABackgrid = require('views/common/XABackgrid');
- var XATableLayout = require('views/common/XATableLayout');
-
- var AssettablelayoutTmpl = require('hbs!tmpl/asset/AssetTableLayout_tmpl');
-
- require('backgrid-filter');
- require('backgrid-paginator');
- require('bootbox');
-
- var AssetTableLayout = Backbone.Marionette.Layout.extend(
- /** @lends AssetTableLayout */
- {
- _viewName : 'AssetTableLayout',
-
- template: AssettablelayoutTmpl,
-
- /*
- breadCrumbs :function(){
- if(this.model.isNew())
- return [XALinks.get(''), XALinks.get('')];
- else
- return [XALinks.get(''), XALinks.get('')];
- },
- */
-
- /** Layout sub regions */
- regions: {
- 'rTableList' : 'div[data-id="r_assettable"]'
- },
-
- /** ui selector cache */
- ui: {},
-
- /** ui events hash */
- events: function() {
- var events = {};
- //events['change ' + this.ui.input] = 'onInputChange';
- return events;
- },
-
- /**
- * intialize a new AssetTableLayout Layout
- * @constructs
- */
- initialize: function(options) {
- console.log("initialized a AssetTableLayout Layout");
-
- _.extend(this, _.pick(options, ''));
-
- this.collection.extraSearchParams = {
- //resourceType : XAEnums.AssetType.ASSET_HDFS.value
- };
-
- this.bindEvents();
- },
-
- /** all events binding here */
- bindEvents : function(){
- /*this.listenTo(this.model, "change:foo", this.modelChanged, this);*/
- /*this.listenTo(communicator.vent,'someView:someEvent', this.someEventHandler, this)'*/
- },
-
- /** on render callback */
- onRender: function() {
- this.initializePlugins();
- this.renderTable();
- },
-
- /** all post render plugin initialization */
- initializePlugins: function(){
- },
-
- renderTable : function(){
- var that = this;
- var TableRow = Backgrid.Row.extend({
- events: {
- 'click' : 'onClick'
- },
- onClick: function (e) {
- if($(e.toElement).is('.icon-edit'))
- return;
- this.$el.parent('tbody').find('tr').removeClass('tr-active');
- this.$el.toggleClass('tr-active');
- that.rFolderInfo.show(new vFolderInfo({
- model : this.model
- }));
-
- }
- });
-
- this.rTableList.show(new XATableLayout({
- columns: this.getColumns(),
- collection: this.collection,
- includeFilter : false,
- gridOpts : {
- row: TableRow,
- header : XABackgrid,
- emptyText : localization.tt('plcHldr.noAssets')
- },
- filterOpts : {
- name: ['name'],
- placeholder: localization.tt('plcHldr.searchByResourcePath'),
- wait: 150
- }
- }));
- },
-
- getColumns : function(){
- var that = this;
- var cols = {
- name : {
- label : localization.tt("lbl.resourcePath"),
- placeholder : 'Resource Path',
- editable:false
- //cell :"uri,"
- /*href: function(model){
- return '#!/policy/' + model.id;
- }*/
- }
-
- };
- return this.collection.constructor.getTableCols(cols, this.collection);
- },
-
-
- /** on close */
- onClose: function(){
- }
-
- });
-
- return AssetTableLayout;
-});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/user/UserProfile.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/user/UserProfile.js b/security-admin/src/main/webapp/scripts/views/user/UserProfile.js
index 79ee687..9c7c7d4 100644
--- a/security-admin/src/main/webapp/scripts/views/user/UserProfile.js
+++ b/security-admin/src/main/webapp/scripts/views/user/UserProfile.js
@@ -81,10 +81,6 @@ define(function(require){
/** on render callback */
onRender: function() {
- /* if(!this.model.isNew()){
- this.$('[data-tab="edit-password"]').hide();
- this.$('[data-tab="edit-basic"]').hide();
- }*/
if(!_.isUndefined(this.model.get('userSource')) && this.model.get('userSource') == XAEnums.UserSource.XA_USER.value){
this.$('[data-tab="edit-password"]').hide();
this.$('[data-tab="edit-basic"]').hide();
@@ -128,8 +124,6 @@ define(function(require){
XAUtil.notifySuccess('Success', "User profile updated successfully !!");
App.appRouter.navigate("#!/policymanager",{trigger: true});
Communicator.vent.trigger('ProfileBar:rerender');
-
- //console.log("success");
},
error: function (model, response, options) {
if(model.responseJSON != undefined && _.isArray(model.responseJSON.messageList)){
@@ -137,8 +131,7 @@ define(function(require){
if (model.responseJSON.msgDesc == "Validation failure"){
XAUtil.notifyError('Error', "Please try different name.");
return;
- }
- else{
+ } else {
XAUtil.notifyError('Error', model.responseJSON.msgDesc);
return;
}
@@ -148,8 +141,9 @@ define(function(require){
if ( response && response.responseJSON && response.responseJSON.msgDesc){
that.form.fields.name.setError(response.responseJSON.msgDesc);
XAUtil.notifyError('Error', response.responseJSON.msgDesc);
- }else
+ }else {
XAUtil.notifyError('Error', 'Error occurred while updating user profile!!');
+ }
//console.log("error");
}
});
@@ -178,18 +172,11 @@ define(function(require){
if(localization.tt(msResponse.responseJSON.msgDesc) == "Invalid new password"){
that.form.fields.newPassword.setError(localization.tt('validationMessages.newPasswordError'));
that.form.fields.reEnterPassword.setError(localization.tt('validationMessages.newPasswordError'));
- }else if(localization.tt(msResponse.responseJSON.msgDesc) == " You can not use old password. "){
+ } else if((msResponse.responseJSON.msgDesc) == "serverMsg.userMgrOldPassword"){
that.form.fields.oldPassword.setError(localization.tt('validationMessages.oldPasswordRepeatError'));
- }
- else{
+ } else {
that.form.fields.oldPassword.setError(localization.tt('validationMessages.oldPasswordError'));
-
}
- //that.form.fields.name.setError(response.responseJSON.msgDesc);
-// XAUtil.notifyError('Error', response.responseJSON.msgDesc);
- //that.form.fields.newPassword.setError(msResponse.responseJSON.msgDesc)
-// that.clearPasswordFields();
- console.log("error");
}
});
},
@@ -199,7 +186,6 @@ define(function(require){
this.form.fields.reEnterPassword.setValue('');
},
onCancel : function(){
-// App.appRouter.navigate("",{trigger: false});
window.history.back();
},
/** on close */
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/user/UserProfileForm.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/user/UserProfileForm.js b/security-admin/src/main/webapp/scripts/views/user/UserProfileForm.js
index b363a10..38ee737 100644
--- a/security-admin/src/main/webapp/scripts/views/user/UserProfileForm.js
+++ b/security-admin/src/main/webapp/scripts/views/user/UserProfileForm.js
@@ -22,7 +22,6 @@ define(function(require){
'use strict';
var Backbone = require('backbone');
-
var localization = require('utils/XALangSupport');
var XAUtil = require('utils/XAUtils');
var XAEnums = require('utils/XAEnums');
@@ -62,8 +61,6 @@ define(function(require){
/** fields for the form
*/
schema :function(){
- var that = this;
- //var plugginAttr = this.getPlugginAttr(true);
},
/** on render callback */
@@ -76,12 +73,13 @@ define(function(require){
if(this.model.has('userRoleList')){
var roleList = this.model.get('userRoleList');
if(!_.isUndefined(roleList) && roleList.length > 0){
- if(XAEnums.UserRoles[roleList[0]].value == XAEnums.UserRoles.ROLE_USER.value)
+ if(XAEnums.UserRoles[roleList[0]].value == XAEnums.UserRoles.ROLE_USER.value){
this.fields.userRoleList.setValue(XAEnums.UserRoles.ROLE_USER.value);
- else if(XAEnums.UserRoles[roleList[0]].value == XAEnums.UserRoles.ROLE_KEY_ADMIN.value)
+ } else if(XAEnums.UserRoles[roleList[0]].value == XAEnums.UserRoles.ROLE_KEY_ADMIN.value){
this.fields.userRoleList.setValue(XAEnums.UserRoles.ROLE_KEY_ADMIN.value);
- else
+ } else {
this.fields.userRoleList.setValue(XAEnums.UserRoles.ROLE_SYS_ADMIN.value);
+ }
}
}
if(!_.isUndefined(this.model.get('userSource')) && this.model.get('userSource') == XAEnums.UserSource.XA_USER.value){
@@ -99,9 +97,7 @@ define(function(require){
this.fields.emailAddress.$el.hide();
this.fields.userRoleList.$el.hide();
this.fields.firstName.editor.validators.pop();
-// this.fields.lastName.editor.validators.pop();
this.fields.lastName.editor.validators = [];
- // this.fields.emailAddress.editor.validators.pop();
this.fields.oldPassword.$el.show();
this.fields.newPassword.$el.show();
@@ -115,14 +111,12 @@ define(function(require){
},
formValidation : function(){
},
-
afterCommit : function(){
-// this.model.unset('userRoleList');
if(this.model.get('userRoleList') == XAEnums.UserRoles.ROLE_SYS_ADMIN.value){
this.model.set('userRoleList',["ROLE_SYS_ADMIN"]);
- }else if(this.model.get('userRoleList') == XAEnums.UserRoles.ROLE_USER.value){
+ } else if(this.model.get('userRoleList') == XAEnums.UserRoles.ROLE_USER.value){
this.model.set('userRoleList',["ROLE_USER"]);
- }else if(this.model.get('userRoleList') == XAEnums.UserRoles.ROLE_KEY_ADMIN.value){
+ } else if(this.model.get('userRoleList') == XAEnums.UserRoles.ROLE_KEY_ADMIN.value){
this.model.set('userRoleList',["ROLE_KEY_ADMIN"]);
}
},
@@ -136,16 +130,13 @@ define(function(require){
loginId : this.model.get('id'),
emailAddress :this.model.get('emailAddress'),
oldPassword : that.fields.oldPassword.getValue()
- //updPassword : this.model.get('newPassword'),
});
this.model.changePassword(this.model.get('id'),vPasswordChange,{
wait: true,
success: function () {
XAUtil.notifySuccess('Success', "User profile updated successfully !!");
- console.log("success");
},
error: function (msResponse, options) {
- console.log("error occured during updated user profile: "+localization.tt(msResponse.responseJSON.msgDesc));
if(!localization.tt(msResponse.responseJSON.msgDesc) == "Invalid new password"){
that.fields.oldPassword.setError(localization.tt('validationMessages.oldPasswordError'));
XAUtil.notifyInfo('',localization.tt('msg.myProfileError'));
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/users/GroupCreate.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/users/GroupCreate.js b/security-admin/src/main/webapp/scripts/views/users/GroupCreate.js
index dca6b13..41678ab 100644
--- a/security-admin/src/main/webapp/scripts/views/users/GroupCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/users/GroupCreate.js
@@ -40,10 +40,8 @@ define(function(require){
template: GroupcreateTmpl,
breadCrumbs :function(){
- if(this.model.isNew())
- return [XALinks.get('Groups'),XALinks.get('GroupCreate')];
- else
- return [XALinks.get('Groups'),XALinks.get('GroupEdit')];
+ return this.model.isNew() ? [XALinks.get('Groups'),XALinks.get('GroupCreate')]
+ : [XALinks.get('Groups'),XALinks.get('GroupEdit')];
},
/** Layout sub regions */
@@ -103,7 +101,7 @@ define(function(require){
initializePlugins: function(){
},
onSave: function(){
- var that =this ;
+ var that = this ;
var errors = this.form.commit({validate : false});
if(! _.isEmpty(errors)){
return;
@@ -134,7 +132,7 @@ define(function(require){
groupList.fetch({
cache:false
}).done(function(){
- var newColl;// = groupList;
+ var newColl;
groupList.getLastPage({
cache : false,
success : function(collection, response, options){
@@ -155,12 +153,14 @@ define(function(require){
error : function (model, response, options) {
XAUtil.blockUI('unblock');
if ( response && response.responseJSON && response.responseJSON.msgDesc){
- if(response.responseJSON.msgDesc == "XGroup already exists")
+ if(response.responseJSON.msgDesc == "XGroup already exists"){
XAUtil.notifyError('Error', "Group name already exists");
- else
+ } else {
XAUtil.notifyError('Error', response.responseJSON.msgDesc);
- }else
+ }
+ }else {
XAUtil.notifyError('Error', 'Error occurred while creating/updating group!');
+ }
}
});
},
@@ -176,4 +176,4 @@ define(function(require){
});
return GroupCreate;
-});
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/users/UserCreate.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/users/UserCreate.js b/security-admin/src/main/webapp/scripts/views/users/UserCreate.js
index 817831d..b0fc105 100644
--- a/security-admin/src/main/webapp/scripts/views/users/UserCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/users/UserCreate.js
@@ -40,10 +40,8 @@ define(function(require){
template: UserCreateTmpl,
breadCrumbs :function(){
- if(this.model.isNew())
- return [XALinks.get('Users'),XALinks.get('UserCreate')];
- else
- return [XALinks.get('Users'),XALinks.get('UserEdit')];
+ return this.model.isNew() ? [XALinks.get('Users'),XALinks.get('UserCreate')]
+ : [XALinks.get('Users'),XALinks.get('UserEdit')];
},
/** Layout sub regions */
@@ -98,7 +96,6 @@ define(function(require){
if(!_.isUndefined(this.model.get('userSource')) && this.model.get('userSource') == XAEnums.UserSource.XA_USER.value){
this.$('[data-tab="edit-password"]').hide();
this.$('[data-tab="edit-basic"]').hide();
-// this.ui.btnSave.hide();
}
this.renderForm();
this.rForm.$el.dirtyFields();
@@ -140,11 +137,7 @@ define(function(require){
this.form.beforeSaveUserDetail();
return;
}
- if(this.showBasicFields){
- this.saveUserDetail();
- }else{
- this.savePasswordDetail();
- }
+ this.showBasicFields ? this.saveUserDetail() : this.savePasswordDetail();
},
saveUserDetail : function(){
@@ -157,7 +150,7 @@ define(function(require){
success: function () {
XAUtil.blockUI('unblock');
XAUtil.allowNavigation();
- var msg = that.editUser ? 'User updated successfully' :'User created successfully';
+ var msg = that.editUser ? localization.tt('msg.userUpdatedSucc') : localization.tt('msg.userCreatedSucc');
XAUtil.notifySuccess('Success', msg);
if(that.editUser){
App.appRouter.navigate("#!/users/usertab",{trigger: true});
@@ -167,9 +160,9 @@ define(function(require){
var userList = new VXUserList();
- userList.fetch({
+ userList.fetch({
cache:false
- }).done(function(){
+ }).done(function(){
var newColl = userList;
userList.getLastPage({
cache : false,
@@ -195,13 +188,14 @@ define(function(require){
error : function(model,resp){
XAUtil.blockUI('unblock');
if(!_.isUndefined(resp.responseJSON) && !_.isUndefined(resp.responseJSON.msgDesc)){
- if(resp.responseJSON.msgDesc == "XUser already exists")
+ if(resp.responseJSON.msgDesc == "XUser already exists"){
XAUtil.notifyError('Error',"User already exists.");
- else
+ } else {
XAUtil.notifyError('Error',resp.responseJSON.msgDesc);
- }else
+ }
+ }else {
XAUtil.notifyError('Error', "Error occurred while creating/updating user.");
-
+ }
}
});
},
@@ -219,12 +213,14 @@ define(function(require){
error : function(model,resp){
XAUtil.blockUI('unblock');
if(!_.isUndefined(resp.responseJSON) && !_.isUndefined(resp.responseJSON.msgDesc)){
- if(resp.responseJSON.msgDesc == "serverMsg.userMgrNewPassword")
+ if(resp.responseJSON.msgDesc == "serverMsg.userMgrNewPassword"){
XAUtil.notifyError('Error','Invalid new password');
- else
+ } else {
XAUtil.notifyError('Error',resp.responseJSON.msgDesc);
- }else
+ }
+ } else {
XAUtil.notifyError('Error', "Error occurred while creating/updating user.");
+ }
}
});
},
@@ -236,8 +232,6 @@ define(function(require){
/** on close */
onClose: function(){
}
-
});
-
return UserCreate;
});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/users/UserForm.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/users/UserForm.js b/security-admin/src/main/webapp/scripts/views/users/UserForm.js
index 04f7cc6..d99f079 100644
--- a/security-admin/src/main/webapp/scripts/views/users/UserForm.js
+++ b/security-admin/src/main/webapp/scripts/views/users/UserForm.js
@@ -100,10 +100,11 @@ define(function(require){
options : function(callback, editor){
var userTypes = _.filter(XAEnums.UserRoles,function(m){
- if(!SessionMgr.isKeyAdmin())
+ if(!SessionMgr.isKeyAdmin()){
return m.label != 'Unknown' && m.label != 'KeyAdmin';
- else
+ } else {
return m.label != 'Unknown' && m.label != 'Admin';
+ }
});
var nvPairs = XAUtils.enumToSelectPairs(userTypes);
callback(nvPairs);
@@ -124,12 +125,13 @@ define(function(require){
if(this.model.has('userRoleList')){
var roleList = this.model.get('userRoleList');
if(!_.isUndefined(roleList) && roleList.length > 0){
- if(XAEnums.UserRoles[roleList[0]].value == XAEnums.UserRoles.ROLE_USER.value)
+ if(XAEnums.UserRoles[roleList[0]].value == XAEnums.UserRoles.ROLE_USER.value){
this.fields.userRoleList.setValue(XAEnums.UserRoles.ROLE_USER.value);
- else if(XAEnums.UserRoles[roleList[0]].value == XAEnums.UserRoles.ROLE_KEY_ADMIN.value)
+ } else if(XAEnums.UserRoles[roleList[0]].value == XAEnums.UserRoles.ROLE_KEY_ADMIN.value){
this.fields.userRoleList.setValue(XAEnums.UserRoles.ROLE_KEY_ADMIN.value);
- else
+ } else {
this.fields.userRoleList.setValue(XAEnums.UserRoles.ROLE_SYS_ADMIN.value);
+ }
}
}
if(!_.isUndefined(this.model.get('userSource')) && this.model.get('userSource') == XAEnums.UserSource.XA_USER.value){
@@ -147,15 +149,15 @@ define(function(require){
if(_.contains(SessionMgr.getUserProfile().get('userRoleList'),'ROLE_SYS_ADMIN')
|| _.contains(SessionMgr.getUserProfile().get('userRoleList'),'ROLE_KEY_ADMIN')){
this.fields.userRoleList.editor.$el.attr('disabled',false);
- }else{
+ } else {
if(!SessionMgr.isKeyAdmin()){
this.fields.userRoleList.editor.$el.attr('disabled',true);
}
}
- }else{
+ } else {
this.fields.userRoleList.editor.$el.attr('disabled',true);
}
- }else{
+ } else {
this.fields.userRoleList.editor.$el.attr('disabled',false);
}
//User does not allowed to change his role (it's own role)
@@ -169,8 +171,9 @@ define(function(require){
that.$('[data-customfields="groupIdList"]').html(new AddGroup({
model : that.model
}).render().el);
- if(!that.showBasicFields)
+ if(!that.showBasicFields) {
that.$('[data-customfields="groupIdList"]').hide();
+ }
},
showCustomFields : function(){
if(!this.showBasicFields){
@@ -239,8 +242,6 @@ define(function(require){
}else{
this.model.set('userRoleList',["ROLE_SYS_ADMIN"]);
}
-// this.model.unset('userRoleList');
-
},
/** all post render plugin initialization */
initializePlugins: function(){
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js b/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js
index 2ade868..2908d3a 100644
--- a/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js
@@ -107,10 +107,11 @@ define(function(require){
/** on render callback */
onRender: function() {
this.initializePlugins();
- if(this.tab == 'grouptab')
+ if(this.tab == 'grouptab'){
this.renderGroupTab();
- else
+ } else {
this.renderUserTab();
+ }
this.addVisualSearch();
},
onTabChange : function(e){
@@ -120,8 +121,7 @@ define(function(require){
if(this.showUsers){
this.renderUserTab();
this.addVisualSearch();
- }
- else{
+ } else {
this.renderGroupTab();
this.addVisualSearch();
}
@@ -469,7 +469,7 @@ define(function(require){
return this.groupList.constructor.getTableCols(cols, this.groupList);
},
addVisualSearch : function(){
- var coll,placeholder;
+ var coll,placeholder, that = this;
var searchOpt = [], serverAttrName = [];
if(this.showUsers){
placeholder = localization.tt('h.searchForYourUser');
@@ -501,7 +501,10 @@ define(function(require){
valueMatches :function(facet, searchTerm, callback) {
switch (facet) {
case 'Role':
- callback(XAUtil.hackForVSLabelValuePairs(XAEnums.UserRoles));
+ var roles = XAUtil.hackForVSLabelValuePairs(XAEnums.UserRoles);
+ var label = SessionMgr.isSystemAdmin() || SessionMgr.isUser() ? XAEnums.UserRoles.ROLE_KEY_ADMIN.label : XAEnums.UserRoles.ROLE_SYS_ADMIN.label;
+ callback(_.filter(roles, function(o) { return o.label !== label; }));
+// callback(XAUtil.hackForVSLabelValuePairs(XAEnums.UserRoles));
break;
case 'User Source':
callback(XAUtil.hackForVSLabelValuePairs(XAEnums.UserTypes));
@@ -513,7 +516,7 @@ define(function(require){
callback(XAUtil.hackForVSLabelValuePairs(XAEnums.VisibilityStatus));
break;
case 'User Status':
- callback(XAUtil.hackForVSLabelValuePairs(XAEnums.ActiveStatus));
+ callback(that.getActiveStatusNVList());
break;
/*case 'Start Date' :
setTimeout(function () { XAUtil.displayDatepicker(that.ui.visualSearch, callback); }, 0);
@@ -532,6 +535,13 @@ define(function(require){
};
XAUtil.addVisualSearch(searchOpt,serverAttrName, coll,pluginAttr);
},
+ getActiveStatusNVList : function() {
+ var activeStatusList = _.filter(XAEnums.ActiveStatus, function(obj){
+ if(obj.label != XAEnums.ActiveStatus.STATUS_DELETED.label)
+ return obj;
+ });
+ return _.map(activeStatusList, function(status) { return { 'label': status.label, 'value': status.label}; })
+ },
onShowMore : function(e){
var id = $(e.currentTarget).attr('policy-group-id');
this.rTableList.$el.find('[policy-group-id="'+id+'"]').show();
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/accounts/AccountCreate_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/accounts/AccountCreate_tmpl.html b/security-admin/src/main/webapp/templates/accounts/AccountCreate_tmpl.html
deleted file mode 100644
index 1fe0fce..0000000
--- a/security-admin/src/main/webapp/templates/accounts/AccountCreate_tmpl.html
+++ /dev/null
@@ -1,28 +0,0 @@
-{{!--
- 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.
---}}
-<div class="wrap non-collapsible">
- <h4> Account Details </h4>
- <div data-id="r_form"></div>
- <div class="form-actions">
- <button type="submit" data-id="save" class="btn btn-primary">
- Save
- </button>
- <button type="button" data-id="cancel" class="btn btn-inverse">
- Cancel
- </button>
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/accounts/AccountDetailLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/accounts/AccountDetailLayout_tmpl.html b/security-admin/src/main/webapp/templates/accounts/AccountDetailLayout_tmpl.html
deleted file mode 100644
index f0e5c0f..0000000
--- a/security-admin/src/main/webapp/templates/accounts/AccountDetailLayout_tmpl.html
+++ /dev/null
@@ -1,88 +0,0 @@
-{{!--
- 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.
---}}
-<div class="wrap non-collapsible">
- <div class="span12">
-
- <legend>Account Info</legend>
- <div><a id="editDetail" class="pull-right" href="#!/accounts/{{this.id}}/edit">Edit</a></div>
-
-
- <table id="dvDispDetail" class="table table-bordered table-striped">
- <tbody>
- <tr>
- <td width="40%">{{tt 'lbl.customerName'}}</td>
- <td>{{this.customerName}}</td>
- </tr>
- <tr>
- <td>{{tt 'lbl.accountCode'}}</td>
- <td>{{this.accountCode}}</td>
- </tr>
- <tr>
- <td>{{tt 'lbl.accountStatus'}}</td>
- {{#if_eq this.status compare='Enabled'}}
- <td>{{tt 'lbl.ActiveStatus_STATUS_ENABLED'}}</td>
- {{else}}
- <td>{{tt 'lbl.ActiveStatus_STATUS_DISABLED'}}</td>
- {{/if_eq}}
- </tr>
- </tbody>
- </table>
-
- </div>
-</div>
-
-<!--
- <fieldset>
-
- <form style="display:none" id="frmAddAcc" class="form-horizontal">
- <label class="infoMsg">Fields marked as * are mandatory</label>
- <div class="control-group">
- <label class="control-label">Account Name *</label>
- <div class="controls">
- <input class="validate[required]" id="inpCustName" type="text">
- </div>
- </div>
- <div class="control-group">
- <label class="control-label">Account Status *</label>
- <div class="controls">
- select class="validate[required]" id="selActStatus" name="" id="">
- <option value="">Select</option>
-
- <option value="1">Enabled</option>
-
- <option value="0">Disabled</option>
-
- </select
- <span>Enable </span>
- <input id="enabled" type="radio" class="validate[required]" name="status" title="Enabled" checked="checked">
- <span>Disable </span>
- <input id="disabled" type="radio" class="validate[required]" name="status" title="Disabled">
- </div>
- </div>
- <div class="control-group">
- <label class="control-label">Support Corporate Authentication</label>
- <div class="controls">
- <input id="chkMail" type="checkbox">
- </div>
- </div>
- <div class="form-actions">
- <button id="btnSaveAcc" type="button" class="btn ">Save Account</button>
- <button id="btnCancel" type="button" class="btn">Cancel</button>
- </div>
- </form>
- </fieldset>
- -->
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/accounts/AccountForm_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/accounts/AccountForm_tmpl.html b/security-admin/src/main/webapp/templates/accounts/AccountForm_tmpl.html
deleted file mode 100644
index 0a0e560..0000000
--- a/security-admin/src/main/webapp/templates/accounts/AccountForm_tmpl.html
+++ /dev/null
@@ -1,23 +0,0 @@
-{{!--
- 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.
---}}
-<form class="form-horizontal" >
- <div class="" data-fields="customerName"></div>
- <div class="" data-fields="accountStatus"></div>
- <div class="" data-fields="accountCode"></div>
-</form>
-
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/accounts/AccountTableLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/accounts/AccountTableLayout_tmpl.html b/security-admin/src/main/webapp/templates/accounts/AccountTableLayout_tmpl.html
deleted file mode 100644
index 4d4d14e..0000000
--- a/security-admin/src/main/webapp/templates/accounts/AccountTableLayout_tmpl.html
+++ /dev/null
@@ -1,31 +0,0 @@
-{{!--
- 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.
---}}
-<h3 class="wrap-header bold"> Manage Accounts </h3>
-<div class="wrap non-collapsible">
- <div class="span12">
- <div class="clearfix">
- <a href="#!/accounts/create" class="btn btn-primary pull-right btn-right" type="button"> Add New Account </a>
- </div>
-
- <div data-id="r_tableList">
- No Records!
- </div>
- <div data-id="r_pagination" class="text-center"></div>
-
- </div>
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/asset/AssetCreate_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/asset/AssetCreate_tmpl.html b/security-admin/src/main/webapp/templates/asset/AssetCreate_tmpl.html
deleted file mode 100644
index 43b7f24..0000000
--- a/security-admin/src/main/webapp/templates/asset/AssetCreate_tmpl.html
+++ /dev/null
@@ -1,36 +0,0 @@
-{{!--
- 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.
---}}
-{{#if editAsset}}
- <h4 class="wrap-header bold"> Edit Repository </h4>
-{{else}}
- <h4 class="wrap-header bold"> Create Repository </h4>
-{{/if}}
-<div class="wrap non-collapsible ">
- <div data-id="r_form"></div>
- <div class="form-actions form-asset" class="row-fluid">
- <button type="submit" data-id="save" class="btn btn-primary">
- Save
- </button>
- <button type="button" data-id="cancel" class="btn btn-inverse">
- Cancel
- </button>
- <button type="button" data-id="delete" class="btn btn-danger" ><!-- style="margin-left: 27%;" -->
- Delete
- </button>
- </div>
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/asset/AssetForm_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/asset/AssetForm_tmpl.html b/security-admin/src/main/webapp/templates/asset/AssetForm_tmpl.html
deleted file mode 100644
index 3e24abc..0000000
--- a/security-admin/src/main/webapp/templates/asset/AssetForm_tmpl.html
+++ /dev/null
@@ -1,69 +0,0 @@
-{{!--
- 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.
---}}
-<form class="form-horizontal" >
- <fieldset class="configProp">
- <p class="formHeader">
- {{tt 'lbl.repositoryDetails'}} :
- </p>
- <div class="" data-fields="name"></div>
- <div class="" data-fields="description"></div>
- <div class="" data-fields="activeStatus"></div>
- <div class="" data-fields="assetType"></div>
- </fieldset>
- <fieldset class="configProp">
- <p class="formHeader">
- Config Properties :
- </p>
- <!-- div class="" data-fields="_vPassword"></div-->
- <div class="" data-fields="userName"></div>
- <div class="" data-fields="passwordKeytabfile"></div>
- <div class="" data-fields="fsDefaultName"></div>
- <div class="" data-fields="authorization"></div>
- <div class="" data-fields="authentication"></div>
- <div class="" data-fields="auth_to_local"></div>
- <div class="" data-fields="datanode"></div>
- <div class="" data-fields="namenode"></div>
- <div class="" data-fields="secNamenode"></div>
- <div class="" data-fields="hadoopRpcProtection"></div>
- <div class="" data-fields="driverClassName"></div>
- <div class="" data-fields="url"></div>
- <div class="" data-fields="masterKerberos"></div>
- <div class="" data-fields="rpcEngine"></div>
- <div class="" data-fields="rpcProtection"></div>
- <div class="" data-fields="securityAuthentication"></div>
- <div class="" data-fields="zookeeperProperty"></div>
- <div class="" data-fields="zookeeperQuorum"></div>
- <div class="" data-fields="zookeeperZnodeParent"></div>
- <div class="" data-fields="knoxUrl"></div>
- <div class="" data-fields="nimbusUrl"></div>
- <div class="" data-fields="commonnameforcertificate"></div>
- <!-- div class="" data-fields="pair"></div-->
- </fieldset>
- <div>
- <div class="control-group field-username hdfs hive knox storm" style="display: block;">
- <label class="control-label" for="c12_username"></label>
- <div class="controls">
- <span data-editor="">
- <input data-id="testConn" type="button" value="Test Connection" class="btn" />
- </span>
-
- </div>
- </div>
- </div>
-
-</form>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/asset/AssetTableLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/asset/AssetTableLayout_tmpl.html b/security-admin/src/main/webapp/templates/asset/AssetTableLayout_tmpl.html
deleted file mode 100644
index 4769039..0000000
--- a/security-admin/src/main/webapp/templates/asset/AssetTableLayout_tmpl.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{{!--
- 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.
---}}
-<h3 class="wrap-header bold"> {{tt 'lbl.listOfPolicies'}} : {{tt 'h.hdfs'}} </h3>
-<div class="wrap non-collapsible m-height">
- <div class="span12">
- <div class="clearfix">
- <a href="#!/policy/create" class="btn btn-primary btn-right" type="button"> {{tt 'lbl.addNewAsset'}} </a>
- <div data-id="r_filter" class="pull-left wrap-filter"></div>
- </div>
-
- <div data-id="r_assettable" class="hdfs-table"></div>
- </div>
-
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/common/Footer_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/common/Footer_tmpl.html b/security-admin/src/main/webapp/templates/common/Footer_tmpl.html
index 253202c..e3accb6 100644
--- a/security-admin/src/main/webapp/templates/common/Footer_tmpl.html
+++ b/security-admin/src/main/webapp/templates/common/Footer_tmpl.html
@@ -23,20 +23,6 @@
</div>
<div class="pull-right">
<ul class="nav nav-footer">
- <!-- <li class="active">
- <a href="http://xasecure.com">About</a>
- </li>
-
- <li>
- <a href="http://xasecure.com">Contact</a>
- </li>
-
- <li>
- <a href="http://xasecure.com" >Privacy</a>
- </li>
- <li>
- <a href="http://xasecure.com">Blog</a>
- </li> -->
</ul>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/common/PolicyManagerLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/common/PolicyManagerLayout_tmpl.html b/security-admin/src/main/webapp/templates/common/PolicyManagerLayout_tmpl.html
deleted file mode 100644
index b4f242b..0000000
--- a/security-admin/src/main/webapp/templates/common/PolicyManagerLayout_tmpl.html
+++ /dev/null
@@ -1,274 +0,0 @@
-{{!--
- 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.
---}}
-<h3 class="wrap-header bold">{{tt 'h.repositoryManager'}}</h3>
-
-<div class="wrap non-collapsible policy-manager">
- <div class="row-fluid">
- <div class="span4">
- <div class="position-relative">
- <table class="table table-bordered table-striped">
- <!-- table-policy -->
- <thead>
- <tr>
- <th>
- <span class="policy-title">
- <img alt="HDFS" src="images/folder-grey.png">
- HDFS
- {{#if isSysAdmin}}
- <a href="{{assetCreateHref}}/{{hdfsVal}}"class="pull-right" title="Add"> <i class="icon-plus"></i></a>
- {{/if}}
- </span>
- </th>
- </tr>
- </thead>
- <tbody>
- {{#unless hdfsList}}
- <tr>
- <td>No Repositories!
- </td>
- </tr>
- {{/unless}}
- {{#each hdfsList}}
-
- <tr>
- <td>
- <div>
- <a data-id="{{./this.id}}" href="#!/hdfs/{{./this.id}}/policies">{{./this.attributes.name}}</a>
- {{#if ../isSysAdmin}}
- <div class="pull-right">
- <a data-id="{{./this.id}}" class="btn btn-mini"
- href="#!/asset/{{./this.id}}" title="Edit"><i
- class="icon-edit"></i></a> <a data-id="{{./this.id}}"
- class="deleteRep btn btn-mini btn-danger"
- href="javascript:void(0);" title="Delete"><i
- class="icon-trash"></i></a>
- </div>
- {{/if}}
- </div>
- </td>
- </tr>
- {{/each}}
- </tbody>
- </table>
-
- <div data-id="r_tableSpinner" class="loading">
- </div>
- </div>
- </div>
- <div class="span4">
- <div class="position-relative">
- <table class="table table-bordered table-striped">
- <!-- table-policy -->
- <thead>
- <tr>
- <th>
- <span class="policy-title">
- <img alt="Hive" src="images/data-grey.png" >
- Hive
- {{#if isSysAdmin}}
- <a href="{{assetCreateHref}}/{{hiveVal}}" class="pull-right" title="Add"><i class="icon-plus"></i></a>
- {{/if}}
- </span>
- </th>
- </tr>
- </thead>
- <tbody>
- {{#unless hiveList}}
- <tr>
- <td>No Repositories!
- </td>
- </tr>
- {{/unless}}
- {{#each hiveList}}
- <tr>
- <td>
- <div>
- <a data-id="{{./this.id}}" href="#!/hive/{{./this.id}}/policies">{{./this.attributes.name}}</a>
- {{#if ../isSysAdmin}}
- <div class="pull-right">
- <a data-id="{{./this.id}}" class="btn btn-mini"
- href="#!/asset/{{./this.id}}" title="Edit"><i
- class="icon-edit"></i></a> <a data-id="{{./this.id}}"
- class="deleteRep btn btn-mini btn-danger"
- href="javascript:void(0);" title="Delete"><i
- class="icon-trash"></i></a>
- </div>
- {{/if}}
- </div>
- </td>
- </tr>
- {{/each}}
-
- </tbody>
- </table>
- <div data-id="r_tableSpinner" class="loading">
- </div>
- </div>
- </div>
- <div class="span4">
- <div class="position-relative">
- <table class="table table-bordered table-striped">
- <!-- table-policy -->
- <thead>
- <tr>
- <th>
- <span class="policy-title">
- <img alt="HBase" src="images/data-grey.png" >
- Hbase
- {{#if isSysAdmin}}
- <a href="{{assetCreateHref}}/{{hbaseVal}}" class="pull-right" title="Add"><i class="icon-plus"></i></a>
- {{/if}}
- </span>
- </th>
- </tr>
- </thead>
- <tbody>
- {{#unless hbaseList}}
- <tr>
- <td>No Repositories!
- </td>
- </tr>
- {{/unless}}
- {{#each hbaseList}}
- <tr>
- <td>
- <div>
-
- <a data-id="{{./this.id}}" href="#!/hbase/{{./this.id}}/policies">{{./this.attributes.name}}</a>
- {{#if ../isSysAdmin}}
- <div class="pull-right">
- <a data-id="{{./this.id}}" class="btn btn-mini"
- href="#!/asset/{{./this.id}}" title="Edit"><i
- class="icon-edit"></i></a> <a data-id="{{./this.id}}"
- class="deleteRep btn btn-mini btn-danger"
- href="javascript:void(0);" title="Delete"><i
- class="icon-trash"></i></a>
- </div>
- {{/if}}
- </div>
- </td>
- </tr>
- {{/each}}
- </tbody>
- </table>
- <div data-id="r_tableSpinner" class="loading">
- </div>
- </div>
- </div>
- </div>
- <div class="row-fluid">
- <div class="span4">
- <div class="position-relative">
- <table class="table table-bordered table-striped">
- <!-- table-policy -->
- <thead>
- <tr>
- <th>
- <span class="policy-title">
- <img alt="KNOX" src="images/router-grey.png" >
- Knox
- {{#if isSysAdmin}}
- <a href="{{assetCreateHref}}/{{knoxVal}}" class="pull-right" title="Add"> <i class="icon-plus"></i></a>
- {{/if}}
- </span>
- </th>
- </tr>
- </thead>
- <tbody>
- {{#unless knoxList}}
- <tr>
- <td>No Repositories!
- </td>
- </tr>
- {{/unless}}
- {{#each knoxList}}
-
- <tr>
- <td>
- <div>
- <a data-id="{{./this.id}}" href="#!/knox/{{./this.id}}/policies">{{./this.attributes.name}}</a>
- {{#if ../isSysAdmin}}
- <div class="pull-right">
- <a data-id="{{./this.id}}" class="btn btn-mini"
- href="#!/asset/{{./this.id}}" title="Edit"><i
- class="icon-edit"></i></a> <a data-id="{{./this.id}}"
- class="deleteRep btn btn-mini btn-danger"
- href="javascript:void(0);" title="Delete"><i
- class="icon-trash"></i></a>
- </div>
- {{/if}}
- </div>
- </td>
- </tr>
- {{/each}}
- </tbody>
- </table>
- <div data-id="r_tableSpinner" class="loading">
- </div>
- </div>
- </div>
- <div class="span4">
- <div class="position-relative">
- <table class="table table-bordered table-striped">
- <!-- table-policy -->
- <thead>
- <tr>
- <th>
- <span class="policy-title">
- <img alt="STORM" src="images/task-grey.png" >
- Storm
- {{#if isSysAdmin}}
- <a href="{{assetCreateHref}}/{{stormVal}}" class="pull-right" title="Add"> <i class="icon-plus"></i></a>
- {{/if}}
- </th>
- </tr>
- </thead>
- <tbody>
- {{#unless stormList}}
- <tr>
- <td>No Repositories!
- </td>
- </tr>
- {{/unless}}
- {{#each stormList}}
-
- <tr>
- <td>
- <div>
- <a data-id="{{./this.id}}" href="#!/storm/{{./this.id}}/policies">{{./this.attributes.name}}</a>
- {{#if ../isSysAdmin}}
- <div class="pull-right">
- <a data-id="{{./this.id}}" class="btn btn-mini"
- href="#!/asset/{{./this.id}}" title="Edit"><i
- class="icon-edit"></i></a> <a data-id="{{./this.id}}"
- class="deleteRep btn btn-mini btn-danger"
- href="javascript:void(0);" title="Delete"><i
- class="icon-trash"></i></a>
- </div>
- {{/if}}
- </div>
- </td>
- </tr>
- {{/each}}
- </tbody>
- </table>
- <div data-id="r_tableSpinner" class="loading">
- </div>
- </div>
- </div>
- </div>
- </div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/common/ProfileBar_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/common/ProfileBar_tmpl.html b/security-admin/src/main/webapp/templates/common/ProfileBar_tmpl.html
index f124a12..1683b89 100644
--- a/security-admin/src/main/webapp/templates/common/ProfileBar_tmpl.html
+++ b/security-admin/src/main/webapp/templates/common/ProfileBar_tmpl.html
@@ -18,53 +18,16 @@
<ul class="nav pull-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle usermenu _allowNav" data-toggle="dropdown" > <img alt="Avatar" src="images/avatar.png">
- <!-- <span>{{userProfile.attributes.firstName}} {{userProfile.attributes.lastName}}</span> </a> -->
<span>{{userProfile.attributes.loginId}}</span> </a>
<ul class="dropdown-menu">
<li>
<a href="#!/userprofile" > <i class="icon-male"></i>Profile </a>
</li>
- <!-- <li>
- <a href="#"> <i class="icon-cogs"></i>Settings </a>
- </li> -->
- <!-- <li class="divider"></li> -->
- <!-- <li>
- <a href="#">Sign In</a>
- </li> -->
<li>
<a href="javascript:;" class="_allowNav" data-id="logout"> <i class="icon-off"></i>Log Out </a>
</li>
</ul>
</li>
</ul>
-<!-- <ul class="nav pull-right ul-db" title="Select Repository">
-
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Repository <i class=" icon-caret-down"></i></a>
- <ul class="dropdown-menu">
- <li class="nav-header">
- HBase
- </li>
- <li>
- <a href="#">Demo Table 1</a>
- </li>
- <li>
- <a href="#">Demo Table 2</a>
- </li>
-
- <li class="divider"></li>
- <li class="nav-header">
- HDFS
- </li>
- <li>
- <a href="#">Test Folder 1</a>
- </li>
- <li>
- <a href="#">Test Folder 2</a>
- </li>
- </ul>
- </li>
- <li class="divider-vertical"></li>
- </ul> -->
</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/common/TopNav_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/common/TopNav_tmpl.html b/security-admin/src/main/webapp/templates/common/TopNav_tmpl.html
index 876f9df..ccc26b6 100644
--- a/security-admin/src/main/webapp/templates/common/TopNav_tmpl.html
+++ b/security-admin/src/main/webapp/templates/common/TopNav_tmpl.html
@@ -40,7 +40,6 @@
{{#hasAccessToTab 'Key Manager'}}
<li><a href="#!/kms/keys/new/manage/service"><i class="icon-key"></i>Key Manager </a></li>
{{/hasAccessToTab}}
- <!-- <li><a href="#">Encryption Policies</a></li> -->
</ul>
</li>
<li class="dropdown">
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/common/UserPermissionList.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/common/UserPermissionList.html b/security-admin/src/main/webapp/templates/common/UserPermissionList.html
index 797ae21..e7fee52 100644
--- a/security-admin/src/main/webapp/templates/common/UserPermissionList.html
+++ b/security-admin/src/main/webapp/templates/common/UserPermissionList.html
@@ -35,7 +35,6 @@
<div class="control-group">
<div class="controls" style="margin-top:-14px">
<button type="button" class="btn btn-small" data-action="addUser" title="Add">
- <!-- {{tt 'btn.add'}} -->
<i class="icon-plus"></i>
</button>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/common/breadcrumbs.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/common/breadcrumbs.html b/security-admin/src/main/webapp/templates/common/breadcrumbs.html
index 26d5116..8de0ad3 100644
--- a/security-admin/src/main/webapp/templates/common/breadcrumbs.html
+++ b/security-admin/src/main/webapp/templates/common/breadcrumbs.html
@@ -20,22 +20,6 @@
}
}}
-<!-- <ul class="breadcrumb-flat">
- {{#each breadcrumb}}
- {{#if this.isLast}}
- <li>
- a href="javascript:;" style="cursor:default; text-decoration: none;color: none;">{{tt this.text}}</a<i class="{{this.iconClass}}"></i>{{tt this.text}}
- </li>
- li><i class="{{this.iconClass}}"></i><a href="{{this.href}}">{{tt this.text}}</a></li
- {{else}}
- <li>
- <a href="{{this.href}}"> {{tt this.text}} </a>
- </li>
- {{/if}}
- {{/each}}
-</ul>
- -->
-
<ul class="breadcrumb-flat">
{{#each breadcrumb}}
<li>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/common/formInputItem.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/common/formInputItem.html b/security-admin/src/main/webapp/templates/common/formInputItem.html
deleted file mode 100644
index b9e4b82..0000000
--- a/security-admin/src/main/webapp/templates/common/formInputItem.html
+++ /dev/null
@@ -1,54 +0,0 @@
-{{!--
- 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.
---}}
-<td>
- <input type="text" data-js="selectGroups" />
-</td>
-
-{{#if policyKnox}}
-<td>
- <input type="text" data-js="ipAddress" placeholder="Enter IP address"/>
-</td>
-{{/if}}
-
-{{#if policyStorm}}
-<td>
- <span class="tags" id="tags-editable-1" data-toggle="manual" data-type="checklist"
- data-value="{{stormPerms}}" data-original-title="Select Actions">
- </span>
- <a href="#" id="tags-edit-1" data-editable="tags-editable-1" class="" style="margin-left:10px;">
- {{#if isModelNew}}
- <i class="icon-plus" title="Add"></i>
- {{else}}
- <i class="icon-pencil" title="Edit"></i>
- {{/if}}
- </a>
-</td>
-{{/if}}
-{{#each permissions}}
- <td style="cursor:pointer;">
- <input data-id="{{./this.value}}" type="checkbox">
- </td>
-{{/each}}
-
-
-
-<td>
- <button type="button" class="btn btn-small btn-danger " data-action="delete">
- <i class="icon-remove"></i>
- </button>
-</td>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/common/formInputItemList.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/common/formInputItemList.html b/security-admin/src/main/webapp/templates/common/formInputItemList.html
deleted file mode 100644
index ff40e5b..0000000
--- a/security-admin/src/main/webapp/templates/common/formInputItemList.html
+++ /dev/null
@@ -1,42 +0,0 @@
-{{!--
- 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.
---}}
-<div class="control-group">
- <label class="control-label">{{tt 'lbl.groupPermissions'}}</label>
- <div class="controls">
- <table class="table-permission table-condensed">
- <thead>
- <tr>
- {{#each permHeaders}}
- <th>{{./this}}</th>
- {{/each}}
-
- </tr>
- </thead>
- <tbody class="js-formInput">
-
- </tbody>
- </table>
- </div>
-</div>
-<div class="control-group">
- <div class="controls" style="margin-top:-14px">
- <button type="button" class="btn btn-small" data-action="addGroup" title="Add">
- <!-- {{tt 'btn.add'}} -->
- <i class="icon-plus"></i>
- </button>
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/folders/FolderInfo_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/folders/FolderInfo_tmpl.html b/security-admin/src/main/webapp/templates/folders/FolderInfo_tmpl.html
deleted file mode 100644
index 741623f..0000000
--- a/security-admin/src/main/webapp/templates/folders/FolderInfo_tmpl.html
+++ /dev/null
@@ -1,134 +0,0 @@
-{{!--
- 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.
---}}
-<div class="well well-small ">
- <!-- <label style="color: white;padding: 5px;font-weight: 700;background: -webkit-linear-gradient(#4C89D6, #b8892d);background: -o-linear-gradient(#f7ec13, #b8892d);background: linear-gradient(#94BBEB, #2D75B8);">Policy Information</label> -->
- <div class="fancy title" style="margin-bottom: 16px;">
- <span>Policy Information</span>
- </div>
- <div class="datagrid-stretch-wrapper newScroll" style="overflow-y: auto; height:400px"><!-- height:400px;"> -->
- {{#if hdfsModel}}
- <label class="labelInverse">{{tt 'lbl.resourceInformation'}} :</label>
- <table class="table table-bordered">
- <tbody>
- {{#if name}}
- <tr>
- <td>{{tt 'lbl.resourcePath'}}(s)</td>
- <td> {{{customPermString name }}} </td>
- </tr>
- {{/if}}
- </tbody>
- </table>
- {{/if}}
- {{#if hiveOrHbaseModel}}
- <label class="labelInverse">{{tt 'lbl.resourceInformation'}} :</label>
- <table class="table table-bordered">
- <tbody>
- {{#if databases}}
- <tr>
- <td>{{tt 'lbl.database'}}(s)</td>
- <td>{{{customPermString databases 'label label-info'}}}</td>
- </tr>
- {{/if}}
- {{#if tables}}
- <tr>
- <td>{{tt 'lbl.table'}}(s)</td>
- <td> {{{customPermString tables 'label label-success'}}} </td>
- </tr>
- {{/if}}
- {{#if columnFamilies}}
- <tr>
- <td>{{tt 'lbl.columnFamilies'}}(s)</td>
- <td> {{{customPermString columnFamilies 'label label-info'}}} </td>
- </tr>
- {{/if}}
- {{#if columns}}
- <tr>
- <td>{{tt 'lbl.column'}}(s)</td>
- <td> {{{customPermString columns 'label label-yellow'}}} </td>
- </tr>
- {{/if}}
- {{#if udfs}}
- <tr>
- <td>{{tt 'lbl.udf'}}(s)</td>
- <td> {{{customPermString udfs 'label label-success'}}} </td>
- </tr>
- {{/if}}
- </tbody>
- </table>
- {{/if}}
- <!-- <label class="labelInverse" >{{tt 'lbl.policyInfo'}} :</label> -->
- <table class="table table-bordered">
- <tbody>
- <tr>
- <td>{{tt 'lbl.createdBy'}}</td>
- <td> {{owner}} </td>
- </tr>
- <tr>
- <td>{{tt 'lbl.createdOn'}}</td>
- <td>{{dateFormat createDate format="MM/DD/YYYY HH:mm:ss A"}}</td>
- </tr>
- <tr>
- <td>{{tt 'lbl.updatedBy'}}</td>
- <td> {{updatedBy}} </td>
- </tr>
- <tr>
- <td>{{tt 'lbl.updatedOn'}}</td>
- <td>{{dateFormat updateDate format="MM/DD/YYYY HH:mm:ss A"}} </td>
- </tr>
- </tbody>
- </table>
- {{#if groupPermListArr}}
- <label class="labelInverse"> {{tt 'lbl.permissionGranted'}} :</label>
- <table class="table table-bordered">
- <thead>
- <tr>
- <th >{{tt 'lbl.groupName'}}</th>
- <th >{{tt 'lbl.permissions'}}</th>
- </tr>
- </thead>
- <tbody>
- {{#each groupPermListArr}}
- <tr>
- <td>{{./this.name}}</td>
- <td >{{{customPermString ./this.permType}}}</td>
- </tr>
- {{/each}}
- </tbody>
- </table>
- {{/if}}
- {{#if userPermListArr}}
- <label class="labelInverse">{{tt 'lbl.userPermissions'}} :</label>
- <table class="table table-bordered">
- <thead>
- <tr>
- <th >{{tt 'lbl.userName'}}</th>
- <th >{{tt 'lbl.permissions'}}</th>
- </tr>
- </thead>
- <tbody>
- {{#each userPermListArr}}
- <tr>
- <td>{{./this.name}}</td>
- <td style="word-break: break-word;">{{{customPermString ./this.permType}}}</td>
- </tr>
- {{/each}}
- </tbody>
- </table>
- {{/if}}
- <!-- <a href="javascript:void(0);" class="btn btn-primary" disabled="disabled" onclick="alert('Coming Soon..')"> Manage Folder </a> -->
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/hbase/HbasePolicyCreate_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/hbase/HbasePolicyCreate_tmpl.html b/security-admin/src/main/webapp/templates/hbase/HbasePolicyCreate_tmpl.html
deleted file mode 100644
index 954f3f5..0000000
--- a/security-admin/src/main/webapp/templates/hbase/HbasePolicyCreate_tmpl.html
+++ /dev/null
@@ -1,48 +0,0 @@
-{{!--
- 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.
---}}
-{{#if editPolicy}}
- <h4> {{tt 'h.editPolicy'}}</h4>
-{{else}}
- <h4> {{tt 'h.createPolicy'}} </h4>
-{{/if}}
-<div class="wrap non-collapsible ">
-<div class="alert alert-danger" data-id="policyDisabledAlert" style="display:none;">
- <button type="button" class="close" data-dismiss="alert">×</button>
- <strong>Warning !</strong> {{tt 'msg.policyDisabledMsg'}}
-</div>
- <div data-id="r_form"></div>
- <div class="form-actions form-policy" class="row-fluid">
- {{#if editPolicy}}
- <button type="submit" data-id="save" class="btn btn-primary btn-spinner">
- <span>Save</span>
- <i class="icon-spinner icon-spin"></i>
- </button>
- {{else}}
- <button type="submit" data-id="save" class="btn btn-primary btn-spinner">
- <span>Add</span>
- <i class="icon-spinner icon-spin"></i>
- </button>
- {{/if}}
- <button type="button" data-id="cancel" class="btn btn-inverse">
- Cancel
- </button>
- {{#if editPolicy}}
- <button type="button" data-id="delete" class="btn btn-danger" ><!-- style="margin-left: 27%;" -->Delete</button>
- {{/if}}
- </div>
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/hbase/HbasePolicyForm_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/hbase/HbasePolicyForm_tmpl.html b/security-admin/src/main/webapp/templates/hbase/HbasePolicyForm_tmpl.html
deleted file mode 100644
index fdd5f47..0000000
--- a/security-admin/src/main/webapp/templates/hbase/HbasePolicyForm_tmpl.html
+++ /dev/null
@@ -1,56 +0,0 @@
-{{!--
- 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.
---}}
-<form class="form-horizontal">
- <fieldset>
- <p class="formHeader">
- Policy Details :
- </p>
- <div class="" data-fields="policyName" style="float:left"></div>
- <div class="" data-editors="resourceStatus" style="float:left"></div>
- <div class="clearfix"></div>
- <div class="" data-fields="tables"></div>
- <div class="" data-fields="columnFamilies"></div>
- <div class="" data-fields="columns"></div>
- <div class="" data-fields="_vAuditListToggle"></div>
- <!--
- <div class="" data-fields="isEncrypt"></div>
- -->
- </fieldset>
- <fieldset>
- <p class="formHeader">
- User and Group Permissions :
- </p>
- <div class="" data-customfields="groupPerms">
- <div class="control-group">
- <label class="control-label">{{tt 'lbl.groupPermissions'}}</label>
- <div class="controls">
- <img src="images/loading.gif" style=" margin-left: 4%; margin-top: 1%;" />
- </div>
- </div>
- </div>
- <div class="" data-customfields="userPerms">
- <div class="control-group">
- <label class="control-label">{{tt 'lbl.userPermissions'}}</label>
- <div class="controls">
- <img src="images/loading.gif" style=" margin-left: 4%; margin-top: 1%;" />
- </div>
- </div>
- </div>
- <div class="" data-fields="description"></div>
- </fieldset>
-</form>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/hbase/HbaseTableLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/hbase/HbaseTableLayout_tmpl.html b/security-admin/src/main/webapp/templates/hbase/HbaseTableLayout_tmpl.html
deleted file mode 100644
index 109b9d2..0000000
--- a/security-admin/src/main/webapp/templates/hbase/HbaseTableLayout_tmpl.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{{!--
- 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.
---}}
-<h3 class="wrap-header bold"> {{tt 'lbl.listOfPolicies'}} : {{assetModel.attributes.name}} </h3>
-<div class="wrap non-collapsible m-height ">
- <div>
- <div class="span9">
- <div class="visual_search"></div>
- </div>
- <div class="clearfix">
- <a href="#!/hbase/{{assetId}}/policy/create" class="btn btn-primary btn-right" type="button"> {{tt 'lbl.addNewPolicy'}} </a>
- {{#if isSysAdmin}}
- {{#if version}}
- <a href="javascript:void(0);" data-js="export" class="btn btn-black btn-right">{{tt 'lbl.exports'}}</a>
- {{/if}}
- {{/if}}
- <div data-id="r_filter" class="wrap-filter pull-left"></div>
- </div>
-
- <div data-id="r_tableList" class="clickable">
- </div>
- </div>
-
- <!-- <div class="span3" style="margin-top:39px">
- <div id="policyDetail"></div>
- </div> -->
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/hdfs/HDFSTableLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/hdfs/HDFSTableLayout_tmpl.html b/security-admin/src/main/webapp/templates/hdfs/HDFSTableLayout_tmpl.html
deleted file mode 100644
index a0b2780..0000000
--- a/security-admin/src/main/webapp/templates/hdfs/HDFSTableLayout_tmpl.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{{!--
- 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.
---}}
-<h3 class="wrap-header bold"> {{tt 'lbl.listOfPolicies'}} : {{assetModel.attributes.name}} </h3>
-<div class="wrap non-collapsible m-height ">
- <div>
- <div class="span9">
- <div class="visual_search"></div>
- </div>
- <div class="clearfix">
- <a href="#!/policy/{{assetId}}/create" class="btn btn-primary btn-right" type="button"> {{tt 'lbl.addNewPolicy'}} </a>
- {{#if isSysAdmin}}
- {{#if version}}
- <a href="javascript:void(0);" data-js="export" class="btn btn-black btn-right">{{tt 'lbl.exports'}}</a>
- {{/if}}
- {{/if}}
- <div data-id="r_filter" class="pull-left wrap-filter"></div>
- </div>
-
- <div data-id="r_hdfstable" class="hdfs-table clickable"></div>
- </div>
-
- <!-- <div class="span3" style="margin-top:39px">
- <div id="folderDetail" style="display:none;"></div>
- <div id="folderDetail"></div>
- </div> -->
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/hdfs/PolicyCreate_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/hdfs/PolicyCreate_tmpl.html b/security-admin/src/main/webapp/templates/hdfs/PolicyCreate_tmpl.html
deleted file mode 100644
index eab1c22..0000000
--- a/security-admin/src/main/webapp/templates/hdfs/PolicyCreate_tmpl.html
+++ /dev/null
@@ -1,48 +0,0 @@
-{{!--
- 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.
---}}
-{{#if editPolicy}}
- <h4> {{tt 'h.editPolicy'}}</h4>
-{{else}}
- <h4> {{tt 'h.createPolicy'}} </h4>
-{{/if}}
-<div class="wrap non-collapsible ">
-<div class="alert alert-danger" data-id="policyDisabledAlert" style="display:none;">
- <button type="button" class="close" data-dismiss="alert">×</button>
- <strong>Warning !</strong> {{tt 'msg.policyDisabledMsg'}}
-</div>
- <div data-id="r_form"></div>
- <div class="form-actions form-policy" class="row-fluid">
- {{#if editPolicy}}
- <button type="submit" data-id="save" class="btn btn-spinner btn-primary">
- <span>Save</span>
- <i class="icon-spinner icon-spin"></i>
- </button>
- {{else}}
- <button type="submit" data-id="save" class="btn btn-spinner btn-primary">
- <span>Add</span>
- <i class="icon-spinner icon-spin"></i>
- </button>
- {{/if}}
- <button type="button" data-id="cancel" class="btn btn-inverse">
- Cancel
- </button>
- {{#if editPolicy}}
- <button type="button" data-id="delete" class="btn btn-danger" ><!-- style="margin-left: 27%;" -->Delete</button>
- {{/if}}
- </div>
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/hdfs/PolicyForm_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/hdfs/PolicyForm_tmpl.html b/security-admin/src/main/webapp/templates/hdfs/PolicyForm_tmpl.html
deleted file mode 100644
index 7505b78..0000000
--- a/security-admin/src/main/webapp/templates/hdfs/PolicyForm_tmpl.html
+++ /dev/null
@@ -1,61 +0,0 @@
-{{!--
- 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.
---}}
-<form class="form-horizontal">
- <fieldset>
- <p class="formHeader">
- Policy Details :
- </p>
- <!--ul id="name1"></ul-->
- <!--div class="control-group field-name">
- <label class="control-label" for="name2">Resource Path(new impl) *</label>
- <div class="controls">
- <input type="text" class="select2-input" id="name2" style="width: 250px;">
- </div>
- </div-->
- <div class="" data-fields="policyName" style="float:left"></div>
- <div class="" data-editors="resourceStatus" style="float:left"></div>
- <div class="clearfix"></div>
- <div class="" data-fields="name"></div>
- <!-- <div class="" data-fields="description"></div> -->
- <div class="" data-fields="isRecursive"></div>
- <div class="" data-fields="_vAuditListToggle"></div>
- <div class="" data-fields="isEncrypt"></div>
- </fieldset>
- <fieldset>
- <p class="formHeader">
- User and Group Permissions :
- </p>
- <div class="" data-customfields="groupPerms">
- <div class="control-group">
- <label class="control-label">{{tt 'lbl.groupPermissions'}}</label>
- <div class="controls">
- <img src="images/loading.gif" style=" margin-left: 4%; margin-top: 1%;" />
- </div>
- </div>
- </div>
- <div class="" data-customfields="userPerms">
- <div class="control-group">
- <label class="control-label">{{tt 'lbl.userPermissions'}}</label>
- <div class="controls">
- <img src="images/loading.gif" style=" margin-left: 4%; margin-top: 1%;" />
- </div>
- </div>
- </div>
- <div class="" data-fields="description"></div>
- </fieldset>
-</form>
-
[4/5] incubator-ranger git commit: RANGER-799 : Ranger UI fixes -
partial search not working on Policy listing page
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/common/UserPermissionList.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/common/UserPermissionList.js b/security-admin/src/main/webapp/scripts/views/common/UserPermissionList.js
index fce1963..58da18c 100644
--- a/security-admin/src/main/webapp/scripts/views/common/UserPermissionList.js
+++ b/security-admin/src/main/webapp/scripts/views/common/UserPermissionList.js
@@ -23,12 +23,13 @@
define(function(require) {
'use strict';
- var Backbone = require('backbone');
- var App = require('App');
- var XAEnums = require('utils/XAEnums');
+ var Backbone = require('backbone');
+ var App = require('App');
+ var XAEnums = require('utils/XAEnums');
var XAUtil = require('utils/XAUtils');
var localization = require('utils/XALangSupport');
- var VXUser = require('models/VXUser');
+ var VXUser = require('models/VXUser');
+
require('bootstrap-editable');
var UserPermissionItem = Backbone.Marionette.ItemView.extend({
@@ -59,9 +60,10 @@ define(function(require) {
initialize : function(options) {
_.extend(this, _.pick(options, 'userList','policyType'));
- //this.subjectList = this.mStudent.getSubjectList();
+
this.stormPermsIds = [];
if(this.policyType == XAEnums.AssetType.ASSET_STORM.value){
+
if(this.model.has('editMode') && this.model.get('editMode')){
this.stormPermsIds = _.map(this.model.get('_vPermList'), function(p){
if(XAEnums.XAPermType.XA_PERM_TYPE_ADMIN.value != p.permType)
@@ -86,17 +88,19 @@ define(function(require) {
this.$el.find('input[data-id="' + p.permType + '"]').attr('checked', 'checked');
},this);
}
- if(this.policyType == XAEnums.AssetType.ASSET_STORM.value)
+ if(this.policyType == XAEnums.AssetType.ASSET_STORM.value){
this.renderStormPerms();
+ }
this.createSelectUserDropDown();
this.userDropDownChange();
},
checkDirtyFieldForDropDown : function(e){
- //that.model.has('groupId')
var userIdList =[];
- if(!_.isUndefined(this.model.get('userId')))
+
+ if(!_.isUndefined(this.model.get('userId'))){
userIdList = this.model.get('userId').split(',');
+ }
XAUtil.checkDirtyField(userIdList, e.val, $(e.currentTarget));
},
toggleAddButton : function(e){
@@ -112,7 +116,7 @@ define(function(require) {
$('[data-action="addUser"]').hide();
if(!_.isUndefined(e.removed))
$('[data-action="addUser"]').show();
- }else{
+ } else {
$('[data-action="addUser"]').show();
}
},
@@ -123,6 +127,7 @@ define(function(require) {
},
evClickTD : function(e){
var $el = $(e.currentTarget),permList =[],perms =[];
+
if($(e.toElement).is('td')){
var $checkbox = $el.find('input');
$checkbox.is(':checked') ? $checkbox.prop('checked',false) : $checkbox.prop('checked',true);
@@ -131,43 +136,26 @@ define(function(require) {
if(!_.isUndefined(curPerm)){
var perms = [];
if(this.model.has('_vPermList')){
- if(_.isArray(this.model.get('_vPermList')))
+ if(_.isArray(this.model.get('_vPermList'))){
perms = this.model.get('_vPermList');
- else
+ } else {
perms.push(this.model.get('_vPermList'));
+ }
}
-
- /* permMapList = [ {id: 18, groupId : 1, permType :5}, {id: 18, groupId : 1, permType :4}, {id: 18, groupId : 2, permType :5} ]
- [1] => [ {id: 18, groupId : 1, permType :5}, {id: 19, groupId : 1, permType :4} ]
- [2] => [ {id: 20, groupId : 2, permType :5} ]
- { groupId : 1,
- _vPermList : [ { id: 18, permType : 5 }, { id: 19, permType : 4 } ]
- }
- this.model => { groupId : 2,
- _vPermList : [ { id: 20, permType : 5 }, { permType : 6 } ]
- }
-
- */
-
-// perms = this.model.has('_vPermList') ? this.model.get('_vPermList'): [];
-
if($el.find('input[type="checkbox"]').is(':checked')){
perms.push({permType : curPerm});
+
if(curPerm == XAEnums.XAPermType.XA_PERM_TYPE_ADMIN.value){
$el.parent().find('input[type="checkbox"]:not(:checked)[data-id!="'+curPerm+'"]').map(function(){
perms.push({ permType :$(this).data('id')});
- // return { permType :$(this).data('id')};
});
- // this.model.set('_vPermList', perms);
$el.parent().find('input[type="checkbox"]').prop('checked',true);
}
} else {
perms = _.reject(perms,function(el) { return el.permType == curPerm; });
-
- //perms = _.without(perms, curPerm);
-
}
+
this.checkDirtyFieldForCheckBox(perms);
if(!_.isEmpty(perms)){
this.model.set('_vPermList', perms);
@@ -215,15 +203,6 @@ define(function(require) {
callback(data);
},
createSearchChoice: function(term, data) {
- /*if ($(data).filter(function() {
- return this.text.localeCompare(term) === 0;
- //return this.value == (term) ? true : false;
- }).length === 0) {
- return {
- id : term,
- text: term
- };
- }*/
},
ajax: {
url: "service/xusers/users",
@@ -233,22 +212,14 @@ define(function(require) {
},
results: function (data, page) {
var results = [],selectedVals=[];
- /*if(!_.isEmpty(that.ui.selectUsers.select2('val')))
- selectedVals = that.ui.selectUsers.select2('val');
- selectedVals.push.apply(selectedVals, that.getUsersSelectdValues());
- selectedVals = $.unique(selectedVals);*/
+
selectedVals = that.getUsersSelectdValues();
if(data.resultSize != "0"){
- //if(data.vXUsers.length > 1){
-
results = data.vXUsers.map(function(m, i){ return {id : m.id+"", text: m.name}; });
- if(!_.isEmpty(selectedVals))
+ if(!_.isEmpty(selectedVals)){
results = XAUtil.filterResultByIds(results, selectedVals);
- //console.log(results.length);
+ }
return {results : results};
- // }
- // results = [{id : data.vXUsers.id+"", text: data.vXUsers.name}];
- // return {results : results};
}
return {results : results};
}
@@ -268,19 +239,20 @@ define(function(require) {
userDropDownChange : function(){
var that = this;
this.ui.selectUsers.on('change',function(e){
- // console.log(e.currentTarget.value);
that.checkDirtyFieldForDropDown(e);
that.toggleAddButton(e);
var duplicateUsername = false;
if(e.removed != undefined){
var gIdArr = [],gNameArr = [];
+
gIdArr = _.without(that.model.get('userId').split(','), e.removed.id);
- if(that.model.get('userName') != undefined)
+ if(that.model.get('userName') != undefined){
gNameArr = _.without(that.model.get('userName').split(','), e.removed.text);
+ }
if(!_.isEmpty(gIdArr)){
that.model.set('userId',gIdArr.join(','));
that.model.set('userName',gNameArr.join(','));
- }else{
+ } else {
that.model.unset('userId');
that.model.unset('userName');
}
@@ -288,34 +260,38 @@ define(function(require) {
}
if(!_.isUndefined(e.added)){
- that.model.set('userId', e.currentTarget.value);
+ that.model.set('userId', e.currentTarget.value);
}
});
},
getUsersSelectdValues : function(){
var vals = [],selectedVals = [];
+
this.collection.each(function(m){
if(!_.isUndefined(m.get('userId'))){
vals.push.apply(vals, m.get('userId').split(','));
}
});
- if(!_.isEmpty(this.ui.selectUsers.select2('val')))
+ if(!_.isEmpty(this.ui.selectUsers.select2('val'))){
selectedVals = this.ui.selectUsers.select2('val');
+ }
vals.push.apply(vals , selectedVals);
vals = $.unique(vals);
return vals;
},
evIPAddress :function(e){
- if(!_.isEmpty($(e.currentTarget).val()))
+ if(!_.isEmpty($(e.currentTarget).val())){
this.model.set('ipAddress',$(e.currentTarget).val().split(','));
- else
+ } else {
this.model.unset('ipAddress');
+ }
},
renderStormPerms :function(){
var that = this;
var permArr = _.pick(XAEnums.XAPermType, XAUtil.getStormActions(this.policyType));
this.stormPerms = _.map(permArr,function(m){return {text:m.label, value:m.value};});
this.stormPerms.push({'value' : -1, 'text' : 'Select/Deselect All'});
+
this.ui.tags.editable({
placement: 'right',
// emptytext : 'Please select',
@@ -325,9 +301,8 @@ define(function(require) {
$(this).html('');
return;
}
- if(!_.isArray(idList))
- idList = [idList];
-// that.checkDirtyFieldForGroup(values);
+ if(!_.isArray(idList)) idList = [idList];
+
var permTypeArr = [];
var valArr = _.map(idList, function(id){
if(!(parseInt(id) <= 0) && (!_.isNaN(parseInt(id)))){
@@ -340,8 +315,8 @@ define(function(require) {
var adminPerm = _.where(that.model.get('_vPermList'),{'permType': XAEnums.XAPermType.XA_PERM_TYPE_ADMIN.value });
permTypeArr = _.isEmpty(adminPerm) ? permTypeArr : _.union(permTypeArr,adminPerm);
}
- that.model.set('_vPermList', permTypeArr);
-
+
+ that.model.set('_vPermList', permTypeArr);
$(this).html(valArr.join(" "));
},
});
@@ -356,7 +331,6 @@ define(function(require) {
});
});
},
-
});
@@ -364,17 +338,14 @@ define(function(require) {
return Backbone.Marionette.CompositeView.extend({
_msvName : 'UserPermissionList',
template : require('hbs!tmpl/common/UserPermissionList'),
- //tagName : 'ul',
- //className : 'timeline-container',
templateHelpers :function(){
+
return {
permHeaders : XAUtil.getPermHeaders(this.policyType,false)
};
},
getItemView : function(item){
- if(!item){
- return;
- }
+ if(!item){ return; }
return UserPermissionItem;
},
itemViewContainer : ".js-formInput",
@@ -390,12 +361,10 @@ define(function(require) {
},
initialize : function(options) {
_.extend(this, _.pick(options, 'userList','policyType'));
- //this.listenTo(this.collection, 'removeAddBtn', this.render, this);
- /*if(options.model.isNew())
- this.collection.add(new Backbone.Model());*/
- if(this.collection.length == 0)
+
+ if(this.collection.length == 0){
this.collection.add(new Backbone.Model());
-
+ }
},
onRender : function(){
//console.log("onRender of ArtifactFormNoteList called");
@@ -414,12 +383,11 @@ define(function(require) {
userIds.push.apply(userIds,temp);
}
});
- if(userIds.length == this.userList.length)
+ if(userIds.length == this.userList.length){
this.$('button[data-action="addUser"]').hide();
- else
+ } else {
this.$('button[data-action="addUser"]').show();
+ }
}
-
});
-
});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/common/XABackgrid.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/common/XABackgrid.js b/security-admin/src/main/webapp/scripts/views/common/XABackgrid.js
index d9cc832..6c95390 100644
--- a/security-admin/src/main/webapp/scripts/views/common/XABackgrid.js
+++ b/security-admin/src/main/webapp/scripts/views/common/XABackgrid.js
@@ -78,10 +78,7 @@ define(function(require){
var $clearButton = this.clearButton();
var searchTerms = this.searchBox().val();
- // if(e.which === XAGlobals.keys.ENTER_KEY ){
- if(!e.shiftKey)
- this.search();
- // }
+ if(!e.shiftKey) this.search();
if (searchTerms) {
$clearButton.show();
@@ -179,10 +176,7 @@ define(function(require){
var $clearButton = this.clearButton();
var searchTerms = this.searchBox().val();
- // if(e.which === XAGlobals.keys.ENTER_KEY ){
- if(!e.shiftKey)
- this.search();
- // }
+ if(!e.shiftKey) this.search();
if (searchTerms) {
$clearButton.show();
@@ -281,7 +275,6 @@ define(function(require){
this.$el.find('select').on('click',function(e){
that.search(e.currentTarget.value);
});
- //this.delegateEvents();
return this;
},
@@ -307,15 +300,7 @@ define(function(require){
collection.fetch({data: data, reset: true});
}
- /*clear: function (e) {
- if (e) e.preventDefault();
- this.searchBox().val(null);
- this.collection.fetch({reset: true});
- }*/
-
});
-
-
var HeaderRow = Backgrid.Row.extend({
@@ -391,6 +376,5 @@ define(function(require){
});
-
return XAHeader;
});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/common/XATableLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/common/XATableLayout.js b/security-admin/src/main/webapp/scripts/views/common/XATableLayout.js
index 12bd6d7..ae81b86 100644
--- a/security-admin/src/main/webapp/scripts/views/common/XATableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/common/XATableLayout.js
@@ -48,7 +48,7 @@ define(function(require){
'rPagination' : 'div[data-id="r_pagination"]'
},
- // /** ui selector cache */
+ /** ui selector cache */
ui: {},
gridOpts : {
@@ -122,11 +122,9 @@ define(function(require){
this.listenTo(this.collection, "sync reset", this.showHidePager);
this.listenTo(this.collection, 'request', function(){
-// $(this.rTableSpinner.el).addClass('loading');
this.$el.find(this.rTableSpinner.el).addClass('loading');
},this);
this.listenTo(this.collection, 'sync error', function(){
-// $(this.rTableSpinner.el).removeClass('loading');
this.$el.find(this.rTableSpinner.el).removeClass('loading');
},this);
},
@@ -158,11 +156,6 @@ define(function(require){
renderTable : function(){
var that = this;
this.rTableList.show(new Backgrid.Grid(this.gridOpts));
-
- /*this.rTableSpinner.show(new Spinner({
- collection: this.collection
- }));*/
-
},
renderPagination : function(){
this.rPagination.show(new Backgrid.Extension.Paginator({
@@ -175,7 +168,6 @@ define(function(require){
showHidePager : function(){
if(this.collection.state && this.collection.state.totalRecords > XAGlobals.settings.PAGE_SIZE) {
this.$el.find(this.rPagination.el).show()
- //$(this.rPagination.el).show();
} else {
this.$el.find(this.rPagination.el).hide();
}
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/folders/FolderInfo.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/folders/FolderInfo.js b/security-admin/src/main/webapp/scripts/views/folders/FolderInfo.js
deleted file mode 100644
index 18ef7e2..0000000
--- a/security-admin/src/main/webapp/scripts/views/folders/FolderInfo.js
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * 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(function(require){
- 'use strict';
-
- var Backbone = require('backbone');
- var Communicator = require('communicator');
-
- var XAUtil = require('utils/XAUtils');
- var XAEnums = require('utils/XAEnums');
- var VXPermMapList = require('collections/VXPermMapList');
- var FolderInfo_tmpl = require('hbs!tmpl/folders/FolderInfo_tmpl');
- var KnoxInfo_tmpl = require('hbs!tmpl/knox/KnoxInfo_tmpl');
-
- var FolderInfo = Backbone.Marionette.ItemView.extend(
- /** @lends FolderInfo */
- {
- _viewName : FolderInfo,
-
- template: FolderInfo_tmpl,
- templateHelpers :function(){
-
- var hiveModel = this.model.get('assetType') == XAEnums.AssetType.ASSET_HIVE.value ? true : false;
- var hbaseModel = this.model.get('assetType') == XAEnums.AssetType.ASSET_HBASE.value ? true : false;
- var hiveOrHbaseModel = hiveModel || hbaseModel;
- return {
- groupPermListArr: this.getGroupPermListArr(),
- userPermListArr : this.getUserPermListArr(),
- hdfsModel : this.model.get('assetType') == XAEnums.AssetType.ASSET_HDFS.value ? true : false,
- hiveOrHbaseModel: hiveOrHbaseModel,
-
- };
- },
- /** ui selector cache */
- ui: {},
-
- /** ui events hash */
- events: function() {
- var events = {};
- //events['change ' + this.ui.input] = 'onInputChange';
- return events;
- },
-
- /**
- * intialize a new FolderInfo ItemView
- * @constructs
- */
- initialize: function(options) {
- console.log("initialized a FolderInfo ItemView");
-
- _.extend(this, _.pick(options, ''));
- //this.model.set('permMapList',new VXPermMapList(this.model.attributes.permMapList))
- this.bindEvents();
- this.getTemplateForView();
- },
-
- /** all events binding here */
- bindEvents : function(){
- /*this.listenTo(this.model, "change:foo", this.modelChanged, this);*/
- /*this.listenTo(communicator.vent,'someView:someEvent', this.someEventHandler, this)'*/
- },
-
- /** on render callback */
- onRender: function() {
- this.initializePlugins();
- },
-
- /** all post render plugin initialization */
- initializePlugins: function(){
- },
- getTemplateForView : function(){
- if(this.model.get('assetType') == XAEnums.AssetType.ASSET_KNOX.value){
- this.template = KnoxInfo_tmpl;
- }
- },
- getGroupPermListArr : function(){
- var groupList = [];
- var perm=[],permListArr =[];
- if(!_.isUndefined(this.model.attributes.permMapList)){
- if(_.isArray(this.model.attributes.permMapList)){
- groupList = new VXPermMapList(this.model.attributes.permMapList);
- groupList = groupList.groupBy('groupId');
- }else{
- groupList = this.model.attributes.permMapList.groupBy('groupId');
- }
-
- _.each(groupList,function(val,prop){
- var groups = groupList[prop];
- var permTypeArr =[],name ='',ipAddressArr =[];
- groups = _.sortBy(groups, function (m) {return m.get('permType');});
- _.each(groups,function(gprop){
- var permVal = _.pick(gprop.attributes,'permType').permType;
- var label = XAUtil.enumValueToLabel(XAEnums.XAPermType,permVal);
- permTypeArr.push(label);
- name = _.pick(gprop.attributes,'groupName').groupName;
- if(!_.isUndefined(gprop.get('ipAddress')))
- ipAddressArr.push(gprop.get('ipAddress'))
-
- });
- if(name != undefined){
- var ipAddress = _.uniq(ipAddressArr).toString();
- permListArr.push({
- name :name,
- permType :permTypeArr.toString(),
- ipAddress :_.isEmpty(ipAddress) ? "--" : ipAddress
- });
- }
-
- });
- }
- return permListArr;
- },
- getUserPermListArr : function(){
- var userList = [];
- var perm=[],permListArr =[];
- if(!_.isUndefined(this.model.attributes.permMapList)){
- if(_.isArray(this.model.attributes.permMapList)){
- userList = new VXPermMapList(this.model.attributes.permMapList);
- userList = userList.groupBy('userId');
- }else{
- userList = this.model.attributes.permMapList.groupBy('userId');
- }
- //var userList = this.model.attributes.permMapList.groupBy('userId');
- _.each(userList,function(val,prop){
- var users = userList[prop];
- users = _.sortBy(users, function (m) {return m.get('permType');});
- var permTypeArr =[],name ='', ipAddressArr =[];
- _.each(users,function(gprop){
- var permVal = _.pick(gprop.attributes,'permType').permType;
- var label = XAUtil.enumValueToLabel(XAEnums.XAPermType,permVal);
- permTypeArr.push(label);
- name = _.pick(gprop.attributes,'userName').userName;
- if(!_.isUndefined(gprop.get('ipAddress')))
- ipAddressArr.push(gprop.get('ipAddress'))
- });
- if(name != undefined){
- var ipAddress = _.uniq(ipAddressArr).toString();
- permListArr.push({ name :name,
- permType :permTypeArr.toString(),
- ipAddress :_.isEmpty(ipAddress) ? "--" : ipAddress
- });
- }
-
- });
- }
- return permListArr;
- },
- /** on close */
- onClose: function(){
- }
-
- });
-
- return FolderInfo;
-});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/kms/KMSTableLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/kms/KMSTableLayout.js b/security-admin/src/main/webapp/scripts/views/kms/KMSTableLayout.js
index 52990dd..a5d0d82 100755
--- a/security-admin/src/main/webapp/scripts/views/kms/KMSTableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/kms/KMSTableLayout.js
@@ -40,7 +40,6 @@ define(function(require){
template: KmsTablelayoutTmpl,
templateHelpers : function(){
-// return { kmsServiceName : this.kmsServiceName };
},
breadCrumbs :[XALinks.get('KmsManage')],
/** Layout sub regions */
@@ -78,10 +77,8 @@ define(function(require){
this.showKeyList = true;
this.isKnownKmsServicePage = this.kmsManagePage == 'new' ? false : true;
this.initializeKMSServices();
- if(this.isKnownKmsServicePage){
- this.getKeysForKmsService();
- }
this.bindEvents();
+ this.defaultsCollstate = this.collection.state;
},
/** all events binding here */
@@ -99,16 +96,19 @@ define(function(require){
});
},
getKeysForKmsService : function() {
+ var that = this;
this.collection.queryParams['provider'] = this.kmsServiceName;
this.collection.fetch({
cache : false,
reset :true,
- error : function(model,resp){
+ error : function(collection,resp){
var errorMsg = 'Error getting key list!!';
if(!_.isUndefined(resp) && !_.isUndefined(resp.responseJSON) && !_.isUndefined(resp.responseJSON.msgDesc)){
errorMsg = resp.responseJSON.msgDesc;
}
XAUtil.notifyError('Error', errorMsg);
+ collection.state = that.defaultsCollstate;
+ collection.reset();
}
});
},
@@ -128,13 +128,19 @@ define(function(require){
}
this.setupKmsServiceAutoComplete();
this.addVisualSearch();
+ //Showing pagination even if No Key found
+ if(!this.isKnownKmsServicePage){
+ this.collection.reset();
+ }
+ if(this.isKnownKmsServicePage){
+ this.getKeysForKmsService();
+ }
},
onTabChange : function(e){
var that = this;
this.showKeyList = $(e.currentTarget).attr('href') == '#keys' ? true : false;
if(this.showKeyList){
this.renderKeyTab();
-// this.addVisualSearch();
}
},
renderKeyTab : function(){
@@ -152,19 +158,16 @@ define(function(require){
emptyText : 'No Key found!'
}
}));
-
},
getColumns : function(){
var that = this;
var cols = {
-
name : {
label : localization.tt("lbl.keyName"),
cell :'string',
editable:false,
sortable:false,
-
},
cipher : {
label : localization.tt("lbl.cipher"),
@@ -206,12 +209,10 @@ define(function(require){
drag : false,
editable:false,
sortable:false,
-// sortType: 'toggle',
-// direction: 'descending',
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function (rawValue, model) {
if(!_.isUndefined(rawValue))
- return Globalize.format(new Date(rawValue), "MM/dd/yyyy hh:mm:ss tt");
+ return Globalize.format(new Date(rawValue), "MM/dd/yyyy hh:mm:ss tt");
}
})
},
@@ -227,7 +228,6 @@ define(function(require){
}),
editable: false,
sortable : false
-
}
};
@@ -252,7 +252,6 @@ define(function(require){
valueMatches :function(facet, searchTerm, callback) {
switch (facet) {
}
-
}
}
};
@@ -263,6 +262,7 @@ define(function(require){
},
setupKmsServiceAutoComplete : function(serviceName){
var that = this, arr = [];
+
this.ui.selectServiceName.select2({
maximumSelectionSize : 1,
closeOnSelect : true,
@@ -275,13 +275,13 @@ define(function(require){
url: "service/plugins/services",
dataType: 'json',
data: function (term, page) {
- return {name : term, 'serviceType' : 'kms'};
+ return { name : term, 'serviceType' : 'kms' };
},
results: function (data, page) {
var results = [],selectedVals = [];
if(data.resultSize != "0"){
results = data.services.map(function(m, i){ return {id : m.name, text: m.name}; });
- return {results : results};
+ return { results : results };
}
return { results : results };
}
@@ -296,7 +296,7 @@ define(function(require){
return 'No service found.';
}
})
- .on('select2-focus', XAUtil.select2Focus)
+ //.on('select2-focus', XAUtil.select2Focus)
.on('change',function(e) {
that.kmsServiceName = (e.currentTarget.value)
that.ui.addNewKey.attr('disabled',false);
@@ -311,12 +311,12 @@ define(function(require){
var obj = this.collection.get($(e.currentTarget).data('id'));
var model = new KmsKey(obj.attributes);
model.collection = this.collection;
- var url = model.urlRoot+"/"+model.get('name')+"?provider="+ this.kmsServiceName;
+ var url = model.urlRoot +"/"+model.get('name') +"?provider="+ this.kmsServiceName;
+
XAUtil.confirmPopup({
msg :'Are you sure want to delete ?',
callback : function(){
XAUtil.blockUI();
-
model.destroy({
'url' : url,
'success': function(model, response) {
@@ -343,7 +343,7 @@ define(function(require){
var obj = this.collection.get($(e.currentTarget).data('id'));
var model = new KmsKey({ 'name' : obj.attributes.name });
model.collection = this.collection;
- var url = model.urlRoot+"?provider="+ this.kmsServiceName;
+ var url = model.urlRoot + "?provider=" + this.kmsServiceName;
XAUtil.confirmPopup({
msg :'Are you sure want to rollover ?',
callback : function(){
@@ -363,7 +363,7 @@ define(function(require){
var errorMsg = 'Error rollovering key!';
XAUtil.blockUI('unblock');
if(!_.isUndefined(resp) && !_.isUndefined(resp.responseJSON) && !_.isUndefined(resp.responseJSON.msgDesc)){
- errorMsg = resp.responseJSON.msgDesc;
+ errorMsg = resp.responseJSON.msgDesc;
}
XAUtil.notifyError('Error', errorMsg);
}
@@ -379,4 +379,4 @@ define(function(require){
});
return KmsTableLayout;
-});
\ No newline at end of file
+});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/kms/KmsKeyCreate.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/kms/KmsKeyCreate.js b/security-admin/src/main/webapp/scripts/views/kms/KmsKeyCreate.js
index 0bc62b6..38cb03f 100644
--- a/security-admin/src/main/webapp/scripts/views/kms/KmsKeyCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/kms/KmsKeyCreate.js
@@ -34,7 +34,6 @@ define(function(require){
var KmsKeyCreateTmpl= require('hbs!tmpl/kms/KmsKeyCreate_tmpl');
var RKmsKeyForm = require('views/kms/KmsKeyForm');
-// var RangerServiceDef = require('models/RangerServiceDef');
var KmsKeyCreate = Backbone.Marionette.Layout.extend(
/** @lends KmsKeyCreate */
@@ -49,8 +48,9 @@ define(function(require){
},
breadCrumbs :function(){
var opts = { 'kmsService' : this.kmsService, 'kmsServiceDefModel' : this.kmsServiceDefModel }
- if(this.model.isNew())
+ if(this.model.isNew()){
return [XALinks.get('KmsManage',opts), XALinks.get('KmsServiceForKey', opts), XALinks.get('KmsKeyCreate')];
+ }
} ,
/** Layout sub regions */
@@ -110,9 +110,7 @@ define(function(require){
onSave: function(){
var that =this ;
var errors = this.form.commit({validate : false});
- if(! _.isEmpty(errors)){
- return;
- }
+ if(! _.isEmpty(errors)) return;
var options = {
url : this.model.urlRoot+"?provider="+ this.kmsServiceName,
success: function () {
@@ -125,12 +123,14 @@ define(function(require){
error : function (model, resp, options) {
XAUtil.blockUI('unblock');
var errorMsg = 'Error creating Key!';
- if(!_.isUndefined(resp) && !_.isUndefined(resp.responseJSON) && !_.isUndefined(resp.responseJSON.msgDesc)){
+ if(!_.isUndefined(resp) && !_.isUndefined(resp.responseJSON)
+ && !_.isUndefined(resp.responseJSON.msgDesc)){
errorMsg = resp.responseJSON.msgDesc;
}
XAUtil.notifyError('Error', errorMsg);
}
}
+
//to check model is new or not
options.type = (this.model.has('versions')) ? 'PUT' : 'POST';
this.form.beforeSave();
@@ -145,7 +145,6 @@ define(function(require){
var that = this;
var url = this.model.urlRoot+"?provider="+ this.kmsServiceName;
XAUtil.confirmPopup({
- //msg :localize.tt('msg.confirmDelete'),
msg :'Are you sure want to delete ?',
callback : function(){
XAUtil.blockUI();
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/permissions/ModulePermissionCreate.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/permissions/ModulePermissionCreate.js b/security-admin/src/main/webapp/scripts/views/permissions/ModulePermissionCreate.js
index 3e03d80..02b879d 100644
--- a/security-admin/src/main/webapp/scripts/views/permissions/ModulePermissionCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/permissions/ModulePermissionCreate.js
@@ -38,25 +38,23 @@ define(function(require){
{
_viewName : 'ModulePermissionCreate',
- template: ModulePermissionCreateTmpl,
- breadCrumbs :function(){
- if(this.model.isNew())
- return [XALinks.get('ModulePermissions')];
- else
- return [XALinks.get('ModulePermissions'),XALinks.get('ModulePermissionEdit',this.model)];
- },
-
- /** Layout sub regions */
- regions: {
- 'rForm' :'div[data-id="r_form"]'
- },
-
- /** ui selector cache */
- ui: {
- 'tab' : '.nav-tabs',
- 'btnSave' : '[data-id="save"]',
- 'btnCancel' : '[data-id="cancel"]'
- },
+ template: ModulePermissionCreateTmpl,
+ breadCrumbs :function(){
+ return this.model.isNew() ? [XALinks.get('ModulePermissions')]
+ : [XALinks.get('ModulePermissions'),XALinks.get('ModulePermissionEdit',this.model)];
+ },
+
+ /** Layout sub regions */
+ regions: {
+ 'rForm' :'div[data-id="r_form"]'
+ },
+
+ /** ui selector cache */
+ ui: {
+ 'tab' : '.nav-tabs',
+ 'btnSave' : '[data-id="save"]',
+ 'btnCancel' : '[data-id="cancel"]'
+ },
/** ui events hash */
events: function() {
@@ -94,34 +92,33 @@ define(function(require){
initializePlugins: function(){
},
renderForm : function(){
- var VXGroupList = require('collections/VXGroupList');
- var VXUserList = require('collections/VXUserList');
- var params = {sortBy : 'name'};
- this.userList = new VXUserList();
- this.userList.setPageSize(100,{fetch:true});
- this.userList.fetch({
- cache :false,
- data: params,
- async : false
- });
- this.groupList = new VXGroupList();
- this.groupList.setPageSize(100,{fetch:true});
- this.groupList.fetch({
- cache :false,
- data : params,
- async : false
- });
- var that = this;
- this.form = new ModulePermissionForm({
- template : require('hbs!tmpl/permissions/ModulePermissionForm_tmpl'),
- model : that.model,
- groupList : that.groupList,
- userList : that.userList
- });
- this.rForm.show(this.form);
+ var VXGroupList = require('collections/VXGroupList');
+ var VXUserList = require('collections/VXUserList');
+ var params = {sortBy : 'name'};
+ this.userList = new VXUserList();
+ this.userList.setPageSize(100,{fetch:true});
+ this.userList.fetch({
+ cache :false,
+ data: params,
+ async : false
+ });
+ this.groupList = new VXGroupList();
+ this.groupList.setPageSize(100,{fetch:true});
+ this.groupList.fetch({
+ cache :false,
+ data : params,
+ async : false
+ });
+ var that = this;
+ this.form = new ModulePermissionForm({
+ template : require('hbs!tmpl/permissions/ModulePermissionForm_tmpl'),
+ model : that.model,
+ groupList : that.groupList,
+ userList : that.userList
+ });
+ this.rForm.show(this.form);
},
onSave: function(){
-
var errors = this.form.commit({validate : false});
if(! _.isEmpty(errors)){
this.form.beforeSaveModulePermissions();
@@ -142,14 +139,14 @@ define(function(require){
var msg = that.editMode ? 'Module Permissions updated successfully' :'Module Permissions created successfully';
XAUtil.notifySuccess('Success', msg);
App.appRouter.navigate("#!/permissions",{trigger: true});
- } ,
+ },
error : function(model,resp){
XAUtil.blockUI('unblock');
if(!_.isUndefined(resp.responseJSON) && !_.isUndefined(resp.responseJSON.msgDesc)){
XAUtil.notifyError('Error',resp.responseJSON.msgDesc);
- }else
+ } else {
XAUtil.notifyError('Error', "Error occurred while creating/updating module permissions.");
-
+ }
}
});
},
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/permissions/ModulePermissionForm.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/permissions/ModulePermissionForm.js b/security-admin/src/main/webapp/scripts/views/permissions/ModulePermissionForm.js
index 497a4a2..14509e1 100644
--- a/security-admin/src/main/webapp/scripts/views/permissions/ModulePermissionForm.js
+++ b/security-admin/src/main/webapp/scripts/views/permissions/ModulePermissionForm.js
@@ -46,9 +46,6 @@ define(function(require) {
_viewName : 'ModulePermissionForm',
template : require('hbs!tmpl/permissions/ModulePermissionForm_tmpl'),
templateHelpers :function(){
- return {
-
- };
},
templateData : function(){
return { 'id' : this.model.id, 'permHeaders' : this.getPermHeaders() };
@@ -106,10 +103,6 @@ define(function(require) {
var that = this;
Backbone.Form.prototype.render.call(this, options);
- if(!this.model.isNew()){
- //this.setUpSwitches();
- }
-
},
setupFieldsforEditModule : function(){
var groupsNVList=[],usersNVList =[];
@@ -135,19 +128,18 @@ define(function(require) {
getPlugginAttr :function(autocomplete, options){
var that = this;
if(!autocomplete)
- return{tags : true,width :'220px',multiple: true,minimumInputLength: 1};
+ return{ tags : true, width :'220px', multiple: true, minimumInputLength: 1 };
else {
return {
closeOnSelect : true,
multiple: true,
minimumInputLength: 0,
tokenSeparators: [",", " "],
- /*tags : modelDefaultTags,*/
initSelection : function (element, callback) {
var data = [];
_.each(options.permList,function (elem) {
- data.push({id: elem[options.idKey], text: elem[options.textKey]});
- });
+ data.push({id: elem[options.idKey], text: elem[options.textKey]});
+ });
callback(data);
},
createSearchChoice: function(term, data) {
@@ -170,16 +162,22 @@ define(function(require) {
cache: false,
data: function (term, page) {
//To be checked
- return {name : term, isVisible : XAEnums.VisibilityStatus.STATUS_VISIBLE.value};
-// return {loginId : term};
+ return { name : term, isVisible : XAEnums.VisibilityStatus.STATUS_VISIBLE.value };
},
results: function (data, page) {
var results = [];
+ var results = [], selectedVals = [];
+ //Get selected values of groups/users dropdown
+ selectedVals = that.getSelectedValues(options);
if(data.resultSize != "0"){
- if(!_.isUndefined(data.vXGroups))
+ if(!_.isUndefined(data.vXGroups)){
results = data.vXGroups.map(function(m, i){ return {id : m.id+"", text: m.name}; });
- else if(!_.isUndefined(data.vXUsers))
+ } else if(!_.isUndefined(data.vXUsers)){
results = data.vXUsers.map(function(m, i){ return {id : m.id+"", text: m.name}; });
+ }
+ if(!_.isEmpty(selectedVals)){
+ results = XAUtil.filterResultByText(results, selectedVals);
+ }
}
return { results : results};
},
@@ -199,16 +197,23 @@ define(function(require) {
return result.text;
},
formatNoMatches : function(term){
- switch (term){
- //case that.type.DATABASE :return localization.tt("msg.enterAlteastOneCharactere");
- //case that.type.TABLE :return localization.tt("msg.enterAlteastOneCharactere");
- //case that.type.COLUMN :return localization.tt("msg.enterAlteastOneCharactere");
- default : return "No Matches found";
- }
+ return options.textKey == 'groupName' ? 'No group found.' : 'No user found.';
}
};
}
},
+
+ getSelectedValues : function(options){
+ var vals = [],selectedVals = [];
+ var type = options.textKey == 'groupName' ? 'selectGroups' : 'selectUsers';
+ var $select = this.$('[name="'+type+'"]');
+ if(!_.isEmpty($select.select2('data'))){
+ selectedVals = _.map($select.select2('data'),function(obj){ return obj.text; });
+ }
+ vals.push.apply(vals , selectedVals);
+ vals = $.unique(vals);
+ return vals;
+ },
beforeSaveModulePermissions : function(){
if(this.model.get('module') != ''){
var groupValStr = this.fields.selectGroups.getValue();
@@ -234,7 +239,7 @@ define(function(require) {
//Look for equals
if(_.isEqual(selectedIdList,modelPerms)) {
//No changes in Selected Users
- }else{
+ } else {
//look for new values -
//loop through each new element and check if it has any non matching ids
@@ -261,7 +266,7 @@ define(function(require) {
}
}
- }else{
+ } else {
//Remove permissions from all objects which earlier had permission
_.each(options.permList, function(perm){
perm.isAllowed = 0;
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/permissions/ModulePermsTableLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/permissions/ModulePermsTableLayout.js b/security-admin/src/main/webapp/scripts/views/permissions/ModulePermsTableLayout.js
index 18d7c4c..c8ce659 100644
--- a/security-admin/src/main/webapp/scripts/views/permissions/ModulePermsTableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/permissions/ModulePermsTableLayout.js
@@ -27,10 +27,10 @@ define(function(require){
var XAGlobals = require('utils/XAGlobals');
var SessionMgr = require('mgrs/SessionMgr');
var XAUtil = require('utils/XAUtils');
+ var localization = require('utils/XALangSupport');
var XABackgrid = require('views/common/XABackgrid');
var XATableLayout = require('views/common/XATableLayout');
- var localization = require('utils/XALangSupport');
var RangerServiceDef = require('models/RangerServiceDef');
var UserPermission = require('models/UserPermission');
var ModulePermsTableLayoutTmpl = require('hbs!tmpl/permissions/ModulePermsTableLayout_tmpl');
@@ -44,25 +44,22 @@ define(function(require){
{
_viewName : 'ModulePermsTableLayout',
- template: ModulePermsTableLayoutTmpl,
+ template: ModulePermsTableLayoutTmpl,
templateHelpers : function(){
- return {
- //rangerService:this.rangerService
- };
},
- breadCrumbs : function(){
- return [XALinks.get('ModulePermissions')];
+ breadCrumbs : function(){
+ return [XALinks.get('ModulePermissions')];
},
/** Layout sub regions */
- regions: {
+ regions: {
'rTableList' : 'div[data-id="r_table"]',
},
- // /** ui selector cache */
- ui: {
+ /** ui selector cache */
+ ui: {
'btnShowMore' : '[data-id="showMore"]',
'btnShowLess' : '[data-id="showLess"]',
'visualSearch' : '.visual_search'
@@ -77,13 +74,14 @@ define(function(require){
return events;
},
- /**
+ /**
* intialize a new RangerPolicyTableLayout Layout
* @constructs
*/
initialize: function(options) {
console.log("initialized a ModulePermsTableLayout Layout");
- //_.extend(this, _.pick(options));
+
+ _.extend(this, _.pick(options));
this.bindEvents();
},
@@ -95,10 +93,16 @@ define(function(require){
//this.initializePlugins();
this.addVisualSearch();
this.renderTable();
+ this.initializeModulePerms();
},
/** all post render plugin initialization */
initializePlugins: function(){
},
+ initializeModulePerms : function(){
+ this.collection.fetch({
+ cache : false,
+ });
+ },
renderTable : function(){
var that = this;
this.rTableList.show(new XATableLayout({
@@ -148,10 +152,9 @@ define(function(require){
label : localization.tt("lbl.users"),
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function (rawValue, model) {
- if(!_.isUndefined(rawValue))
- return XAUtil.showGroupsOrUsers(rawValue, model, 'users');
- else
- return '--';
+ return !_.isUndefined(rawValue) ?
+ XAUtil.showGroupsOrUsers(rawValue, model, 'users')
+ : '--';
}
}),
editable : false,
@@ -200,12 +203,8 @@ define(function(require){
},
addVisualSearch : function(){
var that = this;
- //var resourceSearchOpt = _.map(this.collection.models, function(resource){ return XAUtil.capitaliseFirstLetter(resource.module) });
-
var searchOpt = ['Module Name','Group Name','User Name'];
-
var serverAttrName = [{text : "Module Name", label :"module"},{text : "Group Name", label :"groupName"},{text : "User Name", label :"userName"}];
-
var pluginAttr = {
placeholder :localization.tt('h.searchForPermissions'),
container : this.ui.visualSearch,
@@ -213,17 +212,7 @@ define(function(require){
callbacks : {
valueMatches :function(facet, searchTerm, callback) {
switch (facet) {
- /*case 'Module Name':
- callback(that.getActiveStatusNVList());
- break;
- case 'Group Name':
- callback(XAUtil.enumToSelectLabelValuePairs(XAEnums.AuthType));
- break;
- case 'User Name' :
- setTimeout(function () { XAUtil.displayDatepicker(that.ui.visualSearch, callback); }, 0);
- break;*/
}
-
}
}
};
@@ -234,6 +223,7 @@ define(function(require){
if(obj.label != XAEnums.ActiveStatus.STATUS_DELETED.label)
return obj;
});
+
return _.map(activeStatusList, function(status) { return { 'label': status.label, 'value': status.label.toLowerCase()}; })
},
/** on close */
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js b/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js
index b392248..b5a3c7f 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js
@@ -35,8 +35,8 @@ define(function(require) {
var VXUserList = require('collections/VXUserList');
require('bootstrap-editable');
- var FormInputItem = Backbone.Marionette.ItemView.extend({
- _msvName : 'FormInputItem',
+ var PermissionItem = Backbone.Marionette.ItemView.extend({
+ _msvName : 'PermissionItem',
template : require('hbs!tmpl/policies/PermissionItem'),
tagName : 'tr',
templateHelpers : function(){
@@ -442,7 +442,7 @@ define(function(require) {
return Backbone.Marionette.CompositeView.extend({
- _msvName : 'FormInputItemList',
+ _msvName : 'PermissionItemList',
template : require('hbs!tmpl/policies/PermissionList'),
templateHelpers :function(){
return {
@@ -453,7 +453,7 @@ define(function(require) {
if(!item){
return;
}
- return FormInputItem;
+ return PermissionItem;
},
itemViewContainer : ".js-formInput",
itemViewOptions : function() {
@@ -476,14 +476,11 @@ define(function(require) {
this.collection.add(new Backbone.Model());
},
onRender : function(){
-// this.toggleAddButton();
},
addNew : function(){
var that =this;
-// if(this.groupList.length > this.collection.length && (this.userList.length > this.collection.length)){
- this.collection.add(new Backbone.Model());
-// this.toggleAddButton();
-// }
+ this.collection.add(new Backbone.Model());
+
},
toggleAddButton : function(){
var groupNames=[], userNames=[];
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
index 9a6b92f..621edf6 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
@@ -31,7 +31,6 @@ define(function(require){
var XABackgrid = require('views/common/XABackgrid');
var XATableLayout = require('views/common/XATableLayout');
var localization = require('utils/XALangSupport');
- var vFolderInfo = require('views/folders/FolderInfo');
var RangerService = require('models/RangerService');
var RangerServiceDef = require('models/RangerServiceDef');
var RangerPolicy = require('models/RangerPolicy');
@@ -122,12 +121,18 @@ define(function(require){
async : false
})
},
+ initializePolicies : function(){
+ this.collection.url = XAUtil.getServicePoliciesURL(this.rangerService.id);
+ this.collection.fetch({
+ cache : false,
+ });
+ },
/** on render callback */
onRender: function() {
// this.initializePlugins();
this.addVisualSearch();
this.renderTable();
-
+ this.initializePolicies();
// XAUtil.highlightDisabledPolicy(this);
},
@@ -319,7 +324,7 @@ define(function(require){
var searchOpt = ['Policy Name','Group Name','User Name','Status'];//,'Start Date','End Date','Today'];
searchOpt = _.union(searchOpt, resourceSearchOpt)
- var serverAttrName = [{text : "Policy Name", label :"policyName"},{text : "Group Name", label :"group"},
+ var serverAttrName = [{text : "Policy Name", label :"policyNamePartial"},{text : "Group Name", label :"group"},
{text : "User Name", label :"user"}, {text : "Status", label :"isEnabled"}];
// {text : 'Start Date',label :'startDate'},{text : 'End Date',label :'endDate'},
// {text : 'Today',label :'today'}];
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
index 040cda7..50f773c 100644
--- a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
@@ -28,7 +28,7 @@ define(function(require){
var XAUtil = require('utils/XAUtils');
var SessionMgr = require('mgrs/SessionMgr');
var RangerServiceList = require('collections/RangerServiceList');
- var RangerService = require('models/RangerService');
+ var RangerService = require('models/RangerService');
var ServicemanagerlayoutTmpl = require('hbs!tmpl/common/ServiceManagerLayout_tmpl');
return Backbone.Marionette.Layout.extend(
@@ -39,11 +39,10 @@ define(function(require){
template: ServicemanagerlayoutTmpl,
templateHelpers: function(){
- var groupedServices = this.services.groupBy("type");
return {
- operation : SessionMgr.isSystemAdmin() || SessionMgr.isKeyAdmin(),
+ operation : SessionMgr.isSystemAdmin() || SessionMgr.isKeyAdmin(),
serviceDefs : this.collection.models,
- services : groupedServices
+ services : this.services.groupBy("type")
};
},
breadCrumbs :[XALinks.get('ServiceManager')],
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
index b3147ee..d3c684c 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
@@ -105,7 +105,6 @@ define(function(require) {
console.log("initialized a AuditLayout Layout");
_.extend(this, _.pick(options, 'accessAuditList','tab'));
- // this.initializePolling();
this.bindEvents();
this.currentTab = '#'+this.tab;
var date = new Date().toString();
@@ -119,20 +118,13 @@ define(function(require) {
//this.listenTo(this.collection, "change:foo", this.render, this);
},
initializeCollection : function(){
-
this.collection.fetch({
reset : true,
cache : false
});
},
- initializePolling : function(){
- this.timerId = setInterval(function(){
-// that.onRefresh(this.accessAuditList);
- console.log('polling collection..');
- },XAGlobals.settings.AUDIT_REPORT_POLLING);
- },
initializeServiceDefColl : function() {
- this.serviceDefList = new RangerServiceDefList();
+ this.serviceDefList = new RangerServiceDefList();
this.serviceDefList.fetch({
cache : false,
async:false
@@ -146,15 +138,15 @@ define(function(require) {
this.onTabChange();
this.ui.tab.find('li[class="active"]').removeClass();
this.ui.tab.find('[href="'+this.currentTab+'"]').parent().addClass('active');
-
- }else{
+ } else {
this.renderBigDataTable();
this.addSearchForBigDataTab();
this.modifyTableForSubcolumns();
}
},
- displayDatepicker : function ($el, callback) {
- var input = $el.find('.search_facet.is_editing input.search_facet_input');
+ displayDatepicker : function ($el, callback) {
+ var input = $el.find('.search_facet.is_editing input.search_facet_input');
+
input.datepicker({
autoclose : true,
dateFormat: 'yy-mm-dd'
@@ -168,7 +160,7 @@ define(function(require) {
input.datepicker("destroy");
});
input.datepicker('show');
- },
+ },
modifyTableForSubcolumns : function(){
this.$el.find('[data-id="r_tableList"] table thead').prepend('<tr>\
<th class="renderable pid"></th>\
@@ -185,17 +177,17 @@ define(function(require) {
},
renderDateFields : function(){
var that = this;
+
this.ui.startDate.datepicker({
autoclose : true
- //language : $.cookie().lang
}).on('changeDate', function(ev) {
that.ui.endDate.datepicker('setStartDate', ev.date);
}).on('keydown',function(){
return false;
});
+
this.ui.endDate.datepicker({
autoclose : true
- //language : $.cookie().lang
}).on('changeDate', function(ev) {
that.ui.startDate.datepicker('setEndDate', ev.date);
}).on('keydown',function(){
@@ -204,60 +196,60 @@ define(function(require) {
},
onTabChange : function(e){
var that = this, tab;
- if(!_.isUndefined(e))
- tab = $(e.currentTarget).attr('href');
- else
- tab = this.currentTab;
+ tab = !_.isUndefined(e) ? $(e.currentTarget).attr('href') : this.currentTab;
this.$el.parents('body').find('.datepicker').remove();
switch (tab) {
- case "#bigData":
- this.currentTab = '#bigData';
- this.ui.visualSearch.show();
- this.ui.visualSearch.parents('.well').show();
- this.renderBigDataTable();
- this.modifyTableForSubcolumns();
- if(this.accessAuditList.length <= 0){
- this.accessAuditList.fetch({
- cache : false
+ case "#bigData":
+ this.currentTab = '#bigData';
+ this.ui.visualSearch.show();
+ this.ui.visualSearch.parents('.well').show();
+ this.renderBigDataTable();
+ this.modifyTableForSubcolumns();
+ if(this.accessAuditList.length <= 0){
+ this.accessAuditList.fetch({
+ cache : false
+ });
+ }
+ this.addSearchForBigDataTab();
+ this.listenTo(this.accessAuditList, "request", that.updateLastRefresh);
+ break;
+ case "#admin":
+ this.currentTab = '#admin';
+ this.trxLogList = new VXTrxLogList();
+ this.renderAdminTable();
+ if(_.isUndefined(App.sessionId)){
+ this.trxLogList.fetch({
+ cache : false
+ });
+ }
+ this.addSearchForAdminTab();
+ this.listenTo(this.trxLogList, "request", that.updateLastRefresh);
+ break;
+ case "#loginSession":
+ this.currentTab = '#loginSession';
+ this.authSessionList = new VXAuthSession();
+ this.renderLoginSessionTable();
+ //Setting SortBy as id and sortType as desc = 1
+ this.authSessionList.setSorting('id',1);
+ this.authSessionList.fetch({
+ cache:false,
});
- }
- this.addSearchForBigDataTab();
- break;
- case "#admin":
- this.currentTab = '#admin';
- this.trxLogList = new VXTrxLogList();
- this.renderAdminTable();
- if(_.isUndefined(App.sessionId)){
- this.trxLogList.fetch({
- cache : false
+ this.addSearchForLoginSessionTab();
+ this.listenTo(this.authSessionList, "request", that.updateLastRefresh)
+ break;
+ case "#agent":
+ this.currentTab = '#agent';
+ this.policyExportAuditList = new VXPolicyExportAuditList();
+ var params = { priAcctId : 1 };
+ that.renderAgentTable();
+ this.policyExportAuditList.setSorting('createDate',1);
+ this.policyExportAuditList.fetch({
+ cache : false,
+ data :params
});
- }
- this.addSearchForAdminTab();
-
- break;
- case "#loginSession":
- this.currentTab = '#loginSession';
- this.authSessionList = new VXAuthSession();
- this.renderLoginSessionTable();
- //Setting SortBy as id and sortType as desc = 1
- this.authSessionList.setSorting('id',1);
- this.authSessionList.fetch({
- cache:false,
- });
- this.addSearchForLoginSessionTab();
- break;
- case "#agent":
- this.currentTab = '#agent';
- this.policyExportAuditList = new VXPolicyExportAuditList();
- var params = { priAcctId : 1 };
- that.renderAgentTable();
- this.policyExportAuditList.setSorting('createDate',1);
- this.policyExportAuditList.fetch({
- cache : false,
- data :params
- });
- this.addSearchForAgentTab();
- break;
+ this.addSearchForAgentTab();
+ this.listenTo(this.policyExportAuditList, "request", that.updateLastRefresh);
+ break;
}
var lastUpdateTime = Globalize.format(new Date(), "MM/dd/yyyy hh:mm:ss tt");
that.ui.lastUpdateTimeLabel.html(lastUpdateTime);
@@ -287,12 +279,12 @@ define(function(require) {
valueMatches : function(facet, searchTerm, callback) {
var auditList = [];
_.each(XAEnums.ClassTypes, function(obj){
- if((obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_POLICY.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_SERVICE.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_USER.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value))
+ if((obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_POLICY.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_SERVICE.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_USER.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value))
auditList.push({label :obj.label, value :obj.value+''});
});
@@ -331,7 +323,6 @@ define(function(require) {
callback([today]);
break;
}
-
}
}
};
@@ -352,12 +343,12 @@ define(function(require) {
var auditList = [],query = '';
_.each(XAEnums.ClassTypes, function(obj){
- if((obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_POLICY.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_SERVICE.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_USER.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value))
+ if((obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_POLICY.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_SERVICE.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_USER.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value))
auditList.push({label :obj.label, value :obj.label+''});
});
if(!_.isUndefined(App.sessionId)){
@@ -563,7 +554,7 @@ define(function(require) {
userName :self.model.get('owner'),
action : action
});
- }else{
+ } else {
var view = new vOperationDiffDetail({
collection : fullTrxLogListForTrxId,
classType : self.model.get('objectClassType'),
@@ -585,9 +576,6 @@ define(function(require) {
modal.$el.addClass('modal-diff').attr('tabindex',-1);
modal.$el.find('.cancel').hide();
});
-
-
-
}
});
this.ui.tableList.addClass("clickable");
@@ -605,15 +593,14 @@ define(function(require) {
getAdminTableColumns : function(){
var auditList = [];
_.each(XAEnums.ClassTypes, function(obj){
- if((obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_POLICY.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_SERVICE.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_USER.value) ||
- (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value))
+ if((obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_POLICY.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_RANGER_SERVICE.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_USER.value)
+ || (obj.value == XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value))
auditList.push({text :obj.label, id :obj.value});
});
- console.log(auditList);
var cols = {
operation : {
label : localization.tt("lbl.operation"),
@@ -629,7 +616,7 @@ define(function(require) {
label = XAUtils.enumValueToLabel(XAEnums.ClassTypes,rawValue), html = '';
if(rawValue == XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value || rawValue == XAEnums.ClassTypes.CLASS_TYPE_RANGER_SERVICE.value)
html = 'Service '+action+'d '+'<b>'+name+'</b>';
- if(rawValue == XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value|| rawValue == XAEnums.ClassTypes.CLASS_TYPE_RANGER_POLICY.value)
+ if(rawValue == XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value || rawValue == XAEnums.ClassTypes.CLASS_TYPE_RANGER_POLICY.value)
html = 'Policy '+action+'d '+'<b>'+name+'</b>';
if(rawValue == XAEnums.ClassTypes.CLASS_TYPE_XA_USER.value)
html = 'User '+action+'d '+'<b>'+name+'</b>';
@@ -670,7 +657,6 @@ define(function(require) {
cell: "String",
click : false,
drag : false,
- //sortable:false,
editable:false,
sortType: 'toggle',
direction: 'descending',
@@ -690,14 +676,16 @@ define(function(require) {
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function (rawValue) {
var html = '';
- if(rawValue =='create')
+ if(rawValue =='create'){
html = '<label class="label label-success">'+rawValue+'</label>';
- else if(rawValue == 'update')
+ } else if(rawValue == 'update'){
html = '<label class="label label-yellow">'+rawValue+'</label>';
- else if(rawValue == 'delete')
+ }else if(rawValue == 'delete'){
html = '<label class="label label-important">'+rawValue+'</label>';
- else
+ } else {
html = '<label class="label">'+rawValue+'</label>';
+ }
+
return html;
}
})
@@ -791,19 +779,10 @@ define(function(require) {
if(rawValue == -1){
return '--';
}
- /*var rangerService = new RangerService();
- rangerService.urlRoot += '/name/'+model.get('repoName');
- rangerService.fetch({
- cache : false,
- async : false
- });*/
-
-// if (SessionMgr.isKeyAdmin()) {
- var serviceDef = that.serviceDefList.findWhere({'id' : model.get('repoType')})
- if(_.isUndefined(serviceDef)){
- return rawValue;
- }
-// }
+ var serviceDef = that.serviceDefList.findWhere({'id' : model.get('repoType')});
+ if(_.isUndefined(serviceDef)){
+ return rawValue;
+ }
var href = 'javascript:void(0)';
return '<a href="'+href+'" title="'+rawValue+'">'+rawValue+'</a>';
}
@@ -831,7 +810,6 @@ define(function(require) {
cell: "String",
click : false,
drag : false,
- // sortable:false,
editable:false
},
repoName : {
@@ -875,7 +853,6 @@ define(function(require) {
cell: "html",
click : false,
drag : false,
- // sortable:false,
editable:false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function (rawValue) {
@@ -883,10 +860,11 @@ define(function(require) {
_.each(_.toArray(XAEnums.AccessResult),function(m){
if(parseInt(rawValue) == m.value){
label= m.label;
- if(m.value == XAEnums.AccessResult.ACCESS_RESULT_ALLOWED.value)
+ if(m.value == XAEnums.AccessResult.ACCESS_RESULT_ALLOWED.value){
html = '<label class="label label-success">'+label+'</label>';
- else
+ } else {
html = '<label class="label label-important">'+label+'</label>';
+ }
}
});
return html;
@@ -944,7 +922,7 @@ define(function(require) {
if(obj.value != XAEnums.AuthType.AUTH_TYPE_UNKNOWN.value)
authTypeList.push({text :obj.label, id :obj.value});
});
- console.log(authStatusList);
+
var cols = {
id : {
label : localization.tt("lbl.sessionId"),
@@ -952,7 +930,6 @@ define(function(require) {
href: function(model){
return '#!/reports/audit/loginSession/id/'+model.get('id');
},
-// sortable:false,
editable:false,
sortType: 'toggle',
direction: 'descending'
@@ -972,12 +949,13 @@ define(function(require) {
_.each(_.toArray(XAEnums.AuthStatus),function(m){
if(parseInt(rawValue) == m.value){
label= m.label;
- if(m.value == 1)
+ if(m.value == 1){
html = '<label class="label label-success">'+label+'</label>';
- else if(m.value == 2)
+ } else if(m.value == 2){
html = '<label class="label label-important">'+label+'</label>';
- else
+ } else {
html = '<label class="label">'+label+'</label>';
+ }
}
});
return html;
@@ -1026,7 +1004,6 @@ define(function(require) {
authTime : {
label : localization.tt("lbl.loginTime")+ ' ( '+this.timezone+' )',
cell: "String",
- // sortable:false,
editable:false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function (rawValue, model) {
@@ -1097,11 +1074,8 @@ define(function(require) {
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function (rawValue, model) {
var html = rawValue;
- if(rawValue > 400)
- html = '<label class="label btn-danger">'+rawValue+'</label>';
- else
- html = '<label class="label btn-success">'+rawValue+'</label>';
- return html;
+ return (rawValue > 400) ? '<label class="label btn-danger">'+rawValue+'</label>'
+ : '<label class="label btn-success">'+rawValue+'</label>';
}
})
},
@@ -1129,6 +1103,7 @@ define(function(require) {
coll = this.authSessionList;
break;
case "#agent":
+ //TODO
params = { 'priAcctId' : 1 };
coll = this.policyExportAuditList;
break;
@@ -1144,25 +1119,21 @@ define(function(require) {
}
});
-
-
},
onSearch : function(e){
this.setCurrentTabCollection();
- var resourceName= this.ui.resourceName.val();
- var startDate = this.ui.startDate.val();
- var endDate = this.ui.endDate.val();
- var params = { 'startDate' : startDate , 'endDate' : endDate };
+ var resourceName= this.ui.resourceName.val(),
+ startDate = this.ui.startDate.val(),
+ endDate = this.ui.endDate.val(),
+ params = { 'startDate' : startDate , 'endDate' : endDate };
//After every search we need goto to first page
$.extend(this.collection.queryParams,params);
//collection.fetch({data: data, reset: true});
this.collection.state.currentPage = this.collection.state.firstPage;
-
this.collection.fetch({
reset : true,
- cache : false
- //data : params,
+ cache : false,
});
},
setCurrentTabCollection : function(){
@@ -1188,13 +1159,12 @@ define(function(require) {
});
},
- /*
- * onChangeRepository : function(){ this.onSearch(); },
- */
/** all post render plugin initialization */
initializePlugins : function() {
},
-
+ updateLastRefresh : function(){
+ this.ui.lastUpdateTimeLabel.html(Globalize.format(new Date(), "MM/dd/yyyy hh:mm:ss tt"));
+ },
/** on close */
onClose : function() {
clearInterval(this.timerId);
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/reports/LoginSessionDetail.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/reports/LoginSessionDetail.js b/security-admin/src/main/webapp/scripts/views/reports/LoginSessionDetail.js
index 8f0f67e..6f1069d 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/LoginSessionDetail.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/LoginSessionDetail.js
@@ -35,9 +35,6 @@ define(function(require){
template: LoginSessionDetail_tmpl,
templateHelpers :function(){
-
- return {
- };
},
/** ui selector cache */
ui: {
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js b/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
index 1b66728..a214394 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
@@ -27,9 +27,9 @@ define(function(require){
var PolicyOperationDiff_tmpl = require('hbs!tmpl/reports/PolicyOperationDiff_tmpl');
var PolicyUpdateOperationDiff_tmpl = require('hbs!tmpl/reports/PolicyUpdateOperationDiff_tmpl');
var PolicyDeleteUpdateOperationDiff_tmpl = require('hbs!tmpl/reports/PolicyDeleteOperationDiff_tmpl');
- var KnoxPolicyOperationDiff_tmpl = require('hbs!tmpl/reports/KnoxPolicyOperationDiff_tmpl');
- var KnoxPolicyUpdateOperationDiff_tmpl = require('hbs!tmpl/reports/KnoxPolicyUpdateOperationDiff_tmpl');
- var KnoxPolicyDeleteUpdateOperationDiff_tmpl = require('hbs!tmpl/reports/KnoxPolicyDeleteOperationDiff_tmpl');
+ var KnoxPolicyOperationDiff_tmpl = require('hbs!tmpl/reports/KnoxPolicyOperationDiff_tmpl');
+ var KnoxPolicyUpdateOperationDiff_tmpl = require('hbs!tmpl/reports/KnoxPolicyUpdateOperationDiff_tmpl');
+ var KnoxPolicyDeleteUpdateOperationDiff_tmpl= require('hbs!tmpl/reports/KnoxPolicyDeleteOperationDiff_tmpl');
var AssetOperationDiff_tmpl = require('hbs!tmpl/reports/AssetOperationDiff_tmpl');
var AssetUpdateOperationDiff_tmpl = require('hbs!tmpl/reports/AssetUpdateOperationDiff_tmpl');
var UserOperationDiff_tmpl = require('hbs!tmpl/reports/UserOperationDiff_tmpl');
@@ -55,7 +55,9 @@ define(function(require){
if(this.templateType == XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value){
obj = $.extend(obj, {
newConnConfig : this.newConnConfig,
- previousConnConfig : this.previousConnConfig
+ previousConnConfig : this.previousConnConfig,
+ isNewConnConfig : _.isEmpty(this.newConnConfig) ? false : true,
+ isPreviousConnConfig: _.isEmpty(this.previousConnConfig) ? false : true
});
}
if(this.templateType == XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value){
@@ -76,7 +78,6 @@ define(function(require){
newGroupList : this.newGroupList,
previousGroupList : this.previousGroupList,
isGroup : this.isGroup
-
});
}
@@ -109,7 +110,6 @@ define(function(require){
_.extend(this, _.pick(options, 'classType','objectName','objectId','objectCreatedDate','action','userName'));
this.bindEvents();
- //this.initializeDiffOperation();
this.getTemplateForView();
},
@@ -126,7 +126,6 @@ define(function(require){
//remove last comma from Perms
_.each(this.ui.diff.find('ol li'),function(m){
var text = $(m).text().replace(/,(?=[^,]*$)/, '');
- //$(m).text(text);
$(m).find('span').last().remove();
});
_.each(this.ui.policyDiff.find('ol li'),function(m){
@@ -140,9 +139,9 @@ define(function(require){
this.templateType=XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value;
if(this.action == 'create'){
this.template = AssetOperationDiff_tmpl;
- }else if(this.action == 'update'){
+ } else if(this.action == 'update'){
this.template = AssetUpdateOperationDiff_tmpl;
- }else{
+ } else {
this.template = AssetOperationDiff_tmpl;
}
this.assetDiffOperation();
@@ -151,9 +150,9 @@ define(function(require){
this.templateType=XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value;
if(this.action == 'create'){
this.template = PolicyOperationDiff_tmpl;
- }else if(this.action == 'update'){
+ } else if(this.action == 'update'){
this.template = PolicyUpdateOperationDiff_tmpl;
- }else{
+ } else{
this.template = PolicyDeleteUpdateOperationDiff_tmpl;
}
this.resourceDiffOperation();
@@ -163,9 +162,9 @@ define(function(require){
|| this.classType == XAEnums.ClassTypes.CLASS_TYPE_PASSWORD_CHANGE.value){
if(this.action == 'create' || this.action == 'delete'){
this.template = UserOperationDiff_tmpl;
- }else if(this.action == 'update' || this.action == "password change"){
+ } else if(this.action == 'update' || this.action == "password change"){
this.template = UserUpdateOperationDiff_tmpl;
- }else{
+ } else{
this.template = UserOperationDiff_tmpl;
}
this.userDiffOperation();
@@ -174,14 +173,11 @@ define(function(require){
if(this.classType == XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value){
if(this.action == 'create'){
this.template = GroupOperationDiff_tmpl;
- //this.groupDiffOperation();
- }else if(this.action == 'update'){
+ } else if(this.action == 'update'){
this.template = GroupUpdateOperationDiff_tmpl;
- }else{
+ } else{
this.template = GroupOperationDiff_tmpl;
}
- //this.template=GroupUpdateOperationDiff_tmpl;
- // this.groupDiffOperation();
this.templateType = XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value;
}
},
@@ -202,7 +198,13 @@ define(function(require){
if(this.action == 'create' || this.action == 'delete'){
this.newConnConfig = this.removeUnwantedFromObject(this.newConnConfig);
this.previousConnConfig = this.removeUnwantedFromObject(this.previousConnConfig);
+ }else{
+ var tmp = this.newConnConfig, tmp1 = {};;
+ _.each(tmp,function(val, name){ tmp1[name] = ""; })
+ _.each(this.previousConnConfig,function(val, name){ tmp1[name]=val; });
+ this.previousConnConfig = tmp1;
}
+
},
resourceDiffOperation : function(){
var that = this, modelColl = [];
@@ -210,8 +212,7 @@ define(function(require){
this.userList = [],this.groupList = [];
this.collection.each(function(m){
var attrName = m.get('attributeName'), type = 'permType';
- if(attrName == "IP Address")
- type = 'ipAddress';
+ if(attrName == "IP Address") type = 'ipAddress';
if(m.get('attributeName') == 'Permission Type' || m.get('attributeName') == "IP Address"){
if(m.get('parentObjectClassType') == XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value){
if(m.get('action') != 'delete'){
@@ -231,8 +232,7 @@ define(function(require){
}
if($.inArray(m.get('parentObjectName'),that.groupList) < 0)
that.groupList.push(m.get('parentObjectName'));
- }
- else{
+ } else {
if(m.get('action') != 'delete'){
if(m.get('action') == 'create'){
var obj = {userName : m.get('parentObjectName')};
@@ -255,11 +255,12 @@ define(function(require){
}
modelColl.push(m);
- }else if(m.get('attributeName') == 'Repository Type'){
- if(m.get('action') != 'delete')
+ } else if(m.get('attributeName') == 'Repository Type'){
+ if(m.get('action') != 'delete'){
that.repositoryType = m.get('newValue');
- else
+ } else {
that.repositoryType = m.get('previousValue');
+ }
modelColl.push(m);
if(that.repositoryType == XAEnums.AssetType.ASSET_KNOX.label && m.get('action') == "create")//XAEnums.AssetType.ASSET_KNOX.value)
that.template = KnoxPolicyOperationDiff_tmpl;
@@ -267,15 +268,16 @@ define(function(require){
that.template = KnoxPolicyUpdateOperationDiff_tmpl;
if(that.repositoryType == XAEnums.AssetType.ASSET_KNOX.label && m.get('action') == "delete")
that.template = KnoxPolicyDeleteUpdateOperationDiff_tmpl;
- }else if(m.get('attributeName') == 'Policy Name'){
- if(m.get('action') != 'delete')
+ } else if(m.get('attributeName') == 'Policy Name'){
+ if(m.get('action') != 'delete'){
that.policyName = m.get('newValue');
- else
+ } else {
that.policyName = m.get('previousValue');
+ }
if(m.get('newValue') == m.get('previousValue'))
modelColl.push(m);
}
-
+
if(_.isUndefined(m.get('attributeName')))
modelColl.push(m);
});
@@ -346,7 +348,7 @@ define(function(require){
if(m.get('action') == 'delete' || m.get('action') == 'update')
that.previousGroupList.push(m.get('parentObjectName'));
modelArr.push(m);
- }else if(m.get('attributeName') == 'User Role'){
+ } else if(m.get('attributeName') == 'User Role'){
var newRole = m.get('newValue').replace(/[[\]]/g,'');
var prevRole = m.get('previousValue').replace(/[[\]]/g,'');
if( newRole == "ROLE_USER")
@@ -361,13 +363,14 @@ define(function(require){
m.set('previousValue',XAEnums.UserRoles.ROLE_SYS_ADMIN.label)
else if(prevRole == "ROLE_KEY_ADMIN")
m.set('previousValue',XAEnums.UserRoles.ROLE_KEY_ADMIN.label)
- }else{
+ } else {
if(!m.has('attributeName'))
modelArr.push(m);
}
});
- if(!_.isEmpty(this.newGroupList) || !_.isEmpty(this.previousGroupList))
+ if(!_.isEmpty(this.newGroupList) || !_.isEmpty(this.previousGroupList)){
this.isGroup = true;
+ }
this.collection.remove(modelArr);
},
groupDiffOperation : function(){
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/reports/PlugableServiceDiffDetail.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/reports/PlugableServiceDiffDetail.js b/security-admin/src/main/webapp/scripts/views/reports/PlugableServiceDiffDetail.js
index ceb8898..52550b6 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/PlugableServiceDiffDetail.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/PlugableServiceDiffDetail.js
@@ -82,7 +82,6 @@ define(function(require){
_.extend(this, _.pick(options, 'classType','objectName','objectId','objectCreatedDate','action','userName','policyId'));
this.bindEvents();
- //this.initializeDiffOperation();
this.initializeServiceDef();
this.getTemplateForView();
@@ -260,7 +259,6 @@ define(function(require){
}
if(this.action == "update"){
_.each(resources,function(val, key){
-// console.log(oldResources)
if(val != oldResources[key])
this.collection.add({'attributeName':key, 'newValue':val.toString(),'previousValue': oldResources[key],type : "Policy Resources"});
}, this)
@@ -341,8 +339,6 @@ define(function(require){
this.newPermList.push({})
}
}
- console.log(this.oldPermList)
- console.log(this.newPermList)
},
/** all post render plugin initialization */
initializePlugins: function(){
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js b/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
index b1ed454..1002516 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
@@ -78,13 +78,8 @@ define(function(require) {'use strict';
/** ui events hash */
events : function() {
var events = {};
- //events['change ' + this.ui.input] = 'onInputChange';
events['click ' + this.ui.searchBtn] = 'onSearch';
- //events["'change ' "+ this.ui.userName +"','" + this.ui.userGroup+"'"] = 'onSearch';
- //events['change ' + this.ui.userName+ ','+this.ui.userGroup+ ',' +this.ui.resourceName] = 'onSearch';
events['click .autoText'] = 'autocompleteFilter';
-
- //events['keydown ' + this.ui.userGroup] = 'groupKeyDown';
events['click .gotoLink'] = 'gotoTable';
events['click ' + this.ui.btnShowMore] = 'onShowMore';
events['click ' + this.ui.btnShowLess] = 'onShowLess';
@@ -101,7 +96,6 @@ define(function(require) {'use strict';
console.log("initialized a UserAccessLayout Layout");
_.extend(this, _.pick(options, 'groupList','userList'));
this.bindEvents();
-
},
initializeRequiredData : function() {
this.policyCollList = [];
@@ -116,7 +110,6 @@ define(function(require) {'use strict';
},
initializeServiceDef : function() {
this.serviceDefList = new RangerServiceDefList();
-// this.serviceDefList.queryParams.sortBy = 'id';
this.serviceDefList.fetch({
cache : false,
async:false
@@ -138,34 +131,18 @@ define(function(require) {'use strict';
this.renderTable(obj.collName, obj.serviceDefName);
this.getResourceLists(obj.collName,obj.serviceDefName);
},this);
+ this.$el.find('[data-js="policyName"]').focus();
},
getResourceLists: function(collName, serviceDefName){
var that = this, coll = this[collName];
coll.queryParams.serviceType = serviceDefName;
- /* if(!_.isUndefined(params)){
- _.each(params,function(val, attr){
- if(!_.isUndefined(val) && !_.isEmpty(val))
- coll.queryParams[attr] = val;
- });
- }*/
coll.fetch({
cache : false,
reset: true,
async:false,
}).done(function(){
-// console.log(coll);
coll.trigger('sync')
-// if(coll.queryParams.assetType == XAEnums.AssetType.ASSET_STORM.value){
-// var totalRecords=0;
-// _.each(that.resourceList, function( list ){ totalRecords += list.state.totalRecords; });
- /*that.$('[data-js="searchResult"]').html('Total '+totalRecords+' records found.');
- that.$('[data-js="hdfsSearchResult"]').html(that.hdfsResourceList.state.totalRecords +' records found.');
- that.$('[data-js="hiveSearchResult"]').html(that.hiveResourceList.state.totalRecords +' records found.');
- that.$('[data-js="hbaseSearchResult"]').html(that.hbaseResourceList.state.totalRecords +' records found.');
- that.$('[data-js="knoxSearchResult"]').html(that.knoxResourceList.state.totalRecords +' records found.');
- that.$('[data-js="stormSearchResult"]').html(that.stormResourceList.state.totalRecords +' records found.');*/
-// }
XAUtil.blockUI('unblock');
});
@@ -271,14 +248,6 @@ define(function(require) {'use strict';
},
/** on render callback */
setupGroupAutoComplete : function(){
- //tags : true,
- /*width :'220px',
- multiple: true,
- minimumInputLength: 1,
- data :this.groupList.map(function(m) {
- //console.log(m);
- return {id : m.id,text : m.get('name')};
- }),*/
this.groupArr = this.groupList.map(function(m){
return { id : m.get('name') , text : m.get('name')};
});
@@ -293,8 +262,6 @@ define(function(require) {'use strict';
// tags : this.groupArr,
initSelection : function (element, callback) {
var data = [];
- console.log(that.groupList);
-
$(element.val().split(",")).each(function () {
var obj = _.findWhere(that.groupArr,{id:this});
data.push({id: obj.text, text: obj.text});
@@ -329,7 +296,7 @@ define(function(require) {'use strict';
formatNoMatches: function(result){
return 'No group found.';
}
- }).on('select2-focus', XAUtil.select2Focus);
+ })//.on('select2-focus', XAUtil.select2Focus);
},
setupUserAutoComplete : function(){
var that = this;
@@ -384,7 +351,7 @@ define(function(require) {'use strict';
return 'No user found.';
}
- }).on('select2-focus', XAUtil.select2Focus);
+ })//.on('select2-focus', XAUtil.select2Focus);
},
/** all post render plugin initialization */
initializePlugins : function() {
@@ -395,6 +362,7 @@ define(function(require) {'use strict';
if (wrap.hasClass('wrap') && ! wrap.hasClass('non-collapsible'))
$(this).append('<a href="#" class="wrap-collapse pull-right">hide <i class="icon-caret-up"></i></a>').append('<a href="#" class="wrap-expand pull-right" style="display: none">show <i class="icon-caret-down"></i></a>');
});
+
// Collapse wrap
$(document).on("click", "a.wrap-collapse", function() {
var self = $(this).hide(100, 'linear');
@@ -413,7 +381,6 @@ define(function(require) {'use strict';
});
this.ui.resourceName.bind( "keydown", function( event ) {
-
if ( event.keyCode === $.ui.keyCode.ENTER ) {
that.onSearch();
}
@@ -422,7 +389,6 @@ define(function(require) {'use strict';
},
onSearch : function(e){
var that = this, type;
- // XAUtil.blockUI();
//Get search values
var groups = (this.ui.userGroup.is(':visible')) ? this.ui.userGroup.select2('val'):undefined;
var users = (this.ui.userName.is(':visible')) ? this.ui.userName.select2('val'):undefined;
@@ -459,7 +425,6 @@ define(function(require) {'use strict';
this.setupUserAutoComplete();
$button.text('Username');
}
- //this.onSearch();
},
gotoTable : function(e){
var that = this, elem = $(e.currentTarget),pos;
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/service/ConfigurationList.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/service/ConfigurationList.js b/security-admin/src/main/webapp/scripts/views/service/ConfigurationList.js
index 598db83..dcc85ab 100644
--- a/security-admin/src/main/webapp/scripts/views/service/ConfigurationList.js
+++ b/security-admin/src/main/webapp/scripts/views/service/ConfigurationList.js
@@ -91,13 +91,11 @@ define(function(require) {
},
initialize : function(options) {
_.extend(this, _.pick(options, 'fieldLabel'));
-// this.listenTo(this.groupList, 'sync', this.render, this);
- if(this.collection.length == 0)
- this.collection.add(new Backbone.Model());
+ if(this.collection.length == 0){
+ this.collection.add(new Backbone.Model());
+ }
},
onRender : function(){
-// this.$('table').hide();
-
},
addNew : function(){
var that =this;
[2/5] incubator-ranger git commit: RANGER-799 : Ranger UI fixes -
partial search not working on Policy listing page
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/helpers/XAHelpers.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/helpers/XAHelpers.js b/security-admin/src/main/webapp/templates/helpers/XAHelpers.js
index b140608..66d37ce 100644
--- a/security-admin/src/main/webapp/templates/helpers/XAHelpers.js
+++ b/security-admin/src/main/webapp/templates/helpers/XAHelpers.js
@@ -165,8 +165,7 @@
if(typeof pageSize === 'undefined'){
pageSize = 25;
}
- var html = '',
- fromPage = 0, i = 1;
+ var html = '', fromPage = 0, i = 1;
var index = parseInt(totalCount/pageSize);
if(index == 0){
return html;
@@ -174,7 +173,7 @@
for (; i <= index; i++) {
if(i == 1){
html += '<li class="active" data-page='+fromPage+'><a href="javascript:;">'+i+'</a></li>';
- }else{
+ } else {
html += '<li data-page='+fromPage+'><a href="javascript:;">'+i+'</a></li>';
}
fromPage = pageSize * i;
@@ -189,7 +188,6 @@
if(permsString == "--")
return permsString;
permArr = permsString.split(',');
- //return permArr.join(', ');
var cl = _.isObject(kclass) ? 'label label-info' : kclass;
var tempArr = [];
_.each(permArr, function(val){
@@ -299,8 +297,6 @@
path = "styles/images/s-avatar.png";
}
return path;
- //return path;
- //return XAUtil.getImgPath(id,size);
});
Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
@@ -328,7 +324,6 @@
return options.inverse(this);
break;
}
- //return options.inverse(this);
});
//For Example
@@ -372,13 +367,15 @@
if(hightlightValue == 'new'){
if(_.isNull(oldValue) || oldValue == '--' || oldValue == "" || _.isUndefined(oldValue)){
html = '<span class="add-text">'+newValue+'</span>';
- }else
+ } else {
html = '<span class="">'+newValue+'</span>';
- }else{
+ }
+ } else {
if(_.isNull(newValue) || newValue == '--' || newValue == ""){
html = '<span class="delete-text">'+oldValue+'</span>';
- }else
+ } else {
html = '<span class="">'+oldValue+'</span>';
+ }
}
return html;
});
@@ -387,13 +384,15 @@
if(hightlightValue == 'new'){
if(_.isNull(oldValue[prop]) || oldValue[prop] == ""){
html = '<span class="add-text">'+newValue+'</span>';
- }else
+ } else {
html = '<span class="">'+newValue+'</span>';
- }else{
+ }
+ } else {
if(_.isNull(oldValue[prop]) || oldValue[prop] == ""){
html = '<span class="delete-text">'+newValue+'</span>';
- }else
+ }else{
html = '<span class="">'+newValue+'</span>';
+ }
}
return html;
});
@@ -408,20 +407,19 @@
_.each(newValue, function(val) {
if($.inArray(val, oldValue) < 0){
html += '<span class="add-text">'+_.escape(val)+'</span>';
- }else{
+ } else {
html += '<span>'+_.escape(val)+'</span>';
}
html+='<span>,</span>';
});
- }else{
+ } else {
_.each(oldValue, function(val) {
if($.inArray(val, newValue) < 0){
html += '<span class="delete-text">'+_.escape(val)+'</span>';
- }else{
+ } else {
html += '<span>'+_.escape(val)+'</span>';
}
html+='<span>,</span>';
-
});
}
return html;
@@ -431,7 +429,7 @@
if(hightlightValue == 'new'){
if($.inArray(val, arr) < 0)
html = '<span class="add-text">'+val+'</span>';
- }else{
+ } else {
if($.inArray(val, arr) < 0)
return html = '<span class="delete-text">'+val+'</span>';
}
@@ -452,11 +450,11 @@
});
if(isRemoved)
return html = '<span class="delete-text">'+perm[type]+'</span>';
- }else{
+ } else {
return html = '<span class="delete-text">'+perm[type]+'</span>';
}
}
- }else{
+ } else {
if(_.isNull(perm[type]) || perm[type] != ""){
if(!_.isUndefined(pemList[perm.userName])){
var isNewAdd = true;
@@ -466,7 +464,7 @@
});
if(isNewAdd)
return html = '<span class="add-text">'+perm[type]+'</span>';
- }else{
+ } else {
return html = '<span class="delete-text">'+perm[type]+'</span>';
}
}
@@ -475,8 +473,9 @@
});
Handlebars.registerHelper('highlightPermissionsForGroup', function(perm, newValue, pemList, hightlightValue) {
var type = 'permType';
- if(_.isUndefined(perm.permType))
+ if(_.isUndefined(perm.permType)){
type = 'ipAddress';
+ }
var html = perm[type];
if(hightlightValue == 'old'){
if(_.isNull(perm[type]) || perm[type] != ""){
@@ -488,11 +487,11 @@
});
if(isRemoved)
return html = '<span class="delete-text">'+perm[type]+'</span>';
- }else{
+ } else {
return html = '<span class="delete-text">'+perm[type]+'</span>';
}
}
- }else{
+ } else {
if(_.isNull(perm[type]) || perm[type] != ""){
if(!_.isUndefined(pemList[perm.groupName])){
var isNewAdd = true;
@@ -502,8 +501,7 @@
});
if(isNewAdd)
return html = '<span class="add-text">'+perm[type]+'</span>';
- }
- else{
+ } else {
return html = '<span class="add-text">'+perm[type]+'</span>';
}
}
@@ -511,7 +509,7 @@
return new Handlebars.SafeString(html);
});
Handlebars.registerHelper('getServices', function(services, serviceDef) {
- var XAEnums = require('utils/XAEnums');
+ var XAEnums = require('utils/XAEnums');
var tr = '', serviceOperationDiv = '';
var serviceType = serviceDef.get('name');
if(!_.isUndefined(services[serviceType])){
@@ -540,10 +538,8 @@
var groupModules = _.pluck(vxPortalUser.get('groupPermissions'), 'moduleName');
var moduleNames = _.union(userModules,groupModules);
var returnFlag = _.contains(moduleNames, tabName);
- if (returnFlag)
- return options.fn(this);
- else
- return options.inverse(this);
+
+ return (returnFlag) ? options.fn(this) : options.inverse(this);
});
return HHelpers;
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/hive/HivePolicyCreate_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/hive/HivePolicyCreate_tmpl.html b/security-admin/src/main/webapp/templates/hive/HivePolicyCreate_tmpl.html
deleted file mode 100644
index 69e97d3..0000000
--- a/security-admin/src/main/webapp/templates/hive/HivePolicyCreate_tmpl.html
+++ /dev/null
@@ -1,49 +0,0 @@
-{{!--
- 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.
---}}
-{{#if editPolicy}}
- <h4> {{tt 'h.editPolicy'}}</h4>
-{{else}}
- <h4> {{tt 'h.createPolicy'}} </h4>
-{{/if}}
-<div class="wrap non-collapsible ">
-<div class="alert alert-danger" data-id="policyDisabledAlert" style="display:none;">
- <button type="button" class="close" data-dismiss="alert">×</button>
- <strong>Warning !</strong> {{tt 'msg.policyDisabledMsg'}}
-</div>
- <div data-id="r_form"></div>
- <div class="form-actions form-policy" class="row-fluid">
- {{#if editPolicy}}
- <button type="submit" data-id="save" class="btn btn-primary btn-spinner">
- <span>Save</span>
- <i class="icon-spinner icon-spin"></i>
- </button>
- {{else}}
- <button type="submit" data-id="save" class="btn btn-primary btn-spinner">
- <span>Add</span>
- <i class="icon-spinner icon-spin"></i>
- </button>
-
- {{/if}}
- <button type="button" data-id="cancel" class="btn btn-inverse">
- Cancel
- </button>
- {{#if editPolicy}}
- <button type="button" data-id="delete" class="btn btn-danger" ><!-- style="margin-left: 27%;" -->Delete</button>
- {{/if}}
- </div>
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/hive/HivePolicyForm_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/hive/HivePolicyForm_tmpl.html b/security-admin/src/main/webapp/templates/hive/HivePolicyForm_tmpl.html
deleted file mode 100644
index 94fa928..0000000
--- a/security-admin/src/main/webapp/templates/hive/HivePolicyForm_tmpl.html
+++ /dev/null
@@ -1,67 +0,0 @@
-{{!--
- 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.
---}}
-<form class="form-horizontal">
- <fieldset>
- <p class="formHeader">
- <span>Policy Details :</span>
- </p>
- <div class="" data-fields="policyName" style="float:left"></div>
- <div class="" data-editors="resourceStatus" style="float:left"></div>
- <div class="clearfix"></div>
- <div class="" data-fields="databases"></div>
- <div>
- <div class="control-group inline-block">
- <div data-editors="resourceType" class="control-label"></div>
- <div class="controls" data-editors="tables"></div>
- <div class="controls" data-editors="udfs" style="display:none;"></div>
- </div>
- <div data-editors="isTableInclude" class="is-table-include"></div>
- </div>
-
- <!-- <div class="" data-fields="views" style="display:none"></div> -->
- <!-- <div class="" data-editors="udfs" style="display:none;margin-left: 180px;margin-top: -29px;margin-bottom: 15px;"></div> -->
- <div>
- <div class="select-columns inline-block" data-fields="columns"></div>
- <div class="is-column-include" data-editors="isColumnInclude"></div>
- </div>
- <div class="" data-fields="_vAuditListToggle"></div>
- <div class="" data-fields="isEncrypt"></div>
- </fieldset>
- <fieldset>
- <p class="formHeader">
- User and Group Permissions :
- </p>
- <div class="" data-customfields="groupPerms">
- <div class="control-group">
- <label class="control-label">{{tt 'lbl.groupPermissions'}}</label>
- <div class="controls">
- <img src="images/loading.gif" style=" margin-left: 4%; margin-top: 1%;" />
- </div>
- </div>
- </div>
- <div class="" data-customfields="userPerms">
- <div class="control-group">
- <label class="control-label">{{tt 'lbl.userPermissions'}}</label>
- <div class="controls">
- <img src="images/loading.gif" style=" margin-left: 4%; margin-top: 1%;" />
- </div>
- </div>
- </div>
- <div class="" data-fields="description"></div>
- </fieldset>
-</form>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/hive/HiveTableLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/hive/HiveTableLayout_tmpl.html b/security-admin/src/main/webapp/templates/hive/HiveTableLayout_tmpl.html
deleted file mode 100644
index 9500c1a..0000000
--- a/security-admin/src/main/webapp/templates/hive/HiveTableLayout_tmpl.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{{!--
- 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.
---}}
-<h3 class="wrap-header bold"> {{tt 'lbl.listOfPolicies'}} : {{assetModel.attributes.name}} </h3>
-<div class="wrap non-collapsible m-height ">
- <div>
- <div class="span9">
- <div class="visual_search"></div>
- </div>
- <div class="clearfix">
- <a href="#!/hive/{{assetId}}/policy/create" class="btn btn-primary btn-right" type="button"> {{tt 'lbl.addNewPolicy'}} </a>
- {{#if isSysAdmin}}
- {{#if version}}
- <a href="javascript:void(0);" data-js="export" class="btn btn-black btn-right">{{tt 'lbl.exports'}}</a>
- {{/if}}
- {{/if}}
- <div data-id="r_filter" class="wrap-filter pull-left"></div>
- </div>
-
- <div data-id="r_tableList" class="clickable">
- </div>
- </div>
-
- <!-- <div class="span3" style="margin-top:39px">
- <div id="policyDetail"></div>
- </div> -->
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/kms/KmsKeyCreate_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/kms/KmsKeyCreate_tmpl.html b/security-admin/src/main/webapp/templates/kms/KmsKeyCreate_tmpl.html
index 1249aed..2aaac43 100644
--- a/security-admin/src/main/webapp/templates/kms/KmsKeyCreate_tmpl.html
+++ b/security-admin/src/main/webapp/templates/kms/KmsKeyCreate_tmpl.html
@@ -24,7 +24,6 @@
<button type="button" data-id="cancel" class="btn btn-inverse">
Cancel
</button>
- <!-- <button type="button" data-id="delete" class="btn btn-danger" >style="margin-left: 27%;"Delete</button> -->
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/kms/KmsTableLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/kms/KmsTableLayout_tmpl.html b/security-admin/src/main/webapp/templates/kms/KmsTableLayout_tmpl.html
index 8437c04..8107148 100644
--- a/security-admin/src/main/webapp/templates/kms/KmsTableLayout_tmpl.html
+++ b/security-admin/src/main/webapp/templates/kms/KmsTableLayout_tmpl.html
@@ -14,14 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
--}}
- <!-- <ul class="nav nav-tabs tabs clearfix">
- <li data="groups" data-js="groups">
- <a data-toggle="tab" href="#groups">Zones</a>
- </li>
- <li class="active" data-js="users">
- <a data-toggle="tab" href="#users">Keys</a>
- </li>
- </ul> -->
<h3 class="wrap-header bold"> {{tt 'lbl.keyManagement'}} </h3>
<div class="wrap non-collapsible m-height ">
@@ -35,7 +27,6 @@
<div class="visual_search"></div>
</div>
<div class="clearfix">
- <!-- <input type="text" name="serviceName" data-js="serviceName" style="margin-top: 1px;margin-left: -17px;"> -->
<a href="javascript:;" class="btn btn-primary btn-right" type="button" data-id="addNewKey"> {{tt 'lbl.addNewKey'}} </a>
<a href="#!/group/create" class="btn btn-primary btn-right" type="button" data-id="addNewGroup" style="display:none;"> {{tt 'lbl.addNewZone'}} </a>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/knox/KnoxInfo_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/knox/KnoxInfo_tmpl.html b/security-admin/src/main/webapp/templates/knox/KnoxInfo_tmpl.html
deleted file mode 100644
index 09a6348..0000000
--- a/security-admin/src/main/webapp/templates/knox/KnoxInfo_tmpl.html
+++ /dev/null
@@ -1,106 +0,0 @@
-{{!--
- 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.
---}}
-<div class="well well-small ">
- <!-- <label style="color: white;padding: 5px;font-weight: 700;background: -webkit-linear-gradient(#4C89D6, #b8892d);background: -o-linear-gradient(#f7ec13, #b8892d);background: linear-gradient(#94BBEB, #2D75B8);">Policy Information</label> -->
- <div class="fancy title" style="margin-bottom: 16px;">
- <span>Policy Information</span>
- </div>
- <div class="datagrid-stretch-wrapper newScroll" style="overflow-y: auto; height:400px"><!-- height:400px;"> -->
- <label class="labelInverse">{{tt 'lbl.resourceInformation'}} :</label>
- <table class="table table-bordered">
- <tbody>
- {{#if topologies}}
- <tr>
- <td>{{tt 'lbl.topologyName'}}(s)</td>
- <td>{{{customPermString topologies 'label label-info'}}}</td>
- </tr>
- {{/if}}
- {{#if services}}
- <tr>
- <td>{{tt 'lbl.serivceName'}}(s)</td>
- <td> {{{customPermString services 'label label-success'}}} </td>
- </tr>
- {{/if}}
- </tbody>
- </table>
-
- <!-- <label class="labelInverse" >{{tt 'lbl.policyInfo'}} :</label> -->
- <table class="table table-bordered">
- <tbody>
- <tr>
- <td>{{tt 'lbl.createdBy'}}</td>
- <td> {{owner}} </td>
- </tr>
- <tr>
- <td>{{tt 'lbl.createdOn'}}</td>
- <td>{{dateFormat createDate format="MM/DD/YYYY HH:mm:ss A"}}</td>
- </tr>
- <tr>
- <td>{{tt 'lbl.updatedBy'}}</td>
- <td> {{updatedBy}} </td>
- </tr>
- <tr>
- <td>{{tt 'lbl.updatedOn'}}</td>
- <td>{{dateFormat updateDate format="MM/DD/YYYY HH:mm:ss A"}} </td>
- </tr>
- </tbody>
- </table>
- {{#if groupPermListArr}}
- <label class="labelInverse"> {{tt 'lbl.permissionGranted'}} :</label>
- <table class="table table-bordered">
- <thead>
- <tr>
- <th >{{tt 'lbl.groupName'}}</th>
- <th >{{tt 'lbl.ipAddress'}}</th>
- <th >{{tt 'lbl.permissions'}}</th>
- </tr>
- </thead>
- <tbody>
- {{#each groupPermListArr}}
- <tr>
- <td>{{./this.name}}</td>
- <td >{{{customPermString ./this.ipAddress}}}</td>
- <td >{{{customPermString ./this.permType}}}</td>
- </tr>
- {{/each}}
- </tbody>
- </table>
- {{/if}}
- {{#if userPermListArr}}
- <label class="labelInverse">{{tt 'lbl.userPermissions'}} :</label>
- <table class="table table-bordered">
- <thead>
- <tr>
- <th >{{tt 'lbl.userName'}}</th>
- <th >{{tt 'lbl.ipAddress'}}</th>
- <th >{{tt 'lbl.permissions'}}</th>
- </tr>
- </thead>
- <tbody>
- {{#each userPermListArr}}
- <tr>
- <td>{{./this.name}}</td>
- <td >{{{customPermString ./this.ipAddress}}}</td>
- <td style="word-break: break-word;">{{{customPermString ./this.permType}}}</td>
- </tr>
- {{/each}}
- </tbody>
- </table>
- {{/if}}
- <!-- <a href="javascript:void(0);" class="btn btn-primary" disabled="disabled" onclick="alert('Coming Soon..')"> Manage Folder </a> -->
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/knox/KnoxPolicyCreate_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/knox/KnoxPolicyCreate_tmpl.html b/security-admin/src/main/webapp/templates/knox/KnoxPolicyCreate_tmpl.html
deleted file mode 100644
index 69e97d3..0000000
--- a/security-admin/src/main/webapp/templates/knox/KnoxPolicyCreate_tmpl.html
+++ /dev/null
@@ -1,49 +0,0 @@
-{{!--
- 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.
---}}
-{{#if editPolicy}}
- <h4> {{tt 'h.editPolicy'}}</h4>
-{{else}}
- <h4> {{tt 'h.createPolicy'}} </h4>
-{{/if}}
-<div class="wrap non-collapsible ">
-<div class="alert alert-danger" data-id="policyDisabledAlert" style="display:none;">
- <button type="button" class="close" data-dismiss="alert">×</button>
- <strong>Warning !</strong> {{tt 'msg.policyDisabledMsg'}}
-</div>
- <div data-id="r_form"></div>
- <div class="form-actions form-policy" class="row-fluid">
- {{#if editPolicy}}
- <button type="submit" data-id="save" class="btn btn-primary btn-spinner">
- <span>Save</span>
- <i class="icon-spinner icon-spin"></i>
- </button>
- {{else}}
- <button type="submit" data-id="save" class="btn btn-primary btn-spinner">
- <span>Add</span>
- <i class="icon-spinner icon-spin"></i>
- </button>
-
- {{/if}}
- <button type="button" data-id="cancel" class="btn btn-inverse">
- Cancel
- </button>
- {{#if editPolicy}}
- <button type="button" data-id="delete" class="btn btn-danger" ><!-- style="margin-left: 27%;" -->Delete</button>
- {{/if}}
- </div>
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/knox/KnoxPolicyForm_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/knox/KnoxPolicyForm_tmpl.html b/security-admin/src/main/webapp/templates/knox/KnoxPolicyForm_tmpl.html
deleted file mode 100644
index 2e31599..0000000
--- a/security-admin/src/main/webapp/templates/knox/KnoxPolicyForm_tmpl.html
+++ /dev/null
@@ -1,55 +0,0 @@
-{{!--
- 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.
---}}
-<form class="form-horizontal">
- <fieldset>
- <p class="formHeader">
- <span>Policy Details :</span>
- </p>
- <div class="" data-fields="policyName" style="float:left"></div>
- <div class="" data-editors="resourceStatus" style="float:left"></div>
- <div class="clearfix"></div>
- <div class="" data-fields="topologies"></div>
- <div class="" data-fields="services"></div>
-
- <!-- <div class="" data-fields="views" style="display:none"></div> -->
- <!-- <div class="" data-editors="udfs" style="display:none;margin-left: 180px;margin-top: -29px;margin-bottom: 15px;"></div> -->
- <div class="" data-fields="_vAuditListToggle"></div>
- </fieldset>
- <fieldset>
- <p class="formHeader">
- User and Group Permissions :
- </p>
- <div class="" data-customfields="groupPerms">
- <div class="control-group">
- <label class="control-label">{{tt 'lbl.groupPermissions'}}</label>
- <div class="controls">
- <img src="images/loading.gif" style=" margin-left: 4%; margin-top: 1%;" />
- </div>
- </div>
- </div>
- <div class="" data-customfields="userPerms">
- <div class="control-group">
- <label class="control-label">{{tt 'lbl.userPermissions'}}</label>
- <div class="controls">
- <img src="images/loading.gif" style=" margin-left: 4%; margin-top: 1%;" />
- </div>
- </div>
- </div>
- <div class="" data-fields="description"></div>
- </fieldset>
-</form>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/knox/KnoxTableLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/knox/KnoxTableLayout_tmpl.html b/security-admin/src/main/webapp/templates/knox/KnoxTableLayout_tmpl.html
deleted file mode 100644
index 3369522..0000000
--- a/security-admin/src/main/webapp/templates/knox/KnoxTableLayout_tmpl.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{{!--
- 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.
---}}
-<h3 class="wrap-header bold"> {{tt 'lbl.listOfPolicies'}} : {{assetModel.attributes.name}} </h3>
-<div class="wrap non-collapsible m-height ">
- <div>
- <div class="span9">
- <div class="visual_search"></div>
- </div>
- <div class="clearfix">
- <a href="#!/knox/{{assetId}}/policy/create" class="btn btn-primary btn-right" type="button"> {{tt 'lbl.addNewPolicy'}} </a>
- {{#if isSysAdmin}}
- {{#if version}}
- <a href="javascript:void(0);" data-js="export" class="btn btn-black btn-right">{{tt 'lbl.exports'}}</a>
- {{/if}}
- {{/if}}
- <div data-id="r_filter" class="wrap-filter pull-left"></div>
- </div>
-
- <div data-id="r_tableList" class="clickable">
- </div>
- </div>
-
- <!-- <div class="span3" style="margin-top:39px">
- <div id="policyDetail"></div>
- </div> -->
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/license/LicenseCreate_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/license/LicenseCreate_tmpl.html b/security-admin/src/main/webapp/templates/license/LicenseCreate_tmpl.html
deleted file mode 100644
index 029b024..0000000
--- a/security-admin/src/main/webapp/templates/license/LicenseCreate_tmpl.html
+++ /dev/null
@@ -1,47 +0,0 @@
-{{!--
- 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.
---}}
-<h4 class="wrap-header bold">License Detail</h4>
-<div class="wrap non-collapsible ">
- <!-- <div data-id="r_form"></div> -->
- <form class="form-horizontal">
- <div class="" data-fields="licenseKey">
- <div class="control-group field-licenseKey">
- <label class="control-label" for="licenseKey">Enter License
- Key *</label>
- <div class="controls">
- <span data-editor="">
- <textarea data-id="licenseKey" name="licenseKey" type="text" style=" width: 607px; height: 128px; "></textarea>
- </span>
- <div class="help-inline" data-error=""></div>
- <div class="help-block"></div>
- </div>
- </div>
- </form>
- </div>
- <div style="margin-left: 179px;">
- <button type="button" data-id="save" class="btn btn-primary">
- Save</button>
- <button type="button" data-id="cancel" class="btn btn-inverse">
- Cancel</button>
- </div>
- <br /> <br />
- <p>
- {{tt 'msg.invalidLicenseMsg'}}
- <a href="mailto:sales@xasecure.com">sales@xasecure.com</a>
- </p>
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/license/LicenseInfo_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/license/LicenseInfo_tmpl.html b/security-admin/src/main/webapp/templates/license/LicenseInfo_tmpl.html
deleted file mode 100644
index dd7e5ec..0000000
--- a/security-admin/src/main/webapp/templates/license/LicenseInfo_tmpl.html
+++ /dev/null
@@ -1,59 +0,0 @@
-{{!--
- 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.
---}}
-<h3 class="wrap-header bold">License Information:</h3>
-<div class="well well-small ">
- <!-- <label style="color: white;padding: 5px;font-weight: 700;background: -webkit-linear-gradient(#4C89D6, #b8892d);background: -o-linear-gradient(#f7ec13, #b8892d);background: linear-gradient(#94BBEB, #2D75B8);">Policy Information</label> -->
- <div class="datagrid-stretch-wrapper " style="margin-left: 44px;margin-top: 35px;">
- <table class="table table-bordered table-license">
- <tbody>
- <tr >
- <td>License Text</td>
- <td>
-
- <a href="javascript:void(0);" data-id="editLicenseKey" title="Update" class="pull-right link-tag"><i class="icon-pencil"></i></a>
- <p data-id="licenseKeyText">{{licenseKey}}</p>
- <div data-id="licenseUpdate" style="display:none;">
- <textarea data-id="licenseKeyTextarea" type="text" style="height: 75px;width: 670px;" >
- {{licenseKey}}
- </textarea>
- <button type="submit" data-id="update" class="btn " style="margin-left: -686px;margin-top: 128px;">Update</button>
- <button type="submit" data-id="cancel" class="btn btn-inverse" style="margin-top: 128px;">Cancel</button>
- </div>
- </td>
- </tr>
- <tr>
- <td >License Holder Email</td>
- <td data-id="email"> </td>
- </tr>
- <tr>
- <td>License Type: </td>
- <td data-id="type"> </td>
- </tr>
- <tr>
- <td>License Start Date: </td>
- <td data-id="startDate"> </td>
- </tr>
- <tr>
- <td>License End Date: </td>
- <td data-id="endDate"></td>
- </tr>
-
- </tbody>
- </table>
- </div>
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/permissions/ModulePermissionForm_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/permissions/ModulePermissionForm_tmpl.html b/security-admin/src/main/webapp/templates/permissions/ModulePermissionForm_tmpl.html
index badb615..1bf096b 100644
--- a/security-admin/src/main/webapp/templates/permissions/ModulePermissionForm_tmpl.html
+++ b/security-admin/src/main/webapp/templates/permissions/ModulePermissionForm_tmpl.html
@@ -21,9 +21,7 @@
<b class="policy-form">
<fieldset>
<div class="control-group field-database">
- <!-- <div class="controls"> -->
<div class="" data-fields="module"></div>
- <!-- </div> -->
</div>
</fieldset>
</b>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/policies/PermissionList.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/policies/PermissionList.html b/security-admin/src/main/webapp/templates/policies/PermissionList.html
index 070b908..3373230 100644
--- a/security-admin/src/main/webapp/templates/policies/PermissionList.html
+++ b/security-admin/src/main/webapp/templates/policies/PermissionList.html
@@ -35,7 +35,6 @@
<div class="control-group">
<div class="controls" style="margin-top:-14px">
<button type="button" class="btn btn-small" data-action="addGroup" title="Add">
- <!-- {{tt 'btn.add'}} -->
<i class="icon-plus"></i>
</button>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/AssetOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/AssetOperationDiff_tmpl.html b/security-admin/src/main/webapp/templates/reports/AssetOperationDiff_tmpl.html
index 7f0cef6..e6bd359 100644
--- a/security-admin/src/main/webapp/templates/reports/AssetOperationDiff_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/AssetOperationDiff_tmpl.html
@@ -47,7 +47,7 @@
</div>
</div>
-
+ {{#if isNewConnConfig}}
<h5>Connection Configurations :</h5>
<div class="diff">
<div class="diff-left">
@@ -71,7 +71,7 @@
</ol>
</div>
</div>
-
+ {{/if}}
{{else}}
<label class="no-margin label-size13-weightbold" > Deleted By : {{userName}}</label>
<h4>Service Details</h4>
@@ -104,7 +104,7 @@
</div>
-
+ {{#if isPreviousConnConfig}}
<h4>Connection Configurations :</h4>
<div class="diff">
<div class="diff-left">
@@ -128,6 +128,7 @@
</ol>
</div>
</div>
+ {{/if}}
{{/compare}}
</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/AuditLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/AuditLayout_tmpl.html b/security-admin/src/main/webapp/templates/reports/AuditLayout_tmpl.html
index 9de3007..48467aa 100644
--- a/security-admin/src/main/webapp/templates/reports/AuditLayout_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/AuditLayout_tmpl.html
@@ -14,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
--}}
-<!-- <h3 class="wrap-header bold"><i class="icon-shield"></i> {{tt 'lbl.auditReport'}} </h3> -->
<ul class="nav nav-tabs tabs clearfix">
<li data-js="agent" >
<a data-toggle="tab" href="#agent">{{tt 'h.agents'}}</a>
@@ -44,7 +43,6 @@
</button>
<span class="pull-right" data-id="lastUpdateTime"> Last Updated Time : <label data-id="lastUpdateTimeLabel" class="label label-info">{{currentDate}}</label> </span>
</div>
- <!-- <div data-id="r_auditTable" class="hdfs-table"></div> -->
<div data-id="r_tableLists" class=""></div>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/KnoxPolicyDeleteOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/KnoxPolicyDeleteOperationDiff_tmpl.html b/security-admin/src/main/webapp/templates/reports/KnoxPolicyDeleteOperationDiff_tmpl.html
index 55b0a9e..31cd974 100644
--- a/security-admin/src/main/webapp/templates/reports/KnoxPolicyDeleteOperationDiff_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/KnoxPolicyDeleteOperationDiff_tmpl.html
@@ -14,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
--}}
-<!-- <label class="no-margin label-size13-weightbold">Name : {{objectName}}</label> -->
<label class="no-margin label-size13-weightbold">Policy Name : {{policyName}}</label>
<label class="no-margin label-size13-weightbold">Repository Type : {{repositoryType}}</label>
<label class="no-margin label-size13-weightbold"> Date : {{objectCreatedDate}}</label>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/KnoxPolicyOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/KnoxPolicyOperationDiff_tmpl.html b/security-admin/src/main/webapp/templates/reports/KnoxPolicyOperationDiff_tmpl.html
index 30b6c60..3afe134 100644
--- a/security-admin/src/main/webapp/templates/reports/KnoxPolicyOperationDiff_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/KnoxPolicyOperationDiff_tmpl.html
@@ -15,7 +15,6 @@
limitations under the License.
--}}
<div class="diff-content">
- <!-- <label class="no-margin label-size13-weightbold">Name : {{objectName}}</label> -->
<label class="no-margin label-size13-weightbold">Policy Name : {{policyName}}</label>
<label class="no-margin label-size13-weightbold">Repository Type : {{repositoryType}}</label>
<label class="no-margin label-size13-weightbold"> Date : {{objectCreatedDate}}</label>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/KnoxPolicyUpdateOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/KnoxPolicyUpdateOperationDiff_tmpl.html b/security-admin/src/main/webapp/templates/reports/KnoxPolicyUpdateOperationDiff_tmpl.html
index 7e66fca..07758dd 100644
--- a/security-admin/src/main/webapp/templates/reports/KnoxPolicyUpdateOperationDiff_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/KnoxPolicyUpdateOperationDiff_tmpl.html
@@ -17,8 +17,6 @@
<div class="diff-content">
<div class="row-fluid">
<div class="span6">
- <!-- <label class="no-margin label-size13-weightbold">ID : {{objectId}}</label> -->
- <!-- <label class="no-margin label-size13-weightbold">Name : {{objectName}}</label> -->
<label class="no-margin label-size13-weightbold">Policy Name : {{policyName}}</label>
<label class="no-margin label-size13-weightbold">Repository Type : {{repositoryType}}</label>
<label class="no-margin label-size13-weightbold"> Date : {{objectCreatedDate}}</label>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/LoginSessionDetail_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/LoginSessionDetail_tmpl.html b/security-admin/src/main/webapp/templates/reports/LoginSessionDetail_tmpl.html
index 376967c..ddd6e3d 100644
--- a/security-admin/src/main/webapp/templates/reports/LoginSessionDetail_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/LoginSessionDetail_tmpl.html
@@ -16,7 +16,6 @@
--}}
<h3 class="wrap-header bold">Session Detail:</h3>
<div class="wrap non-collapsible">
- <!-- <label style="color: white;padding: 5px;font-weight: 700;background: -webkit-linear-gradient(#4C89D6, #b8892d);background: -o-linear-gradient(#f7ec13, #b8892d);background: linear-gradient(#94BBEB, #2D75B8);">Policy Information</label> -->
<div class="datagrid-stretch-wrapper "style="margin-left: 44px; margin-top: 35px;">
<table class="table table-bordered table-condensed">
<tbody>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDeleteDiff_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDeleteDiff_tmpl.html b/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDeleteDiff_tmpl.html
index 0d632a4..68ab403 100644
--- a/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDeleteDiff_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyDeleteDiff_tmpl.html
@@ -17,7 +17,6 @@
<div class="diff-content">
<b>Policy ID : </b><label class="label label-ranger"> {{objectId}}</label>
<label class="no-margin label-size13-weightbold">Policy Name : {{policyName}}</label>
- <!-- <label class="no-margin label-size13-weightbold">Repository Type : {{repositoryType}}</label> -->
<label class="no-margin label-size13-weightbold"> Deleted Date : {{objectCreatedDate}}</label>
<label class="no-margin label-size13-weightbold" > Deleted By : {{objectCreatedBy}}</label>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyUpdateDiff_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyUpdateDiff_tmpl.html b/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyUpdateDiff_tmpl.html
index f61e91f..727c998 100644
--- a/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyUpdateDiff_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/PlugableServicePolicyUpdateDiff_tmpl.html
@@ -56,7 +56,6 @@
<h3>New Value</h3>
<ol class="unstyled data">
{{#each collection}}
- <!-- <li class="change-row">{{./this.attributes.newValue}}</li> -->
{{#compare ./this.attributes.newValue "eq" ''}}
<li>--</li>
{{else}}
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/PolicyDeleteOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/PolicyDeleteOperationDiff_tmpl.html b/security-admin/src/main/webapp/templates/reports/PolicyDeleteOperationDiff_tmpl.html
index 7bed784..1449b04 100644
--- a/security-admin/src/main/webapp/templates/reports/PolicyDeleteOperationDiff_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/PolicyDeleteOperationDiff_tmpl.html
@@ -14,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
--}}
-<!-- <label class="no-margin label-size13-weightbold">Name : {{objectName}}</label> -->
<label class="no-margin label-size13-weightbold">Policy Name : {{policyName}}</label>
<label class="no-margin label-size13-weightbold">Repository Type : {{repositoryType}}</label>
<label class="no-margin label-size13-weightbold"> Date : {{objectCreatedDate}}</label>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/PolicyOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/PolicyOperationDiff_tmpl.html b/security-admin/src/main/webapp/templates/reports/PolicyOperationDiff_tmpl.html
index 05d9c77..54248f0 100644
--- a/security-admin/src/main/webapp/templates/reports/PolicyOperationDiff_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/PolicyOperationDiff_tmpl.html
@@ -15,7 +15,6 @@
limitations under the License.
--}}
<div class="diff-content">
- <!-- <label class="no-margin label-size13-weightbold">Name : {{objectName}}</label> -->
<label class="no-margin label-size13-weightbold">Policy Name : {{policyName}}</label>
<label class="no-margin label-size13-weightbold">Repository Type : {{repositoryType}}</label>
<label class="no-margin label-size13-weightbold"> Date : {{objectCreatedDate}}</label>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/PolicyUpdateOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/PolicyUpdateOperationDiff_tmpl.html b/security-admin/src/main/webapp/templates/reports/PolicyUpdateOperationDiff_tmpl.html
index 45c3c59..38de921 100644
--- a/security-admin/src/main/webapp/templates/reports/PolicyUpdateOperationDiff_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/PolicyUpdateOperationDiff_tmpl.html
@@ -17,7 +17,6 @@
<div class="diff-content">
<div class="row-fluid">
<div class="span6">
- <!-- <label class="no-margin label-size13-weightbold">Name : {{objectName}}</label> -->
<label class="no-margin label-size13-weightbold">Policy Name : {{policyName}}</label>
<label class="no-margin label-size13-weightbold">Repository Type : {{repositoryType}}</label>
<label class="no-margin label-size13-weightbold"> Date : {{objectCreatedDate}}</label>
@@ -107,7 +106,6 @@
{{#eachProperty newGroupPermList}}
<li class="change-row">
{{#each value}}
- <!-- {{permType}}, -->
{{{highlightPermissionsForGroup ./this ../property ../../previousGroupPermList 'new'}}}
<span>,</span>
{{/each}}
@@ -151,7 +149,6 @@
{{#eachProperty newUserPermList}}
<li class="change-row">
{{#each value}}
- <!-- {{permType}}, -->
{{{highlightPermissionsForUser ./this ../property ../../previousUserPermList 'new'}}}
<span>,</span>
{{/each}}
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/UserAccessLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/UserAccessLayout_tmpl.html b/security-admin/src/main/webapp/templates/reports/UserAccessLayout_tmpl.html
index e12ce7f..1352882 100644
--- a/security-admin/src/main/webapp/templates/reports/UserAccessLayout_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/UserAccessLayout_tmpl.html
@@ -28,7 +28,7 @@
<div class="control-group">
<label class="control-label">Policy Name</label>
<div class="controls">
- <input type="text" name="policyName" data-js="policyName" class="input-xxlarge">
+ <input type="text" name="policyName" data-js="policyName" class="input-xxlarge" autofocus="true">
</div>
</div>
<div class="control-group">
@@ -82,27 +82,6 @@
</div>
</div>
-<!-- <div class="clearfix">
- <span class="pull-right">GOTO :
- <a href="javascript:;" class="link-tag gotoLink" data-js="gotoHive" style="margin-right: 5px;">
- <i class=" icon-chevron-down" ></i>
- Hive Table
- </a>
- <a href="javascript:;" class="link-tag gotoLink" data-js="gotoHbase">
- <i class=" icon-chevron-down" ></i>
- Hbase Table
- </a>
- <a href="javascript:;" class="link-tag gotoLink" data-js="gotoKnox">
- <i class=" icon-chevron-down" ></i>
- Knox Table
- </a>
- <a href="javascript:;" class="link-tag gotoLink" data-js="gotoStorm">
- <i class=" icon-chevron-down" ></i>
- Storm Table
- </a>
- </span>
- </div> -->
-
<div class="row-fluid">
{{#each policyHeaderList}}
<h3 class="wrap-header bold reportSearchHeader" data-js="hdfsHeader"> {{capitaliseLetter this.serviceDefName}}
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/reports/UserUpdateOperationDiff_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/reports/UserUpdateOperationDiff_tmpl.html b/security-admin/src/main/webapp/templates/reports/UserUpdateOperationDiff_tmpl.html
index 2bce108..0123f0c 100644
--- a/security-admin/src/main/webapp/templates/reports/UserUpdateOperationDiff_tmpl.html
+++ b/security-admin/src/main/webapp/templates/reports/UserUpdateOperationDiff_tmpl.html
@@ -90,7 +90,6 @@
<ol class="unstyled data">
<li class="change-row">
{{#each previousGroupList}}
- <!-- {{this}} -->
{{{highlightUsersForArr ./this ../newGroupList 'old'}}}
<span>,</span>
{{/each}}
@@ -102,7 +101,6 @@
<ol class="unstyled data">
<li class="change-row">
{{#each newGroupList}}
- <!-- {{this}} -->
{{{highlightUsersForArr ./this ../previousGroupList 'new'}}}
<span>,</span>
{{/each}}
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/service/ConfigurationList_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/service/ConfigurationList_tmpl.html b/security-admin/src/main/webapp/templates/service/ConfigurationList_tmpl.html
index dbc0d65..3e59836 100644
--- a/security-admin/src/main/webapp/templates/service/ConfigurationList_tmpl.html
+++ b/security-admin/src/main/webapp/templates/service/ConfigurationList_tmpl.html
@@ -34,8 +34,5 @@
<button type="button" class="btn btn-small" data-action="addGroup" title="Add">
<i class="icon-plus"></i>
</button>
- <!-- <button type="button" class="btn btn-small" data-action="addGroup" title="Add">
- Add New Configuration
- </button> -->
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/service/ServiceCreate_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/service/ServiceCreate_tmpl.html b/security-admin/src/main/webapp/templates/service/ServiceCreate_tmpl.html
index 587a7c6..d79028e 100644
--- a/security-admin/src/main/webapp/templates/service/ServiceCreate_tmpl.html
+++ b/security-admin/src/main/webapp/templates/service/ServiceCreate_tmpl.html
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
--}}
-{{#if editAsset}}
+{{#if editService}}
<h4 class="wrap-header bold"> Edit Service </h4>
{{else}}
<h4 class="wrap-header bold"> Create Service </h4>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/storm/StormPolicyCreate_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/storm/StormPolicyCreate_tmpl.html b/security-admin/src/main/webapp/templates/storm/StormPolicyCreate_tmpl.html
deleted file mode 100644
index 69e97d3..0000000
--- a/security-admin/src/main/webapp/templates/storm/StormPolicyCreate_tmpl.html
+++ /dev/null
@@ -1,49 +0,0 @@
-{{!--
- 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.
---}}
-{{#if editPolicy}}
- <h4> {{tt 'h.editPolicy'}}</h4>
-{{else}}
- <h4> {{tt 'h.createPolicy'}} </h4>
-{{/if}}
-<div class="wrap non-collapsible ">
-<div class="alert alert-danger" data-id="policyDisabledAlert" style="display:none;">
- <button type="button" class="close" data-dismiss="alert">×</button>
- <strong>Warning !</strong> {{tt 'msg.policyDisabledMsg'}}
-</div>
- <div data-id="r_form"></div>
- <div class="form-actions form-policy" class="row-fluid">
- {{#if editPolicy}}
- <button type="submit" data-id="save" class="btn btn-primary btn-spinner">
- <span>Save</span>
- <i class="icon-spinner icon-spin"></i>
- </button>
- {{else}}
- <button type="submit" data-id="save" class="btn btn-primary btn-spinner">
- <span>Add</span>
- <i class="icon-spinner icon-spin"></i>
- </button>
-
- {{/if}}
- <button type="button" data-id="cancel" class="btn btn-inverse">
- Cancel
- </button>
- {{#if editPolicy}}
- <button type="button" data-id="delete" class="btn btn-danger" ><!-- style="margin-left: 27%;" -->Delete</button>
- {{/if}}
- </div>
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/storm/StormPolicyForm_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/storm/StormPolicyForm_tmpl.html b/security-admin/src/main/webapp/templates/storm/StormPolicyForm_tmpl.html
deleted file mode 100644
index 4b70327..0000000
--- a/security-admin/src/main/webapp/templates/storm/StormPolicyForm_tmpl.html
+++ /dev/null
@@ -1,55 +0,0 @@
-{{!--
- 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.
---}}
-<form class="form-horizontal">
- <fieldset>
- <p class="formHeader">
- <span>Policy Details :</span>
- </p>
- <div class="" data-fields="policyName" style="float:left"></div>
- <div class="" data-editors="resourceStatus" style="float:left"></div>
- <div class="clearfix"></div>
- <div class="" data-fields="topologies"></div>
- <!-- <div class="" data-fields="services"></div> -->
-
- <!-- <div class="" data-fields="views" style="display:none"></div> -->
- <!-- <div class="" data-editors="udfs" style="display:none;margin-left: 180px;margin-top: -29px;margin-bottom: 15px;"></div> -->
- <div class="" data-fields="_vAuditListToggle"></div>
- </fieldset>
- <fieldset>
- <p class="formHeader">
- User and Group Permissions :
- </p>
- <div class="" data-customfields="groupPerms">
- <div class="control-group">
- <label class="control-label">{{tt 'lbl.groupPermissions'}}</label>
- <div class="controls">
- <img src="images/loading.gif" style=" margin-left: 4%; margin-top: 1%;" />
- </div>
- </div>
- </div>
- <div class="" data-customfields="userPerms">
- <div class="control-group">
- <label class="control-label">{{tt 'lbl.userPermissions'}}</label>
- <div class="controls">
- <img src="images/loading.gif" style=" margin-left: 4%; margin-top: 1%;" />
- </div>
- </div>
- </div>
- <div class="" data-fields="description"></div>
- </fieldset>
-</form>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/storm/StormTableLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/storm/StormTableLayout_tmpl.html b/security-admin/src/main/webapp/templates/storm/StormTableLayout_tmpl.html
deleted file mode 100644
index 9e6495d..0000000
--- a/security-admin/src/main/webapp/templates/storm/StormTableLayout_tmpl.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{{!--
- 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.
---}}
-<h3 class="wrap-header bold"> {{tt 'lbl.listOfPolicies'}} : {{assetModel.attributes.name}} </h3>
-<div class="wrap non-collapsible m-height ">
- <div>
- <div class="span9">
- <div class="visual_search"></div>
- </div>
- <div class="clearfix">
- <a href="#!/storm/{{assetId}}/policy/create" class="btn btn-primary btn-right" type="button"> {{tt 'lbl.addNewPolicy'}} </a>
- {{#if isSysAdmin}}
- {{#if version}}
- <a href="javascript:void(0);" data-js="export" class="btn btn-black btn-right">{{tt 'lbl.exports'}}</a>
- {{/if}}
- {{/if}}
- <div data-id="r_filter" class="wrap-filter pull-left"></div>
- </div>
-
- <div data-id="r_tableList" class="clickable">
- </div>
- </div>
-
- <!-- <div class="span3" style="margin-top:39px">
- <div id="policyDetail"></div>
- </div> -->
-</div>
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/templates/user/UserProfileForm_tmpl.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/templates/user/UserProfileForm_tmpl.html b/security-admin/src/main/webapp/templates/user/UserProfileForm_tmpl.html
index 8ed5ac6..6dfa39b 100644
--- a/security-admin/src/main/webapp/templates/user/UserProfileForm_tmpl.html
+++ b/security-admin/src/main/webapp/templates/user/UserProfileForm_tmpl.html
@@ -15,10 +15,6 @@
limitations under the License.
--}}
<form class="form-horizontal">
- <!-- <fieldset> -->
- <!-- <legend>
- User Profile
- </legend> -->
<div class="" data-fields="firstName"></div>
<div class="" data-fields="lastName"></div>
<div class="" data-fields="emailAddress"></div>
@@ -26,14 +22,6 @@
<div class="" data-fields="oldPassword"></div>
<div class="" data-fields="newPassword"></div>
<div class="" data-fields="reEnterPassword"></div>
- <!-- </fieldset> -->
- <!-- <fieldset>
- <legend>
- User and Group Permissions
- </legend>
- <div class="" data-customfields="groupPerms"></div>
- <div class="" data-customfields="userPerms"></div>
- </fieldset> -->
</form>
[5/5] incubator-ranger git commit: RANGER-799 : Ranger UI fixes -
partial search not working on Policy listing page
Posted by ga...@apache.org.
RANGER-799 : Ranger UI fixes - partial search not working on Policy listing page
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/082d0f28
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/082d0f28
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/082d0f28
Branch: refs/heads/ranger-0.5
Commit: 082d0f282885eee9fa3c2f13f1e763e77d425f2e
Parents: 4b6b641
Author: Gautam Borad <ga...@apache.org>
Authored: Fri Feb 12 15:55:30 2016 +0530
Committer: Gautam Borad <ga...@apache.org>
Committed: Mon Feb 22 11:05:10 2016 +0530
----------------------------------------------------------------------
.../org/apache/ranger/util/RangerRestUtil.java | 14 -
security-admin/src/main/webapp/ajax_failure.jsp | 31 --
.../src/main/webapp/ajax_success.html | 26 --
.../src/main/webapp/images/data-grey.png | Bin 1468 -> 0 bytes
.../main/webapp/images/database_table_32.png | Bin 1329 -> 0 bytes
.../src/main/webapp/images/folder.png | Bin 920 -> 0 bytes
.../src/main/webapp/images/folder2.png | Bin 946 -> 0 bytes
security-admin/src/main/webapp/images/hbase.jpg | Bin 4575 -> 0 bytes
security-admin/src/main/webapp/images/hdfs.jpg | Bin 5232 -> 0 bytes
security-admin/src/main/webapp/images/hive.png | Bin 20483 -> 0 bytes
security-admin/src/main/webapp/images/hline.png | Bin 99 -> 0 bytes
security-admin/src/main/webapp/images/knox.gif | Bin 2347 -> 0 bytes
security-admin/src/main/webapp/images/knox1.png | Bin 34126 -> 0 bytes
.../src/main/webapp/images/router-grey.png | Bin 1533 -> 0 bytes
security-admin/src/main/webapp/images/storm.png | Bin 6174 -> 0 bytes
.../src/main/webapp/images/storm1.png | Bin 19620 -> 0 bytes
.../src/main/webapp/images/task-grey.png | Bin 1187 -> 0 bytes
security-admin/src/main/webapp/index.html | 5 -
security-admin/src/main/webapp/login.jsp | 17 -
.../collection_bases/VXAuditRecordListBase.js | 60 ---
.../scripts/collections/VXAuditRecordList.js | 36 --
.../webapp/scripts/controllers/Controller.js | 38 +-
.../src/main/webapp/scripts/mgrs/SessionMgr.js | 3 +-
.../scripts/model_bases/VXAuditRecordBase.js | 106 -----
.../main/webapp/scripts/models/VXAuditRecord.js | 80 ----
.../src/main/webapp/scripts/models/VXGroup.js | 13 +-
.../main/webapp/scripts/models/VXPortalUser.js | 4 +-
.../src/main/webapp/scripts/modules/XALinks.js | 8 +-
.../scripts/modules/globalize/message/en.js | 11 +-
.../src/main/webapp/scripts/utils/XAUtils.js | 5 +-
.../scripts/views/accounts/AccountCreate.js | 133 ------
.../views/accounts/AccountDetailLayout.js | 90 ----
.../scripts/views/accounts/AccountForm.js | 86 ----
.../views/accounts/AccountTableLayout.js | 194 ---------
.../webapp/scripts/views/common/AddGroup.js | 80 ++--
.../webapp/scripts/views/common/BreadCrumbs.js | 2 +-
.../scripts/views/common/FormInputItemList.js | 426 -------------------
.../main/webapp/scripts/views/common/TopNav.js | 2 +-
.../scripts/views/common/UserPermissionList.js | 124 ++----
.../webapp/scripts/views/common/XABackgrid.js | 20 +-
.../scripts/views/common/XATableLayout.js | 10 +-
.../webapp/scripts/views/folders/FolderInfo.js | 173 --------
.../webapp/scripts/views/kms/KMSTableLayout.js | 44 +-
.../webapp/scripts/views/kms/KmsKeyCreate.js | 13 +-
.../views/permissions/ModulePermissionCreate.js | 93 ++--
.../views/permissions/ModulePermissionForm.js | 51 ++-
.../views/permissions/ModulePermsTableLayout.js | 50 +--
.../scripts/views/policies/PermissionList.js | 15 +-
.../views/policies/RangerPolicyTableLayout.js | 11 +-
.../views/policymanager/ServiceLayout.js | 7 +-
.../webapp/scripts/views/reports/AuditLayout.js | 244 +++++------
.../scripts/views/reports/LoginSessionDetail.js | 3 -
.../views/reports/OperationDiffDetail.js | 67 +--
.../views/reports/PlugableServiceDiffDetail.js | 4 -
.../scripts/views/reports/UserAccessLayout.js | 43 +-
.../scripts/views/service/ConfigurationList.js | 8 +-
.../scripts/views/service/ServiceCreate.js | 23 +-
.../webapp/scripts/views/service/ServiceForm.js | 26 +-
.../scripts/views/service/ServiceTableLayout.js | 164 -------
.../webapp/scripts/views/user/UserProfile.js | 24 +-
.../scripts/views/user/UserProfileForm.js | 21 +-
.../webapp/scripts/views/users/GroupCreate.js | 20 +-
.../webapp/scripts/views/users/UserCreate.js | 38 +-
.../main/webapp/scripts/views/users/UserForm.js | 23 +-
.../scripts/views/users/UserTableLayout.js | 24 +-
.../templates/accounts/AccountCreate_tmpl.html | 28 --
.../accounts/AccountDetailLayout_tmpl.html | 88 ----
.../templates/accounts/AccountForm_tmpl.html | 23 -
.../accounts/AccountTableLayout_tmpl.html | 31 --
.../templates/asset/AssetCreate_tmpl.html | 36 --
.../webapp/templates/asset/AssetForm_tmpl.html | 69 ---
.../templates/asset/AssetTableLayout_tmpl.html | 29 --
.../webapp/templates/common/Footer_tmpl.html | 14 -
.../common/PolicyManagerLayout_tmpl.html | 274 ------------
.../templates/common/ProfileBar_tmpl.html | 37 --
.../webapp/templates/common/TopNav_tmpl.html | 1 -
.../templates/common/UserPermissionList.html | 1 -
.../webapp/templates/common/breadcrumbs.html | 16 -
.../webapp/templates/common/formInputItem.html | 54 ---
.../templates/common/formInputItemList.html | 42 --
.../templates/folders/FolderInfo_tmpl.html | 134 ------
.../templates/hbase/HbasePolicyCreate_tmpl.html | 48 ---
.../templates/hbase/HbasePolicyForm_tmpl.html | 56 ---
.../templates/hbase/HbaseTableLayout_tmpl.html | 41 --
.../templates/hdfs/HDFSTableLayout_tmpl.html | 41 --
.../templates/hdfs/PolicyCreate_tmpl.html | 48 ---
.../webapp/templates/hdfs/PolicyForm_tmpl.html | 61 ---
.../main/webapp/templates/helpers/XAHelpers.js | 58 ++-
.../templates/hive/HivePolicyCreate_tmpl.html | 49 ---
.../templates/hive/HivePolicyForm_tmpl.html | 67 ---
.../templates/hive/HiveTableLayout_tmpl.html | 41 --
.../webapp/templates/kms/KmsKeyCreate_tmpl.html | 1 -
.../templates/kms/KmsTableLayout_tmpl.html | 9 -
.../webapp/templates/knox/KnoxInfo_tmpl.html | 106 -----
.../templates/knox/KnoxPolicyCreate_tmpl.html | 49 ---
.../templates/knox/KnoxPolicyForm_tmpl.html | 55 ---
.../templates/knox/KnoxTableLayout_tmpl.html | 41 --
.../templates/license/LicenseCreate_tmpl.html | 47 --
.../templates/license/LicenseInfo_tmpl.html | 59 ---
.../permissions/ModulePermissionForm_tmpl.html | 2 -
.../templates/policies/PermissionList.html | 1 -
.../reports/AssetOperationDiff_tmpl.html | 7 +-
.../templates/reports/AuditLayout_tmpl.html | 2 -
.../KnoxPolicyDeleteOperationDiff_tmpl.html | 1 -
.../reports/KnoxPolicyOperationDiff_tmpl.html | 1 -
.../KnoxPolicyUpdateOperationDiff_tmpl.html | 2 -
.../reports/LoginSessionDetail_tmpl.html | 1 -
.../PlugableServicePolicyDeleteDiff_tmpl.html | 1 -
.../PlugableServicePolicyUpdateDiff_tmpl.html | 1 -
.../reports/PolicyDeleteOperationDiff_tmpl.html | 1 -
.../reports/PolicyOperationDiff_tmpl.html | 1 -
.../reports/PolicyUpdateOperationDiff_tmpl.html | 3 -
.../reports/UserAccessLayout_tmpl.html | 23 +-
.../reports/UserUpdateOperationDiff_tmpl.html | 2 -
.../service/ConfigurationList_tmpl.html | 3 -
.../templates/service/ServiceCreate_tmpl.html | 2 +-
.../templates/storm/StormPolicyCreate_tmpl.html | 49 ---
.../templates/storm/StormPolicyForm_tmpl.html | 55 ---
.../templates/storm/StormTableLayout_tmpl.html | 41 --
.../templates/user/UserProfileForm_tmpl.html | 12 -
.../main/webapp/themejs/1.3.0/bootstrap.min.js | 1 -
121 files changed, 508 insertions(+), 4271 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/java/org/apache/ranger/util/RangerRestUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/util/RangerRestUtil.java b/security-admin/src/main/java/org/apache/ranger/util/RangerRestUtil.java
index eb34b42..6672c5a 100644
--- a/security-admin/src/main/java/org/apache/ranger/util/RangerRestUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/util/RangerRestUtil.java
@@ -101,26 +101,12 @@ public class RangerRestUtil {
userProfile.getFirstName(), gjUser.getFirstName(),
StringUtil.VALIDATION_NAME, "Invalid first name",
MessageEnums.INVALID_INPUT_DATA, null, "firstName"));
-
- userProfile.setLastName(restErrorUtil.validateStringForUpdate(
- userProfile.getLastName(), gjUser.getLastName(),
- StringUtil.VALIDATION_NAME, "Invalid last name",
- MessageEnums.INVALID_INPUT_DATA, null, "lastName"));
-
// firstName
if (!stringUtil.isValidName(userProfile.getFirstName())) {
logger.info("Invalid first name." + userProfile);
messageList.add(MessageEnums.INVALID_INPUT_DATA.getMessage(null,
"firstName"));
}
-
- // lastName
- if (!stringUtil.isValidName(userProfile.getLastName())) {
- logger.info("Invalid last name." + userProfile);
- messageList.add(MessageEnums.INVALID_INPUT_DATA.getMessage(null,
- "lastName"));
- }
-
// create the public screen name
userProfile.setPublicScreenName(userProfile.getFirstName() + " "
+ userProfile.getLastName());
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/ajax_failure.jsp
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/ajax_failure.jsp b/security-admin/src/main/webapp/ajax_failure.jsp
deleted file mode 100644
index b48064c..0000000
--- a/security-admin/src/main/webapp/ajax_failure.jsp
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
- 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.
--->
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<%
- int ajaxReturnCode = 401;
- //PropertiesUtil.getIntProperty("ranger.ajax.auth.required.code", 401);
- response.sendError(ajaxReturnCode);
-%>
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Insert title here</title>
-</head>
-<body>
-Failure
-</body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/ajax_success.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/ajax_success.html b/security-admin/src/main/webapp/ajax_success.html
deleted file mode 100644
index 52023ca..0000000
--- a/security-admin/src/main/webapp/ajax_success.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
- 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.
--->
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Insert title here</title>
-</head>
-<body>
-Success
-</body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/data-grey.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/data-grey.png b/security-admin/src/main/webapp/images/data-grey.png
deleted file mode 100644
index dabec13..0000000
Binary files a/security-admin/src/main/webapp/images/data-grey.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/database_table_32.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/database_table_32.png b/security-admin/src/main/webapp/images/database_table_32.png
deleted file mode 100644
index 14bb068..0000000
Binary files a/security-admin/src/main/webapp/images/database_table_32.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/folder.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/folder.png b/security-admin/src/main/webapp/images/folder.png
deleted file mode 100644
index 0613c6b..0000000
Binary files a/security-admin/src/main/webapp/images/folder.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/folder2.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/folder2.png b/security-admin/src/main/webapp/images/folder2.png
deleted file mode 100644
index 85da97f..0000000
Binary files a/security-admin/src/main/webapp/images/folder2.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/hbase.jpg
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/hbase.jpg b/security-admin/src/main/webapp/images/hbase.jpg
deleted file mode 100644
index 27c177a..0000000
Binary files a/security-admin/src/main/webapp/images/hbase.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/hdfs.jpg
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/hdfs.jpg b/security-admin/src/main/webapp/images/hdfs.jpg
deleted file mode 100644
index 2f6dad2..0000000
Binary files a/security-admin/src/main/webapp/images/hdfs.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/hive.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/hive.png b/security-admin/src/main/webapp/images/hive.png
deleted file mode 100644
index b7939b1..0000000
Binary files a/security-admin/src/main/webapp/images/hive.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/hline.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/hline.png b/security-admin/src/main/webapp/images/hline.png
deleted file mode 100644
index b488b95..0000000
Binary files a/security-admin/src/main/webapp/images/hline.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/knox.gif
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/knox.gif b/security-admin/src/main/webapp/images/knox.gif
deleted file mode 100644
index 3edc8fd..0000000
Binary files a/security-admin/src/main/webapp/images/knox.gif and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/knox1.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/knox1.png b/security-admin/src/main/webapp/images/knox1.png
deleted file mode 100644
index 56265c7..0000000
Binary files a/security-admin/src/main/webapp/images/knox1.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/router-grey.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/router-grey.png b/security-admin/src/main/webapp/images/router-grey.png
deleted file mode 100644
index 5424139..0000000
Binary files a/security-admin/src/main/webapp/images/router-grey.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/storm.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/storm.png b/security-admin/src/main/webapp/images/storm.png
deleted file mode 100644
index 510cc92..0000000
Binary files a/security-admin/src/main/webapp/images/storm.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/storm1.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/storm1.png b/security-admin/src/main/webapp/images/storm1.png
deleted file mode 100644
index a5b36c7..0000000
Binary files a/security-admin/src/main/webapp/images/storm1.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/images/task-grey.png
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/images/task-grey.png b/security-admin/src/main/webapp/images/task-grey.png
deleted file mode 100644
index 6c76084..0000000
Binary files a/security-admin/src/main/webapp/images/task-grey.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/index.html b/security-admin/src/main/webapp/index.html
index f1d0b75..31833b6 100644
--- a/security-admin/src/main/webapp/index.html
+++ b/security-admin/src/main/webapp/index.html
@@ -75,12 +75,7 @@
</section>
<div class='notifications top-right ranger-notifications'></div>
<section id="r_content" class="row-fluid" style="min-height: 450px;">
-
-
- <!-- <img src="images/loading-blue.gif" style="margin-left: 43%;margin-top: 1%;width:4%;" /> -->
-
<div class="loading-img">
-
<div id="center">
<div class="letter_container_1">
<span>L</span>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/login.jsp
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/login.jsp b/security-admin/src/main/webapp/login.jsp
index 0db6882..39fb327 100644
--- a/security-admin/src/main/webapp/login.jsp
+++ b/security-admin/src/main/webapp/login.jsp
@@ -38,11 +38,6 @@
<script type="text/javascript">
$(document).ready(function() {
- /* $('#signin-container').submit(function() {
- document.location = 'dashboard.html';
- return false;
- }); */
-
var updateBoxPosition = function() {
$('#signin-container').css({
'margin-top' : ($(window).height() - $('#signin-container').height()) / 2
@@ -80,22 +75,10 @@
</span>
<button type="submit" class="btn btn-primary btn-block" id="signIn" tabindex="4" >
Sign In
- <!--<img id="signInLoading" src="images/loading.gif" style="visibility: hidden;" /> -->
<i id="signInLoading" class="icon-spinner icon-spin pull-right icon-sign-in"></i>
</button>
</fieldset>
</form>
- <!-- <div class="social">
- <p>
- ...or sign in with
- </p>
-
- <a href="javascript:void(0);" title="" tabindex="5" class="twitter"> <i class="icon-twitter"></i> </a>
-
- <a href="javascript:void(0);" title="" tabindex="6" class="facebook"> <i class="icon-facebook"></i> </a>
-
- <a href="javascript:void(0);" title="" tabindex="7" class="google"> <i class="icon-google-plus"></i> </a>
- </div> -->
</section>
</body>
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/collection_bases/VXAuditRecordListBase.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/collection_bases/VXAuditRecordListBase.js b/security-admin/src/main/webapp/scripts/collection_bases/VXAuditRecordListBase.js
deleted file mode 100644
index 1cd1fb1..0000000
--- a/security-admin/src/main/webapp/scripts/collection_bases/VXAuditRecordListBase.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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(function(require){
- 'use strict';
-
- var XABaseCollection = require('collections/XABaseCollection');
- var XAGlobals = require('utils/XAGlobals');
- var VXAuditRecord = require('models/VXAuditRecord');
-
- var VXAuditRecordListBase = XABaseCollection.extend(
- /** @lends VXAuditRecordListBase.prototype */
- {
- url: XAGlobals.baseURL + 'assets/audit/report',
-
- model : VXAuditRecord,
-
- /**
- * VXAuditRecordListBase initialize method
- * @augments XABaseCollection
- * @constructs
- */
- initialize : function() {
- this.modelName = 'VXAuditRecord';
- this.modelAttrName = 'vXAuditRecords';
- this.bindErrorEvents();
- }
- },{
- // static class members
- /**
- * Table Cols to be passed to Backgrid
- * UI has to use this as base and extend this.
- *
- */
-
- tableCols : {}
-
- });
-
- return VXAuditRecordListBase;
-});
-
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/collections/VXAuditRecordList.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/collections/VXAuditRecordList.js b/security-admin/src/main/webapp/scripts/collections/VXAuditRecordList.js
deleted file mode 100644
index 09c434a..0000000
--- a/security-admin/src/main/webapp/scripts/collections/VXAuditRecordList.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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(function(require){
- 'use strict';
-
- var VXAuditRecordListBase = require('collection_bases/VXAuditRecordListBase');
-
- var VXAuditRecordList = VXAuditRecordListBase.extend(
- /** @lends VXAuditRecordList.prototype */
- {
- },{
- // static class members
- });
-
- return VXAuditRecordList;
-});
-
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/controllers/Controller.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/controllers/Controller.js b/security-admin/src/main/webapp/scripts/controllers/Controller.js
index edbc5b9..351dcdf 100755
--- a/security-admin/src/main/webapp/scripts/controllers/Controller.js
+++ b/security-admin/src/main/webapp/scripts/controllers/Controller.js
@@ -62,12 +62,7 @@ define(function(require) {
var RangerPolicyList = require('collections/RangerPolicyList');
var VXGroupList = require('collections/VXGroupList');
var VXUserList = require('collections/VXUserList');
- var policyList = new RangerPolicyList([],{
- queryParams : {
- //'resourceType' : XAEnums.AssetType.ASSET_HDFS.value,
- //'assetId' : assetId
- }
- });
+ var policyList = new RangerPolicyList();
var that = this;
this.groupList = new VXGroupList();
this.userList = new VXUserList();
@@ -283,18 +278,12 @@ define(function(require) {
var RangerPolicyList = require('collections/RangerPolicyList');
var rangerService = new RangerService({id : serviceId});
- var rangerPolicyList = new RangerPolicyList();
- rangerPolicyList.url = XAUtil.getServicePoliciesURL(serviceId);
-
rangerService.fetch({
cache : false,
async : false
});
- rangerPolicyList.fetch({
- cache : false,
- });
App.rContent.show(new view({
- collection : rangerPolicyList,
+ collection : new RangerPolicyList(),
rangerService : rangerService
}));
},
@@ -345,13 +334,8 @@ define(function(require) {
var ModulePermissionList = require('collections/VXModuleDefList');
var modulePermission = new ModulePermission();
- var modulePermissionList = new ModulePermissionList();
-
- modulePermissionList.fetch({
- cache : false,
- });
App.rContent.show(new view({
- collection : modulePermissionList
+ collection : new ModulePermissionList()
}));
},
@@ -402,22 +386,6 @@ define(function(require) {
kmsServiceName : kmsServiceName
}));
},
-// kmsKeyEditAction : function(kmsServiceName, keyName){
-// MAppState.set({ 'currentTab' : XAGlobals.AppTabs.KMS.value });
-// var view = require('views/kms/KmsKeyCreate');
-// var VXKmsKey = require('models/VXKmsKey');
-// var kmsKeyModel = new VXKmsKey({'name' : keyName});
-// var data = {'provider': kmsServiceName}
-// kmsKeyModel.fetch({
-// cache : true,
-// data : data
-// }).done(function(){
-// App.rContent.show(new view({
-// model : kmsKeyModel,
-// kmsServiceName : kmsServiceName
-// }));
-// });
-// },
/**************** ERROR PAGE ******************************/
pageNotFoundAction : function() {
var XAUtils = require('utils/XAUtils');
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/mgrs/SessionMgr.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/mgrs/SessionMgr.js b/security-admin/src/main/webapp/scripts/mgrs/SessionMgr.js
index 6449c50..e7a3856 100644
--- a/security-admin/src/main/webapp/scripts/mgrs/SessionMgr.js
+++ b/security-admin/src/main/webapp/scripts/mgrs/SessionMgr.js
@@ -132,8 +132,7 @@ define(function(require){
return this.userInRole('ROLE_KEY_ADMIN') ? true : false;
};
SessionMgr.isUser = function(){
- var roles = this.getRoleInUserSchool();
- return $.inArray('ROLE_USER',roles) != -1 ? true : false ;
+ return this.userInRole('ROLE_USER') ? true : false;
};
return SessionMgr;
});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/model_bases/VXAuditRecordBase.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/model_bases/VXAuditRecordBase.js b/security-admin/src/main/webapp/scripts/model_bases/VXAuditRecordBase.js
deleted file mode 100644
index fb1e8fb..0000000
--- a/security-admin/src/main/webapp/scripts/model_bases/VXAuditRecordBase.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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(function(require){
- 'use strict';
-
- var XABaseModel = require('models/XABaseModel');
- var XAGlobals = require('utils/XAGlobals');
-
- var VXAuditRecordBase = XABaseModel.extend(
- /** @lends VXAuditRecordBase.prototype */
- {
- urlRoot: XAGlobals.baseURL + 'assets/audit/report',
-
- defaults: {},
-
- serverSchema : {
- "id" : {
- "dataType" : "Long"
- },
- "version" : {
- "dataType" : "int"
- },
- "createDate" : {
- "dataType" : "Date"
- },
- "updateDate" : {
- "dataType" : "Date"
- },
- "permList" : {
- "dataType" : "list",
- "listType" : "VNameValue"
- },
- "forUserId" : {
- "dataType" : "Long"
- },
- "status" : {
- "dataType" : "int"
- },
- "priGrpId" : {
- "dataType" : "Long"
- },
- "updatedBy" : {
- "dataType" : "String"
- },
- "isSystem" : {
- "dataType" : "boolean"
- },
- "date" : {
- "dataType" : "Date"
- },
- "resource" : {
- "dataType" : "String"
- },
- "action" : {
- "dataType" : "String"
- },
- "result" : {
- "dataType" : "String"
- },
- "user" : {
- "dataType" : "String"
- },
- "enforcer" : {
- "dataType" : "String"
- }
- },
-
-
- idAttribute: 'id',
-
- /**
- * VXAuditRecordBase initialize method
- * @augments XABaseModel
- * @constructs
- */
- initialize: function() {
- this.modelName = 'VXAuditRecordBase';
- }
-
- }, {
- // static class members
- });
-
- return VXAuditRecordBase;
-
-});
-
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/models/VXAuditRecord.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/models/VXAuditRecord.js b/security-admin/src/main/webapp/scripts/models/VXAuditRecord.js
deleted file mode 100644
index 0e89a7f..0000000
--- a/security-admin/src/main/webapp/scripts/models/VXAuditRecord.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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(function(require){
- 'use strict';
-
- var VXAuditRecordBase = require('model_bases/VXAuditRecordBase');
-
- var VXAuditRecord = VXAuditRecordBase.extend(
- /** @lends VXAuditRecord.prototype */
- {
- /**
- * @function schema
- * This method is meant to be used by UI,
- * by default we will remove the unrequired attributes from serverSchema
- */
-
- schemaBase : function(){
- var attrs = _.omit(this.serverSchema, 'id', 'createDate', 'updateDate', "version",
- "createDate", "updateDate", "displayOption",
- "permList", "forUserId", "status", "priGrpId",
- "updatedBy","isSystem");
-
- _.each(attrs, function(o){
- o.type = 'Hidden';
- });
-
- // Overwrite your schema definition here
- return _.extend(attrs,{
- /*name : {
- type : 'Text',
- title : 'Folder Name *',
- validators : ['required'],
- },*/
-
- });
- },
-
- /*links : {
- detail: {
- href: 'javascript:void(0)',
- label : this.toString()
- },
- list: {
- href: 'javascript:void(0)',
- label : this.toString()
- },
- },*/
-
- /** This models toString() */
- toString : function(){
- return /*this.get('name')*/;
- }
-
- }, {
- // static class members
- });
-
- return VXAuditRecord;
-
-});
-
-
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/models/VXGroup.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/models/VXGroup.js b/security-admin/src/main/webapp/scripts/models/VXGroup.js
index 3aa3615..46cb97e 100644
--- a/security-admin/src/main/webapp/scripts/models/VXGroup.js
+++ b/security-admin/src/main/webapp/scripts/models/VXGroup.js
@@ -78,18 +78,7 @@ define(function(require){
}
});
},
-
- /*links : {
- detail: {
- href: 'javascript:void(0)',
- label : this.toString()
- },
- list: {
- href: 'javascript:void(0)',
- label : this.toString()
- },
- },*/
-
+
/** This models toString() */
toString : function(){
return /*this.get('name')*/;
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/models/VXPortalUser.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/models/VXPortalUser.js b/security-admin/src/main/webapp/scripts/models/VXPortalUser.js
index 079fc9c..ad7526a 100644
--- a/security-admin/src/main/webapp/scripts/models/VXPortalUser.js
+++ b/security-admin/src/main/webapp/scripts/models/VXPortalUser.js
@@ -56,8 +56,8 @@ define(function(require){
},
lastName : {
type : 'Text',
- title : localization.tt("lbl.lastName")+' *',
- validators : [{type:'regexp',regexp:/^[a-zA-Z][a-zA-Z0-9\s_-]*[a-zA-Z0-9]+$/,message :'Last name should start with alphabets & can have underscore, hyphen, space.'}],
+ title : localization.tt("lbl.lastName"),
+ validators : ['required',{type:'regexp',regexp:/^[a-zA-Z][a-zA-Z0-9\s_-]*[a-zA-Z0-9]+$/,message :'Last name should start with alphabets & can have underscore, hyphen, space.'}],
editorAttrs : { 'placeholder' : localization.tt("lbl.lastName")}
},
emailAddress : {
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/modules/XALinks.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/modules/XALinks.js b/security-admin/src/main/webapp/scripts/modules/XALinks.js
index e15b45d..4bcffbc 100755
--- a/security-admin/src/main/webapp/scripts/modules/XALinks.js
+++ b/security-admin/src/main/webapp/scripts/modules/XALinks.js
@@ -80,7 +80,7 @@ define(function(require) {
title: 'h.keyEdit'
},
KmsKeyForService : {
- href : 'javascrit:;',
+ href : 'javascript:void(0);',
text : 'KMS_TEST1',
title: 'KMS_TEST1'
},
@@ -110,12 +110,12 @@ define(function(require) {
title: 'h.managePolices'
},
PolicyCreate: {
- href : 'javascipt:;',
+ href : 'javascript:void(0);',
text: 'h.createPolicy',
title: 'h.createPolicy'
},
PolicyEdit: {
- href : 'javascipt:;',
+ href : 'javascript:void(0);',
text: 'h.editPolicy',
title: 'h.editPolicy'
},
@@ -178,7 +178,7 @@ define(function(require) {
text : 'lbl.sessionDetail'
},
ServiceCreate : {
- href : "javascript:void(0);",
+ href : 'javascript:void(0);',
text : 'lbl.createService',
title: 'lbl.createService'
},
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js b/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
index fa02166..6485b7f 100644
--- a/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
+++ b/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
@@ -313,8 +313,8 @@ define(function(require) {
youDontHavePermission : 'You don\'t have permission for the resource !!',
myProfileError :'Your password does not match. Please try again with proper password',
myProfileSuccess :'Profile Edited successfully',
- userNameAlreadyExist : 'User name already exists',
- groupNameAlreadyExist : 'Group name already exists',
+ userNameAlreadyExist : 'User name already exists',
+ groupNameAlreadyExist : 'Group name already exists',
yourAuditLogginIsOff :'You must have at least one or more user/group access defined for the policy.',
policyNotHavingPerm : 'The policy does not have any permissions so audit logging cannot be turned off',
areSureWantToLogout : 'Are you sure want to logout ?',
@@ -324,8 +324,11 @@ define(function(require) {
policyDisabledMsg : 'This policy is currently in disabled state.',
noRecordsFound : 'No Records Found',
keyDeleteMsg : 'Key deleted successfully',
- rolloverSuccessfully : 'Key rollover successfully'
-
+ rolloverSuccessfully : 'Key rollover successfully',
+ userCreatedSucc : 'User created successfully',
+ userUpdatedSucc : 'User updated successfully',
+ grpUpdatedSucc : 'Group updated successfully',
+ grpCreatedSucc : 'Group created successfully',
},
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/utils/XAUtils.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/utils/XAUtils.js b/security-admin/src/main/webapp/scripts/utils/XAUtils.js
index b8a061f..db727ed 100644
--- a/security-admin/src/main/webapp/scripts/utils/XAUtils.js
+++ b/security-admin/src/main/webapp/scripts/utils/XAUtils.js
@@ -1101,7 +1101,7 @@ define(function(require) {
};
XAUtils.showErrorMsg = function(respMsg){
var respArr = respMsg.split(/\([0-9]*\)/);
- respArr.shift();
+ respArr = respArr.filter(function(str){ return str; });
_.each(respArr, function(str){
var validationMsg = str.split(','), erroCodeMsg = '';
//get code from string
@@ -1113,7 +1113,8 @@ define(function(require) {
}
var reason = str.lastIndexOf("reason") != -1 ? (str.substring(str.lastIndexOf("reason")+7, str.indexOf("field[")-3 ))
: str;
- var erroMsg = erroCodeMsg +"<br/>"+XAUtils.capitaliseFirstLetter(reason);
+ erroCodeMsg = erroCodeMsg != "" ? erroCodeMsg +"<br/>" : "";
+ var erroMsg = erroCodeMsg +""+ XAUtils.capitaliseFirstLetter(reason);
return XAUtils.notifyError('Error', erroMsg);
});
};
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/accounts/AccountCreate.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/accounts/AccountCreate.js b/security-admin/src/main/webapp/scripts/views/accounts/AccountCreate.js
deleted file mode 100644
index 75c2967..0000000
--- a/security-admin/src/main/webapp/scripts/views/accounts/AccountCreate.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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(function(require){
- 'use strict';
-
- var App = require('App');
- var Backbone = require('backbone');
- var Communicator = require('communicator');
- var XAUtil = require('utils/XAUtils');
- var XALinks = require('modules/XALinks');
-
- var AccountCreate_tmpl = require('hbs!tmpl/accounts/AccountCreate_tmpl');
- var AccountForm = require('views/accounts/AccountForm');
-
- var AccountCreate = Backbone.Marionette.Layout.extend(
- /** @lends AccountCreate */
- {
- _viewName : 'AccountCreate',
-
- template: AccountCreate_tmpl,
- breadCrumbs :function(){
- if(this.model.isNew())
- return [XALinks.get('Accounts'), XALinks.get('AccountCreate')];
- else
- return [XALinks.get('Accounts'), XALinks.get('AccountEdit')];
- } ,
-
- /** Layout sub regions */
- regions: {
- 'rForm' :'div[data-id="r_form"]'
- },
-
- /** ui selector cache */
- ui: {
- 'btnSave' : '[data-id="save"]',
- 'btnCancel' : '[data-id="cancel"]'
- },
-
- /** ui events hash */
- events: function() {
- var events = {};
- events['click ' + this.ui.btnSave] = 'onSave';
- events['click ' + this.ui.btnCancel] = 'onCancel';
- return events;
- },
-
- /**
- * intialize a new AccountCreate ItemView
- * @constructs
- */
- initialize: function(options) {
- console.log("initialized a AccountCreate ItemView");
-
- _.extend(this, _.pick(options, ''));
-
-
-
- this.bindEvents();
- },
-
- /** all events binding here */
- bindEvents : function(){
- /*this.listenTo(this.model, "change:foo", this.modelChanged, this);*/
- /*this.listenTo(communicator.vent,'someView:someEvent', this.someEventHandler, this)'*/
- },
-
- /** on render callback */
- onRender: function() {
- this.form = new AccountForm({
- model : this.model,
- template : require('hbs!tmpl/accounts/AccountForm_tmpl')
- });
- this.rForm.show(this.form);
- if(!this.model.isNew()){
- this.form.setUpSwitches();
- }
- this.initializePlugins();
- },
-
- /** all post render plugin initialization */
- initializePlugins: function(){
- },
-
- onSave: function(){
- var errors = this.form.commit({validate : false});
- if(! _.isEmpty(errors)){
- return;
- }
- this.model.save();
- /*this.model.save({},{
- wait: true,
- success: function () {
- var msg = 'Account created successfully';
- XAUtil.notifySuccess('Success', msg);
- App.appRouter.navigate("#!/accounts",{trigger: true});
- console.log("success");
- },
- error: function (model, response, options) {
- XAUtil.notifyError('Error', 'Error creating Account!');
- console.log("error");
- }
- });*/
- },
- onCancel: function(){
- App.appRouter.navigate("#!/accounts",{trigger: true});
- },
- /** on close */
- onClose: function(){
- App.appRouter.navigate("#!/accounts",{trigger: true});
- }
-
- });
-
- return AccountCreate;
-});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/accounts/AccountDetailLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/accounts/AccountDetailLayout.js b/security-admin/src/main/webapp/scripts/views/accounts/AccountDetailLayout.js
deleted file mode 100644
index f23813f..0000000
--- a/security-admin/src/main/webapp/scripts/views/accounts/AccountDetailLayout.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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(function(require){
- 'use strict';
-
- var Backbone = require('backbone');
- var Communicator = require('communicator');
-
- var AccountdetaillayoutTmpl = require('hbs!tmpl/accounts/AccountDetailLayout_tmpl');
-
-
- var AccountDetailLayout = Backbone.Marionette.Layout.extend(
- /** @lends AccountDetailLayout */
- {
- _viewName : 'AccountDetailLayout',
-
- template: AccountdetaillayoutTmpl,
-
- /** Layout sub regions */
- regions: {
- rAccountDetail : '#r_accDetail'
- },
-
- /** ui selector cache */
- ui: {},
-
- /** ui events hash */
- events: function() {
- var events = {};
- //events['change ' + this.ui.input] = 'onInputChange';
- return events;
- },
-
- /**
- * intialize a new AccountDetailLayout Layout
- * @constructs
- */
- initialize: function(options) {
- console.log("initialized a AccountDetailLayout Layout");
-
- _.extend(this, _.pick(options, ''));
-
- this.bindEvents();
- },
-
- /** all events binding here */
- bindEvents : function(){
- /*this.listenTo(this.model, "change:foo", this.modelChanged, this);*/
- /*this.listenTo(communicator.vent,'someView:someEvent', this.someEventHandler, this)'*/
- },
-
- /** on render callback */
- onRender: function() {
- this.initializePlugins();
- this.renderDetailView();
- },
- renderDetailView : function(){
- var that = this;
-
- },
- /** all post render plugin initialization */
- initializePlugins: function(){
- },
-
- /** on close */
- onClose: function(){
- }
-
- });
-
- return AccountDetailLayout;
-});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/accounts/AccountForm.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/accounts/AccountForm.js b/security-admin/src/main/webapp/scripts/views/accounts/AccountForm.js
deleted file mode 100644
index 718b9d6..0000000
--- a/security-admin/src/main/webapp/scripts/views/accounts/AccountForm.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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(function(require){
- 'use strict';
-
- var Backbone = require('backbone');
- var Communicator = require('communicator');
- var localization = require('utils/XALangSupport');
- var XAEnums = require('utils/XAEnums');
-
- require('Backbone.BootstrapModal');
- require('backbone-forms.list');
- require('backbone-forms.templates');
- require('backbone-forms');
-
- var AccountForm = Backbone.Form.extend(
- /** @lends AccountForm */
- {
- _viewName : 'AccountForm',
- /**
- * intialize a new AccountForm Form View
- * @constructs
- */
- initialize: function(options) {
- console.log("initialized a AccountForm Form View");
- Backbone.Form.prototype.initialize.call(this, options);
-
- _.extend(this, _.pick(options, ''));
-
- this.bindEvents();
- },
-
- /*schema : function(){
- return _.pick(_.result(this.model.schema),'customerName', 'accountStatus', 'accountCode');
- },
-*/
- /** all events binding here */
- bindEvents : function(){
- /*this.on('field:change', function(form, fieldEditor){
- this.evFieldChange(form, fieldEditor);
- });*/
- },
-
- /** on render callback */
- onRender: function() {
- this.initializePlugins();
- /*if(!this.model.isNew()){
- this.setUpSwitches();
- }*/
- },
- setUpSwitches :function(){
- var that = this;
- var accountStatus = false;
- _.each(_.toArray(XAEnums.BooleanValue),function(m){
- if(parseInt(that.model.get('accountStatus')) == m.value)
- accountStatus = (m.label == XAEnums.BooleanValue.BOOL_TRUE.label) ? true : false;
- });
- this.fields.accountStatus.editor.setValue(accountStatus);
- },
-
- /** all post render plugin initialization */
- initializePlugins: function(){
- }
-
- });
-
- return AccountForm;
-});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/accounts/AccountTableLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/accounts/AccountTableLayout.js b/security-admin/src/main/webapp/scripts/views/accounts/AccountTableLayout.js
deleted file mode 100644
index 1bb863b..0000000
--- a/security-admin/src/main/webapp/scripts/views/accounts/AccountTableLayout.js
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * 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(function(require) {'use strict';
-
- var Backbone = require('backbone');
- var Communicator = require('communicator');
-
- var XALinks = require('modules/XALinks');
- var XAEnums = require('utils/XAEnums');
- var localization = require('utils/XALangSupport');
- var XABackgrid = require('views/common/XABackgrid');
- var XATableLayout = require('views/common/XATableLayout');
-
- var AccounttablelayoutTmpl = require('hbs!tmpl/accounts/AccountTableLayout_tmpl');
-
- require('backgrid');
- require('backgrid-paginator');
- //require('backbone-pageable');
- require('jquery-toggles');
-
- var AccountTableLayout = Backbone.Marionette.Layout.extend(
- /** @lends AccountTableLayout */
- {
- _viewName : 'AccountTableLayout',
-
- template : AccounttablelayoutTmpl,
- breadCrumbs : [XALinks.get('Accounts')],
-
- /** Layout sub regions */
- regions : {
- 'rTableList' : 'div[data-id="r_tableList"]',
- 'rPagination' : 'div[data-id="r_pagination"]'
- },
-
- /** ui selector cache */
- ui : {},
-
- /** ui events hash */
- events : function() {
- var events = {};
- //events['change ' + this.ui.input] = 'onInputChange';
- return events;
- },
-
- /**
- * intialize a new AccountTableLayout Layout
- * @constructs
- */
- initialize : function(options) {
- console.log("initialized a AccountTableLayout Layout");
-
- _.extend(this, _.pick(options, ''));
-
- this.bindEvents();
- },
-
- /** all events binding here */
- bindEvents : function() {
- /*this.listenTo(this.model, "change:foo", this.modelChanged, this);*/
- /*this.listenTo(communicator.vent,'someView:someEvent', this.someEventHandler, this)'*/
- },
-
- /** on render callback */
- onRender : function() {
- this.initializePlugins();
- this.renderTable();
- },
-
- /** all post render plugin initialization */
- initializePlugins : function() {
- },
-
- renderTable : function() {
- /*if(! this.collection.length){
- return;
- }*/
- /*var TableRow = Backgrid.Row.extend({
- });
-
- this.rTableList.show(new Backgrid.Grid({
- className: 'table table-bordered table-condensed backgrid',
- columns : this.getColumns(),
- collection : this.collection,
- row : TableRow
- }));
-
-
- this.rPagination.show(new Backgrid.Extension.Paginator({
- collection : this.collection,
- className: "pagination",
- controls : {
- rewind : {
- label : "«",
- title : "First"
- },
- back : {
- label : "‹",
- title : "Previous"
- },
- forward : {
- label : "›",
- title : "Next"
- },
- fastForward : {
- label : "»",
- title : "Last"
- }
- },
- }));*/
- this.rTableList.show(new XATableLayout({
- columns: this.getColumns(),
- collection: this.collection,
- includeFilter : false,
- gridOpts : {
- header : XABackgrid,
- emptyText : 'No Accounts found!'
- }
- }));
- },
-
- getColumns : function() {
- var cols = {
- //id : {},
- customerName : {
- label : "Customer Name",
- cell : "uri",
- href: function(model){
- return '#!/account/'+model.get('id')+'/user/' + 1;
- }
- },
- accountStatus : {
- label : "Status",
- /*cell :"Switch",
- formatter : _.extend({}, Backgrid.CellFormatter.prototype, {
- fromRaw : function(rawValue) {
- var status;
- _.each(_.toArray(XAEnums.BooleanValue),function(m){
- if(parseInt(rawValue) == m.value){
- status = (m.label == XAEnums.BooleanValue.BOOL_TRUE.label) ? true : false;
- return ;
- }
- });
- //You can use rawValue to custom your html, you can change this value using the name parameter.
- return status;
- }
- }),*/
- formatter : _.extend({}, Backgrid.CellFormatter.prototype, {
- fromRaw : function(rawValue) {
- return rawValue == XAEnums.ActiveStatus.STATUS_ENABLED.value ? XAEnums.ActiveStatus.STATUS_ENABLED.label: XAEnums.ActiveStatus.STATUS_DISABLED.label;
- }
- })
- }
- /*action : {
- cell :"uri",
- label : localization.tt("lbl.action"),
- href: function(model){
- return '#!/accounts/' + model.id+'/edit';
- },
- title : 'Edit',
- editable:false,
- iconKlass :'icon-edit',
- iconTitle :'Edit'
-
-
- }*/
- };
- return this.collection.constructor.getTableCols(cols, this.collection);
- },
-
- /** on close */
- onClose : function() {
- }
- });
-
- return AccountTableLayout;
-});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/common/AddGroup.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/common/AddGroup.js b/security-admin/src/main/webapp/scripts/views/common/AddGroup.js
index ecee740..1246e57 100644
--- a/security-admin/src/main/webapp/scripts/views/common/AddGroup.js
+++ b/security-admin/src/main/webapp/scripts/views/common/AddGroup.js
@@ -27,7 +27,7 @@ define(function(require){
var XAEnums = require('utils/XAEnums');
var localization = require('utils/XALangSupport');
var VXGroup = require('models/VXGroup');
- var AddGroup_tmpl = require('hbs!tmpl/common/AddGroup_tmpl');
+ var AddGroup_tmpl = require('hbs!tmpl/common/AddGroup_tmpl');
require('bootstrap-editable');
var AddGroup = Backbone.Marionette.ItemView.extend(
@@ -61,7 +61,6 @@ define(function(require){
*/
initialize: function(options) {
console.log("initialized a AddGroup ItemView");
-
_.extend(this, _.pick(options));
this.bindEvents();
},
@@ -94,38 +93,30 @@ define(function(require){
return;
}
that.checkDirtyFieldForGroup(values);
- if(!_.isArray(values))
- values=values.toString().split(',');
+ if(!_.isArray(values)) values=values.toString().split(',');
+
var valArr = [];
- if(!_.isUndefined($(that.el).find('.select2-container-multi')) && $(that.el).find('.select2-container-multi').length > 0){
+ if(!_.isUndefined($(that.el).find('.select2-container-multi'))
+ && $(that.el).find('.select2-container-multi').length > 0){
values = $(that.el).find('.select2-container-multi').select2('data')
- }else{
+ } else {
var groupNameList = that.model.get('groupNameList');
values = _.map(that.model.get('groupIdList'),function(id,i){ return {'id': id, 'text': groupNameList[i]};});
}
+
valArr = _.map(values,function(val,i){
return "<span class='label label-inverse'>" + val.text + "</span>"
},that);
+
that.groupArr = values;
that.firstTimeEditGroup = true;
-
$(this).html(valArr.join(" "));
- /*if(valArr.length > 0){
- that.$('.field-groupIdList').removeClass('error');
- that.ui.errorMsg.hide();
- }else{
- that.$('.field-groupIdList').addClass('error');
- that.ui.errorMsg.show();
- }*/
-
},
success: function(response, newValue) {
- console.log(newValue);
that.firstTimeEditGroup = false;
- //that.model.set('group',newValue);
-
}
});
+
this.$('[id^="tags-edit-"]').click(function(e) {
e.stopPropagation();
e.preventDefault();
@@ -140,9 +131,7 @@ define(function(require){
var valuesSoFar = {};
for (var i = 0; i < array.length; ++i) {
var value = array[i];
- if (Object.prototype.hasOwnProperty.call(valuesSoFar, value)) {
- return true;
- }
+ if (Object.prototype.hasOwnProperty.call(valuesSoFar, value)) { return true; }
valuesSoFar[value] = true;
}
return false;
@@ -162,22 +151,12 @@ define(function(require){
var data = [];
if(!_.isUndefined(that.groupArr) && that.firstTimeEditGroup){
data = that.groupArr;
- }
- else
+ } else {
data = element.select2('data');
+ }
callback(data);
},
- /*createSearchChoice: function(term, data) {
- if ($(data).filter(function() {
- return this.text.localeCompare(term) === 0;
- }).length === 0) {
- return {
- id : term,
- text: term
- };
- }
- },*/
ajax: {
url: "service/xusers/groups",
dataType: 'json',
@@ -187,20 +166,19 @@ define(function(require){
results: function (data, page) {
var results = [],selectedVals = [];
groupCnt = data.resultSize
- if(!_.isEmpty(that.$('.tags').data('editable').input.$input.val()))
+
+ if(!_.isEmpty(that.$('.tags').data('editable').input.$input.val())) {
selectedVals = that.$('.tags').data('editable').input.$input.val().split(',');
+ }
if(data.resultSize != "0"){
- //if(data.vXGroups.length > 1){
- results = data.vXGroups.map(function(m, i){ return {id : (m.id).toString(), text: m.name}; });
- if(!_.isEmpty(selectedVals))
- results = XAUtil.filterResultByIds(results, selectedVals);
- // console.log(results.length);
- groupCnt = results.length;
- return {results : results};
- // }
- // results = [{id : (data.vXGroups.id)+"", text: data.vXGroups.name}];
- // return {results : results};
+ results = data.vXGroups.map(function(m, i){ return {id : (m.id).toString(), text: m.name}; });
+ if(!_.isEmpty(selectedVals)) {
+ results = XAUtil.filterResultByIds(results, selectedVals);
+ }
+ groupCnt = results.length;
+ return {results : results};
}
+
return {results : results};
}
},
@@ -211,20 +189,18 @@ define(function(require){
return result.text;
},
formatNoMatches: function(result){
- if(groupCnt > 0)
- return 'Please enter one more character.'
- else
- return 'No group found.';
+ return groupCnt > 0 ? 'Please enter one more character.' : 'No group found.';
}
};
},
checkDirtyFieldForGroup : function(changeValues){
var groupIdList = [];
- if(!_.isArray(changeValues))
- changeValues = [changeValues];
- changeValues = _.map(changeValues, function(val){return parseInt(val);});
- if(!_.isUndefined(this.model.get('groupIdList')))
+ if(!_.isArray(changeValues)) changeValues = [changeValues];
+
+ changeValues = _.map(changeValues, function(val){ return parseInt(val); });
+ if(!_.isUndefined(this.model.get('groupIdList'))){
groupIdList = this.model.get('groupIdList');
+ }
XAUtil.checkDirtyField(groupIdList, changeValues, this.$el);
},
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/common/BreadCrumbs.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/common/BreadCrumbs.js b/security-admin/src/main/webapp/scripts/views/common/BreadCrumbs.js
index c1f2d4b..0093740 100644
--- a/security-admin/src/main/webapp/scripts/views/common/BreadCrumbs.js
+++ b/security-admin/src/main/webapp/scripts/views/common/BreadCrumbs.js
@@ -49,7 +49,7 @@ define(function(require) {
},this);*/
},
onRender : function(){
-
+ this.$el.find('li:last a').addClass('_allowNav');
},
reRenderBookmarks : function(){
this.breadcrumb = this.setLast(this.breadcrumb);
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/common/FormInputItemList.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/common/FormInputItemList.js b/security-admin/src/main/webapp/scripts/views/common/FormInputItemList.js
deleted file mode 100644
index ca1ebc4..0000000
--- a/security-admin/src/main/webapp/scripts/views/common/FormInputItemList.js
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * 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(function(require) {
- 'use strict';
-
- var Backbone = require('backbone');
- var App = require('App');
- var XAEnums = require('utils/XAEnums');
- var XAUtil = require('utils/XAUtils');
- var localization = require('utils/XALangSupport');
- var VXGroup = require('models/VXGroup');
- require('bootstrap-editable');
-
- var FormInputItem = Backbone.Marionette.ItemView.extend({
- _msvName : 'FormInputItem',
- template : require('hbs!tmpl/common/formInputItem'),
- tagName : 'tr',
- templateHelpers : function(){
-
- return {
- permissions : _.flatten(_.pick(XAEnums.XAPermType, XAUtil.getPerms(this.policyType))),
- policyKnox : this.policyType == XAEnums.AssetType.ASSET_KNOX.value ? true :false,
- policyStorm : this.policyType == XAEnums.AssetType.ASSET_STORM.value ? true :false,
- isModelNew : !this.model.has('editMode'),
- stormPerms : this.stormPermsIds.length == 14 ? _.union(this.stormPermsIds,[-1]) : this.stormPermsIds
-
- };
- },
- ui : {
- selectGroups : '[data-js="selectGroups"]',
- inputIPAddress : '[data-js="ipAddress"]',
- tags : '[class=tags]'
- },
- events : {
- 'click [data-action="delete"]' : 'evDelete',
- 'click td' : 'evClickTD',
- 'change [data-js="selectGroups"]': 'evSelectGroup',
- 'change [data-js="ipAddress"]' : 'evIPAddress'
- },
-
- initialize : function(options) {
- _.extend(this, _.pick(options, 'groupList','policyType'));
- //this.subjectList = this.mStudent.getSubjectList();
- this.stormPermsIds = [];
- if(this.policyType == XAEnums.AssetType.ASSET_STORM.value){
- if(this.model.has('editMode') && this.model.get('editMode')){
- this.stormPermsIds = _.map(this.model.get('_vPermList'), function(p){
- if(XAEnums.XAPermType.XA_PERM_TYPE_ADMIN.value != p.permType)
- return p.permType;
- });
- }
- }
- },
-
- onRender : function() {
- var that = this;
- if(!_.isUndefined(this.model.get('groupId'))){
- this.ui.selectGroups.val(this.model.get('groupId').split(','));
- }
- if(!_.isUndefined(this.model.get('ipAddress'))){
- this.ui.inputIPAddress.val(this.model.get('ipAddress').toString());
- }
- if(this.model.has('editMode') && this.model.get('editMode')){
- _.each(this.model.get('_vPermList'), function(p){
- this.$el.find('input[data-id="' + p.permType + '"]').attr('checked', 'checked');
- },this);
- }
- this.createGroupDropDown();
- this.groupDropDownChange();
- if(this.policyType == XAEnums.AssetType.ASSET_STORM.value){
- this.renderStormPerms();
- }
- },
- groupDropDownChange : function(){
- var that = this;
- this.ui.selectGroups.on('change',function(e){
- // console.log(e.currentTarget.value);
- that.checkDirtyFieldForDropDown(e);
- var duplicateGroupName = false;
-
- that.toggleAddButton(e);
- if(e.removed != undefined){
- var gIdArr = [],gNameArr = [];
- gIdArr = _.without(that.model.get('groupId').split(','), e.removed.id);
- if(that.model.get('groupName') != undefined)
- gNameArr = _.without(that.model.get('groupName').split(','), e.removed.text);
- if(!_.isEmpty(gIdArr)){
- that.model.set('groupId',gIdArr.join(','));
- that.model.set('groupName',gNameArr.join(','));
- }else{
- that.model.unset('groupId');
- that.model.unset('groupName');
- }
- return;
- }
- if(!_.isUndefined(e.added)){
- that.model.set('groupId', e.currentTarget.value);
- }
- });
- },
- createGroupDropDown :function(){
- var that = this;
- if(this.model.has('editMode') && !_.isEmpty(this.ui.selectGroups.val())){
- var temp = this.ui.selectGroups.val().split(",");
- _.each(temp , function(id){
- if(_.isUndefined(that.groupList.get(id))){
- var group = new VXGroup({id : id});
- group.fetch({async:false}).done(function(){
- that.groupList.add(group);
- });
- }
- });
- }
- this.groupArr = this.groupList.map(function(m){
- return { id : m.id+"" , text : m.get('name')};
- });
- this.ui.selectGroups.select2({
- closeOnSelect : true,
- placeholder : 'Select Group',
- // maximumSelectionSize : 1,
- width :'220px',
- tokenSeparators: [",", " "],
- tags : this.groupArr,
- initSelection : function (element, callback) {
- var data = [];
- console.log(that.groupList);
-
- $(element.val().split(",")).each(function () {
- var obj = _.findWhere(that.groupArr,{id:this});
- // if(!_.isUndefined(obj))
- data.push({id: this, text: obj.text});
- /*else{
- var group = new VXGroup({id : this});
- group.fetch().done(function(){
- data.push({id: group.id, text: group.get('name')});
- });
- }*/
- });
- callback(data);
- },
- createSearchChoice: function(term, data) {
- /* if ($(data).filter(function() {
- return this.text.localeCompare(term) === 0;
- }).length === 0) {
- return {
- id : term,
- text: term
- };
- }*/
- },
- ajax: {
- url: "service/xusers/groups",
- dataType: 'json',
- data: function (term, page) {
- return {name : term, isVisible : XAEnums.VisibilityStatus.STATUS_VISIBLE.value};
- },
- results: function (data, page) {
- var results = [] , selectedVals = [];
- /*if(!_.isEmpty(that.ui.selectGroups.select2('val')))
- selectedVals = that.ui.selectGroups.select2('val');*/
- selectedVals = that.getGroupSelectdValues();
- if(data.resultSize != "0"){
- //if(data.vXGroups.length > 1){
-
- results = data.vXGroups.map(function(m, i){ return {id : m.id+"", text: m.name}; });
- if(!_.isEmpty(selectedVals))
- results = XAUtil.filterResultByIds(results, selectedVals);
- // console.log(results.length);
- return {results : results};
- //}
- // results = [{id : data.vXGroups.id+"", text: data.vXGroups.name}];
- // return {results : results};
- }
- return {results : results};
- }
- },
- formatResult : function(result){
- return result.text;
- },
- formatSelection : function(result){
- return result.text;
- },
- formatNoMatches: function(result){
- return 'No group found.';
- }
- }).on('select2-focus', XAUtil.select2Focus);
- },
- getGroupSelectdValues : function(){
- var vals = [],selectedVals = [];
- this.collection.each(function(m){
- if(!_.isUndefined(m.get('groupId'))){
- vals.push.apply(vals, m.get('groupId').split(','));
- }
- });
- if(!_.isEmpty(this.ui.selectGroups.select2('val')))
- selectedVals = this.ui.selectGroups.select2('val');
- vals.push.apply(vals , selectedVals);
- vals = $.unique(vals);
- return vals;
- },
- evDelete : function(){
- var that = this;
- this.collection.remove(this.model);
- this.toggleAddButton();
- },
- evClickTD : function(e){
- var $el = $(e.currentTarget),permList =[],perms =[];
- if($(e.toElement).is('td')){
- var $checkbox = $el.find('input');
- $checkbox.is(':checked') ? $checkbox.prop('checked',false) : $checkbox.prop('checked',true);
- }
- var curPerm = $el.find('input').data('id');
- if(!_.isUndefined(curPerm)){
- var perms = [];
- if(this.model.has('_vPermList')){
- if(_.isArray(this.model.get('_vPermList')))
- perms = this.model.get('_vPermList');
- else
- perms.push(this.model.get('_vPermList'));
- }
- /* permMapList = [ {id: 18, groupId : 1, permType :5}, {id: 18, groupId : 1, permType :4}, {id: 18, groupId : 2, permType :5} ]
- [1] => [ {id: 18, groupId : 1, permType :5}, {id: 19, groupId : 1, permType :4} ]
- [2] => [ {id: 20, groupId : 2, permType :5} ]
- { groupId : 1,
- _vPermList : [ { id: 18, permType : 5 }, { id: 19, permType : 4 } ]
- }
- this.model => { groupId : 2,
- _vPermList : [ { id: 20, permType : 5 }, { permType : 6 } ]
- }
-
- */
-// perms = this.model.has('_vPermList') ? this.model.get('_vPermList'): [];
-
- if($el.find('input[type="checkbox"]').is(':checked')){
- perms.push({permType : curPerm});
- if(curPerm == XAEnums.XAPermType.XA_PERM_TYPE_ADMIN.value){
- $el.parent().find('input[type="checkbox"]:not(:checked)[data-id!="'+curPerm+'"]').map(function(){
- perms.push({ permType :$(this).data('id')});
- // return { permType :$(this).data('id')};
- });
- $el.parent().find('input[type="checkbox"]').prop('checked',true);
- }
- } else {
- perms = _.reject(perms,function(el) { return el.permType == curPerm; });
- }
-
- this.checkDirtyFieldForCheckBox(perms);
- if(!_.isEmpty(perms))
- this.model.set('_vPermList', perms);
- else
- this.model.unset('_vPermList');
- }
- },
- checkDirtyFieldForCheckBox : function(perms){
- var permList = [];
- if(!_.isUndefined(this.model.get('_vPermList')))
- permList = _.map(this.model.attributes._vPermList,function(obj){return obj.permType;});
- perms = _.map(perms,function(obj){return obj.permType;});
- XAUtil.checkDirtyField(permList, perms, this.$el);
- },
- toggleAddButton : function(e){
- var temp = [];
- this.collection.each(function(m){
- if(!_.isUndefined(m.get('groupId'))){
- temp.push.apply(temp, m.get('groupId').split(','));
-
- }
- });
- if(!_.isUndefined(e)){
- if( !_.isUndefined(e.added) && ((temp.length + 1) == this.groupList.length))
- $('[data-action="addGroup"]').hide();
- if(!_.isUndefined(e.removed))
- $('[data-action="addGroup"]').show();
- }else{
- $('[data-action="addGroup"]').show();
- }
- },
- evIPAddress :function(e){
- if(!_.isEmpty($(e.currentTarget).val()))
- this.model.set('ipAddress',$(e.currentTarget).val().split(','));
- else
- this.model.unset('ipAddress');
- },
- renderStormPerms :function(){
- var that = this;
- var permArr = _.pick(XAEnums.XAPermType, XAUtil.getStormActions(this.policyType));
- this.stormPerms = _.map(permArr,function(m){return {text:m.label, value:m.value};});
- this.stormPerms.push({'value' : -1, 'text' : 'Select/Deselect All'});
- this.ui.tags.editable({
- placement: 'right',
-// emptytext : 'Please select',
- source: this.stormPerms,
- display: function(idList,srcData) {
- if(_.isEmpty(idList.toString())){
- $(this).html('');
- return;
- }
- if(!_.isArray(idList))
- idList = [idList];
-// that.checkDirtyFieldForGroup(values);
- var permTypeArr = [];
- var valArr = _.map(idList, function(id){
- if(!(parseInt(id) <= 0) && (!_.isNaN(parseInt(id)))){
- var obj = _.findWhere(srcData,{'value' : parseInt(id)});
- permTypeArr.push({permType : obj.value});
- return "<span class='label label-inverse'>" + obj.text + "</span>";
- }
- });
-
- if(that.model.has('_vPermList')){
- var adminPerm = _.where(that.model.get('_vPermList'),{'permType': XAEnums.XAPermType.XA_PERM_TYPE_ADMIN.value });
- permTypeArr = _.isEmpty(adminPerm) ? permTypeArr : _.union(permTypeArr,adminPerm);
- }
- that.model.set('_vPermList', permTypeArr);
-// if(!_.isEmpty(perms))
-// that.model.set('_vPermList', perms);
-// that.model.set('_vPermList', permTypeArr);
- $(this).html(valArr.join(" "));
- },
- });
- this.$('[id^="tags-edit-"]').click(function(e) {
- e.stopPropagation();
- e.preventDefault();
- that.$('#' + $(this).data('editable') ).editable('toggle');
- that.$('input[type="checkbox"][value="-1"]').click(function(e){
- var checkboxlist =$(this).closest('.editable-checklist').find('input[type="checkbox"][value!=-1]')
- $(this).is(':checked') ? checkboxlist.prop('checked',true) : checkboxlist.prop('checked',false);
-
- });
- });
-
- },
- checkDirtyFieldForDropDown : function(e){
- //that.model.has('groupId')
- var groupIdList =[];
- if(!_.isUndefined(this.model.get('groupId')))
- groupIdList = this.model.get('groupId').split(',');
- XAUtil.checkDirtyField(groupIdList, e.val, $(e.currentTarget));
- },
-
- });
-
-
-
- return Backbone.Marionette.CompositeView.extend({
- _msvName : 'FormInputItemList',
- template : require('hbs!tmpl/common/formInputItemList'),
- //tagName : 'ul',
- //className : 'timeline-container',
- templateHelpers :function(){
- console.log(XAUtil.getPermHeaders(this.policyType));
- return {
- permHeaders : XAUtil.getPermHeaders(this.policyType)
- };
- },
- getItemView : function(item){
- if(!item){
- return;
- }
- return FormInputItem;
- },
- itemViewContainer : ".js-formInput",
- itemViewOptions : function() {
- return {
- 'collection' : this.collection,
- 'groupList' : this.groupList,
- 'policyType' : this.policyType,
- };
- },
- events : {
- 'click [data-action="addGroup"]' : 'addNew'
- },
- initialize : function(options) {
- _.extend(this, _.pick(options, 'groupList','policyType'));
- //this.hiveGroupPerm = _.has(options,'hiveGroupPerm') ? true : false;
- this.listenTo(this.groupList, 'sync', this.render, this);
- if(this.collection.length == 0)
- this.collection.add(new Backbone.Model());
- },
- onRender : function(){
- //console.log("onRender of ArtifactFormNoteList called");
- this.toggleAddButton();
- },
- addNew : function(){
- var that =this;
- if(this.groupList.length > this.collection.length){
- this.collection.add(new Backbone.Model());
- this.toggleAddButton();
- }
- },
- toggleAddButton : function(){
- var groupIds=[];
- this.collection.each(function(m){
- if(!_.isUndefined(m.get('groupId'))){
- var temp = m.get('groupId').split(',');
- groupIds.push.apply(groupIds,temp);
- }
- });
- if(groupIds.length == this.groupList.length)
- this.$('button[data-action="addGroup"]').hide();
- else
- this.$('button[data-action="addGroup"]').show();
- },
- });
-
-});
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/082d0f28/security-admin/src/main/webapp/scripts/views/common/TopNav.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/common/TopNav.js b/security-admin/src/main/webapp/scripts/views/common/TopNav.js
index 0e7c6e9..bc5d17c 100644
--- a/security-admin/src/main/webapp/scripts/views/common/TopNav.js
+++ b/security-admin/src/main/webapp/scripts/views/common/TopNav.js
@@ -53,6 +53,7 @@ define(function(require){
initialize: function(options) {
console.log("initialized a TopNav ItemView");
_.extend(this, _.pick(options, ''));
+
this.bindEvents();
this.appState = options.appState;
this.appState.on('change:currentTab', this.highlightNav,this);
@@ -110,7 +111,6 @@ define(function(require){
this.$('#nav' + this.appState.get('currentTab')).parent().addClass('active');
},
mainManuURLS : function() {
-
},
/** on close */
onClose: function(){