diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-12-08 16:48:52 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-12-08 16:48:52 +0100 |
commit | 201847de4d282acafd5fb8c969f077d713d1bdf1 (patch) | |
tree | 2ee51f526ed63d2620a7b8faef8fac69b74da0fc | |
parent | 34b14e12bebafed93d21ac620e7b2b5dc3ef7d55 (diff) | |
download | sonarqube-201847de4d282acafd5fb8c969f077d713d1bdf1.tar.gz sonarqube-201847de4d282acafd5fb8c969f077d713d1bdf1.zip |
improve code quality
106 files changed, 697 insertions, 719 deletions
diff --git a/server/sonar-web/.eslintrc b/server/sonar-web/.eslintrc index a063471955c..19e2098c50f 100644 --- a/server/sonar-web/.eslintrc +++ b/server/sonar-web/.eslintrc @@ -32,7 +32,30 @@ ], "rules": { - "quotes": [2, "single", "avoid-escape"], + "arrow-spacing": 1, + "comma-spacing": [1, { "before": false, "after": true }], + "curly": 2, + "eol-last": 1, + "eqeqeq": [2, "smart"], + "indent": [1, 2, { "SwitchCase": 1, "VariableDeclarator": 2 }], + "jsx-quotes": 1, + "key-spacing": [1, { "beforeColon": false, "afterColon": true }], + "no-multi-spaces": 1, + "no-self-compare": 2, + "no-unexpected-multiline": 2, + "max-len": [1, 120, 2], + "no-const-assign": 2, + "no-multiple-empty-lines": [1, { "max": 3 }], + "no-spaced-func": 1, + "no-this-before-super": 2, + "no-trailing-spaces": 1, + "no-unneeded-ternary": 1, + "object-curly-spacing": [1, "always"], + "one-var": [1, { "let": "never", "const": "never" }], + "quotes": [1, "single", "avoid-escape"], + "prefer-const": 0, + "semi": [1, "always"], + "space-after-keywords": [1, "always"], "react/jsx-closing-bracket-location": [1, "after-props"], "react/jsx-handler-names": 0, diff --git a/server/sonar-web/src/main/js/api/ce.js b/server/sonar-web/src/main/js/api/ce.js index edabd6e9ea7..c33cd819404 100644 --- a/server/sonar-web/src/main/js/api/ce.js +++ b/server/sonar-web/src/main/js/api/ce.js @@ -1,32 +1,32 @@ import $ from 'jquery'; export function getQueue (data) { - let url = baseUrl + '/api/ce/queue'; + const url = baseUrl + '/api/ce/queue'; return $.get(url, data); } export function getActivity (data) { - let url = baseUrl + '/api/ce/activity'; + const url = baseUrl + '/api/ce/activity'; return $.get(url, data); } export function getTask (id) { - let url = baseUrl + '/api/ce/task'; + const url = baseUrl + '/api/ce/task'; return $.get(url, { id }); } export function cancelTask (id) { - let url = baseUrl + '/api/ce/cancel'; + const url = baseUrl + '/api/ce/cancel'; return $.post(url, { id }).then(getTask.bind(null, id)); } export function cancelAllTasks () { - let url = baseUrl + '/api/ce/cancel_all'; + const url = baseUrl + '/api/ce/cancel_all'; return $.post(url); } export function getTasksForComponent(componentId) { - let url = baseUrl + '/api/ce/component'; - let data = { componentId }; + const url = baseUrl + '/api/ce/component'; + const data = { componentId }; return new Promise((resolve) => $.get(url, data).done(resolve)); } diff --git a/server/sonar-web/src/main/js/api/components.js b/server/sonar-web/src/main/js/api/components.js index e4f60f8110b..7b319dd0fe7 100644 --- a/server/sonar-web/src/main/js/api/components.js +++ b/server/sonar-web/src/main/js/api/components.js @@ -2,33 +2,33 @@ import { getJSON, postJSON, post } from '../helpers/request.js'; export function getComponents (data) { - let url = baseUrl + '/api/components/search'; + const url = baseUrl + '/api/components/search'; return getJSON(url, data); } export function getProvisioned (data) { - let url = baseUrl + '/api/projects/provisioned'; + const url = baseUrl + '/api/projects/provisioned'; return getJSON(url, data); } export function getGhosts (data) { - let url = baseUrl + '/api/projects/ghosts'; + const url = baseUrl + '/api/projects/ghosts'; return getJSON(url, data); } export function deleteComponents (data) { - let url = baseUrl + '/api/projects/bulk_delete'; + const url = baseUrl + '/api/projects/bulk_delete'; return post(url, data); } export function createProject (data) { - let url = baseUrl + '/api/projects/create'; + const url = baseUrl + '/api/projects/create'; return postJSON(url, data); } export function getChildren (componentKey, metrics = []) { - let url = baseUrl + '/api/resources/index'; - let data = { resource: componentKey, metrics: metrics.join(','), depth: 1 }; + const url = baseUrl + '/api/resources/index'; + const data = { resource: componentKey, metrics: metrics.join(','), depth: 1 }; return getJSON(url, data); } @@ -37,8 +37,8 @@ export function getFiles (componentKey, metrics = []) { // in this case the WS does not return measures // so the filtering by a qualifier is done manually - let url = baseUrl + '/api/resources/index'; - let data = { resource: componentKey, metrics: metrics.join(','), depth: -1 }; + const url = baseUrl + '/api/resources/index'; + const data = { resource: componentKey, metrics: metrics.join(','), depth: -1 }; return getJSON(url, data).then(r => { return r.filter(component => component.qualifier === 'FIL'); }); diff --git a/server/sonar-web/src/main/js/api/events.js b/server/sonar-web/src/main/js/api/events.js index 23c15b9c9ee..20eb0054d91 100644 --- a/server/sonar-web/src/main/js/api/events.js +++ b/server/sonar-web/src/main/js/api/events.js @@ -8,8 +8,8 @@ import { getJSON } from '../helpers/request.js'; * @returns {Promise} */ export function getEvents (componentKey, categories) { - let url = baseUrl + '/api/events'; - let data = { resource: componentKey }; + const url = baseUrl + '/api/events'; + const data = { resource: componentKey }; if (categories) { data.categories = categories; } diff --git a/server/sonar-web/src/main/js/api/issues.js b/server/sonar-web/src/main/js/api/issues.js index 07b7d1e836a..106b20903b3 100644 --- a/server/sonar-web/src/main/js/api/issues.js +++ b/server/sonar-web/src/main/js/api/issues.js @@ -4,8 +4,8 @@ import { getJSON } from '../helpers/request.js'; export function getFacets (query, facets) { - let url = baseUrl + '/api/issues/search'; - let data = _.extend({}, query, { facets: facets.join(), ps: 1, additionalFields: '_all' }); + const url = baseUrl + '/api/issues/search'; + const data = _.extend({}, query, { facets: facets.join(), ps: 1, additionalFields: '_all' }); return getJSON(url, data).then(r => { return { facets: r.facets, response: r }; }); @@ -31,7 +31,7 @@ export function getTags (query) { export function extractAssignees (facet, response) { return facet.map(item => { - let user = _.findWhere(response.users, { login: item.val }); + const user = _.findWhere(response.users, { login: item.val }); return _.extend(item, { user }); }); } @@ -43,8 +43,8 @@ export function getAssignees (query) { export function getIssuesCount (query) { - let url = baseUrl + '/api/issues/search'; - let data = _.extend({}, query, { ps: 1, facetMode: 'debt' }); + const url = baseUrl + '/api/issues/search'; + const data = _.extend({}, query, { ps: 1, facetMode: 'debt' }); return getJSON(url, data).then(r => { return { issues: r.total, debt: r.debtTotal }; }); diff --git a/server/sonar-web/src/main/js/api/languages.js b/server/sonar-web/src/main/js/api/languages.js index 49b32957b73..5932cf00b3f 100644 --- a/server/sonar-web/src/main/js/api/languages.js +++ b/server/sonar-web/src/main/js/api/languages.js @@ -1,6 +1,6 @@ import { getJSON } from '../helpers/request.js'; export function getLanguages () { - let url = baseUrl + '/api/languages/list'; + const url = baseUrl + '/api/languages/list'; return getJSON(url).then(r => r.languages); } diff --git a/server/sonar-web/src/main/js/api/measures.js b/server/sonar-web/src/main/js/api/measures.js index 0916c4998c1..aeb33eb0ca9 100644 --- a/server/sonar-web/src/main/js/api/measures.js +++ b/server/sonar-web/src/main/js/api/measures.js @@ -2,11 +2,11 @@ import { getJSON } from '../helpers/request.js'; export function getMeasures (componentKey, metrics) { - let url = baseUrl + '/api/resources/index'; - let data = { resource: componentKey, metrics: metrics.join(',') }; + const url = baseUrl + '/api/resources/index'; + const data = { resource: componentKey, metrics: metrics.join(',') }; return getJSON(url, data).then(r => { - let msr = r[0].msr || []; - let measures = {}; + const msr = r[0].msr || []; + const measures = {}; msr.forEach(measure => { measures[measure.key] = measure.val || measure.data; }); @@ -16,11 +16,11 @@ export function getMeasures (componentKey, metrics) { export function getMeasuresAndVariations (componentKey, metrics) { - let url = baseUrl + '/api/resources/index'; - let data = { resource: componentKey, metrics: metrics.join(','), includetrends: 'true' }; + const url = baseUrl + '/api/resources/index'; + const data = { resource: componentKey, metrics: metrics.join(','), includetrends: 'true' }; return getJSON(url, data).then(r => { - let msr = r[0].msr || []; - let measures = {}; + const msr = r[0].msr || []; + const measures = {}; msr.forEach(measure => { measures[measure.key] = { value: measure.val != null ? measure.val : measure.data, diff --git a/server/sonar-web/src/main/js/api/metrics.js b/server/sonar-web/src/main/js/api/metrics.js index 9bb7cfb67ca..47583f6f4db 100644 --- a/server/sonar-web/src/main/js/api/metrics.js +++ b/server/sonar-web/src/main/js/api/metrics.js @@ -1,7 +1,7 @@ import { getJSON } from '../helpers/request.js'; export function getMetrics () { - let url = baseUrl + '/api/metrics/search'; - let data = { ps: 9999 }; + const url = baseUrl + '/api/metrics/search'; + const data = { ps: 9999 }; return getJSON(url, data).then(r => r.metrics); } diff --git a/server/sonar-web/src/main/js/api/nav.js b/server/sonar-web/src/main/js/api/nav.js index 61e7e75ce3f..03c79ab60cc 100644 --- a/server/sonar-web/src/main/js/api/nav.js +++ b/server/sonar-web/src/main/js/api/nav.js @@ -1,17 +1,17 @@ import { getJSON } from '../helpers/request.js'; export function getGlobalNavigation () { - let url = baseUrl + '/api/navigation/global'; + const url = baseUrl + '/api/navigation/global'; return getJSON(url); } export function getComponentNavigation (componentKey) { - let url = baseUrl + '/api/navigation/component'; - let data = { componentKey }; + const url = baseUrl + '/api/navigation/component'; + const data = { componentKey }; return getJSON(url, data); } export function getSettingsNavigation () { - let url = baseUrl + '/api/navigation/settings'; + const url = baseUrl + '/api/navigation/settings'; return getJSON(url); } diff --git a/server/sonar-web/src/main/js/api/permissions.js b/server/sonar-web/src/main/js/api/permissions.js index 626adfcfb3c..083b61838fa 100644 --- a/server/sonar-web/src/main/js/api/permissions.js +++ b/server/sonar-web/src/main/js/api/permissions.js @@ -15,7 +15,7 @@ function typeError (method, message) { export function getUsers (data) { - let url = buildUrl('/api/permissions/users'); + const url = buildUrl('/api/permissions/users'); return request({ type: 'GET', url: url, data: data }); } @@ -28,8 +28,8 @@ export function grantToUser (permission, user, project) { return typeError('grantToUser', 'please provide user login'); } - let url = buildUrl('/api/permissions/add_user'); - let data = { permission: permission, login: user }; + const url = buildUrl('/api/permissions/add_user'); + const data = { permission: permission, login: user }; if (project) { data.projectId = project; } @@ -45,8 +45,8 @@ export function revokeFromUser (permission, user, project) { return typeError('revokeFromUser', 'please provide user login'); } - let url = buildUrl('/api/permissions/remove_user'); - let data = { permission: permission, login: user }; + const url = buildUrl('/api/permissions/remove_user'); + const data = { permission: permission, login: user }; if (project) { data.projectId = project; } @@ -55,7 +55,7 @@ export function revokeFromUser (permission, user, project) { export function getGroups (data) { - let url = buildUrl('/api/permissions/groups'); + const url = buildUrl('/api/permissions/groups'); return request({ type: 'GET', url: url, data: data }); } @@ -68,8 +68,8 @@ export function grantToGroup (permission, group, project) { return typeError('grantToGroup', 'please provide group name'); } - let url = buildUrl('/api/permissions/add_group'); - let data = { permission: permission, groupName: group }; + const url = buildUrl('/api/permissions/add_group'); + const data = { permission: permission, groupName: group }; if (project) { data.projectId = project; } @@ -85,8 +85,8 @@ export function revokeFromGroup (permission, group, project) { return typeError('revokeFromGroup', 'please provide group name'); } - let url = buildUrl('/api/permissions/remove_group'); - let data = { permission: permission, groupName: group }; + const url = buildUrl('/api/permissions/remove_group'); + const data = { permission: permission, groupName: group }; if (project) { data.projectId = project; } @@ -95,8 +95,8 @@ export function revokeFromGroup (permission, group, project) { export function getPermissionTemplates (query) { - let url = buildUrl('/api/permissions/search_templates'); - let data = { }; + const url = buildUrl('/api/permissions/search_templates'); + const data = { }; if (query) { data.q = query; } @@ -105,18 +105,18 @@ export function getPermissionTemplates (query) { export function createPermissionTemplate (options) { - let url = buildUrl('/api/permissions/create_template'); + const url = buildUrl('/api/permissions/create_template'); return request(_.extend({ type: 'POST', url: url }, options)); } export function updatePermissionTemplate (options) { - let url = buildUrl('/api/permissions/update_template'); + const url = buildUrl('/api/permissions/update_template'); return request(_.extend({ type: 'POST', url: url }, options)); } export function deletePermissionTemplate (options) { - let url = buildUrl('/api/permissions/delete_template'); + const url = buildUrl('/api/permissions/delete_template'); return request(_.extend({ type: 'POST', url: url }, options)); } @@ -126,13 +126,13 @@ export function setDefaultPermissionTemplate (template, qualifier) { return typeError('setDefaultPermissionTemplate', 'please provide permission template ID'); } - let url = buildUrl('/api/permissions/set_default_template'); - let data = { templateId: template, qualifier }; + const url = buildUrl('/api/permissions/set_default_template'); + const data = { templateId: template, qualifier }; return request({ type: 'POST', url, data }); } export function applyTemplateToProject(options) { - let url = buildUrl('/api/permissions/apply_template'); + const url = buildUrl('/api/permissions/apply_template'); return request(_.extend({ type: 'POST', url: url }, options)); } diff --git a/server/sonar-web/src/main/js/api/system.js b/server/sonar-web/src/main/js/api/system.js index a1c3ca082ea..9ebf6aa5e6a 100644 --- a/server/sonar-web/src/main/js/api/system.js +++ b/server/sonar-web/src/main/js/api/system.js @@ -1,12 +1,12 @@ import { getJSON, post } from '../helpers/request'; export function setLogLevel (level) { - let url = window.baseUrl + '/api/system/change_log_level'; - let data = { level }; + const url = window.baseUrl + '/api/system/change_log_level'; + const data = { level }; return post(url, data); } export function getSystemInfo () { - let url = window.baseUrl + '/api/system/info'; + const url = window.baseUrl + '/api/system/info'; return getJSON(url); } diff --git a/server/sonar-web/src/main/js/api/time-machine.js b/server/sonar-web/src/main/js/api/time-machine.js index 200cfaafbad..5773c559b79 100644 --- a/server/sonar-web/src/main/js/api/time-machine.js +++ b/server/sonar-web/src/main/js/api/time-machine.js @@ -1,7 +1,7 @@ import { getJSON } from '../helpers/request.js'; export function getTimeMachineData (componentKey, metrics) { - let url = baseUrl + '/api/timemachine/index'; - let data = { resource: componentKey, metrics }; + const url = baseUrl + '/api/timemachine/index'; + const data = { resource: componentKey, metrics }; return getJSON(url, data); } diff --git a/server/sonar-web/src/main/js/api/user-tokens.js b/server/sonar-web/src/main/js/api/user-tokens.js index ca522f914b4..582d5f12df7 100644 --- a/server/sonar-web/src/main/js/api/user-tokens.js +++ b/server/sonar-web/src/main/js/api/user-tokens.js @@ -7,8 +7,8 @@ import { getJSON, postJSON, post } from '../helpers/request.js'; * @returns {Promise} */ export function getTokens (login) { - let url = baseUrl + '/api/user_tokens/search'; - let data = { login }; + const url = baseUrl + '/api/user_tokens/search'; + const data = { login }; return getJSON(url, data).then(r => r.userTokens); } @@ -20,8 +20,8 @@ export function getTokens (login) { * @returns {Promise} */ export function generateToken(userLogin, tokenName) { - let url = baseUrl + '/api/user_tokens/generate'; - let data = { login: userLogin, name: tokenName }; + const url = baseUrl + '/api/user_tokens/generate'; + const data = { login: userLogin, name: tokenName }; return postJSON(url, data); } @@ -33,7 +33,7 @@ export function generateToken(userLogin, tokenName) { * @returns {Promise} */ export function revokeToken(userLogin, tokenName) { - let url = baseUrl + '/api/user_tokens/revoke'; - let data = { login: userLogin, name: tokenName }; + const url = baseUrl + '/api/user_tokens/revoke'; + const data = { login: userLogin, name: tokenName }; return post(url, data); } diff --git a/server/sonar-web/src/main/js/api/users.js b/server/sonar-web/src/main/js/api/users.js index 90910dd0d95..a3e6f3e5d1b 100644 --- a/server/sonar-web/src/main/js/api/users.js +++ b/server/sonar-web/src/main/js/api/users.js @@ -1,6 +1,6 @@ import $ from 'jquery'; export function getCurrentUser () { - let url = baseUrl + '/api/users/current'; + const url = baseUrl + '/api/users/current'; return $.get(url); } diff --git a/server/sonar-web/src/main/js/apps/api-documentation/header-view.js b/server/sonar-web/src/main/js/apps/api-documentation/header-view.js index 4b270ebbeec..87b38112295 100644 --- a/server/sonar-web/src/main/js/apps/api-documentation/header-view.js +++ b/server/sonar-web/src/main/js/apps/api-documentation/header-view.js @@ -8,5 +8,3 @@ export default Marionette.ItemView.extend({ 'change': 'render' } }); - - diff --git a/server/sonar-web/src/main/js/apps/api-documentation/item-view.js b/server/sonar-web/src/main/js/apps/api-documentation/item-view.js index d55546e7e2b..8e410fd8a5b 100644 --- a/server/sonar-web/src/main/js/apps/api-documentation/item-view.js +++ b/server/sonar-web/src/main/js/apps/api-documentation/item-view.js @@ -49,5 +49,3 @@ export default Marionette.ItemView.extend({ this.$el.toggleClass('hidden', this.shouldBeHidden()); } }); - - diff --git a/server/sonar-web/src/main/js/apps/api-documentation/layout.js b/server/sonar-web/src/main/js/apps/api-documentation/layout.js index 88f40994d2c..bc7fb5f67bd 100644 --- a/server/sonar-web/src/main/js/apps/api-documentation/layout.js +++ b/server/sonar-web/src/main/js/apps/api-documentation/layout.js @@ -20,5 +20,3 @@ export default Marionette.LayoutView.extend({ this.$('.search-navigator-side').css({ top: top }).isolatedScroll(); } }); - - diff --git a/server/sonar-web/src/main/js/apps/api-documentation/list-view.js b/server/sonar-web/src/main/js/apps/api-documentation/list-view.js index 2360ebf707a..26df3833992 100644 --- a/server/sonar-web/src/main/js/apps/api-documentation/list-view.js +++ b/server/sonar-web/src/main/js/apps/api-documentation/list-view.js @@ -18,5 +18,3 @@ export default Marionette.CollectionView.extend({ this.render(); } }); - - diff --git a/server/sonar-web/src/main/js/apps/api-documentation/list.js b/server/sonar-web/src/main/js/apps/api-documentation/list.js index dcb5823f809..102fc71189f 100644 --- a/server/sonar-web/src/main/js/apps/api-documentation/list.js +++ b/server/sonar-web/src/main/js/apps/api-documentation/list.js @@ -20,5 +20,3 @@ export default Backbone.Collection.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/api-documentation/router.js b/server/sonar-web/src/main/js/apps/api-documentation/router.js index f84f4394d8c..3ecaab59036 100644 --- a/server/sonar-web/src/main/js/apps/api-documentation/router.js +++ b/server/sonar-web/src/main/js/apps/api-documentation/router.js @@ -13,5 +13,3 @@ export default Backbone.Router.extend({ this.app.controller.show(path); } }); - - diff --git a/server/sonar-web/src/main/js/apps/api-documentation/search-view.js b/server/sonar-web/src/main/js/apps/api-documentation/search-view.js index 737e909ca4a..6eb9efe74e4 100644 --- a/server/sonar-web/src/main/js/apps/api-documentation/search-view.js +++ b/server/sonar-web/src/main/js/apps/api-documentation/search-view.js @@ -32,5 +32,3 @@ export default Marionette.ItemView.extend({ this.options.state.set({ query: query }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/background-tasks/main.js b/server/sonar-web/src/main/js/apps/background-tasks/main.js index 9743b91f0ea..02fa64391e1 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/main.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/main.js @@ -168,11 +168,11 @@ export default React.createClass({ showFailures() { this.setState({ - statusFilter: STATUSES.FAILED, - currentsFilter: CURRENTS.ONLY_CURRENTS, - activityPage: 1 - }, - this.requestActivity); + statusFilter: STATUSES.FAILED, + currentsFilter: CURRENTS.ONLY_CURRENTS, + activityPage: 1 + }, + this.requestActivity); }, onTaskCanceled(task) { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/search.js b/server/sonar-web/src/main/js/apps/background-tasks/search.js index 8c68049cf14..e1c5e6cdea5 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/search.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/search.js @@ -39,10 +39,10 @@ export default React.createClass({ onDateChange(newDate) { if (newDate === DATE.CUSTOM) { - let minDateRaw = this.refs.minDate.value, - maxDateRaw = this.refs.maxDate.value, - minDate = moment(minDateRaw, DATE_FORMAT, true), - maxDate = moment(maxDateRaw, DATE_FORMAT, true); + let minDateRaw = this.refs.minDate.value; + let maxDateRaw = this.refs.maxDate.value; + let minDate = moment(minDateRaw, DATE_FORMAT, true); + let maxDate = moment(maxDateRaw, DATE_FORMAT, true); this.props.onDateChange(newDate, minDate.isValid() ? minDate : null, maxDate.isValid() ? maxDate : null); @@ -69,8 +69,8 @@ export default React.createClass({ }, renderCustomDateInput() { - let shouldBeVisible = this.props.dateFilter === DATE.CUSTOM, - className = shouldBeVisible ? 'spacer-top' : 'spacer-top hidden'; + let shouldBeVisible = this.props.dateFilter === DATE.CUSTOM; + let className = shouldBeVisible ? 'spacer-top' : 'spacer-top hidden'; return ( <div className={className}> from @@ -87,8 +87,8 @@ export default React.createClass({ }, onSearch() { - let searchInput = this.refs.searchInput, - query = searchInput.value; + let searchInput = this.refs.searchInput; + let query = searchInput.value; this.props.onSearch(query); }, diff --git a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js index f8dcd2570a4..d816c21c219 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js @@ -91,5 +91,3 @@ export default ModalFormView.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js index 881b84434de..ec2ea523c9e 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-popup-view.js @@ -35,5 +35,3 @@ export default PopupView.extend({ }; } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/controller.js b/server/sonar-web/src/main/js/apps/coding-rules/controller.js index e399ddb9acc..d020701976f 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/controller.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/controller.js @@ -158,5 +158,3 @@ export default Controller.extend({ } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js index 35ae3641ba5..2062e292b99 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js @@ -41,5 +41,3 @@ export default BaseFacet.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/available-since-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/available-since-facet.js index 253c636bd8f..f2190fa9bd6 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/available-since-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/available-since-facet.js @@ -37,5 +37,3 @@ export default BaseFacet.extend({ } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/base-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/base-facet.js index ebdca1169e0..251a688a144 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/base-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/base-facet.js @@ -5,5 +5,3 @@ export default BaseFacet.extend({ className: 'search-navigator-facet-box', template: Template }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/characteristic-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/characteristic-facet.js index 9ab26b33caf..9c7dae3a8ab 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/characteristic-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/characteristic-facet.js @@ -60,5 +60,3 @@ export default BaseFacet.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-labels-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-labels-facet.js index 7396208123f..0e722adff01 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-labels-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-labels-facet.js @@ -23,5 +23,3 @@ export default BaseFacet.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js index ba35fe660ed..9b2e01ef70a 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js @@ -65,5 +65,3 @@ export default BaseFacet.extend({ this.options.app.state.updateFilter(obj); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js index ecf8ba9dde9..d72f47e4584 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js @@ -65,5 +65,3 @@ export default BaseFacet.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/key-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/key-facet.js index b2854b5028a..87f16198d35 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/key-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/key-facet.js @@ -19,5 +19,3 @@ export default BaseFacet.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js index 258640cbd89..f36935865fb 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js @@ -46,5 +46,3 @@ export default CustomValuesFacet.extend({ } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/quality-profile-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/quality-profile-facet.js index c04d56f93ee..24a3cea18b0 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/quality-profile-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/quality-profile-facet.js @@ -74,5 +74,3 @@ export default BaseFacet.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js index 0b1216ca4bd..094907f65ca 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/query-facet.js @@ -32,5 +32,3 @@ export default BaseFacet.extend({ this.options.app.state.updateFilter(obj, { force: true }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js index 8efc8b46869..a360cf743d9 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js @@ -50,5 +50,3 @@ export default CustomValuesFacet.extend({ } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/severity-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/severity-facet.js index 9c019f36b95..fabaadda424 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/severity-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/severity-facet.js @@ -13,5 +13,3 @@ export default BaseFacet.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js index 7d2e627f243..23b0e41e089 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js @@ -25,5 +25,3 @@ export default BaseFacet.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js index b54b63ddb1a..a54d3b2e150 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js @@ -25,5 +25,3 @@ export default CustomValuesFacet.extend({ } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/template-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/template-facet.js index 13c5cd7b405..30d0630dbbd 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/template-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/template-facet.js @@ -26,5 +26,3 @@ export default BaseFacet.extend({ } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js b/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js index ff902dec733..51359305d94 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js @@ -20,5 +20,3 @@ export default Marionette.ItemView.extend({ return _.extend(this._super(), { canWrite: this.options.app.canWrite }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/layout.js b/server/sonar-web/src/main/js/apps/coding-rules/layout.js index ef24f8ce321..662a991fbdc 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/layout.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/layout.js @@ -38,5 +38,3 @@ export default Marionette.LayoutView.extend({ } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js b/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js index 6cc502192d5..2f6e7c4ecc1 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js @@ -26,5 +26,3 @@ export default Backbone.Model.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js b/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js index 8e293c6ad6e..5e6440d0fa3 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js @@ -39,5 +39,3 @@ export default Backbone.Collection.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/models/state.js b/server/sonar-web/src/main/js/apps/coding-rules/models/state.js index 952bff0d252..47889fe2258 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/models/state.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/models/state.js @@ -19,6 +19,3 @@ export default State.extend({ } } }); - - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule-filter-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule-filter-view.js index b2dc3619cf9..9a5057edd4e 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule-filter-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule-filter-view.js @@ -20,4 +20,3 @@ export default ActionOptionsView.extend({ } }); - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js index d3e9d49ba6b..ff0da3c7803 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js @@ -2,7 +2,7 @@ import $ from 'jquery'; import _ from 'underscore'; import ModalFormView from '../../../components/common/modal-form'; import Template from '../templates/rule/coding-rules-custom-rule-creation.hbs'; -import {csvEscape} from '../../../helpers/csv'; +import { csvEscape } from '../../../helpers/csv'; import latinize from '../../../helpers/latinize'; export default ModalFormView.extend({ @@ -187,5 +187,3 @@ export default ModalFormView.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js index 43f577429a9..6e7002ba587 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js @@ -40,5 +40,3 @@ export default Marionette.ItemView.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js index c550708d0aa..0f2cdfb95f2 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js @@ -41,5 +41,3 @@ export default Marionette.CompositeView.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js index d5c5dd07fbf..cb0869490d0 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js @@ -114,5 +114,3 @@ export default ModalFormView.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js index e20be1987e7..e861820b8e8 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js @@ -3,7 +3,7 @@ import _ from 'underscore'; import Backbone from 'backbone'; import ModalForm from '../../../components/common/modal-form'; import Template from '../templates/rule/coding-rules-profile-activation.hbs'; -import {csvEscape} from '../../../helpers/csv'; +import { csvEscape } from '../../../helpers/csv'; export default ModalForm.extend({ template: Template, @@ -139,5 +139,3 @@ export default ModalForm.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js index f169121e376..c1a2bc458e5 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js @@ -81,5 +81,3 @@ export default Marionette.ItemView.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js index 5f9f497acba..5bfe09cc90c 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js @@ -4,77 +4,75 @@ import ProfileView from './rule-profile-view'; import ProfileActivationView from './profile-activation-view'; import Template from '../templates/rule/coding-rules-rule-profiles.hbs'; - export default Marionette.CompositeView.extend({ - template: Template, - childView: ProfileView, - childViewContainer: '#coding-rules-detail-quality-profiles', +export default Marionette.CompositeView.extend({ + template: Template, + childView: ProfileView, + childViewContainer: '#coding-rules-detail-quality-profiles', - childViewOptions: function () { - return { - app: this.options.app, - rule: this.model, - refreshActives: this.refreshActives.bind(this) - }; - }, + childViewOptions: function () { + return { + app: this.options.app, + rule: this.model, + refreshActives: this.refreshActives.bind(this) + }; + }, - modelEvents: { - 'change': 'render' - }, + modelEvents: { + 'change': 'render' + }, - events: { - 'click #coding-rules-quality-profile-activate': 'activate' - }, + events: { + 'click #coding-rules-quality-profile-activate': 'activate' + }, - onRender: function () { - var isManual = this.model.get('isManual'), - qualityProfilesVisible = !isManual; + onRender: function () { + var isManual = this.model.get('isManual'), + qualityProfilesVisible = !isManual; - if (qualityProfilesVisible) { - if (this.model.get('isTemplate')) { - qualityProfilesVisible = this.collection.length > 0; - } - else { - qualityProfilesVisible = (this.options.app.canWrite || this.collection.length > 0); - } + if (qualityProfilesVisible) { + if (this.model.get('isTemplate')) { + qualityProfilesVisible = this.collection.length > 0; } + else { + qualityProfilesVisible = (this.options.app.canWrite || this.collection.length > 0); + } + } - this.$el.toggleClass('hidden', !qualityProfilesVisible); - }, - - activate: function () { - var that = this, - activationView = new ProfileActivationView({ - rule: this.model, - collection: this.collection, - app: this.options.app - }); - activationView.on('profileActivated', function (severity, params, profile) { - if (that.options.app.state.get('query').qprofile === profile) { - var activation = { - severity: severity, - inherit: 'NONE', - params: params, - qProfile: profile - }; - that.model.set({ activation: activation }); - } - that.refreshActives(); - }); - activationView.render(); - }, - - refreshActives: function () { - var that = this; - this.options.app.controller.getRuleDetails(this.model).done(function (data) { - that.collection.reset(that.model.getInactiveProfiles(data.actives, that.options.app.qualityProfiles)); - }); - }, + this.$el.toggleClass('hidden', !qualityProfilesVisible); + }, - serializeData: function () { - return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { - canWrite: this.options.app.canWrite - }); - } - }); + activate: function () { + var that = this, + activationView = new ProfileActivationView({ + rule: this.model, + collection: this.collection, + app: this.options.app + }); + activationView.on('profileActivated', function (severity, params, profile) { + if (that.options.app.state.get('query').qprofile === profile) { + var activation = { + severity: severity, + inherit: 'NONE', + params: params, + qProfile: profile + }; + that.model.set({ activation: activation }); + } + that.refreshActives(); + }); + activationView.render(); + }, + refreshActives: function () { + var that = this; + this.options.app.controller.getRuleDetails(this.model).done(function (data) { + that.collection.reset(that.model.getInactiveProfiles(data.actives, that.options.app.qualityProfiles)); + }); + }, + serializeData: function () { + return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { + canWrite: this.options.app.canWrite + }); + } +}); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js index e4e70351b97..5897372020b 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js @@ -87,5 +87,3 @@ export default WorkspaceListItemView.extend(RuleFilterMixin).extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/global-permissions/permission-users-groups-mixin.js b/server/sonar-web/src/main/js/apps/global-permissions/permission-users-groups-mixin.js index 91da5b747bb..70c729ec7a1 100644 --- a/server/sonar-web/src/main/js/apps/global-permissions/permission-users-groups-mixin.js +++ b/server/sonar-web/src/main/js/apps/global-permissions/permission-users-groups-mixin.js @@ -11,7 +11,8 @@ export default { renderNotDisplayed() { const notDisplayedCount = this.props.total - this.props.max; - return notDisplayedCount > 0 ? <span className="note spacer-right" href="#">and {notDisplayedCount} more</span> : null; + return notDisplayedCount > 0 ? + <span className="note spacer-right" href="#">and {notDisplayedCount} more</span> : null; }, renderItems() { diff --git a/server/sonar-web/src/main/js/apps/global-permissions/permissions-list.js b/server/sonar-web/src/main/js/apps/global-permissions/permissions-list.js index c48769daab6..aa5e125da43 100644 --- a/server/sonar-web/src/main/js/apps/global-permissions/permissions-list.js +++ b/server/sonar-web/src/main/js/apps/global-permissions/permissions-list.js @@ -5,7 +5,7 @@ import Permission from './permission'; export default React.createClass({ - propTypes:{ + propTypes: { permissions: React.PropTypes.arrayOf(React.PropTypes.object).isRequired }, diff --git a/server/sonar-web/src/main/js/apps/issues/workspace-list-item-view.js b/server/sonar-web/src/main/js/apps/issues/workspace-list-item-view.js index 568fc546723..3b8c9ecda30 100644 --- a/server/sonar-web/src/main/js/apps/issues/workspace-list-item-view.js +++ b/server/sonar-web/src/main/js/apps/issues/workspace-list-item-view.js @@ -6,14 +6,14 @@ import CheckboxTemplate from './templates/issues-issue-checkbox.hbs'; import FilterTemplate from './templates/issues-issue-filter.hbs'; var SHOULD_NULL = { - any: ['issues'], - resolutions: ['resolved'], - resolved: ['resolutions'], - assignees: ['assigned'], - assigned: ['assignees'], - actionPlans: ['planned'], - planned: ['actionPlans'] - }; + any: ['issues'], + resolutions: ['resolved'], + resolved: ['resolutions'], + assignees: ['assigned'], + assigned: ['assignees'], + actionPlans: ['planned'], + planned: ['actionPlans'] +}; export default IssueView.extend({ checkboxTemplate: CheckboxTemplate, @@ -131,5 +131,3 @@ export default IssueView.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/apps/overview/components/complexity-distribution.js b/server/sonar-web/src/main/js/apps/overview/components/complexity-distribution.js index a32a6cca4c3..7a674fa99e2 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/complexity-distribution.js +++ b/server/sonar-web/src/main/js/apps/overview/components/complexity-distribution.js @@ -15,9 +15,9 @@ export const ComplexityDistribution = React.createClass({ renderBarChart () { let data = this.props.distribution.split(';').map((point, index) => { - let tokens = point.split('='), - y = parseInt(tokens[1], 10), - value = parseInt(tokens[0], 10); + let tokens = point.split('='); + let y = parseInt(tokens[1], 10); + let value = parseInt(tokens[0], 10); return { x: index, y: y, diff --git a/server/sonar-web/src/main/js/apps/overview/components/coverage-measures-list.js b/server/sonar-web/src/main/js/apps/overview/components/coverage-measures-list.js index 96520d0ffda..61e0e8898d5 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/coverage-measures-list.js +++ b/server/sonar-web/src/main/js/apps/overview/components/coverage-measures-list.js @@ -55,7 +55,7 @@ export const CoverageMeasuresList = React.createClass({ metrics = metrics.map(metric => { return <DetailedMeasure key={metric.key} - {...this.props} + {...this.props} {...this.props} metric={metric.key} type={metric.type}/>; diff --git a/server/sonar-web/src/main/js/apps/overview/components/domain-bubble-chart.js b/server/sonar-web/src/main/js/apps/overview/components/domain-bubble-chart.js index ffda795363a..7020ef962bb 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/domain-bubble-chart.js +++ b/server/sonar-web/src/main/js/apps/overview/components/domain-bubble-chart.js @@ -73,6 +73,7 @@ export class DomainBubbleChart extends React.Component { let sizeMetricsTitle = this.getSizeMetricsTitle(); let sizeMetricsType = this.state.sizeMetrics[0].type; + /* eslint max-len: 0 */ let inner = [ component.name, `${this.state.xMetric.name}: ${formatMeasure(getMeasure(component, this.props.xMetric), this.state.xMetric.type)}`, diff --git a/server/sonar-web/src/main/js/apps/overview/components/domain-timeline.js b/server/sonar-web/src/main/js/apps/overview/components/domain-timeline.js index 7275a408e0b..25db1cddea3 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/domain-timeline.js +++ b/server/sonar-web/src/main/js/apps/overview/components/domain-timeline.js @@ -68,8 +68,8 @@ export const DomainTimeline = React.createClass({ }, handleMetricChange (selected) { - let newMetric = selected.value, - comparisonMetric = this.state.comparisonMetric; + let newMetric = selected.value; + let comparisonMetric = this.state.comparisonMetric; if (newMetric === comparisonMetric) { comparisonMetric = ''; } diff --git a/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js b/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js index d2db3d954d4..033a791ead4 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js +++ b/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js @@ -54,8 +54,8 @@ export class DomainTreemap extends React.Component { ${formatMeasure(component.measures[this.props.sizeMetric], this.state.sizeMetric.type)}` ]; if (this.state.colorMetric) { - let measure = component.measures[this.props.colorMetric], - formatted = measure != null ? formatMeasure(measure, this.state.colorMetric.type) : '—'; + let measure = component.measures[this.props.colorMetric]; + let formatted = measure != null ? formatMeasure(measure, this.state.colorMetric.type) : '—'; inner.push(`${this.state.colorMetric.name}: ${formatted}`); } inner = inner.join('<br>'); diff --git a/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js b/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js index 5edafc83856..0b751209e84 100644 --- a/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js +++ b/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js @@ -94,8 +94,8 @@ export const CoverageMain = React.createClass({ .domain([0, 25, 50, 75, 100]) .range(CHART_REVERSED_COLORS_RANGE_PERCENT); - let coverageMetric = this.state.coverageMetricPrefix + 'coverage', - uncoveredLinesMetric = this.state.coverageMetricPrefix + 'uncovered_lines'; + let coverageMetric = this.state.coverageMetricPrefix + 'coverage'; + let uncoveredLinesMetric = this.state.coverageMetricPrefix + 'uncovered_lines'; if (this.state.measures[coverageMetric] == null) { return this.renderEmpty(); diff --git a/server/sonar-web/src/main/js/apps/overview/domains/debt-domain.js b/server/sonar-web/src/main/js/apps/overview/domains/debt-domain.js index 7527c23c18e..4ee8ce45476 100644 --- a/server/sonar-web/src/main/js/apps/overview/domains/debt-domain.js +++ b/server/sonar-web/src/main/js/apps/overview/domains/debt-domain.js @@ -11,7 +11,10 @@ import { getPeriodLabel, getPeriodDate } from './../helpers/periods'; import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin'; import { filterMetrics, filterMetricsForDomains } from '../helpers/metrics'; import { CHART_COLORS_RANGE_PERCENT } from '../../../helpers/constants'; -import { AddedRemovedMeasure, AddedRemovedDebt, OnNewCodeMeasure, SeverityMeasure } from './../components/issue-measure'; +import { AddedRemovedMeasure, + AddedRemovedDebt, + OnNewCodeMeasure, + SeverityMeasure } from './../components/issue-measure'; import { IssuesTags } from './../components/issues-tags'; import Assignees from './../components/issues-assignees'; import { getFacet, extractAssignees } from '../../../api/issues'; diff --git a/server/sonar-web/src/main/js/apps/overview/gate/gate-condition.js b/server/sonar-web/src/main/js/apps/overview/gate/gate-condition.js index 6d88348ed1a..c688d959d68 100644 --- a/server/sonar-web/src/main/js/apps/overview/gate/gate-condition.js +++ b/server/sonar-web/src/main/js/apps/overview/gate/gate-condition.js @@ -18,12 +18,12 @@ const Measure = React.createClass({ export default React.createClass({ render() { - let metricName = window.t('metric', this.props.condition.metric.name, 'name'), - threshold = this.props.condition.level === 'ERROR' ? - this.props.condition.error : this.props.condition.warning, - period = this.props.condition.period ? - getPeriodLabel(this.props.component.periods, this.props.condition.period) : null, - periodDate = getPeriodDate(this.props.component.periods, this.props.condition.period); + let metricName = window.t('metric', this.props.condition.metric.name, 'name'); + let threshold = this.props.condition.level === 'ERROR' ? + this.props.condition.error : this.props.condition.warning; + let period = this.props.condition.period ? + getPeriodLabel(this.props.component.periods, this.props.condition.period) : null; + let periodDate = getPeriodDate(this.props.component.periods, this.props.condition.period); let classes = 'alert_' + this.props.condition.level.toUpperCase(); @@ -43,7 +43,11 @@ export default React.createClass({ <div className="overview-gate-condition-metric"> <div>{metricName}</div> - <div>{window.t('quality_gates.operator', this.props.condition.op, 'short')} <Measure value={threshold} type={this.props.condition.metric.type}/></div> + <div> + {window.t('quality_gates.operator', this.props.condition.op, 'short')} + {' '} + <Measure value={threshold} type={this.props.condition.metric.type}/> + </div> </div> </div> </li> diff --git a/server/sonar-web/src/main/js/apps/overview/gate/gate.js b/server/sonar-web/src/main/js/apps/overview/gate/gate.js index 05ebfda1892..3f78fe08dba 100644 --- a/server/sonar-web/src/main/js/apps/overview/gate/gate.js +++ b/server/sonar-web/src/main/js/apps/overview/gate/gate.js @@ -26,9 +26,9 @@ export default React.createClass({ return this.props.component.qualifier === 'TRK' ? <GateEmpty/> : null; } - let level = this.props.gate.level.toLowerCase(), - badgeClassName = 'badge badge-' + level, - badgeText = window.t('overview.gate', this.props.gate.level); + let level = this.props.gate.level.toLowerCase(); + let badgeClassName = 'badge badge-' + level; + let badgeText = window.t('overview.gate', this.props.gate.level); return ( <div className="overview-gate"> diff --git a/server/sonar-web/src/main/js/apps/overview/main/components.js b/server/sonar-web/src/main/js/apps/overview/main/components.js index e4207753ee2..0344e9f60c8 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/components.js +++ b/server/sonar-web/src/main/js/apps/overview/main/components.js @@ -137,8 +137,8 @@ export const Measure = React.createClass({ export const DomainMixin = { renderTimelineStartDate() { - let momentDate = moment(this.props.historyStartDate), - fromNow = momentDate.fromNow(); + let momentDate = moment(this.props.historyStartDate); + let fromNow = momentDate.fromNow(); return <span className="overview-domain-timeline-date">{window.tp('overview.started_x', fromNow)}</span>; }, diff --git a/server/sonar-web/src/main/js/apps/overview/main/coverage.js b/server/sonar-web/src/main/js/apps/overview/main/coverage.js index 36168a35b5f..07aaff0c383 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/coverage.js +++ b/server/sonar-web/src/main/js/apps/overview/main/coverage.js @@ -1,6 +1,13 @@ import React from 'react'; -import { Domain, DomainHeader, DomainPanel, DomainNutshell, DomainLeak, MeasuresList, Measure, DomainMixin } from './components'; +import { Domain, + DomainHeader, + DomainPanel, + DomainNutshell, + DomainLeak, + MeasuresList, + Measure, + DomainMixin } from './components'; import { DrilldownLink } from '../../../components/shared/drilldown-link'; import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin'; import { DonutChart } from '../../../components/charts/donut-chart'; diff --git a/server/sonar-web/src/main/js/apps/overview/main/duplications.js b/server/sonar-web/src/main/js/apps/overview/main/duplications.js index eb08696c9bc..64cafcf8932 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/duplications.js +++ b/server/sonar-web/src/main/js/apps/overview/main/duplications.js @@ -1,6 +1,13 @@ import React from 'react'; -import { Domain, DomainHeader, DomainPanel, DomainNutshell, DomainLeak, MeasuresList, Measure, DomainMixin } from './components'; +import { Domain, + DomainHeader, + DomainPanel, + DomainNutshell, + DomainLeak, + MeasuresList, + Measure, + DomainMixin } from './components'; import { DrilldownLink } from '../../../components/shared/drilldown-link'; import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin'; import { DonutChart } from '../../../components/charts/donut-chart'; @@ -20,8 +27,8 @@ export const GeneralDuplications = React.createClass({ if (!this.hasLeakPeriod()) { return null; } - let measure = this.props.leak['duplicated_lines_density'], - formatted = measure != null ? formatMeasureVariation(measure, 'PERCENT') : '—'; + let measure = this.props.leak['duplicated_lines_density']; + let formatted = measure != null ? formatMeasureVariation(measure, 'PERCENT') : '—'; return <DomainLeak> <MeasuresList> <Measure label={getMetricName('duplications')}> diff --git a/server/sonar-web/src/main/js/apps/overview/main/issues.js b/server/sonar-web/src/main/js/apps/overview/main/issues.js index 9993f49c720..86a145596e2 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/issues.js +++ b/server/sonar-web/src/main/js/apps/overview/main/issues.js @@ -1,7 +1,14 @@ import moment from 'moment'; import React from 'react'; -import { Domain, DomainHeader, DomainPanel, DomainNutshell, DomainLeak, MeasuresList, Measure, DomainMixin } from './components'; +import { Domain, + DomainHeader, + DomainPanel, + DomainNutshell, + DomainLeak, + MeasuresList, + Measure, + DomainMixin } from './components'; import { Rating } from './../../../components/shared/rating'; import { IssuesLink } from '../../../components/shared/issues-link'; import { DrilldownLink } from '../../../components/shared/drilldown-link'; diff --git a/server/sonar-web/src/main/js/apps/overview/main/size.js b/server/sonar-web/src/main/js/apps/overview/main/size.js index 683d23f5270..d1138a87f13 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/size.js +++ b/server/sonar-web/src/main/js/apps/overview/main/size.js @@ -1,6 +1,13 @@ import React from 'react'; -import { Domain, DomainHeader, DomainPanel, DomainNutshell, DomainLeak, MeasuresList, Measure, DomainMixin } from './components'; +import { Domain, + DomainHeader, + DomainPanel, + DomainNutshell, + DomainLeak, + MeasuresList, + Measure, + DomainMixin } from './components'; import { DrilldownLink } from '../../../components/shared/drilldown-link'; import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin'; import { getMetricName } from '../helpers/metrics'; @@ -20,8 +27,8 @@ export const GeneralSize = React.createClass({ if (!this.hasLeakPeriod()) { return null; } - let measure = this.props.leak['ncloc'], - formatted = measure != null ? formatMeasureVariation(measure, 'SHORT_INT') : '—'; + let measure = this.props.leak['ncloc']; + let formatted = measure != null ? formatMeasureVariation(measure, 'SHORT_INT') : '—'; return <DomainLeak> <MeasuresList> <Measure label={getMetricName('ncloc')}>{formatted}</Measure> diff --git a/server/sonar-web/src/main/js/apps/overview/meta.js b/server/sonar-web/src/main/js/apps/overview/meta.js index 8228db26f34..80ef21d8a9e 100644 --- a/server/sonar-web/src/main/js/apps/overview/meta.js +++ b/server/sonar-web/src/main/js/apps/overview/meta.js @@ -46,56 +46,56 @@ export default React.createClass({ render() { let profiles = (this.props.component.profiles || []).map(profile => { - return ( - <li key={profile.key}> - <span className="note spacer-right">({profile.language})</span> - <QualityProfileLink profile={profile.key}>{profile.name}</QualityProfileLink> - </li> - ); - }), - links = (this.props.component.links || []).map(link => { - let iconClassName = `spacer-right icon-color-link icon-${link.type}`; - return ( - <li key={link.type}> - <i className={iconClassName}/> - <a href={link.href} target="_blank">{link.name}</a> - </li> - ); - }); + return ( + <li key={profile.key}> + <span className="note spacer-right">({profile.language})</span> + <QualityProfileLink profile={profile.key}>{profile.name}</QualityProfileLink> + </li> + ); + }); + let links = (this.props.component.links || []).map(link => { + let iconClassName = `spacer-right icon-color-link icon-${link.type}`; + return ( + <li key={link.type}> + <i className={iconClassName}/> + <a href={link.href} target="_blank">{link.name}</a> + </li> + ); + }); let descriptionCard = this.props.component.description ? ( - <div className="overview-meta-card"> - <div className="overview-meta-description">{this.props.component.description}</div> - </div> - ) : null, + <div className="overview-meta-card"> + <div className="overview-meta-description">{this.props.component.description}</div> + </div> + ) : null; - linksCard = _.size(this.props.component.links) > 0 ? ( - <div className="overview-meta-card"> - <ul className="overview-meta-list">{links}</ul> - </div> - ) : null, + let linksCard = _.size(this.props.component.links) > 0 ? ( + <div className="overview-meta-card"> + <ul className="overview-meta-list">{links}</ul> + </div> + ) : null; - profilesCard = !this.isView() && !this.isDeveloper() && _.size(this.props.component.profiles) > 0 ? ( - <div className="overview-meta-card"> - <h4 className="overview-meta-header">{window.t('overview.quality_profiles')}</h4> - <ul className="overview-meta-list">{profiles}</ul> - </div> - ) : null, + let profilesCard = !this.isView() && !this.isDeveloper() && _.size(this.props.component.profiles) > 0 ? ( + <div className="overview-meta-card"> + <h4 className="overview-meta-header">{window.t('overview.quality_profiles')}</h4> + <ul className="overview-meta-list">{profiles}</ul> + </div> + ) : null; - gateCard = !this.isView() && !this.isDeveloper() && this.props.component.gate ? ( - <div className="overview-meta-card"> - <h4 className="overview-meta-header">{window.t('overview.quality_gate')}</h4> - <ul className="overview-meta-list"> - <li> - {this.props.component.gate.isDefault ? - <span className="note spacer-right">(Default)</span> : null} - <QualityGateLink gate={this.props.component.gate.key}> - {this.props.component.gate.name} - </QualityGateLink> - </li> - </ul> - </div> - ) : null; + let gateCard = !this.isView() && !this.isDeveloper() && this.props.component.gate ? ( + <div className="overview-meta-card"> + <h4 className="overview-meta-header">{window.t('overview.quality_gate')}</h4> + <ul className="overview-meta-list"> + <li> + {this.props.component.gate.isDefault ? + <span className="note spacer-right">(Default)</span> : null} + <QualityGateLink gate={this.props.component.gate.key}> + {this.props.component.gate.name} + </QualityGateLink> + </li> + </ul> + </div> + ) : null; return ( <div className="overview-meta"> diff --git a/server/sonar-web/src/main/js/apps/permission-templates/create-view.js b/server/sonar-web/src/main/js/apps/permission-templates/create-view.js index 733e970069f..13f3c49c9d9 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/create-view.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/create-view.js @@ -1,5 +1,5 @@ import FormView from './form-view'; -import {createPermissionTemplate} from '../../api/permissions'; +import { createPermissionTemplate } from '../../api/permissions'; export default FormView.extend({ sendRequest: function () { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/delete-view.js b/server/sonar-web/src/main/js/apps/permission-templates/delete-view.js index 8f86bb0759d..da708bf9ad6 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/delete-view.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/delete-view.js @@ -1,5 +1,5 @@ import ModalForm from '../../components/common/modal-form'; -import {deletePermissionTemplate} from '../../api/permissions'; +import { deletePermissionTemplate } from '../../api/permissions'; import Template from './templates/permission-templates-delete.hbs'; export default ModalForm.extend({ diff --git a/server/sonar-web/src/main/js/apps/permission-templates/main.js b/server/sonar-web/src/main/js/apps/permission-templates/main.js index 5032bef5547..26d120abba4 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/main.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/main.js @@ -2,7 +2,7 @@ import _ from 'underscore'; import React from 'react'; import Header from './header'; import PermissionTemplates from './permission-templates'; -import {getPermissionTemplates} from '../../api/permissions'; +import { getPermissionTemplates } from '../../api/permissions'; const PERMISSIONS_ORDER = ['user', 'codeviewer', 'issueadmin', 'admin']; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/permission-template-set-defaults.js b/server/sonar-web/src/main/js/apps/permission-templates/permission-template-set-defaults.js index 87a75de168b..614e61242c6 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/permission-template-set-defaults.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/permission-template-set-defaults.js @@ -1,6 +1,6 @@ import _ from 'underscore'; import React from 'react'; -import {setDefaultPermissionTemplate} from '../../api/permissions'; +import { setDefaultPermissionTemplate } from '../../api/permissions'; import QualifierIcon from '../../components/shared/qualifier-icon'; export default React.createClass({ diff --git a/server/sonar-web/src/main/js/apps/permission-templates/permission-templates.js b/server/sonar-web/src/main/js/apps/permission-templates/permission-templates.js index 030fec04c2f..a3811ce5d8b 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/permission-templates.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/permission-templates.js @@ -6,7 +6,7 @@ import PermissionTemplate from './permission-template'; export default React.createClass({ - propTypes:{ + propTypes: { permissionTemplates: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, permissions: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, topQualifiers: React.PropTypes.array.isRequired, diff --git a/server/sonar-web/src/main/js/apps/permission-templates/update-view.js b/server/sonar-web/src/main/js/apps/permission-templates/update-view.js index 38e546b820d..fa1f7f533ec 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/update-view.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/update-view.js @@ -1,5 +1,5 @@ import FormView from './form-view'; -import {updatePermissionTemplate} from '../../api/permissions'; +import { updatePermissionTemplate } from '../../api/permissions'; export default FormView.extend({ sendRequest: function () { diff --git a/server/sonar-web/src/main/js/apps/project-permissions/apply-template-view.js b/server/sonar-web/src/main/js/apps/project-permissions/apply-template-view.js index 73dc0ec1b95..f4a451c2f33 100644 --- a/server/sonar-web/src/main/js/apps/project-permissions/apply-template-view.js +++ b/server/sonar-web/src/main/js/apps/project-permissions/apply-template-view.js @@ -1,7 +1,7 @@ import $ from 'jquery'; import _ from 'underscore'; import ModalForm from '../../components/common/modal-form'; -import {applyTemplateToProject} from '../../api/permissions'; +import { applyTemplateToProject } from '../../api/permissions'; import Template from './templates/project-permissions-apply-template.hbs'; export default ModalForm.extend({ diff --git a/server/sonar-web/src/main/js/apps/project-permissions/permissions-footer.js b/server/sonar-web/src/main/js/apps/project-permissions/permissions-footer.js index ad03541cbd6..fa7399ae655 100644 --- a/server/sonar-web/src/main/js/apps/project-permissions/permissions-footer.js +++ b/server/sonar-web/src/main/js/apps/project-permissions/permissions-footer.js @@ -3,7 +3,7 @@ import React from 'react'; export default React.createClass({ - propTypes:{ + propTypes: { count: React.PropTypes.number.isRequired, total: React.PropTypes.number.isRequired, loadMore: React.PropTypes.func.isRequired diff --git a/server/sonar-web/src/main/js/apps/project-permissions/permissions.js b/server/sonar-web/src/main/js/apps/project-permissions/permissions.js index c3ae66271a4..3a7ba95f6be 100644 --- a/server/sonar-web/src/main/js/apps/project-permissions/permissions.js +++ b/server/sonar-web/src/main/js/apps/project-permissions/permissions.js @@ -6,7 +6,7 @@ import Project from './project'; export default React.createClass({ - propTypes:{ + propTypes: { projects: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, permissions: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, permissionTemplates: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, diff --git a/server/sonar-web/src/main/js/apps/projects/app.js b/server/sonar-web/src/main/js/apps/projects/app.js index 627a8a9b9cd..aba9a066b50 100644 --- a/server/sonar-web/src/main/js/apps/projects/app.js +++ b/server/sonar-web/src/main/js/apps/projects/app.js @@ -1,14 +1,14 @@ import React from 'react'; import ReactDOM from 'react-dom'; import Main from './main'; -import {getCurrentUser} from '../../api/users'; +import { getCurrentUser } from '../../api/users'; import '../../helpers/handlebars-helpers'; window.sonarqube.appStarted.then(options => { getCurrentUser().done(user => { - let el = document.querySelector(options.el), - hasProvisionPermission = user.permissions.global.indexOf('provisioning') !== -1, - topLevelQualifiers = options.rootQualifiers; + let el = document.querySelector(options.el); + let hasProvisionPermission = user.permissions.global.indexOf('provisioning') !== -1; + let topLevelQualifiers = options.rootQualifiers; ReactDOM.render(<Main hasProvisionPermission={hasProvisionPermission} topLevelQualifiers={topLevelQualifiers}/>, el); }); diff --git a/server/sonar-web/src/main/js/apps/projects/main.js b/server/sonar-web/src/main/js/apps/projects/main.js index 051de7c515a..b415414911a 100644 --- a/server/sonar-web/src/main/js/apps/projects/main.js +++ b/server/sonar-web/src/main/js/apps/projects/main.js @@ -3,8 +3,8 @@ import React from 'react'; import Header from './header'; import Search from './search'; import Projects from './projects'; -import {PAGE_SIZE, TYPE} from './constants'; -import {getComponents, getProvisioned, getGhosts, deleteComponents} from '../../api/components'; +import { PAGE_SIZE, TYPE } from './constants'; +import { getComponents, getProvisioned, getGhosts, deleteComponents } from '../../api/components'; import ListFooter from '../../components/shared/list-footer'; export default React.createClass({ diff --git a/server/sonar-web/src/main/js/apps/projects/search.js b/server/sonar-web/src/main/js/apps/projects/search.js index c07450d93ca..4d465b3665e 100644 --- a/server/sonar-web/src/main/js/apps/projects/search.js +++ b/server/sonar-web/src/main/js/apps/projects/search.js @@ -1,6 +1,6 @@ import _ from 'underscore'; import React from 'react'; -import {TYPE, QUALIFIERS_ORDER} from './constants'; +import { TYPE, QUALIFIERS_ORDER } from './constants'; import DeleteView from './delete-view'; import RadioToggle from '../../components/shared/radio-toggle'; import Checkbox from '../../components/shared/checkbox'; @@ -39,11 +39,11 @@ export default React.createClass({ renderCheckbox() { let isAllChecked = this.props.projects.length > 0 && - this.props.selection.length === this.props.projects.length, - thirdState = this.props.projects.length > 0 && + this.props.selection.length === this.props.projects.length; + let thirdState = this.props.projects.length > 0 && this.props.selection.length > 0 && - this.props.selection.length < this.props.projects.length, - isChecked = isAllChecked || thirdState; + this.props.selection.length < this.props.projects.length; + let isChecked = isAllChecked || thirdState; return <Checkbox onCheck={this.onCheck} initiallyChecked={isChecked} thirdState={thirdState}/>; }, diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/profile.js b/server/sonar-web/src/main/js/apps/quality-profiles/profile.js index 73ace102b13..06a8c780cb6 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/profile.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/profile.js @@ -17,8 +17,8 @@ export default Backbone.Model.extend({ this.fetchProfileRules(), this.fetchInheritance() ).done(function () { - that.set(that.fetchChanged); - }); + that.set(that.fetchChanged); + }); }, fetchProfileRules: function () { @@ -114,5 +114,3 @@ export default Backbone.Model.extend({ this.unset('comparison'); } }); - - diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/restore-profile-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/restore-profile-view.js index 2d280acafa9..249fe7778a6 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/restore-profile-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/restore-profile-view.js @@ -30,5 +30,3 @@ export default ModalFormView.extend({ } } }); - - diff --git a/server/sonar-web/src/main/js/apps/system/item-value.js b/server/sonar-web/src/main/js/apps/system/item-value.js index a4d2da93154..d482aee873b 100644 --- a/server/sonar-web/src/main/js/apps/system/item-value.js +++ b/server/sonar-web/src/main/js/apps/system/item-value.js @@ -9,8 +9,8 @@ export default React.createClass({ return <ItemLogLevel value={this.props.value}/>; } - let rawValue = this.props.value, - formattedValue; + let rawValue = this.props.value; + let formattedValue; switch (typeof this.props.value) { case 'boolean': formattedValue = <ItemBoolean value={rawValue}/>; diff --git a/server/sonar-web/src/main/js/apps/users/tokens-view.js b/server/sonar-web/src/main/js/apps/users/tokens-view.js index f3277b1fea0..4dc0b77bf0b 100644 --- a/server/sonar-web/src/main/js/apps/users/tokens-view.js +++ b/server/sonar-web/src/main/js/apps/users/tokens-view.js @@ -52,8 +52,8 @@ export default Modal.extend({ onRevokeTokenFormSubmit(e) { e.preventDefault(); - let tokenName = $(e.currentTarget).data('token'), - token = _.findWhere(this.tokens, { name: `${tokenName}` }); + let tokenName = $(e.currentTarget).data('token'); + let token = _.findWhere(this.tokens, { name: `${tokenName}` }); if (token) { if (token.deleting) { revokeToken(this.model.id, tokenName).then(this.requestTokens.bind(this)); diff --git a/server/sonar-web/src/main/js/components/charts/donut-chart.js b/server/sonar-web/src/main/js/components/charts/donut-chart.js index de07bd6f169..20a911044ab 100644 --- a/server/sonar-web/src/main/js/components/charts/donut-chart.js +++ b/server/sonar-web/src/main/js/components/charts/donut-chart.js @@ -38,8 +38,8 @@ export const DonutChart = React.createClass({ let availableWidth = this.state.width - this.props.padding[1] - this.props.padding[3]; let availableHeight = this.state.height - this.props.padding[0] - this.props.padding[2]; - let size = Math.min(availableWidth, availableHeight), - radius = Math.floor(size / 2); + let size = Math.min(availableWidth, availableHeight); + let radius = Math.floor(size / 2); let pie = d3.layout.pie() .sort(null) diff --git a/server/sonar-web/src/main/js/components/charts/treemap.js b/server/sonar-web/src/main/js/components/charts/treemap.js index ad851948113..63e974f5995 100644 --- a/server/sonar-web/src/main/js/components/charts/treemap.js +++ b/server/sonar-web/src/main/js/components/charts/treemap.js @@ -123,8 +123,8 @@ export const Treemap = React.createClass({ .filter(d => !d.children) .filter(d => !!d.dx && !!d.dy); - let prefix = mostCommitPrefix(this.props.items.map(item => item.label)), - prefixLength = prefix.length; + let prefix = mostCommitPrefix(this.props.items.map(item => item.label)); + let prefixLength = prefix.length; let rectangles = nodes.map((node, index) => { let label = prefixLength ? `${prefix}<br>${node.label.substr(prefixLength)}` : node.label; diff --git a/server/sonar-web/src/main/js/components/common/select-list.js b/server/sonar-web/src/main/js/components/common/select-list.js index be096e6128b..32e31f48137 100644 --- a/server/sonar-web/src/main/js/components/common/select-list.js +++ b/server/sonar-web/src/main/js/components/common/select-list.js @@ -139,6 +139,7 @@ var SelectListItemView = Backbone.View.extend({ var SelectListView = Backbone.View.extend({ template: function (l) { + /* eslint max-len: 0 */ return '<div class="select-list-container">' + '<div class="select-list-control">' + '<div class="select-list-check-control">' + @@ -449,5 +450,3 @@ window.SelectList.defaults = { errorMessage: 'Something gone wrong, try to reload the page and try again.' }; - - diff --git a/server/sonar-web/src/main/js/components/shared/avatar.js b/server/sonar-web/src/main/js/components/shared/avatar.js index 6178343a7f7..5858671b6cb 100644 --- a/server/sonar-web/src/main/js/components/shared/avatar.js +++ b/server/sonar-web/src/main/js/components/shared/avatar.js @@ -18,7 +18,7 @@ export default React.createClass({ .replace('{SIZE}', this.props.size * 2); return <img className="rounded" src={url} - width={this.props.size} + width={this.props.size} height={this.props.size} alt={this.props.email}/>; } diff --git a/server/sonar-web/src/main/js/components/shared/checkbox.js b/server/sonar-web/src/main/js/components/shared/checkbox.js index 633c23c8354..27587494749 100644 --- a/server/sonar-web/src/main/js/components/shared/checkbox.js +++ b/server/sonar-web/src/main/js/components/shared/checkbox.js @@ -4,7 +4,7 @@ export default React.createClass({ propTypes: { onCheck: React.PropTypes.func.isRequired, initiallyChecked: React.PropTypes.bool, - thirdState: React.PropTypes.bool + thirdState: React.PropTypes.bool }, getInitialState() { diff --git a/server/sonar-web/src/main/js/components/shared/favorite.js b/server/sonar-web/src/main/js/components/shared/favorite.js index f75d03b4cb4..93a47b17db8 100644 --- a/server/sonar-web/src/main/js/components/shared/favorite.js +++ b/server/sonar-web/src/main/js/components/shared/favorite.js @@ -32,6 +32,7 @@ export default React.createClass({ }, renderSVG() { + /* eslint max-len: 0 */ return ( <svg width="16" height="16" style={{ fillRule: 'evenodd', clipRule: 'evenodd', strokeLinejoin: 'round', strokeMiterlimit: 1.41421 }}> <path d="M15.4275,5.77678C15.4275,5.90773 15.3501,6.05059 15.1953,6.20536L11.9542,9.36608L12.7221,13.8304C12.728,13.872 12.731,13.9316 12.731,14.0089C12.731,14.1339 12.6998,14.2396 12.6373,14.3259C12.5748,14.4122 12.484,14.4554 12.3649,14.4554C12.2518,14.4554 12.1328,14.4197 12.0078,14.3482L7.99888,12.2411L3.98995,14.3482C3.85901,14.4197 3.73996,14.4554 3.63281,14.4554C3.50781,14.4554 3.41406,14.4122 3.35156,14.3259C3.28906,14.2396 3.25781,14.1339 3.25781,14.0089C3.25781,13.9732 3.26377,13.9137 3.27567,13.8304L4.04353,9.36608L0.793531,6.20536C0.644719,6.04464 0.570313,5.90178 0.570313,5.77678C0.570313,5.55654 0.736979,5.41964 1.07031,5.36606L5.55245,4.71428L7.56138,0.651781C7.67447,0.407729 7.8203,0.285703 7.99888,0.285703C8.17745,0.285703 8.32328,0.407729 8.43638,0.651781L10.4453,4.71428L14.9274,5.36606C15.2608,5.41964 15.4274,5.55654 15.4274,5.77678L15.4275,5.77678Z" diff --git a/server/sonar-web/src/main/js/components/shared/list-footer.js b/server/sonar-web/src/main/js/components/shared/list-footer.js index dee7559dbb9..2946473a141 100644 --- a/server/sonar-web/src/main/js/components/shared/list-footer.js +++ b/server/sonar-web/src/main/js/components/shared/list-footer.js @@ -32,8 +32,8 @@ export default React.createClass({ }, render() { - let hasMore = this.props.total > this.props.count, - loadMoreLink = <a onClick={this.handleLoadMore} className="spacer-left" href="#">show more</a>; + let hasMore = this.props.total > this.props.count; + let loadMoreLink = <a onClick={this.handleLoadMore} className="spacer-left" href="#">show more</a>; let className = classNames('spacer-top note text-center', { 'new-loading': !this.props.ready }); return ( <footer className={className}> diff --git a/server/sonar-web/src/main/js/components/shared/pending-icon.js b/server/sonar-web/src/main/js/components/shared/pending-icon.js index 6749e973287..915627beb80 100644 --- a/server/sonar-web/src/main/js/components/shared/pending-icon.js +++ b/server/sonar-web/src/main/js/components/shared/pending-icon.js @@ -2,6 +2,7 @@ import React from 'react'; export default React.createClass({ render() { + /* eslint max-len: 0 */ return ( <svg width="16" height="16" className="icon-pending"> <g transform="matrix(0.0364583,0,0,0.0364583,1,-0.166667)"> diff --git a/server/sonar-web/src/main/js/helpers/latinize.js b/server/sonar-web/src/main/js/helpers/latinize.js index 48ddda4b309..750775cdf6e 100644 --- a/server/sonar-web/src/main/js/helpers/latinize.js +++ b/server/sonar-web/src/main/js/helpers/latinize.js @@ -2,351 +2,352 @@ * Latinize string by removing all diacritics * From http://stackoverflow.com/questions/990904/javascript-remove-accents-in-strings */ + /* eslint max-len: 0 */ var defaultDiacriticsRemovalap = [ - { - 'base': 'A', - 'letters': '\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F' - }, - { - 'base': 'AA', - 'letters': '\uA732' - }, - { - 'base': 'AE', - 'letters': '\u00C6\u01FC\u01E2' - }, - { - 'base': 'AO', - 'letters': '\uA734' - }, - { - 'base': 'AU', - 'letters': '\uA736' - }, - { - 'base': 'AV', - 'letters': '\uA738\uA73A' - }, - { - 'base': 'AY', - 'letters': '\uA73C' - }, - { - 'base': 'B', - 'letters': '\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181' - }, - { - 'base': 'C', - 'letters': '\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E' - }, - { - 'base': 'D', - 'letters': '\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779' - }, - { - 'base': 'DZ', - 'letters': '\u01F1\u01C4' - }, - { - 'base': 'Dz', - 'letters': '\u01F2\u01C5' - }, - { - 'base': 'E', - 'letters': '\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E' - }, - { - 'base': 'F', - 'letters': '\u0046\u24BB\uFF26\u1E1E\u0191\uA77B' - }, - { - 'base': 'G', - 'letters': '\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E' - }, - { - 'base': 'H', - 'letters': '\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D' - }, - { - 'base': 'I', - 'letters': '\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197' - }, - { - 'base': 'J', - 'letters': '\u004A\u24BF\uFF2A\u0134\u0248' - }, - { - 'base': 'K', - 'letters': '\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2' - }, - { - 'base': 'L', - 'letters': '\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780' - }, - { - 'base': 'LJ', - 'letters': '\u01C7' - }, - { - 'base': 'Lj', - 'letters': '\u01C8' - }, - { - 'base': 'M', - 'letters': '\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C' - }, - { - 'base': 'N', - 'letters': '\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4' - }, - { - 'base': 'NJ', - 'letters': '\u01CA' - }, - { - 'base': 'Nj', - 'letters': '\u01CB' - }, - { - 'base': 'O', - 'letters': '\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C' - }, - { - 'base': 'OI', - 'letters': '\u01A2' - }, - { - 'base': 'OO', - 'letters': '\uA74E' - }, - { - 'base': 'OU', - 'letters': '\u0222' - }, - { - 'base': 'OE', - 'letters': '\u008C\u0152' - }, - { - 'base': 'oe', - 'letters': '\u009C\u0153' - }, - { - 'base': 'P', - 'letters': '\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754' - }, - { - 'base': 'Q', - 'letters': '\u0051\u24C6\uFF31\uA756\uA758\u024A' - }, - { - 'base': 'R', - 'letters': '\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782' - }, - { - 'base': 'S', - 'letters': '\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784' - }, - { - 'base': 'T', - 'letters': '\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786' - }, - { - 'base': 'TZ', - 'letters': '\uA728' - }, - { - 'base': 'U', - 'letters': '\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244' - }, - { - 'base': 'V', - 'letters': '\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245' - }, - { - 'base': 'VY', - 'letters': '\uA760' - }, - { - 'base': 'W', - 'letters': '\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72' - }, - { - 'base': 'X', - 'letters': '\u0058\u24CD\uFF38\u1E8A\u1E8C' - }, - { - 'base': 'Y', - 'letters': '\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE' - }, - { - 'base': 'Z', - 'letters': '\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762' - }, - { - 'base': 'a', - 'letters': '\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250' - }, - { - 'base': 'aa', - 'letters': '\uA733' - }, - { - 'base': 'ae', - 'letters': '\u00E6\u01FD\u01E3' - }, - { - 'base': 'ao', - 'letters': '\uA735' - }, - { - 'base': 'au', - 'letters': '\uA737' - }, - { - 'base': 'av', - 'letters': '\uA739\uA73B' - }, - { - 'base': 'ay', - 'letters': '\uA73D' - }, - { - 'base': 'b', - 'letters': '\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253' - }, - { - 'base': 'c', - 'letters': '\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184' - }, - { - 'base': 'd', - 'letters': '\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A' - }, - { - 'base': 'dz', - 'letters': '\u01F3\u01C6' - }, - { - 'base': 'e', - 'letters': '\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD' - }, - { - 'base': 'f', - 'letters': '\u0066\u24D5\uFF46\u1E1F\u0192\uA77C' - }, - { - 'base': 'g', - 'letters': '\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F' - }, - { - 'base': 'h', - 'letters': '\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265' - }, - { - 'base': 'hv', - 'letters': '\u0195' - }, - { - 'base': 'i', - 'letters': '\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131' - }, - { - 'base': 'j', - 'letters': '\u006A\u24D9\uFF4A\u0135\u01F0\u0249' - }, - { - 'base': 'k', - 'letters': '\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3' - }, - { - 'base': 'l', - 'letters': '\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747' - }, - { - 'base': 'lj', - 'letters': '\u01C9' - }, - { - 'base': 'm', - 'letters': '\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F' - }, - { - 'base': 'n', - 'letters': '\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5' - }, - { - 'base': 'nj', - 'letters': '\u01CC' - }, - { - 'base': 'o', - 'letters': '\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275' - }, - { - 'base': 'oi', - 'letters': '\u01A3' - }, - { - 'base': 'ou', - 'letters': '\u0223' - }, - { - 'base': 'oo', - 'letters': '\uA74F' - }, - { - 'base': 'p', - 'letters': '\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755' - }, - { - 'base': 'q', - 'letters': '\u0071\u24E0\uFF51\u024B\uA757\uA759' - }, - { - 'base': 'r', - 'letters': '\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783' - }, - { - 'base': 's', - 'letters': '\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B' - }, - { - 'base': 't', - 'letters': '\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787' - }, - { - 'base': 'tz', - 'letters': '\uA729' - }, - { - 'base': 'u', - 'letters': '\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289' - }, - { - 'base': 'v', - 'letters': '\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C' - }, - { - 'base': 'vy', - 'letters': '\uA761' - }, - { - 'base': 'w', - 'letters': '\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73' - }, - { - 'base': 'x', - 'letters': '\u0078\u24E7\uFF58\u1E8B\u1E8D' - }, - { - 'base': 'y', - 'letters': '\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF' - }, - { - 'base': 'z', - 'letters': '\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763' - } + { + 'base': 'A', + 'letters': '\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F' + }, + { + 'base': 'AA', + 'letters': '\uA732' + }, + { + 'base': 'AE', + 'letters': '\u00C6\u01FC\u01E2' + }, + { + 'base': 'AO', + 'letters': '\uA734' + }, + { + 'base': 'AU', + 'letters': '\uA736' + }, + { + 'base': 'AV', + 'letters': '\uA738\uA73A' + }, + { + 'base': 'AY', + 'letters': '\uA73C' + }, + { + 'base': 'B', + 'letters': '\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181' + }, + { + 'base': 'C', + 'letters': '\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E' + }, + { + 'base': 'D', + 'letters': '\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779' + }, + { + 'base': 'DZ', + 'letters': '\u01F1\u01C4' + }, + { + 'base': 'Dz', + 'letters': '\u01F2\u01C5' + }, + { + 'base': 'E', + 'letters': '\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E' + }, + { + 'base': 'F', + 'letters': '\u0046\u24BB\uFF26\u1E1E\u0191\uA77B' + }, + { + 'base': 'G', + 'letters': '\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E' + }, + { + 'base': 'H', + 'letters': '\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D' + }, + { + 'base': 'I', + 'letters': '\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197' + }, + { + 'base': 'J', + 'letters': '\u004A\u24BF\uFF2A\u0134\u0248' + }, + { + 'base': 'K', + 'letters': '\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2' + }, + { + 'base': 'L', + 'letters': '\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780' + }, + { + 'base': 'LJ', + 'letters': '\u01C7' + }, + { + 'base': 'Lj', + 'letters': '\u01C8' + }, + { + 'base': 'M', + 'letters': '\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C' + }, + { + 'base': 'N', + 'letters': '\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4' + }, + { + 'base': 'NJ', + 'letters': '\u01CA' + }, + { + 'base': 'Nj', + 'letters': '\u01CB' + }, + { + 'base': 'O', + 'letters': '\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C' + }, + { + 'base': 'OI', + 'letters': '\u01A2' + }, + { + 'base': 'OO', + 'letters': '\uA74E' + }, + { + 'base': 'OU', + 'letters': '\u0222' + }, + { + 'base': 'OE', + 'letters': '\u008C\u0152' + }, + { + 'base': 'oe', + 'letters': '\u009C\u0153' + }, + { + 'base': 'P', + 'letters': '\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754' + }, + { + 'base': 'Q', + 'letters': '\u0051\u24C6\uFF31\uA756\uA758\u024A' + }, + { + 'base': 'R', + 'letters': '\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782' + }, + { + 'base': 'S', + 'letters': '\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784' + }, + { + 'base': 'T', + 'letters': '\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786' + }, + { + 'base': 'TZ', + 'letters': '\uA728' + }, + { + 'base': 'U', + 'letters': '\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244' + }, + { + 'base': 'V', + 'letters': '\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245' + }, + { + 'base': 'VY', + 'letters': '\uA760' + }, + { + 'base': 'W', + 'letters': '\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72' + }, + { + 'base': 'X', + 'letters': '\u0058\u24CD\uFF38\u1E8A\u1E8C' + }, + { + 'base': 'Y', + 'letters': '\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE' + }, + { + 'base': 'Z', + 'letters': '\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762' + }, + { + 'base': 'a', + 'letters': '\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250' + }, + { + 'base': 'aa', + 'letters': '\uA733' + }, + { + 'base': 'ae', + 'letters': '\u00E6\u01FD\u01E3' + }, + { + 'base': 'ao', + 'letters': '\uA735' + }, + { + 'base': 'au', + 'letters': '\uA737' + }, + { + 'base': 'av', + 'letters': '\uA739\uA73B' + }, + { + 'base': 'ay', + 'letters': '\uA73D' + }, + { + 'base': 'b', + 'letters': '\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253' + }, + { + 'base': 'c', + 'letters': '\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184' + }, + { + 'base': 'd', + 'letters': '\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A' + }, + { + 'base': 'dz', + 'letters': '\u01F3\u01C6' + }, + { + 'base': 'e', + 'letters': '\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD' + }, + { + 'base': 'f', + 'letters': '\u0066\u24D5\uFF46\u1E1F\u0192\uA77C' + }, + { + 'base': 'g', + 'letters': '\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F' + }, + { + 'base': 'h', + 'letters': '\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265' + }, + { + 'base': 'hv', + 'letters': '\u0195' + }, + { + 'base': 'i', + 'letters': '\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131' + }, + { + 'base': 'j', + 'letters': '\u006A\u24D9\uFF4A\u0135\u01F0\u0249' + }, + { + 'base': 'k', + 'letters': '\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3' + }, + { + 'base': 'l', + 'letters': '\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747' + }, + { + 'base': 'lj', + 'letters': '\u01C9' + }, + { + 'base': 'm', + 'letters': '\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F' + }, + { + 'base': 'n', + 'letters': '\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5' + }, + { + 'base': 'nj', + 'letters': '\u01CC' + }, + { + 'base': 'o', + 'letters': '\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275' + }, + { + 'base': 'oi', + 'letters': '\u01A3' + }, + { + 'base': 'ou', + 'letters': '\u0223' + }, + { + 'base': 'oo', + 'letters': '\uA74F' + }, + { + 'base': 'p', + 'letters': '\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755' + }, + { + 'base': 'q', + 'letters': '\u0071\u24E0\uFF51\u024B\uA757\uA759' + }, + { + 'base': 'r', + 'letters': '\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783' + }, + { + 'base': 's', + 'letters': '\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B' + }, + { + 'base': 't', + 'letters': '\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787' + }, + { + 'base': 'tz', + 'letters': '\uA729' + }, + { + 'base': 'u', + 'letters': '\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289' + }, + { + 'base': 'v', + 'letters': '\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C' + }, + { + 'base': 'vy', + 'letters': '\uA761' + }, + { + 'base': 'w', + 'letters': '\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73' + }, + { + 'base': 'x', + 'letters': '\u0078\u24E7\uFF58\u1E8B\u1E8D' + }, + { + 'base': 'y', + 'letters': '\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF' + }, + { + 'base': 'z', + 'letters': '\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763' + } ]; var diacriticsMap = {}; diff --git a/server/sonar-web/src/main/js/helpers/measures.js b/server/sonar-web/src/main/js/helpers/measures.js index 81bf4454323..2137e40c6b8 100644 --- a/server/sonar-web/src/main/js/helpers/measures.js +++ b/server/sonar-web/src/main/js/helpers/measures.js @@ -169,8 +169,8 @@ function millisecondsFormatter (value) { } function millisecondsVariationFormatter (value) { - let absValue = Math.abs(value), - formattedValue = millisecondsFormatter(absValue); + let absValue = Math.abs(value); + let formattedValue = millisecondsFormatter(absValue); return value < 0 ? `-${formattedValue}` : `+${formattedValue}`; } diff --git a/server/sonar-web/src/main/js/main/nav/app.js b/server/sonar-web/src/main/js/main/nav/app.js index 16d2a04c780..35c9266c28d 100644 --- a/server/sonar-web/src/main/js/main/nav/app.js +++ b/server/sonar-web/src/main/js/main/nav/app.js @@ -15,8 +15,8 @@ export default class App { let options = window.sonarqube; return new Promise((resolve) => { - let response = {}, - requests = []; + let response = {}; + let requests = []; requests.push( App.renderGlobalNav(options).then(r => response.global = r) diff --git a/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js b/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js index d853e622fbd..bffbb2ba094 100644 --- a/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js +++ b/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js @@ -59,8 +59,8 @@ export default React.createClass({ }, isCustomDashboardActive(customDashboard) { - let path = window.location.pathname, - params = qs.parse(window.location.search.substr(1)); + let path = window.location.pathname; + let params = qs.parse(window.location.search.substr(1)); return path.indexOf(`${window.baseUrl}/dashboard`) === 0 && params['did'] === `${customDashboard.key}`; }, @@ -161,9 +161,9 @@ export default React.createClass({ return null; } let isSettingsActive = SETTINGS_URLS.some(url => { - return window.location.href.indexOf(url) !== -1; - }), - className = 'dropdown' + (isSettingsActive ? ' active' : ''); + return window.location.href.indexOf(url) !== -1; + }); + let className = 'dropdown' + (isSettingsActive ? ' active' : ''); return ( <li className={className}> <a className="dropdown-toggle navbar-admin-link" data-toggle="dropdown" href="#"> diff --git a/server/sonar-web/src/main/js/main/nav/component/component-nav-meta.js b/server/sonar-web/src/main/js/main/nav/component/component-nav-meta.js index fe6df61c599..ed3cdcb52bf 100644 --- a/server/sonar-web/src/main/js/main/nav/component/component-nav-meta.js +++ b/server/sonar-web/src/main/js/main/nav/component/component-nav-meta.js @@ -4,9 +4,9 @@ import PendingIcon from '../../../components/shared/pending-icon'; export default React.createClass({ render() { - let metaList = [], - canSeeBackgroundTasks = this.props.conf.showBackgroundTasks, - backgroundTasksUrl = `${baseUrl}/project/background_tasks?id=${encodeURIComponent(this.props.component.key)}`; + let metaList = []; + let canSeeBackgroundTasks = this.props.conf.showBackgroundTasks; + let backgroundTasksUrl = `${baseUrl}/project/background_tasks?id=${encodeURIComponent(this.props.component.key)}`; if (this.props.isInProgress) { let tooltip = canSeeBackgroundTasks ? @@ -14,7 +14,9 @@ export default React.createClass({ window.t('component_navigation.status.in_progress'); metaList.push( <li key="isInProgress" data-toggle="tooltip" title={tooltip}> - <i className="spinner" style={{ marginTop: '-1px' }}/> <span className="text-info">{window.t('background_task.status.IN_PROGRESS')}</span> + <i className="spinner" style={{ marginTop: '-1px' }}/> + {' '} + <span className="text-info">{window.t('background_task.status.IN_PROGRESS')}</span> </li> ); } else if (this.props.isPending) { diff --git a/server/sonar-web/src/main/js/main/nav/component/component-nav.js b/server/sonar-web/src/main/js/main/nav/component/component-nav.js index 9b1140f1834..c3b182647fb 100644 --- a/server/sonar-web/src/main/js/main/nav/component/component-nav.js +++ b/server/sonar-web/src/main/js/main/nav/component/component-nav.js @@ -2,8 +2,8 @@ import $ from 'jquery'; import _ from 'underscore'; import React from 'react'; import ReactDOM from 'react-dom'; -import {STATUSES} from '../../../apps/background-tasks/constants'; -import {getTasksForComponent} from '../../../api/ce'; +import { STATUSES } from '../../../apps/background-tasks/constants'; +import { getTasksForComponent } from '../../../api/ce'; import ComponentNavFavorite from './component-nav-favorite'; import ComponentNavBreadcrumbs from './component-nav-breadcrumbs'; import ComponentNavMeta from './component-nav-meta'; diff --git a/server/sonar-web/src/main/js/main/nav/global/global-nav-branding.js b/server/sonar-web/src/main/js/main/nav/global/global-nav-branding.js index 1421220263f..9cf36406e46 100644 --- a/server/sonar-web/src/main/js/main/nav/global/global-nav-branding.js +++ b/server/sonar-web/src/main/js/main/nav/global/global-nav-branding.js @@ -2,14 +2,14 @@ import React from 'react'; export default React.createClass({ renderLogo() { - let url = this.props.logoUrl || `${window.baseUrl}/images/logo.svg`, - width = this.props.logoWidth || 100, - height = 30, - title = window.t('layout.sonar.slogan'); + let url = this.props.logoUrl || `${window.baseUrl}/images/logo.svg`; + let width = this.props.logoWidth || 100; + let height = 30; + let title = window.t('layout.sonar.slogan'); return <img src={url} width={width} height={height} - alt={title} + alt={title} title={title}/>; }, diff --git a/server/sonar-web/src/main/js/widgets/old/widget.js b/server/sonar-web/src/main/js/widgets/old/widget.js index 193725cbfd6..82d6bec9972 100644 --- a/server/sonar-web/src/main/js/widgets/old/widget.js +++ b/server/sonar-web/src/main/js/widgets/old/widget.js @@ -50,7 +50,7 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; that.widget.options(that.options()); that.widget.metrics(response.metrics); that.widget.components(response.components); - if(typeof that.widget.parseSource === 'function') { + if (typeof that.widget.parseSource === 'function') { that.widget.parseSource(response); } if (typeof that.widget.maxResultsReached === 'function') { |