diff --git a/src/main/java/com/rebuild/server/business/charts/TableBuilder.java b/src/main/java/com/rebuild/server/business/charts/TableBuilder.java index 6ecb99e5b..585a80347 100644 --- a/src/main/java/com/rebuild/server/business/charts/TableBuilder.java +++ b/src/main/java/com/rebuild/server/business/charts/TableBuilder.java @@ -112,17 +112,18 @@ public class TableBuilder { } // -- + // HTML Table structure - static class TBODY { - String tag = "tbody"; - List children = new ArrayList<>(); - TBODY() { + // or + private static class TBODY { + private String tag = "tbody"; + private List children = new ArrayList<>(); + private TBODY() { } - TBODY(String tag) { + private TBODY(String tag) { this.tag = tag; } - TBODY addChild(TR c) { - c.parent = this; + private TBODY addChild(TR c) { children.add(c); return this; } @@ -136,11 +137,10 @@ public class TableBuilder { } } - static class TR { - TBODY parent = null; - List children = new ArrayList<>(); - TR addChild(TD c) { - c.parent = this; + // + private static class TR { + private List children = new ArrayList<>(); + private TR addChild(TD c) { children.add(c); return this; } @@ -154,17 +154,17 @@ public class TableBuilder { } } - static class TD { - String tag = null; - TR parent = null; - String content; - int rowspan = 1; - TD(String content) { - this(content, "td"); + // or + private static class TD { + private String tag = null; + private String content; + private int rowspan = 1; + private TD(String content) { + this(content, null); } - TD(String content, String tag) { + private TD(String content, String tag) { this.content = StringUtils.defaultIfBlank(content, ""); - this.tag = tag; + this.tag = StringUtils.defaultIfBlank(tag, "td"); } @Override public String toString() { diff --git a/src/main/java/com/rebuild/server/service/notification/Message.java b/src/main/java/com/rebuild/server/service/notification/Message.java index 10bca0c71..447a39bb8 100644 --- a/src/main/java/com/rebuild/server/service/notification/Message.java +++ b/src/main/java/com/rebuild/server/service/notification/Message.java @@ -32,13 +32,12 @@ public class Message { private ID fromUser; private ID toUser; + private String message; private ID relatedRecord; - - private String message; public Message(ID toUser, String message, ID relatedRecord) { - this(UserService.SYSTEM_USER, toUser, message, null); + this(UserService.SYSTEM_USER, toUser, message, relatedRecord); } public Message(ID fromUser, ID toUser, String message, ID relatedRecord) { diff --git a/src/main/webapp/assets/js/rb-base.js b/src/main/webapp/assets/js/rb-base.js index 2fa068d25..41f143249 100644 --- a/src/main/webapp/assets/js/rb-base.js +++ b/src/main/webapp/assets/js/rb-base.js @@ -1,83 +1,7 @@ /* eslint-disable no-unused-vars */ /*! jQuery Cookie Plugin v1.4.1 - https://github.com/carhartl/jquery-cookie */ -// eslint-disable-next-line -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['jquery'], factory) - } else { - if (typeof exports === 'object') { - factory(require('jquery')) - } else { - factory(jQuery) - } - } -}(function ($) { - var pluses = /\+/g - - function encode(s) { - return config.raw ? s : encodeURIComponent(s) - } - - function decode(s) { - return config.raw ? s : decodeURIComponent(s) - } - - function stringifyCookieValue(value) { - return encode(config.json ? JSON.stringify(value) : String(value)) - } - - function parseCookieValue(s) { - if (s.indexOf('"') === 0) { - s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\') - } - try { - s = decodeURIComponent(s.replace(pluses, ' ')) - return config.json ? JSON.parse(s) : s - // eslint-disable-next-line no-empty - } catch (e) {} - } - - function read(s, converter) { - var value = config.raw ? s : parseCookieValue(s) - return $.isFunction(converter) ? converter(value) : value - } - var config = $.cookie = function (key, value, options) { - if (value !== undefined && !$.isFunction(value)) { - options = $.extend({}, config.defaults, options) - if (typeof options.expires === 'number') { - var days = options.expires, - t = options.expires = new Date() - t.setTime(+t + days * 86400000) - } - return (document.cookie = [encode(key), '=', stringifyCookieValue(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : ''].join('')) - } - var result = key ? undefined : {} - var cookies = document.cookie ? document.cookie.split('; ') : [] - for (var i = 0, l = cookies.length; i < l; i++) { - var parts = cookies[i].split('=') - var name = decode(parts.shift()) - var cookie = parts.join('=') - if (key && key === name) { - result = read(cookie, value) - break - } - if (!key && (cookie = read(cookie)) !== undefined) { - result[name] = cookie - } - } - return result - } - config.defaults = {} - $.removeCookie = function (key, options) { - if ($.cookie(key) === undefined) { - return false - } - $.cookie(key, '', $.extend({}, options, { - expires: -1 - })) - return !$.cookie(key) - } -})); +// eslint-disable-next-line quotes +(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else{if(typeof exports==="object"){factory(require("jquery"))}else{factory(jQuery)}}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{s=decodeURIComponent(s.replace(pluses," "));return config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date();t.setTime(+t+days*86400000)}return(document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join(""))}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split("; "):[];for(var i=0,l=cookies.length;i