diff options
author | Stas Vilchik <stas-vilchik@users.noreply.github.com> | 2017-04-20 11:10:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-20 11:10:13 +0200 |
commit | f6e90fdc19e222b3b238f0f5995a8039b7db158e (patch) | |
tree | 69c22415cb50a650b046ce4b9a9ac99e57695dfd /server/sonar-web/src/main/js/helpers | |
parent | 36c9fa041018d7eed91f1d22e0c5eda075737ebc (diff) | |
download | sonarqube-f6e90fdc19e222b3b238f0f5995a8039b7db158e.tar.gz sonarqube-f6e90fdc19e222b3b238f0f5995a8039b7db158e.zip |
upgrade prettier (#1954)
Diffstat (limited to 'server/sonar-web/src/main/js/helpers')
7 files changed, 24 insertions, 23 deletions
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 4dd7a7d2f5a..04c87058262 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/default.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/default.js @@ -19,5 +19,5 @@ */ module.exports = function(...args) { const list = args.slice(0, -1); - return list.reduce((prev, current) => prev != null ? prev : current, null); + return list.reduce((prev, current) => (prev != null ? prev : current), null); }; 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 567966a17b1..c461b7bb672 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged.js @@ -22,7 +22,8 @@ module.exports = function(source, line, options) { 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 || + changed = + currentLine.scm.author !== prevLine.scm.author || currentLine.scm.date !== prevLine.scm.date || !prevLine.show; } 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 7b43f90609a..b25a1a27550 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged2.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifSCMChanged2.js @@ -20,8 +20,8 @@ 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/severityChangelog.js b/server/sonar-web/src/main/js/helpers/handlebars/severityChangelog.js index 8cc4a8b6980..02d67f35097 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/severityChangelog.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/severityChangelog.js @@ -21,7 +21,8 @@ import Handlebars from 'handlebars/runtime'; import { translate, translateWithParameters } from '../../helpers/l10n'; module.exports = function(severity) { - const label = `<i class="icon-severity-${severity.toLowerCase()}"></i>` + + 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/statusHelper.js b/server/sonar-web/src/main/js/helpers/handlebars/statusHelper.js index 7de025a8701..5201239f86b 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/statusHelper.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/statusHelper.js @@ -21,7 +21,8 @@ import Handlebars from 'handlebars/runtime'; import { translate } from '../../helpers/l10n'; module.exports = function(status, resolution) { - let s = `<i class="icon-status-${status.toLowerCase()}"></i>` + + 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/l10n.js b/server/sonar-web/src/main/js/helpers/l10n.js index 08832e67dd7..74a35b57f60 100644 --- a/server/sonar-web/src/main/js/helpers/l10n.js +++ b/server/sonar-web/src/main/js/helpers/l10n.js @@ -58,7 +58,8 @@ function makeRequest(params) { case 304: return JSON.parse(localStorage.getItem('l10n.bundle') || '{}'); case 401: - window.location = window.baseUrl + + window.location = + window.baseUrl + '/sessions/new?return_to=' + encodeURIComponent( window.location.pathname + window.location.search + window.location.hash diff --git a/server/sonar-web/src/main/js/helpers/scrolling.js b/server/sonar-web/src/main/js/helpers/scrolling.js index e0ee20ab024..60b89079ad5 100644 --- a/server/sonar-web/src/main/js/helpers/scrolling.js +++ b/server/sonar-web/src/main/js/helpers/scrolling.js @@ -42,24 +42,21 @@ let smoothScrollTop = (y: number, parent) => { const step = Math.ceil(Math.abs(y - scrollTop) / SCROLLING_STEPS); let stepsDone = 0; - const interval = setInterval( - () => { - const scrollTop = getScrollPosition(parent); - if (scrollTop === y || SCROLLING_STEPS === stepsDone) { - clearInterval(interval); + const interval = setInterval(() => { + const scrollTop = getScrollPosition(parent); + if (scrollTop === y || SCROLLING_STEPS === stepsDone) { + clearInterval(interval); + } else { + let goal; + if (scrollingDown) { + goal = Math.min(y, scrollTop + step); } else { - let goal; - if (scrollingDown) { - goal = Math.min(y, scrollTop + step); - } else { - goal = Math.max(y, scrollTop - step); - } - stepsDone++; - scrollElement(parent, goal); + goal = Math.max(y, scrollTop - step); } - }, - SCROLLING_INTERVAL - ); + stepsDone++; + scrollElement(parent, goal); + } + }, SCROLLING_INTERVAL); }; smoothScrollTop = debounce(smoothScrollTop, SCROLLING_DURATION, { leading: true }); |