diff options
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/handlebars')
88 files changed, 135 insertions, 138 deletions
diff --git a/server/sonar-web/src/main/js/helpers/handlebars/alertIconClass.js b/server/sonar-web/src/main/js/helpers/handlebars/alertIconClass.js index f7ffa5f14d6..5e62278dc0e 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/alertIconClass.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/alertIconClass.js @@ -19,8 +19,6 @@ */ import Handlebars from 'handlebars/runtime'; -module.exports = function (alert) { - return new Handlebars.default.SafeString( - 'icon-alert-' + alert.toLowerCase() - ); +module.exports = function(alert) { + return new Handlebars.default.SafeString('icon-alert-' + alert.toLowerCase()); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/all.js b/server/sonar-web/src/main/js/helpers/handlebars/all.js index e6700493451..b68d8d6b3df 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/all.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/all.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (...args) { +module.exports = function(...args) { const options = args[args.length - 1]; const list = args.slice(0, -1); const all = list.reduce((prev, current) => prev && current, true); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/any.js b/server/sonar-web/src/main/js/helpers/handlebars/any.js index c54631ca2a0..d9dd373ddd4 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/any.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/any.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (...args) { +module.exports = function(...args) { const options = args[args.length - 1]; const list = args.slice(0, -1); const any = list.reduce((prev, current) => prev || current, false); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/avatarHelper.js b/server/sonar-web/src/main/js/helpers/handlebars/avatarHelper.js index b363867eb4b..67220a97d5a 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/avatarHelper.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/avatarHelper.js @@ -20,7 +20,7 @@ import md5 from 'blueimp-md5'; import Handlebars from 'handlebars/runtime'; -function gravatarServer () { +function gravatarServer() { const getStore = require('../../app/utils/getStore').default; const { getSettingValue } = require('../../store/rootReducer'); @@ -28,13 +28,11 @@ function gravatarServer () { return (getSettingValue(store.getState(), 'sonar.lf.gravatarServerUrl') || {}).value; } -module.exports = function (email, size) { +module.exports = function(email, size) { // double the size for high pixel density screens const emailHash = md5.md5((email || '').trim()); - const url = gravatarServer() - .replace('{EMAIL_MD5}', emailHash) - .replace('{SIZE}', size * 2); + const url = gravatarServer().replace('{EMAIL_MD5}', emailHash).replace('{SIZE}', size * 2); return new Handlebars.default.SafeString( - `<img class="rounded" src="${url}" width="${size}" height="${size}" alt="${email}">` + `<img class="rounded" src="${url}" width="${size}" height="${size}" alt="${email}">` ); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/capitalize.js b/server/sonar-web/src/main/js/helpers/handlebars/capitalize.js index 63e2b200913..ee2d3fa8799 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/capitalize.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/capitalize.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (string) { +module.exports = function(string) { return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/changelog.js b/server/sonar-web/src/main/js/helpers/handlebars/changelog.js index 3ccf6a9be07..ec409ce9add 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/changelog.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/changelog.js @@ -20,7 +20,7 @@ import { translate, translateWithParameters } from '../../helpers/l10n'; import { formatMeasure } from '../../helpers/measures'; -module.exports = function (diff) { +module.exports = function(diff) { let message; if (diff.key === 'file') { @@ -28,20 +28,25 @@ module.exports = function (diff) { } if (diff.newValue != null) { - const newValue = diff.key === 'effort' ? - formatMeasure(diff.newValue, 'WORK_DUR') : - diff.newValue; - message = translateWithParameters('issue.changelog.changed_to', - translate('issue.changelog.field', diff.key), newValue); + const newValue = diff.key === 'effort' + ? formatMeasure(diff.newValue, 'WORK_DUR') + : diff.newValue; + message = translateWithParameters( + 'issue.changelog.changed_to', + translate('issue.changelog.field', diff.key), + newValue + ); } else { - message = translateWithParameters('issue.changelog.removed', - translate('issue.changelog.field', diff.key)); + message = translateWithParameters( + 'issue.changelog.removed', + translate('issue.changelog.field', diff.key) + ); } if (diff.oldValue != null) { - const oldValue = diff.key === 'effort' ? - formatMeasure(diff.oldValue, 'WORK_DUR') : - diff.oldValue; + const oldValue = diff.key === 'effort' + ? formatMeasure(diff.oldValue, 'WORK_DUR') + : diff.oldValue; message += ' ('; message += translateWithParameters('issue.changelog.was', oldValue); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/collapsePath.js b/server/sonar-web/src/main/js/helpers/handlebars/collapsePath.js index 9bb0b7584e8..56a8ba3021f 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/collapsePath.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/collapsePath.js @@ -19,6 +19,6 @@ */ import { collapsePath } from '../path'; -module.exports = function (path) { +module.exports = function(path) { return collapsePath(path); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/collapsedDirFromPath.js b/server/sonar-web/src/main/js/helpers/handlebars/collapsedDirFromPath.js index 8eddd1a9364..33dcbdb2294 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/collapsedDirFromPath.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/collapsedDirFromPath.js @@ -19,6 +19,6 @@ */ import { collapsedDirFromPath } from '../path'; -module.exports = function (path) { +module.exports = function(path) { return collapsedDirFromPath(path); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/componentBrowsePermalink.js b/server/sonar-web/src/main/js/helpers/handlebars/componentBrowsePermalink.js index ec104070b26..1786109374c 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/componentBrowsePermalink.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/componentBrowsePermalink.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (componentKey) { +module.exports = function(componentKey) { return window.baseUrl + '/components/index?id=' + encodeURIComponent(componentKey); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/componentDashboardPermalink.js b/server/sonar-web/src/main/js/helpers/handlebars/componentDashboardPermalink.js index 7c8f7e40422..6f388fb49a8 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/componentDashboardPermalink.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/componentDashboardPermalink.js @@ -17,11 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (componentKey, dashboardKey) { - const params = [ - { key: 'id', value: componentKey }, - { key: 'did', value: dashboardKey } - ]; +module.exports = function(componentKey, dashboardKey) { + const params = [{ key: 'id', value: componentKey }, { key: 'did', value: dashboardKey }]; const matchPeriod = window.location.search.match(/period=(\d+)/); if (matchPeriod) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/componentIssuesPermalink.js b/server/sonar-web/src/main/js/helpers/handlebars/componentIssuesPermalink.js index e849eb51826..cd9aaf55d66 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/componentIssuesPermalink.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/componentIssuesPermalink.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (componentKey) { +module.exports = function(componentKey) { return window.baseUrl + '/component_issues/index?id=' + encodeURIComponent(componentKey); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/componentPermalink.js b/server/sonar-web/src/main/js/helpers/handlebars/componentPermalink.js index a5ea3eddbb7..4a45d395468 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/componentPermalink.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/componentPermalink.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (componentKey) { +module.exports = function(componentKey) { return window.baseUrl + '/dashboard/index?id=' + encodeURIComponent(componentKey); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/d.js b/server/sonar-web/src/main/js/helpers/handlebars/d.js index 72d868abb0c..47e0709a26c 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/d.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/d.js @@ -19,6 +19,6 @@ */ import moment from 'moment'; -module.exports = function (date) { +module.exports = function(date) { return moment(date).format('LL'); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/dashboardL10n.js b/server/sonar-web/src/main/js/helpers/handlebars/dashboardL10n.js index 9d7dc2c04c5..2d7819bfabb 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/dashboardL10n.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/dashboardL10n.js @@ -19,7 +19,7 @@ */ import { translate } from '../../helpers/l10n'; -module.exports = function (dashboardName) { +module.exports = function(dashboardName) { const l10nKey = `dashboard.${dashboardName}.name`; const l10nLabel = translate(l10nKey); if (l10nLabel !== l10nKey) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/dashboardUrl.js b/server/sonar-web/src/main/js/helpers/handlebars/dashboardUrl.js index 5f022fd8d18..fbb5b5ab10b 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/dashboardUrl.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/dashboardUrl.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (componentKey, componentQualifier) { +module.exports = function(componentKey, componentQualifier) { let url = window.baseUrl + '/dashboard/index?id=' + encodeURIComponent(componentKey); if (componentQualifier === 'FIL' || componentQualifier === 'CLA') { url += '&metric=sqale_index'; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/default.js b/server/sonar-web/src/main/js/helpers/handlebars/default.js index 39650a052ad..4dd7a7d2f5a 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/default.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/default.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (...args) { +module.exports = function(...args) { const list = args.slice(0, -1); return list.reduce((prev, current) => prev != null ? prev : current, null); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/dirFromPath.js b/server/sonar-web/src/main/js/helpers/handlebars/dirFromPath.js index 8493c686dc8..ef39646e1e4 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/dirFromPath.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/dirFromPath.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (path) { +module.exports = function(path) { if (typeof path === 'string') { const tokens = path.split('/'); return tokens.length > 1 ? tokens.slice(0, -1).join('/') + '/' : ''; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ds.js b/server/sonar-web/src/main/js/helpers/handlebars/ds.js index 82d499370b2..52430aef8dc 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ds.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ds.js @@ -19,6 +19,6 @@ */ import moment from 'moment'; -module.exports = function (date) { +module.exports = function(date) { return moment(date).format('YYYY-MM-DD'); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/dt.js b/server/sonar-web/src/main/js/helpers/handlebars/dt.js index 07be677136d..c343c4bf17e 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/dt.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/dt.js @@ -19,6 +19,6 @@ */ import moment from 'moment'; -module.exports = function (date) { +module.exports = function(date) { return moment(date).format('LLL'); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/durationFromNow.js b/server/sonar-web/src/main/js/helpers/handlebars/durationFromNow.js index ae052bafccc..fec9cb09b05 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/durationFromNow.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/durationFromNow.js @@ -19,6 +19,6 @@ */ import moment from 'moment'; -module.exports = function (date, units) { +module.exports = function(date, units) { return moment(new Date()).diff(date, units); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js b/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js index c47748382a7..15c202363d7 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (context, property, options) { +module.exports = function(context, property, options) { let ret = ''; context.forEach((d, i) => { const changed = i > 0 ? d[property] !== context[i - 1][property] : true; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/eachEven.js b/server/sonar-web/src/main/js/helpers/handlebars/eachEven.js index 08da2f5d2e2..418147dd589 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/eachEven.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/eachEven.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (context, options) { +module.exports = function(context, options) { let ret = ''; context.forEach((d, i) => { if (i % 2 === 0) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/eachIndex.js b/server/sonar-web/src/main/js/helpers/handlebars/eachIndex.js index 380d667fb2b..51289bf6c1c 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/eachIndex.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/eachIndex.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (context, options) { +module.exports = function(context, options) { let ret = ''; context.forEach((d, index) => { const c = { index, ...d }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/eachOdd.js b/server/sonar-web/src/main/js/helpers/handlebars/eachOdd.js index 8ec991eb479..c25ff315438 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/eachOdd.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/eachOdd.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (context, options) { +module.exports = function(context, options) { let ret = ''; context.forEach((d, i) => { if (i % 2 === 1) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/eachReverse.js b/server/sonar-web/src/main/js/helpers/handlebars/eachReverse.js index fd110a74931..aebecc4a762 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/eachReverse.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/eachReverse.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (array, options) { +module.exports = function(array, options) { let ret = ''; if (array && array.length > 0) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/eachWithPrevious.js b/server/sonar-web/src/main/js/helpers/handlebars/eachWithPrevious.js index 140c4f8c01b..c65330c0e2a 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/eachWithPrevious.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/eachWithPrevious.js @@ -17,13 +17,13 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (context, options) { +module.exports = function(context, options) { let ret = ''; if (Array.isArray(context)) { context.forEach((element, index, list) => { const previous = index > 0 ? list[index - 1] : null; - const c = { '_previous': previous, ...element }; + const c = { _previous: previous, ...element }; ret += options.fn(c); }); } diff --git a/server/sonar-web/src/main/js/helpers/handlebars/empty.js b/server/sonar-web/src/main/js/helpers/handlebars/empty.js index b9641e09b32..b6292bc3dfa 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/empty.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/empty.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (array, options) { +module.exports = function(array, options) { const cond = Array.isArray(array) && array.length > 0; return cond ? options.inverse(this) : options.fn(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/eq.js b/server/sonar-web/src/main/js/helpers/handlebars/eq.js index 030c04aa20c..0036c5909b0 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/eq.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/eq.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (v1, v2, options) { +module.exports = function(v1, v2, options) { /* eslint eqeqeq: 0 */ return v1 == v2 ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/eqComponents.js b/server/sonar-web/src/main/js/helpers/handlebars/eqComponents.js index 6fa5faeff0d..1094adc8048 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/eqComponents.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/eqComponents.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (a, b, options) { - const notEq = a && b && ((a.project !== b.project) || (a.subProject !== b.subProject)); +module.exports = function(a, b, options) { + const notEq = a && b && (a.project !== b.project || a.subProject !== b.subProject); return notEq ? options.inverse(this) : options.fn(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/exporterUrl.js b/server/sonar-web/src/main/js/helpers/handlebars/exporterUrl.js index 40ceb13406b..e7cee0663e8 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/exporterUrl.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/exporterUrl.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (profile, exporterKey) { +module.exports = function(profile, exporterKey) { let url = window.baseUrl + '/api/qualityprofiles/export'; url += '?language=' + encodeURIComponent(profile.language); url += '&name=' + encodeURIComponent(profile.name); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/fileFromPath.js b/server/sonar-web/src/main/js/helpers/handlebars/fileFromPath.js index 0380a1ab091..cbd67c58103 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/fileFromPath.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/fileFromPath.js @@ -19,6 +19,6 @@ */ import { fileFromPath } from '../path'; -module.exports = function (path) { +module.exports = function(path) { return fileFromPath(path); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/formatFacetValue.js b/server/sonar-web/src/main/js/helpers/handlebars/formatFacetValue.js index 4358c116440..13ab82b9342 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/formatFacetValue.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/formatFacetValue.js @@ -19,8 +19,7 @@ */ import { formatMeasure } from '../measures'; -module.exports = function (value, facetMode) { +module.exports = function(value, facetMode) { const formatter = facetMode === 'effort' ? 'SHORT_WORK_DUR' : 'SHORT_INT'; return formatMeasure(value, formatter); }; - diff --git a/server/sonar-web/src/main/js/helpers/handlebars/formatMeasure.js b/server/sonar-web/src/main/js/helpers/handlebars/formatMeasure.js index 7c793c4818f..2d0c4f75a3a 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/formatMeasure.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/formatMeasure.js @@ -19,6 +19,6 @@ */ import { formatMeasure } from '../measures'; -module.exports = function (measure, type) { +module.exports = function(measure, type) { return formatMeasure(measure, type); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/formatMeasureVariation.js b/server/sonar-web/src/main/js/helpers/handlebars/formatMeasureVariation.js index 4691729bc14..0f7268b8d45 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/formatMeasureVariation.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/formatMeasureVariation.js @@ -19,6 +19,6 @@ */ import { formatMeasureVariation } from '../measures'; -module.exports = function (measure, type) { +module.exports = function(measure, type) { return formatMeasureVariation(measure, type); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/fromNow.js b/server/sonar-web/src/main/js/helpers/handlebars/fromNow.js index dc2f302ad0a..5d4fc596ef5 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/fromNow.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/fromNow.js @@ -19,6 +19,6 @@ */ import moment from 'moment'; -module.exports = function (date) { +module.exports = function(date) { return moment(date).fromNow(); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/gt.js b/server/sonar-web/src/main/js/helpers/handlebars/gt.js index 7b8ab5ce735..b080892436d 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/gt.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/gt.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (v1, v2, options) { +module.exports = function(v1, v2, options) { return v1 > v2 ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ifLength.js b/server/sonar-web/src/main/js/helpers/handlebars/ifLength.js index 747ecd2a23a..df7578ac096 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifLength.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifLength.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (array, len, options) { +module.exports = function(array, len, options) { const cond = Array.isArray(array) && array.length === +len; return cond ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ifLengthGT.js b/server/sonar-web/src/main/js/helpers/handlebars/ifLengthGT.js index 840e34d71d4..79ee2daf7fc 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifLengthGT.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifLengthGT.js @@ -17,8 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (array, len, options) { - return Array.isArray(array) && array.length > len ? - options.fn(this) : - options.inverse(this); +module.exports = function(array, len, options) { + return Array.isArray(array) && array.length > len ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ifMeasureShouldBeShown.js b/server/sonar-web/src/main/js/helpers/handlebars/ifMeasureShouldBeShown.js index 76daf8434c8..ba482982a56 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifMeasureShouldBeShown.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifMeasureShouldBeShown.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (measure, period, options) { +module.exports = function(measure, period, options) { if (measure != null || period != null) { return options.fn(this); } else { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ifNotEmpty.js b/server/sonar-web/src/main/js/helpers/handlebars/ifNotEmpty.js index 868c2442f40..7cf02fd690e 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifNotEmpty.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifNotEmpty.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (...args) { +module.exports = function(...args) { const options = args[args.length - 1]; const list = args.slice(0, -1); const notEmpty = list.reduce((prev, current) => prev || (current && current.length > 0), false); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged.js b/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged.js index ac1b427f8e4..567966a17b1 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged.js @@ -17,13 +17,14 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (source, line, options) { +module.exports = function(source, line, options) { const currentLine = source.find(row => row.lineNumber === line); const prevLine = source.find(row => row.lineNumber === line - 1); let changed = true; if (currentLine && prevLine && currentLine.scm && prevLine.scm) { - changed = (currentLine.scm.author !== prevLine.scm.author) || - (currentLine.scm.date !== prevLine.scm.date) || (!prevLine.show); + changed = currentLine.scm.author !== prevLine.scm.author || + currentLine.scm.date !== prevLine.scm.date || + !prevLine.show; } return changed ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged2.js b/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged2.js index 1d8c0337576..7b43f90609a 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged2.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged2.js @@ -17,10 +17,11 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (currentLine, prevLine, options) { +module.exports = function(currentLine, prevLine, options) { let changed = true; if (currentLine && prevLine && currentLine.scmAuthor && prevLine.scmAuthor) { - changed = (currentLine.scmAuthor !== prevLine.scmAuthor) || (currentLine.scmDate !== prevLine.scmDate); + changed = currentLine.scmAuthor !== prevLine.scmAuthor || + currentLine.scmDate !== prevLine.scmDate; } return changed ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ifShowAvatars.js b/server/sonar-web/src/main/js/helpers/handlebars/ifShowAvatars.js index 9198d30b927..03afa92c69c 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifShowAvatars.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifShowAvatars.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -function enableGravatar () { +function enableGravatar() { const getStore = require('../../app/utils/getStore').default; const { getSettingValue } = require('../../store/rootReducer'); @@ -25,6 +25,6 @@ function enableGravatar () { return (getSettingValue(store.getState(), 'sonar.lf.enableGravatar') || {}).value === 'true'; } -module.exports = function (options) { +module.exports = function(options) { return enableGravatar() ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ifTestData.js b/server/sonar-web/src/main/js/helpers/handlebars/ifTestData.js index 037472c7453..3890484400a 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifTestData.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifTestData.js @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (test, options) { - if ((test.status !== 'OK') || ((test.status === 'OK') && test.coveredLines)) { +module.exports = function(test, options) { + if (test.status !== 'OK' || (test.status === 'OK' && test.coveredLines)) { return options.fn(this); } else { return options.inverse(this); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/inArray.js b/server/sonar-web/src/main/js/helpers/handlebars/inArray.js index c6128384140..d27ee3bf395 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/inArray.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/inArray.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (array, element, options) { +module.exports = function(array, element, options) { if (Array.isArray(array) && array.indexOf(element) !== -1) { return options.fn(this); } else { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/isActiveLink.js b/server/sonar-web/src/main/js/helpers/handlebars/isActiveLink.js index 842178f8495..ece6ad7cbc7 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/isActiveLink.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/isActiveLink.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (...args) { +module.exports = function(...args) { const options = args[args.length - 1]; const list = args.slice(0, -1); const prefix = list.join(''); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/isNull.js b/server/sonar-web/src/main/js/helpers/handlebars/isNull.js index 83c2b86faa5..7f5de187317 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/isNull.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/isNull.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (value, options) { +module.exports = function(value, options) { return value == null ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/issueFilterHomeLink.js b/server/sonar-web/src/main/js/helpers/handlebars/issueFilterHomeLink.js index f36ab04e62a..c65b1c7a8d0 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/issueFilterHomeLink.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/issueFilterHomeLink.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (id) { +module.exports = function(id) { return window.baseUrl + '/issues/search#id=' + id; }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/issueFilterValue.js b/server/sonar-web/src/main/js/helpers/handlebars/issueFilterValue.js index ee96ae190e5..4752108a788 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/issueFilterValue.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/issueFilterValue.js @@ -19,7 +19,7 @@ */ import { formatMeasure } from '../measures'; -module.exports = function (value, mode) { +module.exports = function(value, mode) { const formatter = mode === 'effort' ? 'SHORT_WORK_DUR' : 'SHORT_INT'; return formatMeasure(value, formatter); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/issueType.js b/server/sonar-web/src/main/js/helpers/handlebars/issueType.js index 9e7cf60f558..e1e5f96fc2a 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/issueType.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/issueType.js @@ -19,6 +19,6 @@ */ import { translate } from '../../helpers/l10n'; -module.exports = function (issueType) { +module.exports = function(issueType) { return translate('issue.type', issueType); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/issueTypeIcon.js b/server/sonar-web/src/main/js/helpers/handlebars/issueTypeIcon.js index 90df8808442..d7c4d6a7fc6 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/issueTypeIcon.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/issueTypeIcon.js @@ -21,22 +21,22 @@ import Handlebars from 'handlebars/runtime'; /* eslint-disable max-len */ const bug = new Handlebars.default.SafeString( - `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> + `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> <path style="fill:currentColor" d="M11 9h1.3l.5.8.8-.5-.8-1.3H11v-.3l2-2.3V3h-1v2l-1 1.2V5c-.1-.8-.7-1.5-1.4-1.9L11 1.8l-.7-.7-1.8 1.6-1.8-1.6-.7.7 1.5 1.3C6.7 3.5 6.1 4.2 6 5v1.1L5 5V3H4v2.3l2 2.3V8H4.2l-.7 1.2.8.5.4-.7H6v.3l-2 1.9V14h1v-2.4l1-1C6 12 7.1 13 8.4 13h.8c.7 0 1.4-.3 1.8-.9.3-.4.3-.9.2-1.4l.9.9V14h1v-2.8l-2-1.9V9zm-2 2H8V6h1v5z"/> </svg>` ); const vulnerability = new Handlebars.default.SafeString( - `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> + `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> <path style="fill:currentColor" d="M10.8 5H6V3.9a2.28 2.28 0 0 1 2-2.5 2.22 2.22 0 0 1 1.8 1.2.48.48 0 0 0 .7.2.48.48 0 0 0 .2-.7A3 3 0 0 0 8 .4a3.34 3.34 0 0 0-3 3.5v1.2a2.16 2.16 0 0 0-2 2.1v4.4a2.22 2.22 0 0 0 2.2 2.2h5.6a2.22 2.22 0 0 0 2.2-2.2V7.2A2.22 2.22 0 0 0 10.8 5zm-2.2 5.5v1.2H7.4v-1.2a1.66 1.66 0 0 1-1.1-1.6A1.75 1.75 0 0 1 8 7.2a1.71 1.71 0 0 1 .6 3.3z"/> </svg>` ); const codeSmell = new Handlebars.default.SafeString( - `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> + `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> <path style="fill:currentColor" d="M8 2C4.7 2 2 4.7 2 8s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zm-.5 5.5h.9v.9h-.9v-.9zm-3.8.2c-.1 0-.2-.1-.2-.2 0-.4.1-1.2.6-2S5.3 4.2 5.6 4c.2 0 .3 0 .3.1l1.3 2.3c0 .1 0 .2-.1.2-.1.2-.2.3-.3.5-.1.2-.2.4-.2.5 0 .1-.1.2-.2.2l-2.7-.1zM9.9 12c-.3.2-1.1.5-2 .5-.9 0-1.7-.3-2-.5-.1 0-.1-.2-.1-.3l1.3-2.3c0-.1.1-.1.2-.1.2.1.3.1.5.1s.4 0 .5-.1c.1 0 .2 0 .2.1l1.3 2.3c.2.2.2.3.1.3zm2.5-4.1L9.7 8c-.1 0-.2-.1-.2-.2 0-.2-.1-.4-.2-.5 0-.1-.2-.3-.3-.4-.1 0-.1-.1-.1-.2l1.3-2.3c.1-.1.2-.1.3-.1.3.2 1 .7 1.5 1.5s.6 1.6.6 2c0 0-.1.1-.2.1z"/> </svg>` ); -module.exports = function (type) { +module.exports = function(type) { switch (type) { case 'BUG': return bug; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/join.js b/server/sonar-web/src/main/js/helpers/handlebars/join.js index 6f9d4b8124d..b28e2eeb3c1 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/join.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/join.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (array, separator) { +module.exports = function(array, separator) { return array.join(separator); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/joinEach.js b/server/sonar-web/src/main/js/helpers/handlebars/joinEach.js index 9d6c2437779..5503875561d 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/joinEach.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/joinEach.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (array, separator, options) { +module.exports = function(array, separator, options) { let ret = ''; if (array && array.length > 0) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/length.js b/server/sonar-web/src/main/js/helpers/handlebars/length.js index 45292c99899..e35510f5a5d 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/length.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/length.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (array) { +module.exports = function(array) { return Array.isArray(array) ? array.length : null; }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/limitString.js b/server/sonar-web/src/main/js/helpers/handlebars/limitString.js index 13d1bffc584..ec131d1c76b 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/limitString.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/limitString.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (str) { +module.exports = function(str) { if (typeof str === 'string') { const LIMIT = 30; return str.length > LIMIT ? str.substr(0, LIMIT) + '...' : str; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/link.js b/server/sonar-web/src/main/js/helpers/handlebars/link.js index db88bdaed9d..e1b6306245b 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/link.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/link.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (...args) { +module.exports = function(...args) { return window.baseUrl + args.slice(0, -1).join(''); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/log.js b/server/sonar-web/src/main/js/helpers/handlebars/log.js index b552a6ba5c5..aaaa9f39c39 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/log.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/log.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (...args) { +module.exports = function(...args) { /* eslint no-console: 0 */ console.log(...args.slice(0, -1)); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/lt.js b/server/sonar-web/src/main/js/helpers/handlebars/lt.js index 02166a34062..2aa609a9ee5 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/lt.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/lt.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (v1, v2, options) { +module.exports = function(v1, v2, options) { return v1 < v2 ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/notEmpty.js b/server/sonar-web/src/main/js/helpers/handlebars/notEmpty.js index 45417e52e04..e7140005ceb 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/notEmpty.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/notEmpty.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (array, options) { +module.exports = function(array, options) { const cond = Array.isArray(array) && array.length > 0; return cond ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/notEq.js b/server/sonar-web/src/main/js/helpers/handlebars/notEq.js index e4d4e1ea6d2..18e0be28841 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/notEq.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/notEq.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (v1, v2, options) { +module.exports = function(v1, v2, options) { /* eslint eqeqeq: 0 */ return v1 != v2 ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/notEqComponents.js b/server/sonar-web/src/main/js/helpers/handlebars/notEqComponents.js index 849135fa4c8..34759858286 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/notEqComponents.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/notEqComponents.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (a, b, options) { - const notEq = a && b && ((a.project !== b.project) || (a.subProject !== b.subProject)); +module.exports = function(a, b, options) { + const notEq = a && b && (a.project !== b.project || a.subProject !== b.subProject); return notEq ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/notNull.js b/server/sonar-web/src/main/js/helpers/handlebars/notNull.js index 7731cd09136..9aa3f2b343c 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/notNull.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/notNull.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (value, options) { +module.exports = function(value, options) { return value != null ? options.fn(this) : options.inverse(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/numberShort.js b/server/sonar-web/src/main/js/helpers/handlebars/numberShort.js index 20d1233eb01..c2a86b8a93c 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/numberShort.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/numberShort.js @@ -19,7 +19,7 @@ */ import numeral from 'numeral'; -module.exports = function (number) { +module.exports = function(number) { let format = '0,0'; if (number >= 10000) { format = '0.[0]a'; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/operators.js b/server/sonar-web/src/main/js/helpers/handlebars/operators.js index d18ffbdfcc1..67b12e35717 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/operators.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/operators.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (options) { +module.exports = function(options) { const ops = ['LT', 'GT', 'EQ', 'NE']; return ops.reduce((prev, current) => prev + options.fn(current), ''); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/parameterChangelog.js b/server/sonar-web/src/main/js/helpers/handlebars/parameterChangelog.js index 75902a3a5b5..0f945dfd629 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/parameterChangelog.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/parameterChangelog.js @@ -20,14 +20,17 @@ import Handlebars from 'handlebars/runtime'; import { translateWithParameters } from '../l10n'; -module.exports = function (value, parameter) { +module.exports = function(value, parameter) { if (parameter) { return new Handlebars.default.SafeString( - translateWithParameters('quality_profiles.parameter_set_to_x', value, parameter) + translateWithParameters('quality_profiles.parameter_set_to_x', value, parameter) ); } else { return new Handlebars.default.SafeString( - translateWithParameters('quality_profiles.changelog.parameter_reset_to_default_value_x', parameter) + translateWithParameters( + 'quality_profiles.changelog.parameter_reset_to_default_value_x', + parameter + ) ); } }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/percent.js b/server/sonar-web/src/main/js/helpers/handlebars/percent.js index f71a9d51d05..5e3e06fb38d 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/percent.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/percent.js @@ -17,9 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (value, total) { +module.exports = function(value, total) { if (total > 0) { - return '' + ((value || 0) / total * 100) + '%'; + return '' + (value || 0) / total * 100 + '%'; } else { return '0%'; } diff --git a/server/sonar-web/src/main/js/helpers/handlebars/profileUrl.js b/server/sonar-web/src/main/js/helpers/handlebars/profileUrl.js index b5531416162..dab5f850fc2 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/profileUrl.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/profileUrl.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (key) { +module.exports = function(key) { return window.baseUrl + '/profiles/show?key=' + encodeURIComponent(key); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/projectFullName.js b/server/sonar-web/src/main/js/helpers/handlebars/projectFullName.js index 6e5d356f633..e92aa71d550 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/projectFullName.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/projectFullName.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (component) { - return component.projectName + (component.subProjectName ? (' / ' + component.subProjectName) : ''); +module.exports = function(component) { + return component.projectName + (component.subProjectName ? ' / ' + component.subProjectName : ''); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/qualifierIcon.js b/server/sonar-web/src/main/js/helpers/handlebars/qualifierIcon.js index 44117345c22..4a4f3420a95 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/qualifierIcon.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/qualifierIcon.js @@ -19,8 +19,8 @@ */ import Handlebars from 'handlebars/runtime'; -module.exports = function (qualifier) { +module.exports = function(qualifier) { return new Handlebars.default.SafeString( - qualifier ? `<i class="icon-qualifier-${qualifier.toLowerCase()}"></i>` : '' + qualifier ? `<i class="icon-qualifier-${qualifier.toLowerCase()}"></i>` : '' ); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/recursive.js b/server/sonar-web/src/main/js/helpers/handlebars/recursive.js index 1064215671c..415e9cebcd0 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/recursive.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/recursive.js @@ -19,7 +19,7 @@ */ let audaciousFn; -module.exports = function (children, options) { +module.exports = function(children, options) { let out = ''; if (options.fn !== undefined) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/repeat.js b/server/sonar-web/src/main/js/helpers/handlebars/repeat.js index 18cb23cac20..a42b736b326 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/repeat.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/repeat.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (number, options) { +module.exports = function(number, options) { let ret = ''; for (let i = 0; i < number; i++) { ret += options.fn(this); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/rulePermalink.js b/server/sonar-web/src/main/js/helpers/handlebars/rulePermalink.js index af903f2bdb0..e338339a804 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/rulePermalink.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/rulePermalink.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (ruleKey) { +module.exports = function(ruleKey) { return window.baseUrl + '/coding_rules#rule_key=' + encodeURIComponent(ruleKey); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/severityChangelog.js b/server/sonar-web/src/main/js/helpers/handlebars/severityChangelog.js index e5747acc20f..e57fccf19be 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/severityChangelog.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/severityChangelog.js @@ -20,7 +20,7 @@ import Handlebars from 'handlebars/runtime'; import { translate, translateWithParameters } from '../../helpers/l10n'; -module.exports = function (severity) { +module.exports = function(severity) { const label = `<i class="icon-severity-${severity.toLowerCase()}"></i> ${translate('severity', severity)}`; const message = translateWithParameters('quality_profiles.severity_set_to_x', label); return new Handlebars.default.SafeString(message); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/severityHelper.js b/server/sonar-web/src/main/js/helpers/handlebars/severityHelper.js index 29ed26a53f7..823d68becfa 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/severityHelper.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/severityHelper.js @@ -20,8 +20,8 @@ import Handlebars from 'handlebars/runtime'; import { translate } from '../../helpers/l10n'; -module.exports = function (severity) { +module.exports = function(severity) { return new Handlebars.default.SafeString( - `<i class="icon-severity-${severity.toLowerCase()}"></i> ${translate('severity', severity)}` + `<i class="icon-severity-${severity.toLowerCase()}"></i> ${translate('severity', severity)}` ); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/severityIcon.js b/server/sonar-web/src/main/js/helpers/handlebars/severityIcon.js index 07c765b6fd3..3304bbbc995 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/severityIcon.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/severityIcon.js @@ -19,8 +19,8 @@ */ import Handlebars from 'handlebars/runtime'; -module.exports = function (severity) { +module.exports = function(severity) { return new Handlebars.default.SafeString( - `<i class="icon-severity-${severity.toLowerCase()}"></i>` + `<i class="icon-severity-${severity.toLowerCase()}"></i>` ); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/show.js b/server/sonar-web/src/main/js/helpers/handlebars/show.js index 98295ceecab..886eb58bab1 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/show.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/show.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (...args) { +module.exports = function(...args) { let ret = null; args.forEach(arg => { if (typeof arg === 'string' && ret == null) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/statusHelper.js b/server/sonar-web/src/main/js/helpers/handlebars/statusHelper.js index 3a083162b08..69abb0af95b 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/statusHelper.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/statusHelper.js @@ -20,7 +20,7 @@ import Handlebars from 'handlebars/runtime'; import { translate } from '../../helpers/l10n'; -module.exports = function (status, resolution) { +module.exports = function(status, resolution) { let s = `<i class="icon-status-${status.toLowerCase()}"></i> ${translate('issue.status', status)}`; if (resolution != null) { s = s + ' (' + translate('issue.resolution', resolution) + ')'; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/statusIcon.js b/server/sonar-web/src/main/js/helpers/handlebars/statusIcon.js index ef2f35b0672..4d90492d251 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/statusIcon.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/statusIcon.js @@ -19,8 +19,6 @@ */ import Handlebars from 'handlebars/runtime'; -module.exports = function (status) { - return new Handlebars.default.SafeString( - `<i class="icon-status-${status.toLowerCase()}"></i>` - ); +module.exports = function(status) { + return new Handlebars.default.SafeString(`<i class="icon-status-${status.toLowerCase()}"></i>`); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/sum.js b/server/sonar-web/src/main/js/helpers/handlebars/sum.js index b64a222cc70..5136e03dd13 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/sum.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/sum.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (...args) { +module.exports = function(...args) { const list = args.slice(0, -1); return list.reduce((p, c) => p + +c, 0); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/t.js b/server/sonar-web/src/main/js/helpers/handlebars/t.js index 2392dafc046..d55d8176234 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/t.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/t.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function () { +module.exports = function() { const args = Array.prototype.slice.call(arguments, 0, -1); return window.t.apply(this, args); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/testStatusIcon.js b/server/sonar-web/src/main/js/helpers/handlebars/testStatusIcon.js index 6fb6b6ab9ea..58e82193a42 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/testStatusIcon.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/testStatusIcon.js @@ -19,8 +19,8 @@ */ import Handlebars from 'handlebars/runtime'; -module.exports = function (status) { +module.exports = function(status) { return new Handlebars.default.SafeString( - `<i class="icon-test-status-${status.toLowerCase()}"></i>` + `<i class="icon-test-status-${status.toLowerCase()}"></i>` ); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/testStatusIconClass.js b/server/sonar-web/src/main/js/helpers/handlebars/testStatusIconClass.js index 88f2f2b0a86..e5718e2c22a 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/testStatusIconClass.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/testStatusIconClass.js @@ -19,7 +19,6 @@ */ import Handlebars from 'handlebars/runtime'; -module.exports = function (status) { - return new Handlebars.default.SafeString(`icon-test-status-${status.toLowerCase()}` - ); +module.exports = function(status) { + return new Handlebars.default.SafeString(`icon-test-status-${status.toLowerCase()}`); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/tp.js b/server/sonar-web/src/main/js/helpers/handlebars/tp.js index f54ed3752ad..f3018e23830 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/tp.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/tp.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function () { +module.exports = function() { const args = Array.prototype.slice.call(arguments, 0, -1); return window.tp.apply(this, args); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/unlessLength.js b/server/sonar-web/src/main/js/helpers/handlebars/unlessLength.js index fc0106e2e8c..95c78a4579b 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/unlessLength.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/unlessLength.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (array, len, options) { +module.exports = function(array, len, options) { const cond = Array.isArray(array) && array.length === +len; return cond ? options.inverse(this) : options.fn(this); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/withFirst.js b/server/sonar-web/src/main/js/helpers/handlebars/withFirst.js index 53e64522098..eb3f52d7e9d 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/withFirst.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/withFirst.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (list, options) { +module.exports = function(list, options) { if (list && list.length > 0) { return options.fn(list[0]); } else { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/withLast.js b/server/sonar-web/src/main/js/helpers/handlebars/withLast.js index df9be847002..bf92fbb7a00 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/withLast.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/withLast.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (list, options) { +module.exports = function(list, options) { if (list && list.length > 0) { return options.fn(list[list.length - 1]); } else { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/withSign.js b/server/sonar-web/src/main/js/helpers/handlebars/withSign.js index cbf9cf8cabb..14511125837 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/withSign.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/withSign.js @@ -17,6 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (number) { +module.exports = function(number) { return number >= 0 ? '+' + number : '' + number; }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/withoutFirst.js b/server/sonar-web/src/main/js/helpers/handlebars/withoutFirst.js index e7d63350446..24e0af2c5cb 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/withoutFirst.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/withoutFirst.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (list, options) { +module.exports = function(list, options) { if (list && list.length > 1) { return list.slice(1).reduce((prev, current) => prev + options.fn(current), ''); } else { |