aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-12-22 17:11:21 +0100
committerGitHub <noreply@github.com>2016-12-22 17:11:21 +0100
commitbc07b29494abd5dff7875175df91df38d0b908ac (patch)
tree05f82f8ca3787011e2a0810e7d85c9d81e4b222f /server/sonar-web/src/main/js/apps
parente52ca10a4a1b07d05c894e0d8564ffa1b5af3e47 (diff)
downloadsonarqube-bc07b29494abd5dff7875175df91df38d0b908ac.tar.gz
sonarqube-bc07b29494abd5dff7875175df91df38d0b908ac.zip
upgrade eslint and its plugins, tune rules (#1481)
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/LoginForm.js4
-rw-r--r--server/sonar-web/src/main/js/apps/account/components/Password.js1
-rw-r--r--server/sonar-web/src/main/js/apps/account/components/Tokens.js3
-rw-r--r--server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.js3
-rw-r--r--server/sonar-web/src/main/js/apps/account/notifications/Notifications.js1
-rw-r--r--server/sonar-web/src/main/js/apps/account/notifications/NotificationsList.js1
-rw-r--r--server/sonar-web/src/main/js/apps/account/notifications/ProjectNotification.js1
-rw-r--r--server/sonar-web/src/main/js/apps/account/notifications/ProjectNotifications.js5
-rw-r--r--server/sonar-web/src/main/js/apps/account/profile/UserExternalIdentity.js3
-rw-r--r--server/sonar-web/src/main/js/apps/account/projects/Projects.js1
-rw-r--r--server/sonar-web/src/main/js/apps/account/tokens-view.js5
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js36
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.js18
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/DateFilter.js1
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/Header.js1
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/Search.js5
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/Stats.js24
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.js3
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/TaskDay.js2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/TaskExecutionTime.js2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/TaskStatus.js1
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.js24
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.js3
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/types.js2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/utils.js2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/views/ScannerContextView.js4
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js4
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/Breadcrumb.js1
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/Breadcrumbs.js1
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/Component.js1
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/ComponentName.js40
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/ComponentPin.js3
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/Components.js1
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/Search.js3
-rw-r--r--server/sonar-web/src/main/js/apps/code/utils.js1
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js12
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/confirm-dialog.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/controller.js8
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/custom-labels-facet.js2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/key-facet.js2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/quality-profile-facet.js18
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/severity-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js10
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/facets/type-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/init.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/models/rule.js2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/models/rules.js8
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js8
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js18
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/delete-rule-view.js3
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js22
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-filter-mixin.js2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js6
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js6
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js8
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js11
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/workspace-list-view.js6
-rw-r--r--server/sonar-web/src/main/js/apps/component-issues/components/ComponentIssuesAppContainer.js2
-rw-r--r--server/sonar-web/src/main/js/apps/component-issues/init.js2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/app/App.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js5
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetails.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsContainer.js4
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsHeader.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/Breadcrumb.js2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/Breadcrumbs.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsList.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsListRow.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/EmptyComponentsList.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListHeader.js3
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListView.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListViewContainer.js4
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureCell.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureDrilldown.js2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/TreeView.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/TreeViewContainer.js4
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js5
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/home/AllMeasures.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/home/DomainMeasures.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/home/Home.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/home/HomeMeasuresList.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/home/MeasureListValue.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/home/MeasuresList.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/home/reducer.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/store/rootReducer.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/store/treeViewActions.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/store/treeViewReducer.js1
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/create-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/custom-measures.js4
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/delete-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/form-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/init.js2
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/update-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/groups/create-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/groups/delete-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/groups/init.js2
-rw-r--r--server/sonar-web/src/main/js/apps/groups/update-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/component-viewer/main.js44
-rw-r--r--server/sonar-web/src/main/js/apps/issues/controller.js12
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js6
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/author-facet.js2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js8
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/file-facet.js2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/language-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/module-facet.js2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/project-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/reporter-facet.js2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/resolution-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/severity-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/status-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/facets/type-facet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/init.js2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/models/issue.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/models/issues.js16
-rw-r--r--server/sonar-web/src/main/js/apps/issues/workspace-header-view.js6
-rw-r--r--server/sonar-web/src/main/js/apps/issues/workspace-list-item-view.js10
-rw-r--r--server/sonar-web/src/main/js/apps/issues/workspace-list-view.js32
-rw-r--r--server/sonar-web/src/main/js/apps/maintenance/init.js2
-rw-r--r--server/sonar-web/src/main/js/apps/maintenance/main-view.js8
-rw-r--r--server/sonar-web/src/main/js/apps/metrics/create-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/metrics/delete-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/metrics/form-view.js6
-rw-r--r--server/sonar-web/src/main/js/apps/metrics/init.js8
-rw-r--r--server/sonar-web/src/main/js/apps/metrics/update-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.js1
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/LeakPeriodLegend.js1
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/Timeline.js1
-rw-r--r--server/sonar-web/src/main/js/apps/overview/events/AnalysesList.js6
-rw-r--r--server/sonar-web/src/main/js/apps/overview/main/Coverage.js1
-rw-r--r--server/sonar-web/src/main/js/apps/overview/meta/Meta.js1
-rw-r--r--server/sonar-web/src/main/js/apps/overview/meta/MetaKey.js1
-rw-r--r--server/sonar-web/src/main/js/apps/overview/qualityGate/EmptyQualityGate.js1
-rw-r--r--server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGate.js1
-rw-r--r--server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateConditions.js1
-rw-r--r--server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/QualityGateCondition-test.js1
-rw-r--r--server/sonar-web/src/main/js/apps/permission-templates/components/NameCell.js3
-rw-r--r--server/sonar-web/src/main/js/apps/permission-templates/utils.js1
-rw-r--r--server/sonar-web/src/main/js/apps/permission-templates/views/CreateView.js4
-rw-r--r--server/sonar-web/src/main/js/apps/permission-templates/views/UpdateView.js4
-rw-r--r--server/sonar-web/src/main/js/apps/permission-templates/views/UsersView.js2
-rw-r--r--server/sonar-web/src/main/js/apps/permissions/global/components/PageHeader.js9
-rw-r--r--server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js2
-rw-r--r--server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.js2
-rw-r--r--server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateForm.js4
-rw-r--r--server/sonar-web/src/main/js/apps/project-admin/key/UpdateForm.js2
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/actions.js2
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.js2
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageHeader.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddEventForm.js6
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeEventForm.js2
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.js2
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.js2
-rw-r--r--server/sonar-web/src/main/js/apps/projects-admin/main.js53
-rw-r--r--server/sonar-web/src/main/js/apps/projects-admin/projects.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projects-admin/search.js26
-rw-r--r--server/sonar-web/src/main/js/apps/projects-admin/views/BulkApplyTemplateView.js2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/AllProjects.js1
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/ProjectCardMeasures.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/Filter.js6
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/FilterContainer.js2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/AddConditionForm.js1
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js1
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js5
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/ConditionsAlert.js7
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Details.js7
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.js1
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.js1
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Intro.js1
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/List.js1
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.js1
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Projects.js3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/containers/QualityGatesAppContainer.js1
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/views/gate-projects-view.js1
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.js1
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.js8
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/views/ChangeProjectsView.js2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/views/CreateProfileView.js8
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/views/RestoreProfileView.js2
-rw-r--r--server/sonar-web/src/main/js/apps/sessions/components/LoginForm.js4
-rw-r--r--server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js2
-rw-r--r--server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.js2
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/App.js2
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/Definition.js5
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/DefinitionChanges.js4
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/DefinitionDefaults.js2
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/EmailForm.js4
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/inputs/Input.js1
-rw-r--r--server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js4
-rw-r--r--server/sonar-web/src/main/js/apps/settings/store/values/actions.js1
-rw-r--r--server/sonar-web/src/main/js/apps/settings/store/values/reducer.js2
-rw-r--r--server/sonar-web/src/main/js/apps/system/__tests__/system-test.js4
-rw-r--r--server/sonar-web/src/main/js/apps/system/item-boolean.js2
-rw-r--r--server/sonar-web/src/main/js/apps/system/item-log-level.js29
-rw-r--r--server/sonar-web/src/main/js/apps/system/item-object.js18
-rw-r--r--server/sonar-web/src/main/js/apps/system/item-value.js2
-rw-r--r--server/sonar-web/src/main/js/apps/system/main.js92
-rw-r--r--server/sonar-web/src/main/js/apps/system/section.js30
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/init.js4
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/plugins.js33
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/search-view.js2
-rw-r--r--server/sonar-web/src/main/js/apps/users/change-password-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/users/create-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/users/deactivate-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/users/form-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/users/init.js3
-rw-r--r--server/sonar-web/src/main/js/apps/users/list-view.js1
-rw-r--r--server/sonar-web/src/main/js/apps/users/tokens-view.js5
-rw-r--r--server/sonar-web/src/main/js/apps/users/update-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/web-api/components/Action.js1
-rw-r--r--server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.js1
-rw-r--r--server/sonar-web/src/main/js/apps/web-api/components/Domain.js1
-rw-r--r--server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.js1
-rw-r--r--server/sonar-web/src/main/js/apps/web-api/components/Params.js1
-rw-r--r--server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.js1
-rw-r--r--server/sonar-web/src/main/js/apps/web-api/components/Search.js7
230 files changed, 535 insertions, 688 deletions
diff --git a/server/sonar-web/src/main/js/apps/about/components/LoginForm.js b/server/sonar-web/src/main/js/apps/about/components/LoginForm.js
index 631959f8ec0..c9f022a3d94 100644
--- a/server/sonar-web/src/main/js/apps/about/components/LoginForm.js
+++ b/server/sonar-web/src/main/js/apps/about/components/LoginForm.js
@@ -57,7 +57,7 @@ export default class LoginForm extends React.Component {
<div className="big-spacer-bottom">
<label htmlFor="login" className="login-label">{translate('login')}</label>
- <input type="text" id="login" name="login" className="login-input" maxLength="255" required
+ <input type="text" id="login" name="login" className="login-input" maxLength="255" required={true}
placeholder={translate('login')}
value={this.state.login}
onChange={e => this.setState({ login: e.target.value })}/>
@@ -65,7 +65,7 @@ export default class LoginForm extends React.Component {
<div className="big-spacer-bottom">
<label htmlFor="password" className="login-label">{translate('password')}</label>
- <input type="password" id="password" name="password" className="login-input" required
+ <input type="password" id="password" name="password" className="login-input" required={true}
placeholder={translate('password')}
value={this.state.password}
onChange={e => this.setState({ password: e.target.value })}/>
diff --git a/server/sonar-web/src/main/js/apps/account/components/Password.js b/server/sonar-web/src/main/js/apps/account/components/Password.js
index fb3641d676b..05060c6d968 100644
--- a/server/sonar-web/src/main/js/apps/account/components/Password.js
+++ b/server/sonar-web/src/main/js/apps/account/components/Password.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React, { Component } from 'react';
-
import { changePassword } from '../../../api/users';
import { translate } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/account/components/Tokens.js b/server/sonar-web/src/main/js/apps/account/components/Tokens.js
index 8c3170380ef..c0043abf678 100644
--- a/server/sonar-web/src/main/js/apps/account/components/Tokens.js
+++ b/server/sonar-web/src/main/js/apps/account/components/Tokens.js
@@ -19,7 +19,6 @@
*/
import Backbone from 'backbone';
import React, { Component } from 'react';
-
import TokensView from '../tokens-view';
export default class Tokens extends Component {
@@ -49,6 +48,6 @@ export default class Tokens extends Component {
}
render () {
- return <div ref="container"></div>;
+ return <div ref="container"/>;
}
}
diff --git a/server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.js b/server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.js
index 180f22468f8..469dfe26312 100644
--- a/server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.js
+++ b/server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import NotificationsList from './NotificationsList';
import { translate } from '../../../helpers/l10n';
@@ -32,7 +31,7 @@ export default function GlobalNotifications ({ notifications, channels }) {
<table className="form">
<thead>
<tr>
- <th></th>
+ <th/>
{channels.map(channel => (
<th key={channel} className="text-center">
<h4>{translate('notification.channel', channel)}</h4>
diff --git a/server/sonar-web/src/main/js/apps/account/notifications/Notifications.js b/server/sonar-web/src/main/js/apps/account/notifications/Notifications.js
index 96eb2b21109..27b96e5b2a0 100644
--- a/server/sonar-web/src/main/js/apps/account/notifications/Notifications.js
+++ b/server/sonar-web/src/main/js/apps/account/notifications/Notifications.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import GlobalNotifications from './GlobalNotifications';
import ProjectNotifications from './ProjectNotifications';
import { translate } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/account/notifications/NotificationsList.js b/server/sonar-web/src/main/js/apps/account/notifications/NotificationsList.js
index a8044b4b142..cc7476e9686 100644
--- a/server/sonar-web/src/main/js/apps/account/notifications/NotificationsList.js
+++ b/server/sonar-web/src/main/js/apps/account/notifications/NotificationsList.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { translate } from '../../../helpers/l10n';
export default function NotificationsList ({ notifications, checkboxName, checkboxId }) {
diff --git a/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotification.js b/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotification.js
index 95fb143d8de..325cca54e1c 100644
--- a/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotification.js
+++ b/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotification.js
@@ -19,7 +19,6 @@
*/
import classNames from 'classnames';
import React, { Component } from 'react';
-
import NotificationsList from './NotificationsList';
import { translate } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotifications.js b/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotifications.js
index 08c5956cd81..cddb8f9149b 100644
--- a/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotifications.js
+++ b/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotifications.js
@@ -19,13 +19,12 @@
*/
import React from 'react';
import Select from 'react-select';
-
import ProjectNotification from './ProjectNotification';
import { translate } from '../../../helpers/l10n';
import { getProjectsWithInternalId } from '../../../api/components';
export default function ProjectNotifications ({ notifications, channels, onAddProject, onRemoveProject }) {
- const loadOptions = (query) => {
+ const loadOptions = query => {
return getProjectsWithInternalId(query)
.then(results => results.map(r => {
return {
@@ -38,7 +37,7 @@ export default function ProjectNotifications ({ notifications, channels, onAddPr
});
};
- const handleAddProject = (selected) => {
+ const handleAddProject = selected => {
const project = {
internalId: selected.value,
name: selected.label
diff --git a/server/sonar-web/src/main/js/apps/account/profile/UserExternalIdentity.js b/server/sonar-web/src/main/js/apps/account/profile/UserExternalIdentity.js
index 5fa90240cef..232d2dc639c 100644
--- a/server/sonar-web/src/main/js/apps/account/profile/UserExternalIdentity.js
+++ b/server/sonar-web/src/main/js/apps/account/profile/UserExternalIdentity.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { getIdentityProviders } from '../../../api/users';
export default class UserExternalIdentity extends React.Component {
@@ -78,7 +77,7 @@ export default class UserExternalIdentity extends React.Component {
return (
<div className="identity-provider"
style={{ backgroundColor: identityProvider.backgroundColor }}>
- <img src={window.baseUrl + identityProvider.iconPath} width="14" height="14"/>
+ <img src={window.baseUrl + identityProvider.iconPath} width="14" height="14" alt={identityProvider.name}/>
{' '}
{user.externalIdentity}
</div>
diff --git a/server/sonar-web/src/main/js/apps/account/projects/Projects.js b/server/sonar-web/src/main/js/apps/account/projects/Projects.js
index 30c56708215..8667fd9f0a0 100644
--- a/server/sonar-web/src/main/js/apps/account/projects/Projects.js
+++ b/server/sonar-web/src/main/js/apps/account/projects/Projects.js
@@ -28,7 +28,6 @@ export default class Projects extends React.Component {
projects: projectsListType.isRequired,
total: React.PropTypes.number.isRequired,
loading: React.PropTypes.bool.isRequired,
- search: React.PropTypes.func.isRequired,
loadMore: React.PropTypes.func.isRequired
};
diff --git a/server/sonar-web/src/main/js/apps/account/tokens-view.js b/server/sonar-web/src/main/js/apps/account/tokens-view.js
index 1429bd31d5a..5ba74f49104 100644
--- a/server/sonar-web/src/main/js/apps/account/tokens-view.js
+++ b/server/sonar-web/src/main/js/apps/account/tokens-view.js
@@ -21,7 +21,6 @@ import $ from 'jquery';
import _ from 'underscore';
import Marionette from 'backbone.marionette';
import Clipboard from 'clipboard';
-
import Template from './templates/account-tokens.hbs';
import { getTokens, generateToken, revokeToken } from '../../api/user-tokens';
@@ -67,7 +66,7 @@ export default Marionette.ItemView.extend({
});
},
- onRevokeTokenFormSubmit(e) {
+ onRevokeTokenFormSubmit (e) {
e.preventDefault();
const tokenName = $(e.currentTarget).data('token');
const token = _.findWhere(this.tokens, { name: `${tokenName}` });
@@ -93,7 +92,7 @@ export default Marionette.ItemView.extend({
this.newToken = null;
},
- serializeData() {
+ serializeData () {
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
tokens: this.tokens,
newToken: this.newToken,
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js b/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js
index 9c882e0ce88..8c0b458208b 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js
@@ -56,7 +56,7 @@ describe('Search', () => {
expect(component.find('.js-search').length).toBe(0);
});
- it('should search', (done) => {
+ it('should search', done => {
const searchSpy = jest.fn();
const component = shallow(<Search {...defaultProps} onFilterUpdate={searchSpy}/>);
const searchInput = component.find('.js-search');
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js
index d94951e32c7..45be61d8a9c 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js
@@ -34,17 +34,30 @@ import { Task } from '../types';
import { getComponent } from '../../../store/rootReducer';
import '../background-tasks.css';
+type Props = {
+ component: Object,
+ location: Object
+};
+
+type State = {
+ loading: boolean,
+ tasks: Array<*>,
+ types?: Array<*>,
+ query: string,
+ pendingCount: number,
+ failingCount: number,
+};
+
class BackgroundTasksApp extends React.Component {
+ loadTasksDebounced: Function;
+ mounted: boolean;
+ props: Props;
+
static contextTypes = {
router: React.PropTypes.object.isRequired
};
- static propTypes = {
- component: React.PropTypes.object,
- location: React.PropTypes.object
- };
-
- state: any = {
+ state: State = {
loading: true,
tasks: [],
@@ -69,11 +82,11 @@ class BackgroundTasksApp extends React.Component {
});
}
- shouldComponentUpdate (nextProps: any, nextState: any) {
+ shouldComponentUpdate (nextProps: Props, nextState: State) {
return shallowCompare(this, nextProps, nextState);
}
- componentDidUpdate (prevProps: any) {
+ componentDidUpdate (prevProps: Props) {
if (prevProps.component !== this.props.component ||
prevProps.location !== this.props.location) {
this.loadTasksDebounced();
@@ -84,9 +97,6 @@ class BackgroundTasksApp extends React.Component {
this.mounted = false;
}
- loadTasksDebounced: any;
- mounted: boolean;
-
loadTasks () {
this.setState({ loading: true });
@@ -98,7 +108,7 @@ class BackgroundTasksApp extends React.Component {
const query = this.props.location.query.query || DEFAULT_FILTERS.query;
const filters = { status, taskType, currents, minSubmittedAt, maxExecutedAt, query };
- const parameters: any = mapFiltersToParameters(filters);
+ const parameters: Object = mapFiltersToParameters(filters);
if (this.props.component) {
parameters.componentId = this.props.component.id;
@@ -125,7 +135,7 @@ class BackgroundTasksApp extends React.Component {
});
}
- handleFilterUpdate (nextState: any) {
+ handleFilterUpdate (nextState: Object) {
const nextQuery = { ...this.props.location.query, ...nextState };
// remove defaults
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.js b/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.js
index f6cdd97a28b..41394a5a6b2 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.js
@@ -17,13 +17,12 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
- /* @flow */
+/* @flow */
import React from 'react';
-
import Checkbox from '../../../components/controls/Checkbox';
import { CURRENTS } from '../constants';
-const CurrentsFilter = ({ value, onChange } : { value: ?string, onChange: any }) => {
+const CurrentsFilter = ({ value, onChange }: { value: ?string, onChange: (string) => void }) => {
function handleChange (value) {
const newValue = value ? CURRENTS.ONLY_CURRENTS : CURRENTS.ALL;
onChange(newValue);
@@ -40,13 +39,16 @@ const CurrentsFilter = ({ value, onChange } : { value: ?string, onChange: any })
return (
<div className="bt-search-form-field">
- <Checkbox
- checked={checked}
- onCheck={handleChange}/>
+ <Checkbox checked={checked} onCheck={handleChange}/>
&nbsp;
<label
- onClick={handleLabelClick}
- style={{ cursor: 'pointer' }}>Yes</label>
+ style={{ cursor: 'pointer' }}
+ role="checkbox"
+ tabIndex="0"
+ aria-checked={checked ? 'true' : 'false'}
+ onClick={handleLabelClick}>
+ Yes
+ </label>
</div>
);
};
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/DateFilter.js b/server/sonar-web/src/main/js/apps/background-tasks/components/DateFilter.js
index bdebed1fcaf..3cfa4a42028 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/DateFilter.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/DateFilter.js
@@ -21,7 +21,6 @@
import $ from 'jquery';
import moment from 'moment';
import React, { Component } from 'react';
-
import { DATE_FORMAT } from '../constants';
export default class DateFilter extends Component {
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Header.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Header.js
index a8dc2607fde..2867a89970b 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/Header.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Header.js
@@ -19,7 +19,6 @@
*/
/* @flow */
import React from 'react';
-
import { translate } from '../../../helpers/l10n';
const Header = () => {
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js
index 1b03a3bbead..d048f3e09e9 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js
@@ -19,7 +19,6 @@
*/
/* @flow */
import React from 'react';
-
import StatusFilter from './StatusFilter';
import TypesFilter from './TypesFilter';
import CurrentsFilter from './CurrentsFilter';
@@ -58,12 +57,12 @@ export default class Search extends React.Component {
this.props.onFilterUpdate({ query });
}
- handleReload (e: any) {
+ handleReload (e: Object) {
e.target.blur();
this.props.onReload();
}
- handleReset (e: any) {
+ handleReset (e: Object) {
e.preventDefault();
e.target.blur();
this.props.onFilterUpdate(DEFAULT_FILTERS);
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Stats.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Stats.js
index a7f6ffe3e29..4d3e87bf424 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/Stats.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Stats.js
@@ -20,28 +20,32 @@
/* @flow */
import React from 'react';
import shallowCompare from 'react-addons-shallow-compare';
-
import { translate } from '../../../helpers/l10n';
+type Props = {
+ failingCount: number,
+ pendingCount: number,
+ onShowFailing: () => void,
+ onCancelAllPending: () => void
+};
+
+type State = Object;
+
export default class Stats extends React.Component {
- static propTypes = {
- failingCount: React.PropTypes.number,
- pendingCount: React.PropTypes.number,
- onShowFailing: React.PropTypes.func.isRequired,
- onCancelAllPending: React.PropTypes.func.isRequired
- };
+ props: Props;
+ state: State;
- shouldComponentUpdate (nextProps: any, nextState: any) {
+ shouldComponentUpdate (nextProps: Props, nextState: State) {
return shallowCompare(this, nextProps, nextState);
}
- handleCancelAllPending (e: any) {
+ handleCancelAllPending (e: Object) {
e.preventDefault();
e.target.blur();
this.props.onCancelAllPending();
}
- handleShowFailing (e: any) {
+ handleShowFailing (e: Object) {
e.preventDefault();
e.target.blur();
this.props.onShowFailing();
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.js b/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.js
index f0693466bd6..a7663ac0940 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.js
@@ -20,11 +20,10 @@
/* @flow */
import React from 'react';
import Select from 'react-select';
-
import { STATUSES } from '../constants';
import { translate } from '../../../helpers/l10n';
-const StatusFilter = ({ value, onChange }: { value: ?string, onChange: any }) => {
+const StatusFilter = ({ value, onChange }: { value: ?string, onChange: Function }) => {
const options = [
{ value: STATUSES.ALL, label: translate('background_task.status.ALL') },
{ value: STATUSES.ALL_EXCEPT_PENDING, label: translate('background_task.status.ALL_EXCEPT_PENDING') },
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDay.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDay.js
index c7275f1668e..55cba79ec3e 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDay.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDay.js
@@ -26,7 +26,7 @@ function isAnotherDay (a, b) {
return !moment(a).isSame(moment(b), 'day');
}
-const TaskDay = ({ task, prevTask } : { task: Task, prevTask: ?Task }) => {
+const TaskDay = ({ task, prevTask }: { task: Task, prevTask: ?Task }) => {
const shouldDisplay = !prevTask || isAnotherDay(task.submittedAt, prevTask.submittedAt);
return (
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskExecutionTime.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskExecutionTime.js
index e0d12d09b7a..7fda5c4304a 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskExecutionTime.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskExecutionTime.js
@@ -22,7 +22,7 @@ import React from 'react';
import { formatDuration } from '../utils';
import { Task } from '../types';
-const TaskExecutionTime = ({ task } : { task: Task }) => {
+const TaskExecutionTime = ({ task }: { task: Task }) => {
return (
<td className="thin nowrap text-right">
{formatDuration(task.executionTimeMs)}
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskStatus.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskStatus.js
index 89e925590fe..dceb2c8f61f 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskStatus.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskStatus.js
@@ -19,7 +19,6 @@
*/
/* @flow */
import React from 'react';
-
import { STATUSES } from './../constants';
import PendingIcon from '../../../components/shared/pending-icon';
import { translate } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.js
index d696d47f9a2..b81e7818849 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.js
@@ -21,21 +21,25 @@
import React from 'react';
import shallowCompare from 'react-addons-shallow-compare';
import classNames from 'classnames';
-
import Task from './Task';
import { translate } from '../../../helpers/l10n';
+type Props = {
+ tasks: Array<*>,
+ component: Object,
+ types: Array<*>,
+ loading: boolean,
+ onCancelTask: Function,
+ onFilterTask: Function
+};
+
+type State = Object;
+
export default class Tasks extends React.Component {
- static propTypes = {
- tasks: React.PropTypes.array.isRequired,
- component: React.PropTypes.object,
- types: React.PropTypes.array.isRequired,
- loading: React.PropTypes.bool.isRequired,
- onCancelTask: React.PropTypes.func.isRequired,
- onFilterTask: React.PropTypes.func.isRequired
- };
+ props: Props;
+ state: State;
- shouldComponentUpdate (nextProps: any, nextState: any) {
+ shouldComponentUpdate (nextProps: Props, nextState: State) {
return shallowCompare(this, nextProps, nextState);
}
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.js
index d167e23a0f6..61d0f3b369b 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.js
@@ -20,11 +20,10 @@
/* @flow */
import React from 'react';
import Select from 'react-select';
-
import { ALL_TYPES } from '../constants';
import { translate } from '../../../helpers/l10n';
-const TypesFilter = ({ value, onChange, types }: { value: string, onChange: any, types: string[] }) => {
+const TypesFilter = ({ value, onChange, types }: { value: string, onChange: Function, types: string[] }) => {
const options = types.map(t => {
return {
value: t,
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/types.js b/server/sonar-web/src/main/js/apps/background-tasks/types.js
index 00c000fd0c8..42ab8b6294b 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/types.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/types.js
@@ -18,5 +18,5 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
export type Task = {
- id: string;
+ id: string
};
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/utils.js b/server/sonar-web/src/main/js/apps/background-tasks/utils.js
index cf0c4c89b8b..6801335faad 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/utils.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/utils.js
@@ -25,7 +25,7 @@ export function updateTask (tasks: Task[], newTask: Task) {
return tasks.map(task => task.id === newTask.id ? newTask : task);
}
-export function mapFiltersToParameters (filters: any = {}) {
+export function mapFiltersToParameters (filters: Object = {}) {
const parameters = {};
if (filters.status === STATUSES.ALL) {
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/views/ScannerContextView.js b/server/sonar-web/src/main/js/apps/background-tasks/views/ScannerContextView.js
index 21da975c6bb..67d557e3517 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/views/ScannerContextView.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/views/ScannerContextView.js
@@ -30,14 +30,14 @@ export default Modal.extend({
this.loadScannerContext();
},
- loadScannerContext() {
+ loadScannerContext () {
getTask(this.options.task.id, ['scannerContext']).then(task => {
this.scannerContext = task.scannerContext;
this.render();
});
},
- serializeData() {
+ serializeData () {
return {
task: this.options.task,
scannerContext: this.scannerContext
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js b/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js
index 809467dff01..12e0e4b1eb2 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js
@@ -31,7 +31,7 @@ export default Modal.extend({
this.loadStacktrace();
},
- loadStacktrace() {
+ loadStacktrace () {
getTask(this.options.task.id, ['stacktrace']).then(task => {
this.loaded = true;
this.stacktrace = task.errorStacktrace;
@@ -39,7 +39,7 @@ export default Modal.extend({
});
},
- serializeData() {
+ serializeData () {
return {
task: this.options.task,
stacktrace: this.stacktrace,
diff --git a/server/sonar-web/src/main/js/apps/code/components/Breadcrumb.js b/server/sonar-web/src/main/js/apps/code/components/Breadcrumb.js
index 1280e2289b4..016de7c2475 100644
--- a/server/sonar-web/src/main/js/apps/code/components/Breadcrumb.js
+++ b/server/sonar-web/src/main/js/apps/code/components/Breadcrumb.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import ComponentName from './ComponentName';
const Breadcrumb = ({ rootComponent, component, canBrowse }) => (
diff --git a/server/sonar-web/src/main/js/apps/code/components/Breadcrumbs.js b/server/sonar-web/src/main/js/apps/code/components/Breadcrumbs.js
index 611b98b1b5d..c4cdc3a2f15 100644
--- a/server/sonar-web/src/main/js/apps/code/components/Breadcrumbs.js
+++ b/server/sonar-web/src/main/js/apps/code/components/Breadcrumbs.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Breadcrumb from './Breadcrumb';
const Breadcrumbs = ({ rootComponent, breadcrumbs }) => (
diff --git a/server/sonar-web/src/main/js/apps/code/components/Component.js b/server/sonar-web/src/main/js/apps/code/components/Component.js
index 7a772566d7f..26980087887 100644
--- a/server/sonar-web/src/main/js/apps/code/components/Component.js
+++ b/server/sonar-web/src/main/js/apps/code/components/Component.js
@@ -21,7 +21,6 @@ import classNames from 'classnames';
import React from 'react';
import ReactDOM from 'react-dom';
import shallowCompare from 'react-addons-shallow-compare';
-
import ComponentName from './ComponentName';
import ComponentMeasure from './ComponentMeasure';
import ComponentDetach from './ComponentDetach';
diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentName.js b/server/sonar-web/src/main/js/apps/code/components/ComponentName.js
index 3ac38eff1b5..9a11b7e103f 100644
--- a/server/sonar-web/src/main/js/apps/code/components/ComponentName.js
+++ b/server/sonar-web/src/main/js/apps/code/components/ComponentName.js
@@ -66,28 +66,26 @@ const ComponentName = ({ component, rootComponent, previous, canBrowse }) => {
<span>{name}</span>
</Link>
);
- } else {
- if (canBrowse) {
- const query = { id: rootComponent.key };
- if (component.key !== rootComponent.key) {
- Object.assign(query, { selected: component.key });
- }
- inner = (
- <Link to={{ pathname: '/code', query }} className="link-with-icon">
- <QualifierIcon qualifier={component.qualifier}/>
- {' '}
- <span>{name}</span>
- </Link>
- );
- } else {
- inner = (
- <span>
- <QualifierIcon qualifier={component.qualifier}/>
- {' '}
- {name}
- </span>
- );
+ } else if (canBrowse) {
+ const query = { id: rootComponent.key };
+ if (component.key !== rootComponent.key) {
+ Object.assign(query, { selected: component.key });
}
+ inner = (
+ <Link to={{ pathname: '/code', query }} className="link-with-icon">
+ <QualifierIcon qualifier={component.qualifier}/>
+ {' '}
+ <span>{name}</span>
+ </Link>
+ );
+ } else {
+ inner = (
+ <span>
+ <QualifierIcon qualifier={component.qualifier}/>
+ {' '}
+ {name}
+ </span>
+ );
}
return (
diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentPin.js b/server/sonar-web/src/main/js/apps/code/components/ComponentPin.js
index b22c078aa07..058004de0c1 100644
--- a/server/sonar-web/src/main/js/apps/code/components/ComponentPin.js
+++ b/server/sonar-web/src/main/js/apps/code/components/ComponentPin.js
@@ -18,13 +18,12 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Workspace from '../../../components/workspace/main';
import PinIcon from '../../../components/shared/pin-icon';
import { translate } from '../../../helpers/l10n';
const ComponentPin = ({ component }) => {
- const handleClick = (e) => {
+ const handleClick = e => {
e.preventDefault();
Workspace.openComponent({ uuid: component.id });
};
diff --git a/server/sonar-web/src/main/js/apps/code/components/Components.js b/server/sonar-web/src/main/js/apps/code/components/Components.js
index 902ccccd345..d2b86fcd7a5 100644
--- a/server/sonar-web/src/main/js/apps/code/components/Components.js
+++ b/server/sonar-web/src/main/js/apps/code/components/Components.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Component from './Component';
import ComponentsEmpty from './ComponentsEmpty';
import ComponentsHeader from './ComponentsHeader';
diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.js b/server/sonar-web/src/main/js/apps/code/components/Search.js
index 659b397074c..91b527710ae 100644
--- a/server/sonar-web/src/main/js/apps/code/components/Search.js
+++ b/server/sonar-web/src/main/js/apps/code/components/Search.js
@@ -21,7 +21,6 @@ import React from 'react';
import shallowCompare from 'react-addons-shallow-compare';
import classNames from 'classnames';
import debounce from 'lodash/debounce';
-
import Components from './Components';
import { getTree } from '../../../api/components';
import { translate, translateWithParameters } from '../../../helpers/l10n';
@@ -192,7 +191,7 @@ export default class Search extends React.Component {
<div id="code-search" className={containerClassName}>
<form className="search-box" onSubmit={this.handleSubmit.bind(this)}>
<button className="search-box-submit button-clean">
- <i className="icon-search"></i>
+ <i className="icon-search"/>
</button>
<input
diff --git a/server/sonar-web/src/main/js/apps/code/utils.js b/server/sonar-web/src/main/js/apps/code/utils.js
index 72c1f58425d..a4b74f38e33 100644
--- a/server/sonar-web/src/main/js/apps/code/utils.js
+++ b/server/sonar-web/src/main/js/apps/code/utils.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import without from 'lodash/without';
-
import {
addComponent,
getComponent as getComponentFromBucket,
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 773106b4056..f58aff2b8ce 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
@@ -68,10 +68,10 @@ export default ModalFormView.extend({
const that = this;
let looper = $.Deferred().resolve();
this.disableForm();
- profiles.forEach(function (profile) {
+ profiles.forEach(profile => {
const opts = _.extend({}, options, { profile_key: profile });
- looper = looper.then(function () {
- return $.post(url, opts).done(function (r) {
+ looper = looper.then(() => {
+ return $.post(url, opts).done(r => {
if (!that.isDestroyed) {
if (r.failed) {
that.showWarnMessage(profile, r.succeeded, r.failed);
@@ -82,7 +82,7 @@ export default ModalFormView.extend({
});
});
});
- looper.done(function () {
+ looper.done(() => {
that.options.app.controller.fetchList();
if (!that.isDestroyed) {
that.$(that.ui.codingRulesSubmitBulkChange.selector).hide();
@@ -98,9 +98,7 @@ export default ModalFormView.extend({
const languages = queryLanguages && queryLanguages.length > 0 ? queryLanguages.split(',') : [];
let profiles = this.options.app.qualityProfiles;
if (languages.length > 0) {
- profiles = _.filter(profiles, function (profile) {
- return languages.indexOf(profile.lang) !== -1;
- });
+ profiles = _.filter(profiles, profile => languages.indexOf(profile.lang) !== -1);
}
return profiles;
},
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/confirm-dialog.js b/server/sonar-web/src/main/js/apps/coding-rules/confirm-dialog.js
index 3325e156b5a..10f1902018d 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/confirm-dialog.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/confirm-dialog.js
@@ -42,13 +42,13 @@ export default function (options) {
settings.html + '</div><div class="modal-foot"><button data-confirm="yes">' + settings.yesLabel +
'</button> <a data-confirm="no" class="action">' + settings.noLabel + '</a></div></div>');
- $('[data-confirm=yes]', dialog).on('click', function () {
+ $('[data-confirm=yes]', dialog).on('click', () => {
dialog.dialog('close');
settings.yesHandler();
return settings.always();
});
- $('[data-confirm=no]', dialog).on('click', function () {
+ $('[data-confirm=no]', dialog).on('click', () => {
dialog.dialog('close');
settings.noHandler();
return settings.always();
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 27d6a475da4..f22cfbb19a3 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
@@ -61,7 +61,7 @@ export default Controller.extend({
const that = this;
const url = window.baseUrl + '/api/rules/search';
const options = _.extend(this._searchParameters(), this.app.state.get('query'));
- return $.get(url, options).done(function (r) {
+ return $.get(url, options).done(r => {
const rules = that.app.list.parseRules(r);
if (firstPage) {
that.app.list.reset(rules);
@@ -94,7 +94,7 @@ export default Controller.extend({
const url = window.baseUrl + '/api/rules/search';
const facet = this.app.facets.get(id);
const options = _.extend({ facets: id, ps: 1 }, this.app.state.get('query'));
- return $.get(url, options).done(function (r) {
+ return $.get(url, options).done(r => {
const facetData = _.findWhere(r.facets, { property: id });
if (facetData) {
facet.set(facetData);
@@ -116,7 +116,7 @@ export default Controller.extend({
key: rule.id,
actives: true
};
- return $.get(url, options).done(function (data) {
+ return $.get(url, options).done(data => {
rule.set(data.rule);
rule.addExtraAttributes(that.app.repositories);
});
@@ -126,7 +126,7 @@ export default Controller.extend({
const that = this;
const ruleModel = typeof rule === 'string' ? new Rule({ key: rule }) : rule;
this.app.layout.workspaceDetailsRegion.reset();
- this.getRuleDetails(ruleModel).done(function (data) {
+ this.getRuleDetails(ruleModel).done(data => {
key.setScope('details');
that.app.workspaceListView.unbindScrollEvents();
that.app.state.set({ rule: ruleModel });
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 598f09c3a58..9d43e62bde9 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
@@ -56,8 +56,6 @@ export default BaseFacet.extend({
sortValues (values) {
const order = this.severities;
- return _.sortBy(values, function (v) {
- return order.indexOf(v.val);
- });
+ return _.sortBy(values, v => order.indexOf(v.val));
}
});
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 3cd599acaf8..908d59307b2 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
@@ -29,7 +29,7 @@ export default BaseFacet.extend({
getValues () {
const that = this;
const labels = that.getLabelsSource();
- return this.model.getValues().map(function (item) {
+ return this.model.getValues().map(item => {
return _.extend(item, {
label: labels[item.val]
});
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 bd7a3bba91c..438209740db 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
@@ -60,7 +60,7 @@ export default BaseFacet.extend({
getValues () {
const values = ['NONE', 'INHERITED', 'OVERRIDES'];
- return values.map(function (key) {
+ return values.map(key => {
return {
label: translate('coding_rules.filters.inheritance', key.toLowerCase()),
val: key
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 62613aabed5..ac2373659b0 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
@@ -17,8 +17,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import BaseFacet from './base-facet';
import _ from 'underscore';
+import BaseFacet from './base-facet';
import Template from '../templates/facets/coding-rules-key-facet.hbs';
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 9af9562fff7..f9bb3674191 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
@@ -36,7 +36,7 @@ export default CustomValuesFacet.extend({
results (data) {
return {
more: false,
- results: data.languages.map(function (lang) {
+ results: data.languages.map(lang => {
return { id: lang.key, text: lang.name };
})
};
@@ -51,7 +51,7 @@ export default CustomValuesFacet.extend({
getValues () {
const that = this;
const labels = that.getLabelsSource();
- return this.model.getValues().map(function (item) {
+ return this.model.getValues().map(item => {
return _.extend(item, {
label: labels[item.val]
});
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 b50c8bd7481..338f088bc62 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
@@ -38,16 +38,14 @@ export default BaseFacet.extend({
const languages = languagesQuery != null ? languagesQuery.split(',') : [];
const lang = languages.length === 1 ? languages[0] : null;
const values = this.options.app.qualityProfiles
- .filter(function (profile) {
- return lang != null ? profile.lang === lang : true;
- })
- .map(function (profile) {
- return {
- label: profile.name,
- extra: that.options.app.languages[profile.lang],
- val: profile.key
- };
- });
+ .filter(profile => (
+ lang != null ? profile.lang === lang : true
+ ))
+ .map(profile => ({
+ label: profile.name,
+ extra: that.options.app.languages[profile.lang],
+ val: profile.key
+ }));
return _.sortBy(values, 'label');
},
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 76067f5b24c..5c0c0b6c28f 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
@@ -36,7 +36,7 @@ export default CustomValuesFacet.extend({
results (data) {
return {
more: false,
- results: data.repositories.map(function (repo) {
+ results: data.repositories.map(repo => {
return { id: repo.key, text: repo.name + ' (' + repo.language + ')' };
})
};
@@ -52,7 +52,7 @@ export default CustomValuesFacet.extend({
getValues () {
const that = this;
const labels = that.getLabelsSource();
- return this.model.getValues().map(function (value) {
+ return this.model.getValues().map(value => {
const repo = _.findWhere(that.options.app.repositories, { key: value.val });
if (repo != null) {
const langName = that.options.app.languages[repo.language];
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 970722c318c..44f61bd04c4 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
@@ -27,8 +27,6 @@ export default BaseFacet.extend({
sortValues (values) {
const order = this.severities;
- return _.sortBy(values, function (v) {
- return order.indexOf(v.val);
- });
+ return _.sortBy(values, v => order.indexOf(v.val));
}
});
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 eab8055cfe2..7bc588e2ead 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
@@ -26,17 +26,15 @@ export default BaseFacet.extend({
getValues () {
const values = this.model.getValues();
- const x = values.map(function (value) {
- return _.extend(value, { label: translate('rules.status', value.val.toLowerCase()) });
- });
+ const x = values.map(value => (
+ _.extend(value, { label: translate('rules.status', value.val.toLowerCase()) })
+ ));
return x;
},
sortValues (values) {
const order = this.statuses;
- return _.sortBy(values, function (v) {
- return order.indexOf(v.val);
- });
+ return _.sortBy(values, v => order.indexOf(v.val));
},
serializeData () {
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 b672b3af9ba..747b4f93cfb 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
@@ -35,7 +35,7 @@ export default CustomValuesFacet.extend({
results (data) {
return {
more: false,
- results: data.tags.map(function (tag) {
+ results: data.tags.map(tag => {
return { id: tag, text: tag };
})
};
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/type-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/type-facet.js
index af8b47c9248..021070ee8e5 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/facets/type-facet.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/type-facet.js
@@ -26,9 +26,7 @@ export default BaseFacet.extend({
sortValues (values) {
const order = ['BUG', 'VULNERABILITY', 'CODE_SMELL'];
- return _.sortBy(values, function (v) {
- return order.indexOf(v.val);
- });
+ return _.sortBy(values, v => order.indexOf(v.val));
}
});
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/init.js b/server/sonar-web/src/main/js/apps/coding-rules/init.js
index 37470e65465..b3513a01abf 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/init.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/init.js
@@ -35,13 +35,13 @@ import FiltersView from './filters-view';
const App = new Marionette.Application();
App.on('start', function (el) {
- $.get(window.baseUrl + '/api/rules/app').done(function (r) {
+ $.get(window.baseUrl + '/api/rules/app').done(r => {
App.canWrite = r.canWrite;
App.qualityProfiles = _.sortBy(r.qualityprofiles, ['name', 'lang']);
App.languages = _.extend(r.languages, {
none: 'None'
});
- _.map(App.qualityProfiles, function (profile) {
+ _.map(App.qualityProfiles, profile => {
profile.language = App.languages[profile.lang];
});
App.repositories = r.repositories;
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 8ceb2ec3dc8..17129610b17 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
@@ -36,7 +36,7 @@ export default Backbone.Model.extend({
},
getInactiveProfiles (actives, profiles) {
- return actives.map(function (profile) {
+ return actives.map(profile => {
const profileBase = _.findWhere(profiles, { key: profile.qProfile });
if (profileBase != null) {
_.extend(profile, profileBase);
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 57906ae9c7f..4766dd0e17b 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
@@ -29,8 +29,8 @@ export default Backbone.Collection.extend({
const profiles = r.qProfiles || [];
if (r.actives != null) {
- rules = rules.map(function (rule) {
- const activations = (r.actives[rule.key] || []).map(function (activation) {
+ rules = rules.map(rule => {
+ const activations = (r.actives[rule.key] || []).map(activation => {
const profile = profiles[activation.qProfile];
if (profile != null) {
_.extend(activation, { profile });
@@ -47,13 +47,13 @@ export default Backbone.Collection.extend({
},
setIndex () {
- this.forEach(function (rule, index) {
+ this.forEach((rule, index) => {
rule.set({ index });
});
},
addExtraAttributes (repositories) {
- this.models.forEach(function (model) {
+ this.models.forEach(model => {
model.addExtraAttributes(repositories);
});
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js
index 5566f70945d..638722e77fb 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js
@@ -100,7 +100,7 @@ export default Marionette.LayoutView.extend({
template_key: this.model.get('key'),
f: 'name,severity,params'
};
- return $.get(url, options).done(function (data) {
+ return $.get(url, options).done(data => {
that.customRules.reset(data.rules);
});
},
@@ -111,15 +111,15 @@ export default Marionette.LayoutView.extend({
bindShortcuts () {
const that = this;
- key('up', 'details', function () {
+ key('up', 'details', () => {
that.options.app.controller.selectPrev();
return false;
});
- key('down', 'details', function () {
+ key('down', 'details', () => {
that.options.app.controller.selectNext();
return false;
});
- key('left, backspace', 'details', function () {
+ key('left, backspace', 'details', () => {
that.options.app.controller.hideDetails();
return false;
});
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 b9ebae4d1a2..6e41407104d 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
@@ -128,9 +128,7 @@ export default ModalFormView.extend({
value
};
}).get();
- options.params = params.map(function (param) {
- return param.key + '=' + csvEscape(param.value);
- }).join(';');
+ options.params = params.map(param => param.key + '=' + csvEscape(param.value)).join(';');
this.sendRequest(action, options);
},
@@ -145,9 +143,7 @@ export default ModalFormView.extend({
prevent_reactivation: false
};
const params = this.existingRule.params;
- options.params = params.map(function (param) {
- return param.key + '=' + param.defaultValue;
- }).join(';');
+ options.params = params.map(param => param.key + '=' + param.defaultValue).join(';');
this.sendRequest('create', options);
},
@@ -163,14 +159,14 @@ export default ModalFormView.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
if (that.options.templateRule) {
that.options.app.controller.showDetails(that.options.templateRule);
} else {
that.options.app.controller.showDetails(that.model);
}
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
if (jqXHR.status === 409) {
that.existingRule = jqXHR.responseJSON.rule;
that.showErrors([], [{ msg: translate('coding_rules.reactivate.help') }]);
@@ -187,12 +183,10 @@ export default ModalFormView.extend({
if (this.options.templateRule) {
params = this.options.templateRule.get('params');
} else if (this.model && this.model.has('params')) {
- params = this.model.get('params').map(function (p) {
- return _.extend(p, { value: p.defaultValue });
- });
+ params = this.model.get('params').map(p => _.extend(p, { value: p.defaultValue }));
}
- const statuses = ['READY', 'BETA', 'DEPRECATED'].map(function (status) {
+ const statuses = ['READY', 'BETA', 'DEPRECATED'].map(status => {
return {
id: status,
text: translate('rules.status', status.toLowerCase())
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/delete-rule-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/delete-rule-view.js
index b0d344118f0..f3f543991b2 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/delete-rule-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/delete-rule-view.js
@@ -18,14 +18,13 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import $ from 'jquery';
-
import ModalFormView from '../../../components/common/modal-form';
import Template from '../templates/rule/coding-rules-delete-rule.hbs';
export default ModalFormView.extend({
template: Template,
- onFormSubmit() {
+ onFormSubmit () {
ModalFormView.prototype.onFormSubmit.apply(this, arguments);
const url = window.baseUrl + '/api/rules/delete';
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 dce27670e4d..62840df8ee0 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
@@ -66,7 +66,7 @@ export default ModalForm.extend({
formatResult: format,
formatSelection: format
});
- setTimeout(function () {
+ setTimeout(() => {
that.$('a').first().focus();
}, 0);
},
@@ -81,9 +81,7 @@ export default ModalForm.extend({
value: $(this).val() || $(this).prop('placeholder') || ''
};
}).get();
- const paramsHash = (params.map(function (param) {
- return param.key + '=' + csvEscape(param.value);
- })).join(';');
+ const paramsHash = (params.map(param => param.key + '=' + csvEscape(param.value))).join(';');
if (this.model) {
profileKey = this.model.get('qProfile');
@@ -110,10 +108,10 @@ export default ModalForm.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
that.destroy();
that.trigger('profileActivated', severity, params, profileKey);
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
@@ -121,12 +119,10 @@ export default ModalForm.extend({
getAvailableQualityProfiles (lang) {
const activeQualityProfiles = this.collection || new Backbone.Collection();
- const inactiveProfiles = _.reject(this.options.app.qualityProfiles, function (profile) {
- return activeQualityProfiles.findWhere({ key: profile.key });
- });
- return _.filter(inactiveProfiles, function (profile) {
- return profile.lang === lang;
- });
+ const inactiveProfiles = _.reject(this.options.app.qualityProfiles, profile => (
+ activeQualityProfiles.findWhere({ key: profile.key })
+ ));
+ return _.filter(inactiveProfiles, profile => profile.lang === lang);
},
serializeData () {
@@ -134,7 +130,7 @@ export default ModalForm.extend({
if (this.model != null) {
const modelParams = this.model.get('params');
if (_.isArray(modelParams)) {
- params = params.map(function (p) {
+ params = params.map(p => {
const parentParam = _.findWhere(modelParams, { key: p.key });
if (parentParam != null) {
_.extend(p, { value: parentParam.value });
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 49486712db8..ae3ca70b0fa 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
@@ -70,13 +70,13 @@ export default Marionette.ItemView.extend({
key: this.model.get('key'),
markdown_note: this.ui.extendDescriptionText.val()
}
- }).done(function (r) {
+ }).done(r => {
that.model.set({
htmlNote: r.rule.htmlNote,
mdNote: r.rule.mdNote
});
that.render();
- }).fail(function () {
+ }).fail(() => {
that.render();
});
},
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-filter-mixin.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-filter-mixin.js
index 4bc6a1ef131..f990e39cf48 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-filter-mixin.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-filter-mixin.js
@@ -31,7 +31,7 @@ export default {
bottomRight: true,
model: this.model
});
- popup.on('select', function (property, value) {
+ popup.on('select', (property, value) => {
const obj = {};
obj[property] = '' + value;
that.options.app.state.updateFilter(obj);
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js
index 97c5499ae3b..be53536adfb 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js
@@ -29,7 +29,7 @@ export default Marionette.ItemView.extend({
const that = this;
this.total = null;
this.projects = [];
- this.requestIssues().done(function () {
+ this.requestIssues().done(() => {
that.render();
});
},
@@ -43,10 +43,10 @@ export default Marionette.ItemView.extend({
ps: 1,
facets: 'projectUuids'
};
- return $.get(url, options).done(function (r) {
+ return $.get(url, options).done(r => {
const projectsFacet = _.findWhere(r.facets, { property: 'projectUuids' });
let projects = projectsFacet != null ? projectsFacet.values : [];
- projects = projects.map(function (project) {
+ projects = projects.map(project => {
const projectBase = _.findWhere(r.components, { uuid: project.val });
return _.extend(project, {
name: projectBase != null ? projectBase.longName : ''
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js
index dc67ad6c39f..9d01de1ec4e 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js
@@ -63,7 +63,7 @@ export default Marionette.ItemView.extend(RuleFilterMixin).extend({
changeTags () {
const that = this;
- this.requestTags().done(function (r) {
+ this.requestTags().done(r => {
that.ui.tagInput.select2({
tags: _.difference(_.difference(r.tags, that.model.get('tags')), that.model.get('sysTags')),
width: '300px'
@@ -95,10 +95,10 @@ export default Marionette.ItemView.extend(RuleFilterMixin).extend({
key: this.model.get('key'),
tags
}
- }).done(function (r) {
+ }).done(r => {
that.model.set('tags', r.rule.tags);
that.cancelEdit();
- }).always(function () {
+ }).always(() => {
that.cancelEdit();
});
},
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js
index a2dcd979655..d6786752061 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js
@@ -60,7 +60,7 @@ export default Marionette.ItemView.extend({
rule: this.options.rule,
app: this.options.app
});
- activationView.on('profileActivated', function () {
+ activationView.on('profileActivated', () => {
that.options.refreshActives();
});
activationView.render();
@@ -81,7 +81,7 @@ export default Marionette.ItemView.extend({
rule_key: ruleKey,
reset: true
}
- }).done(function () {
+ }).done(() => {
that.options.refreshActives();
});
}
@@ -102,7 +102,7 @@ export default Marionette.ItemView.extend({
profile_key: that.model.get('qProfile'),
rule_key: ruleKey
}
- }).done(function () {
+ }).done(() => {
that.options.refreshActives();
});
}
@@ -135,7 +135,7 @@ export default Marionette.ItemView.extend({
if (!parent) {
return params;
}
- return params.map(function (p) {
+ return params.map(p => {
const parentParam = _.findWhere(parent.params, { key: p.key });
if (parentParam != null) {
return _.extend(p, {
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 e3abef640bf..625dd58fcb2 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
@@ -61,7 +61,7 @@ export default Marionette.CompositeView.extend({
collection: this.collection,
app: this.options.app
});
- activationView.on('profileActivated', function (severity, params, profile) {
+ activationView.on('profileActivated', (severity, params, profile) => {
if (that.options.app.state.get('query').qprofile === profile) {
const activation = {
severity,
@@ -78,7 +78,7 @@ export default Marionette.CompositeView.extend({
refreshActives () {
const that = this;
- this.options.app.controller.getRuleDetails(this.model).done(function (data) {
+ this.options.app.controller.getRuleDetails(this.model).done(data => {
that.collection.reset(that.model.getInactiveProfiles(data.actives, that.options.app.qualityProfiles));
});
},
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 a965be731e3..c96b5e42af9 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
@@ -69,15 +69,16 @@ export default WorkspaceListItemView.extend(RuleFilterMixin).extend({
activate () {
const that = this;
const selectedProfile = this.options.app.state.get('query').qprofile;
- const othersQualityProfiles = _.reject(this.options.app.qualityProfiles, function (profile) {
- return profile.key === selectedProfile;
- });
+ const othersQualityProfiles = _.reject(
+ this.options.app.qualityProfiles,
+ profile => profile.key === selectedProfile
+ );
const activationView = new ProfileActivationView({
rule: this.model,
collection: new Backbone.Collection(othersQualityProfiles),
app: this.options.app
});
- activationView.on('profileActivated', function (severity, params, profile) {
+ activationView.on('profileActivated', (severity, params, profile) => {
const activation = {
severity,
params,
@@ -104,7 +105,7 @@ export default WorkspaceListItemView.extend(RuleFilterMixin).extend({
profile_key: activation.qProfile,
rule_key: ruleKey
}
- }).done(function () {
+ }).done(() => {
that.model.unset('activation');
});
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-view.js b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-view.js
index eda62e135e3..0027d77be23 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-view.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-view.js
@@ -31,15 +31,15 @@ export default WorkspaceListView.extend({
bindShortcuts () {
WorkspaceListView.prototype.bindShortcuts.apply(this, arguments);
const that = this;
- key('right', 'list', function () {
+ key('right', 'list', () => {
that.options.app.controller.showDetailsForSelected();
return false;
});
- key('a', function () {
+ key('a', () => {
that.options.app.controller.activateCurrent();
return false;
});
- key('d', function () {
+ key('d', () => {
that.options.app.controller.deactivateCurrent();
return false;
});
diff --git a/server/sonar-web/src/main/js/apps/component-issues/components/ComponentIssuesAppContainer.js b/server/sonar-web/src/main/js/apps/component-issues/components/ComponentIssuesAppContainer.js
index 3c08036cb91..cd350778a4a 100644
--- a/server/sonar-web/src/main/js/apps/component-issues/components/ComponentIssuesAppContainer.js
+++ b/server/sonar-web/src/main/js/apps/component-issues/components/ComponentIssuesAppContainer.js
@@ -18,8 +18,8 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-import init from '../init';
import { connect } from 'react-redux';
+import init from '../init';
import { getComponent, getCurrentUser } from '../../../store/rootReducer';
class ComponentIssuesAppContainer extends React.Component {
diff --git a/server/sonar-web/src/main/js/apps/component-issues/init.js b/server/sonar-web/src/main/js/apps/component-issues/init.js
index 3727a08c044..fc3ed9e8464 100644
--- a/server/sonar-web/src/main/js/apps/component-issues/init.js
+++ b/server/sonar-web/src/main/js/apps/component-issues/init.js
@@ -111,7 +111,7 @@ App.updateContextFacets = function () {
});
};
-App.on('start', function (options) {
+App.on('start', options => {
init.call(App, options);
});
diff --git a/server/sonar-web/src/main/js/apps/component-measures/app/App.js b/server/sonar-web/src/main/js/apps/component-measures/app/App.js
index 75fa2d320a4..80d365c932b 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/app/App.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/app/App.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Spinner from './../components/Spinner';
export default class App extends React.Component {
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js b/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js
index ae760d3a0a5..7ccd892e8f2 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js
@@ -19,7 +19,6 @@
*/
import React from 'react';
import moment from 'moment';
-
import { TooltipsContainer } from '../../../components/mixins/tooltips-mixin';
import { getPeriodLabel, getPeriodDate } from '../../../helpers/periods';
import { translateWithParameters } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js b/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js
index bb5e925bc73..d96e9f42bb0 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Spinner from './../Spinner';
import { BubbleChart as OriginalBubbleChart } from '../../../../components/charts/bubble-chart';
import bubbles from '../../config/bubbles';
@@ -136,8 +135,8 @@ export default class BubbleChart extends React.Component {
};
});
- const formatXTick = (tick) => formatMeasure(tick, this.xMetric.type);
- const formatYTick = (tick) => formatMeasure(tick, this.yMetric.type);
+ const formatXTick = tick => formatMeasure(tick, this.xMetric.type);
+ const formatYTick = tick => formatMeasure(tick, this.yMetric.type);
return (
<OriginalBubbleChart
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetails.js b/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetails.js
index 125b9c72897..15ef60cad3d 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetails.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetails.js
@@ -19,7 +19,6 @@
*/
import React from 'react';
import { Link, IndexLink } from 'react-router';
-
import Spinner from './../components/Spinner';
import MeasureDetailsHeader from './MeasureDetailsHeader';
import MeasureDrilldown from './drilldown/MeasureDrilldown';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsContainer.js b/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsContainer.js
index b569c01636b..833a01abf67 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsContainer.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsContainer.js
@@ -25,8 +25,8 @@ import {
getMeasuresAppDetailsMetric,
getMeasuresAppDetailsMeasure,
getMeasuresAppDetailsSecondaryMeasure,
- getMeasuresAppDetailsPeriods
- , getMeasuresAppComponent
+ getMeasuresAppDetailsPeriods,
+ getMeasuresAppComponent
} from '../../../store/rootReducer';
const mapStateToProps = state => {
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsHeader.js b/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsHeader.js
index dfa4e81a60b..c3769f4b5d0 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsHeader.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsHeader.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Measure from './../components/Measure';
import LanguageDistribution from '../../../components/charts/LanguageDistribution';
import LeakPeriodLegend from '../components/LeakPeriodLegend';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/Breadcrumb.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/Breadcrumb.js
index 15a44e30452..10e9578f6d2 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/Breadcrumb.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/Breadcrumb.js
@@ -23,7 +23,7 @@ import { isDiffMetric, formatLeak } from '../../utils';
import { formatMeasure } from '../../../../helpers/measures';
const Breadcrumb = ({ component, metric, onBrowse }) => {
- const handleClick = (e) => {
+ const handleClick = e => {
e.preventDefault();
e.target.blur();
onBrowse(component);
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/Breadcrumbs.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/Breadcrumbs.js
index dfcf88d9bef..eb28c93def5 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/Breadcrumbs.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/Breadcrumbs.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Breadcrumb from './Breadcrumb';
const Breadcrumbs = ({ breadcrumbs, metric, onBrowse }) => (
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js
index cad8f0d7fb4..13592032907 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js
@@ -19,7 +19,6 @@
*/
import React from 'react';
import classNames from 'classnames';
-
import QualifierIcon from '../../../../components/shared/qualifier-icon';
import { splitPath } from '../../../../helpers/path';
import { getComponentUrl } from '../../../../helpers/urls';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsList.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsList.js
index ff6b063441b..04c0c3a242e 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsList.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsList.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import ComponentsListRow from './ComponentsListRow';
import EmptyComponentsList from './EmptyComponentsList';
import complementary from '../../config/complementary';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsListRow.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsListRow.js
index d734aca5f75..613ac3b3834 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsListRow.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsListRow.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import ComponentCell from './ComponentCell';
import MeasureCell from './MeasureCell';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/EmptyComponentsList.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/EmptyComponentsList.js
index 7b1a11d5791..fd15d5593ab 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/EmptyComponentsList.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/EmptyComponentsList.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { translate } from '../../../../helpers/l10n';
const EmptyComponentsList = () => {
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListHeader.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListHeader.js
index a12be76c7e4..749a633ae07 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListHeader.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListHeader.js
@@ -18,11 +18,10 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Breadcrumbs from './Breadcrumbs';
import { translateWithParameters } from '../../../../helpers/l10n';
-const ListHeader = (props) => {
+const ListHeader = props => {
const { metric, breadcrumbs, onBrowse } = props;
const { selectedIndex, componentsCount, onSelectPrevious, onSelectNext } = props;
const hasPrevious = selectedIndex > 0;
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListView.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListView.js
index 49a3635cf8d..8897b9df2f9 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListView.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListView.js
@@ -19,7 +19,6 @@
*/
import React from 'react';
import classNames from 'classnames';
-
import ComponentsList from './ComponentsList';
import ListHeader from './ListHeader';
import Spinner from '../../components/Spinner';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListViewContainer.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListViewContainer.js
index 57d20b41a46..ee9b1182799 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListViewContainer.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListViewContainer.js
@@ -27,8 +27,8 @@ import {
getMeasuresAppListPageIndex,
getMeasuresAppAllMetrics,
getMeasuresAppDetailsMetric,
- isMeasuresAppFetching
- , getMeasuresAppComponent
+ isMeasuresAppFetching,
+ getMeasuresAppComponent
} from '../../../../store/rootReducer';
const mapStateToProps = state => {
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureCell.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureCell.js
index bed973fa11f..1744215ee16 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureCell.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureCell.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Measure from '../../components/Measure';
const MeasureCell = ({ component, metric }) => {
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureDrilldown.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureDrilldown.js
index cc7e06546ed..b274c3a4d60 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureDrilldown.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/MeasureDrilldown.js
@@ -19,13 +19,11 @@
*/
import React from 'react';
import { Link } from 'react-router';
-
import IconList from './../../components/IconList';
import IconTree from './../../components/IconTree';
import IconBubbles from './../../components/IconBubbles';
import IconTreemap from './../../components/IconTreemap';
import IconHistory from './../../components/IconHistory';
-
import { hasHistory, hasBubbleChart, hasTreemap } from '../../utils';
import { translate } from '../../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/TreeView.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/TreeView.js
index e71b35e5e7a..0e6d8923ffa 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/TreeView.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/TreeView.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import ComponentsList from './ComponentsList';
import ListHeader from './ListHeader';
import Spinner from '../../components/Spinner';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/TreeViewContainer.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/TreeViewContainer.js
index cb5e2a0e76b..070175f1fe6 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/TreeViewContainer.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/TreeViewContainer.js
@@ -36,8 +36,8 @@ import {
getMeasuresAppTreePageIndex,
getMeasuresAppAllMetrics,
getMeasuresAppDetailsMetric,
- isMeasuresAppFetching
- , getMeasuresAppComponent
+ isMeasuresAppFetching,
+ getMeasuresAppComponent
} from '../../../../store/rootReducer';
const mapStateToProps = state => {
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js b/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js
index 3e0f15fec20..71281f261f3 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js
@@ -20,7 +20,6 @@
import sortBy from 'lodash/sortBy';
import moment from 'moment';
import React from 'react';
-
import Spinner from './../../components/Spinner';
import Timeline from '../../../../components/charts/Timeline';
import { getTimeMachineData } from '../../../../api/time-machine';
@@ -117,8 +116,8 @@ export default class MeasureHistory extends React.Component {
};
});
- const formatValue = (value) => formatMeasure(value, metric.type);
- const formatYTick = (tick) => formatMeasure(tick, getShortType(metric.type));
+ const formatValue = value => formatMeasure(value, metric.type);
+ const formatYTick = tick => formatMeasure(tick, getShortType(metric.type));
return (
<div style={{ height: HEIGHT }}>
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js b/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js
index 1fe61d36ec9..12060645ba4 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Spinner from './../../components/Spinner';
import { getLeakValue } from '../../utils';
import { Treemap } from '../../../../components/charts/treemap';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasures.js b/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasures.js
index bb3cb74a2ff..9225f9ba49d 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasures.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasures.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import AllMeasuresDomain from './AllMeasuresDomain';
import { getLeakPeriodLabel } from '../../../helpers/periods';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js b/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js
index 6f14109c27a..c5017b1d982 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import HomeMeasuresList from './HomeMeasuresList';
import { getLocalizedMetricDomain } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/DomainMeasures.js b/server/sonar-web/src/main/js/apps/component-measures/home/DomainMeasures.js
index 00d84915590..106f144c0d3 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/home/DomainMeasures.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/home/DomainMeasures.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import HomeMeasuresList from './HomeMeasuresList';
import MeasureBubbleChartContainer from '../components/bubbleChart/MeasureBubbleChartContainer';
import { hasBubbleChart } from '../utils';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/Home.js b/server/sonar-web/src/main/js/apps/component-measures/home/Home.js
index 6b1faf5402f..306667e20f5 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/home/Home.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/home/Home.js
@@ -19,7 +19,6 @@
*/
import React from 'react';
import { Link, IndexLink } from 'react-router';
-
import LeakPeriodLegend from '../components/LeakPeriodLegend';
import { getLeakPeriod } from '../../../helpers/periods';
import { translate, getLocalizedMetricDomain } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/HomeMeasuresList.js b/server/sonar-web/src/main/js/apps/component-measures/home/HomeMeasuresList.js
index ce240293f58..c6335fbbf83 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/home/HomeMeasuresList.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/home/HomeMeasuresList.js
@@ -20,7 +20,6 @@
import React from 'react';
import partition from 'lodash/partition';
import sortBy from 'lodash/sortBy';
-
import MeasuresList from './MeasuresList';
import { domains } from '../config/domains';
import { getLocalizedMetricName } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/MeasureListValue.js b/server/sonar-web/src/main/js/apps/component-measures/home/MeasureListValue.js
index b7ef268f81c..a6d9767e923 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/home/MeasureListValue.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/home/MeasureListValue.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Measure from '../components/Measure';
import { isDiffMetric } from '../utils';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/MeasuresList.js b/server/sonar-web/src/main/js/apps/component-measures/home/MeasuresList.js
index 42d3f46e94f..5186914c1b5 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/home/MeasuresList.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/home/MeasuresList.js
@@ -19,7 +19,6 @@
*/
import React from 'react';
import { Link } from 'react-router';
-
import MeasureListValue from './MeasureListValue';
import { getLocalizedMetricName } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/reducer.js b/server/sonar-web/src/main/js/apps/component-measures/home/reducer.js
index 1771e6a68bd..99b9bdc82bb 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/home/reducer.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/home/reducer.js
@@ -21,7 +21,6 @@ import groupBy from 'lodash/groupBy';
import partition from 'lodash/partition';
import sortBy from 'lodash/sortBy';
import toPairs from 'lodash/toPairs';
-
import { RECEIVE_MEASURES } from './actions';
import { getLocalizedMetricName } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/store/rootReducer.js b/server/sonar-web/src/main/js/apps/component-measures/store/rootReducer.js
index f57fef25a4a..ff1c9c75895 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/store/rootReducer.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/store/rootReducer.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { combineReducers } from 'redux';
-
import appReducer from './../app/reducer';
import statusReducer from './statusReducer';
import homeReducer from '../home/reducer';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/store/treeViewActions.js b/server/sonar-web/src/main/js/apps/component-measures/store/treeViewActions.js
index 5697f7a2a79..2b4983ef65f 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/store/treeViewActions.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/store/treeViewActions.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import initial from 'lodash/initial';
-
import { getComponentTree } from '../../../api/components';
import { enhanceWithMeasure } from '../utils';
import { startFetching, stopFetching } from './statusActions';
diff --git a/server/sonar-web/src/main/js/apps/component-measures/store/treeViewReducer.js b/server/sonar-web/src/main/js/apps/component-measures/store/treeViewReducer.js
index 99b6c0fc374..34346ee523c 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/store/treeViewReducer.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/store/treeViewReducer.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import pick from 'lodash/pick';
-
import { DISPLAY_HOME } from './../app/actions';
import { UPDATE_STORE, INIT } from './treeViewActions';
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/create-view.js b/server/sonar-web/src/main/js/apps/custom-measures/create-view.js
index d1dda2a31e8..7d33183eb47 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/create-view.js
+++ b/server/sonar-web/src/main/js/apps/custom-measures/create-view.js
@@ -36,10 +36,10 @@ export default FormView.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
that.collection.refresh();
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/custom-measures.js b/server/sonar-web/src/main/js/apps/custom-measures/custom-measures.js
index eb64353b809..abbe306371f 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/custom-measures.js
+++ b/server/sonar-web/src/main/js/apps/custom-measures/custom-measures.js
@@ -60,9 +60,7 @@ export default Backbone.Collection.extend({
},
getTakenMetrics () {
- const metrics = this.map(function (model) {
- return model.get('metric').id;
- });
+ const metrics = this.map(model => model.get('metric').id);
return _.uniq(metrics);
}
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/delete-view.js b/server/sonar-web/src/main/js/apps/custom-measures/delete-view.js
index 4e86d48df91..f0e4f7fabae 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/delete-view.js
+++ b/server/sonar-web/src/main/js/apps/custom-measures/delete-view.js
@@ -37,10 +37,10 @@ export default ModalForm.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
collection.refresh();
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
}
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/form-view.js b/server/sonar-web/src/main/js/apps/custom-measures/form-view.js
index c25c9470ef1..5ed6696cdab 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/form-view.js
+++ b/server/sonar-web/src/main/js/apps/custom-measures/form-view.js
@@ -52,9 +52,7 @@ export default ModalForm.extend({
getAvailableMetrics () {
const takenMetrics = this.collection.getTakenMetrics();
- return this.metrics.toJSON().filter(function (metric) {
- return takenMetrics.indexOf(metric.id) === -1;
- });
+ return this.metrics.toJSON().filter(metric => takenMetrics.indexOf(metric.id) === -1);
},
serializeData () {
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/init.js b/server/sonar-web/src/main/js/apps/custom-measures/init.js
index caf512737a0..10912adbe7a 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/init.js
+++ b/server/sonar-web/src/main/js/apps/custom-measures/init.js
@@ -58,7 +58,7 @@ const init = function (el, component) {
this.customMeasures.fetch();
};
-App.on('start', function (options) {
+App.on('start', options => {
init.call(App, options.el, options.component);
});
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/update-view.js b/server/sonar-web/src/main/js/apps/custom-measures/update-view.js
index e3de7acde10..ef5e3dc7d12 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/update-view.js
+++ b/server/sonar-web/src/main/js/apps/custom-measures/update-view.js
@@ -33,10 +33,10 @@ export default FormView.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
that.collection.refresh();
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
diff --git a/server/sonar-web/src/main/js/apps/groups/create-view.js b/server/sonar-web/src/main/js/apps/groups/create-view.js
index f39b361be58..55dbef7c44d 100644
--- a/server/sonar-web/src/main/js/apps/groups/create-view.js
+++ b/server/sonar-web/src/main/js/apps/groups/create-view.js
@@ -34,10 +34,10 @@ export default FormView.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
that.collection.refresh();
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
diff --git a/server/sonar-web/src/main/js/apps/groups/delete-view.js b/server/sonar-web/src/main/js/apps/groups/delete-view.js
index df29da5b6c1..9ac1c4d0b27 100644
--- a/server/sonar-web/src/main/js/apps/groups/delete-view.js
+++ b/server/sonar-web/src/main/js/apps/groups/delete-view.js
@@ -37,10 +37,10 @@ export default ModalForm.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
collection.total--;
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
},
diff --git a/server/sonar-web/src/main/js/apps/groups/init.js b/server/sonar-web/src/main/js/apps/groups/init.js
index 4ec6a7e95e6..6c62483d4e3 100644
--- a/server/sonar-web/src/main/js/apps/groups/init.js
+++ b/server/sonar-web/src/main/js/apps/groups/init.js
@@ -54,7 +54,7 @@ const init = function (el) {
this.groups.fetch();
};
-App.on('start', function (el) {
+App.on('start', el => {
init.call(App, el);
});
diff --git a/server/sonar-web/src/main/js/apps/groups/update-view.js b/server/sonar-web/src/main/js/apps/groups/update-view.js
index da2a52615ed..a48462193b1 100644
--- a/server/sonar-web/src/main/js/apps/groups/update-view.js
+++ b/server/sonar-web/src/main/js/apps/groups/update-view.js
@@ -33,10 +33,10 @@ export default FormView.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
that.collection.refresh();
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
diff --git a/server/sonar-web/src/main/js/apps/issues/component-viewer/main.js b/server/sonar-web/src/main/js/apps/issues/component-viewer/main.js
index 9b8e8ad6974..aa8835e3137 100644
--- a/server/sonar-web/src/main/js/apps/issues/component-viewer/main.js
+++ b/server/sonar-web/src/main/js/apps/issues/component-viewer/main.js
@@ -53,36 +53,24 @@ export default SourceViewer.extend({
}
return selectedIssueView.find('.js-issue-' + action).click();
};
- key('up', 'componentViewer', function () {
+ key('up', 'componentViewer', () => {
that.options.app.controller.selectPrev();
return false;
});
- key('down', 'componentViewer', function () {
+ key('down', 'componentViewer', () => {
that.options.app.controller.selectNext();
return false;
});
- key('left,backspace', 'componentViewer', function () {
+ key('left,backspace', 'componentViewer', () => {
that.options.app.controller.closeComponentViewer();
return false;
});
- key('f', 'componentViewer', function () {
- return doAction('transition');
- });
- key('a', 'componentViewer', function () {
- return doAction('assign');
- });
- key('m', 'componentViewer', function () {
- return doAction('assign-to-me');
- });
- key('p', 'componentViewer', function () {
- return doAction('plan');
- });
- key('i', 'componentViewer', function () {
- return doAction('set-severity');
- });
- return key('c', 'componentViewer', function () {
- return doAction('comment');
- });
+ key('f', 'componentViewer', () => doAction('transition'));
+ key('a', 'componentViewer', () => doAction('assign'));
+ key('m', 'componentViewer', () => doAction('assign-to-me'));
+ key('p', 'componentViewer', () => doAction('plan'));
+ key('i', 'componentViewer', () => doAction('set-severity'));
+ key('c', 'componentViewer', () => doAction('comment'));
},
unbindShortcuts () {
@@ -126,9 +114,7 @@ export default SourceViewer.extend({
selectIssue (e) {
const key = $(e.currentTarget).data('issue-key');
- const issue = this.issues.find(function (model) {
- return model.get('key') === key;
- });
+ const issue = this.issues.find(model => model.get('key') === key);
const index = this.options.app.list.indexOf(issue);
return this.options.app.state.set({ selectedIndex: index });
},
@@ -170,9 +156,7 @@ export default SourceViewer.extend({
if ((this.baseIssue != null) && this.baseIssue.has('index')) {
index = Math.max(index, this.baseIssue.get('index'));
}
- return issues.filter(function (issue) {
- return Math.abs(issue.get('index') - index) <= that.ISSUES_LIMIT / 2;
- });
+ return issues.filter(issue => Math.abs(issue.get('index') - index) <= that.ISSUES_LIMIT / 2);
},
requestIssues () {
@@ -183,10 +167,8 @@ export default SourceViewer.extend({
} else {
r = $.Deferred().resolve().promise();
}
- return r.done(function () {
- that.issues.reset(that.options.app.list.filter(function (issue) {
- return issue.get('component') === that.model.key();
- }));
+ return r.done(() => {
+ that.issues.reset(that.options.app.list.filter(issue => issue.get('component') === that.model.key()));
that.issues.reset(that.limitIssues(that.issues));
return that.addIssuesPerLineMeta(that.issues);
});
diff --git a/server/sonar-web/src/main/js/apps/issues/controller.js b/server/sonar-web/src/main/js/apps/issues/controller.js
index 619bcacdb23..ff55d711134 100644
--- a/server/sonar-web/src/main/js/apps/issues/controller.js
+++ b/server/sonar-web/src/main/js/apps/issues/controller.js
@@ -53,7 +53,7 @@ export default Controller.extend({
if (this.options.app.state.get('isContext')) {
_.extend(data, this.options.app.state.get('contextQuery'));
}
- return $.get(window.baseUrl + '/api/issues/search', data).done(function (r) {
+ return $.get(window.baseUrl + '/api/issues/search', data).done(r => {
const issues = that.options.app.list.parseIssues(r);
if (firstPage) {
that.options.app.list.reset(issues);
@@ -61,7 +61,7 @@ export default Controller.extend({
that.options.app.list.add(issues);
}
that.options.app.list.setIndex();
- FACET_DATA_FIELDS.forEach(function (field) {
+ FACET_DATA_FIELDS.forEach(field => {
that.options.app.facets[field] = r[field];
});
that.options.app.facets.reset(that._allFacets());
@@ -107,8 +107,8 @@ export default Controller.extend({
if (this.options.app.state.get('isContext')) {
_.extend(data, this.options.app.state.get('contextQuery'));
}
- return $.get(window.baseUrl + '/api/issues/search', data, function (r) {
- FACET_DATA_FIELDS.forEach(function (field) {
+ return $.get(window.baseUrl + '/api/issues/search', data, r => {
+ FACET_DATA_FIELDS.forEach(field => {
that.options.app.facets[field] = that._mergeCollections(that.options.app.facets[field], r[field]);
});
const facetData = _.findWhere(r.facets, { property: id });
@@ -146,9 +146,7 @@ export default Controller.extend({
_.extend(filter, { assignees: '__me__' });
}
const route = [];
- _.map(filter, function (value, property) {
- return route.push(`${property}=${encodeURIComponent(value)}`);
- });
+ _.map(filter, (value, property) => route.push(`${property}=${encodeURIComponent(value)}`));
return route.join(separator);
},
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js
index 535eceeca6c..6a90690d762 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js
@@ -75,7 +75,7 @@ export default CustomValuesFacet.extend({
getValuesWithLabels () {
const values = this.model.getValues();
const users = this.options.app.facets.users;
- values.forEach(function (v) {
+ values.forEach(v => {
const login = v.val;
let name = '';
if (login) {
@@ -111,9 +111,7 @@ export default CustomValuesFacet.extend({
},
sortValues (values) {
- return _.sortBy(values, function (v) {
- return v.val === '' ? -999999 : -v.count;
- });
+ return _.sortBy(values, v => v.val === '' ? -999999 : -v.count);
},
serializeData () {
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js
index bdb039f805a..e8a3b60fad4 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js
@@ -49,7 +49,7 @@ export default CustomValuesFacet.extend({
results (data) {
return {
more: false,
- results: data.authors.map(function (author) {
+ results: data.authors.map(author => {
return { id: author, text: author };
})
};
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js
index 3a5a11fa616..404f558f9d2 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js
@@ -22,7 +22,7 @@ import _ from 'underscore';
import moment from 'moment';
import BaseFacet from './base-facet';
import Template from '../templates/facets/issues-creation-date-facet.hbs';
-import '../../../components/widgets/barchart.js';
+import '../../../components/widgets/barchart';
import { formatMeasure } from '../../../helpers/measures';
export default BaseFacet.extend({
@@ -52,7 +52,7 @@ export default BaseFacet.extend({
});
const props = ['createdAfter', 'createdBefore', 'createdAt'];
const query = this.options.app.state.get('query');
- props.forEach(function (prop) {
+ props.forEach(prop => {
const value = query[prop];
if (value != null) {
return that.$(`input[name=${prop}]`).val(value);
@@ -62,13 +62,13 @@ export default BaseFacet.extend({
if (!(_.isArray(values) && values.length > 0)) {
let date = moment();
values = [];
- _.times(10, function () {
+ _.times(10, () => {
values.push({ count: 0, val: date.toDate().toString() });
date = date.subtract(1, 'days');
});
values.reverse();
}
- values = values.map(function (v) {
+ values = values.map(v => {
const format = that.options.app.state.getFacetMode() === 'count' ? 'SHORT_INT' : 'SHORT_WORK_DUR';
const text = formatMeasure(v.count, format);
return _.extend(v, { text });
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/file-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/file-facet.js
index 134be19e085..42b0370e7bb 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/file-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/file-facet.js
@@ -36,7 +36,7 @@ export default BaseFacet.extend({
getValuesWithLabels () {
const values = this.model.getValues();
const source = this.options.app.facets.components;
- values.forEach(function (v) {
+ values.forEach(v => {
const key = v.val;
let label = null;
if (key) {
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js
index ab9b6671c0e..7fb91eca821 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js
@@ -50,7 +50,7 @@ export default CustomValuesFacet.extend({
results (data) {
return {
more: false,
- results: data.languages.map(function (lang) {
+ results: data.languages.map(lang => {
return { id: lang.key, text: lang.name };
})
};
@@ -62,7 +62,7 @@ export default CustomValuesFacet.extend({
getValuesWithLabels () {
const values = this.model.getValues();
const source = this.options.app.facets.languages;
- values.forEach(function (v) {
+ values.forEach(v => {
const key = v.val;
let label = null;
if (key) {
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/module-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/module-facet.js
index 937f4815bf9..e3bb21fde2b 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/module-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/module-facet.js
@@ -24,7 +24,7 @@ export default BaseFacet.extend({
getValuesWithLabels () {
const values = this.model.getValues();
const components = this.options.app.facets.components;
- values.forEach(function (v) {
+ values.forEach(v => {
const uuid = v.val;
let label = uuid;
if (uuid) {
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js
index bc6e193242c..a575924d5f3 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js
@@ -71,7 +71,7 @@ export default CustomValuesFacet.extend({
results (data) {
return {
more: data.p * data.ps < data.total,
- results: data.components.map(function (c) {
+ results: data.components.map(c => {
return { id: c.uuid, text: c.name };
})
};
@@ -83,7 +83,7 @@ export default CustomValuesFacet.extend({
getValuesWithLabels () {
const values = this.model.getValues();
const projects = this.options.app.facets.components;
- values.forEach(function (v) {
+ values.forEach(v => {
const uuid = v.val;
let label = '';
if (uuid) {
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/reporter-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/reporter-facet.js
index 0c299b952ad..4b7bee47e11 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/reporter-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/reporter-facet.js
@@ -39,7 +39,7 @@ export default CustomValuesFacet.extend({
getValuesWithLabels () {
const values = this.model.getValues();
const source = this.options.app.facets.users;
- values.forEach(function (v) {
+ values.forEach(v => {
const key = v.val;
let label = null;
if (key) {
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/resolution-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/resolution-facet.js
index 43c2793e247..3eaa49156f3 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/resolution-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/resolution-facet.js
@@ -60,9 +60,7 @@ export default BaseFacet.extend({
sortValues (values) {
const order = ['', 'FIXED', 'FALSE-POSITIVE', 'WONTFIX', 'REMOVED'];
- return _.sortBy(values, function (v) {
- return order.indexOf(v.val);
- });
+ return _.sortBy(values, v => order.indexOf(v.val));
}
});
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js
index 343fa489e1c..6675a0c0d3b 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js
@@ -49,7 +49,7 @@ export default CustomValuesFacet.extend({
return { q: term, p: page };
},
results (data) {
- const results = data.rules.map(function (rule) {
+ const results = data.rules.map(rule => {
const lang = rule.langName || translate('manual');
return {
id: rule.key,
@@ -68,7 +68,7 @@ export default CustomValuesFacet.extend({
getValuesWithLabels () {
const values = this.model.getValues();
const rules = this.options.app.facets.rules;
- values.forEach(function (v) {
+ values.forEach(v => {
const key = v.val;
let label = '';
let extra = '';
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/severity-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/severity-facet.js
index baed7a76c99..5b3bafea666 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/severity-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/severity-facet.js
@@ -26,9 +26,7 @@ export default BaseFacet.extend({
sortValues (values) {
const order = ['BLOCKER', 'MINOR', 'CRITICAL', 'INFO', 'MAJOR'];
- return _.sortBy(values, function (v) {
- return order.indexOf(v.val);
- });
+ return _.sortBy(values, v => order.indexOf(v.val));
}
});
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/status-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/status-facet.js
index a0bfd985016..ed7500fbd20 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/status-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/status-facet.js
@@ -26,9 +26,7 @@ export default BaseFacet.extend({
sortValues (values) {
const order = ['OPEN', 'RESOLVED', 'REOPENED', 'CLOSED', 'CONFIRMED'];
- return _.sortBy(values, function (v) {
- return order.indexOf(v.val);
- });
+ return _.sortBy(values, v => order.indexOf(v.val));
}
});
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js
index 6bf0055b685..2ab8c47190e 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js
@@ -46,7 +46,7 @@ export default CustomValuesFacet.extend({
return { q: term, ps: 10 };
},
results (data) {
- const results = data.tags.map(function (tag) {
+ const results = data.tags.map(tag => {
return { id: tag, text: tag };
});
return { more: false, results };
@@ -57,7 +57,7 @@ export default CustomValuesFacet.extend({
getValuesWithLabels () {
const values = this.model.getValues();
- values.forEach(function (v) {
+ values.forEach(v => {
v.label = v.val;
v.extra = '';
});
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/type-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/type-facet.js
index 2790b3a36a4..73bc116813a 100644
--- a/server/sonar-web/src/main/js/apps/issues/facets/type-facet.js
+++ b/server/sonar-web/src/main/js/apps/issues/facets/type-facet.js
@@ -26,9 +26,7 @@ export default BaseFacet.extend({
sortValues (values) {
const order = ['BUG', 'VULNERABILITY', 'CODE_SMELL'];
- return _.sortBy(values, function (v) {
- return order.indexOf(v.val);
- });
+ return _.sortBy(values, v => order.indexOf(v.val));
}
});
diff --git a/server/sonar-web/src/main/js/apps/issues/init.js b/server/sonar-web/src/main/js/apps/issues/init.js
index 158189b2686..9bdbde6d8e9 100644
--- a/server/sonar-web/src/main/js/apps/issues/init.js
+++ b/server/sonar-web/src/main/js/apps/issues/init.js
@@ -72,7 +72,7 @@ const init = function ({ el, user }) {
Backbone.history.start();
};
-App.on('start', function (el) {
+App.on('start', el => {
init.call(App, el);
});
diff --git a/server/sonar-web/src/main/js/apps/issues/models/issue.js b/server/sonar-web/src/main/js/apps/issues/models/issue.js
index 3ac85533697..6c1f425a540 100644
--- a/server/sonar-web/src/main/js/apps/issues/models/issue.js
+++ b/server/sonar-web/src/main/js/apps/issues/models/issue.js
@@ -22,9 +22,9 @@ import Issue from '../../../components/issue/models/issue';
export default Issue.extend({
reset (attrs, options) {
const keepFields = ['index', 'selected', 'comments'];
- keepFields.forEach(function (field) {
+ keepFields.forEach(field => {
attrs[field] = this.get(field);
- }.bind(this));
+ });
return Issue.prototype.reset.call(this, attrs, options);
}
});
diff --git a/server/sonar-web/src/main/js/apps/issues/models/issues.js b/server/sonar-web/src/main/js/apps/issues/models/issues.js
index adb43844c4d..12183136153 100644
--- a/server/sonar-web/src/main/js/apps/issues/models/issues.js
+++ b/server/sonar-web/src/main/js/apps/issues/models/issues.js
@@ -31,11 +31,9 @@ export default Backbone.Collection.extend({
_injectRelational (issue, source, baseField, lookupField) {
const baseValue = issue[baseField];
if (baseValue != null && _.size(source)) {
- const lookupValue = _.find(source, function (candidate) {
- return candidate[lookupField] === baseValue;
- });
+ const lookupValue = _.find(source, candidate => candidate[lookupField] === baseValue);
if (lookupValue != null) {
- Object.keys(lookupValue).forEach(function (key) {
+ Object.keys(lookupValue).forEach(key => {
const newKey = baseField + key.charAt(0).toUpperCase() + key.slice(1);
issue[newKey] = lookupValue[key];
});
@@ -47,7 +45,7 @@ export default Backbone.Collection.extend({
_injectCommentsRelational (issue, users) {
if (issue.comments) {
const that = this;
- const newComments = issue.comments.map(function (comment) {
+ const newComments = issue.comments.map(comment => {
let newComment = _.extend({}, comment, { author: comment.login });
delete newComment.login;
newComment = that._injectRelational(newComment, users, 'author', 'login');
@@ -81,7 +79,7 @@ export default Backbone.Collection.extend({
parseIssues (r) {
const that = this;
- return r.issues.map(function (issue, index) {
+ return r.issues.map((issue, index) => {
_.extend(issue, { index });
issue = that._injectRelational(issue, r.components, 'component', 'key');
issue = that._injectRelational(issue, r.components, 'project', 'key');
@@ -96,14 +94,12 @@ export default Backbone.Collection.extend({
},
setIndex () {
- return this.forEach(function (issue, index) {
- return issue.set({ index });
- });
+ return this.forEach((issue, index) => issue.set({ index }));
},
selectByKeys (keys) {
const that = this;
- keys.forEach(function (key) {
+ keys.forEach(key => {
const issue = that.get(key);
if (issue) {
issue.set({ selected: true });
diff --git a/server/sonar-web/src/main/js/apps/issues/workspace-header-view.js b/server/sonar-web/src/main/js/apps/issues/workspace-header-view.js
index a618e107325..9035dfec2ba 100644
--- a/server/sonar-web/src/main/js/apps/issues/workspace-header-view.js
+++ b/server/sonar-web/src/main/js/apps/issues/workspace-header-view.js
@@ -60,7 +60,7 @@ export default WorkspaceHeaderView.extend({
$('#modal').dialog('close');
const selectedIndex = this.options.app.state.get('selectedIndex');
const selectedKeys = _.pluck(this.options.app.list.where({ selected: true }), 'id');
- this.options.app.controller.fetchList().done(function () {
+ this.options.app.controller.fetchList().done(() => {
that.options.app.state.set({ selectedIndex });
that.options.app.list.selectByKeys(selectedKeys);
});
@@ -80,7 +80,7 @@ export default WorkspaceHeaderView.extend({
},
selectNone () {
- this.options.app.list.where({ selected: true }).forEach(function (issue) {
+ this.options.app.list.where({ selected: true }).forEach(issue => {
issue.set({ selected: false });
});
this._suppressUpdate = false;
@@ -88,7 +88,7 @@ export default WorkspaceHeaderView.extend({
},
selectAll () {
- this.options.app.list.forEach(function (issue) {
+ this.options.app.list.forEach(issue => {
issue.set({ selected: true });
});
this._suppressUpdate = false;
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 eef64f22edd..d99c5ef07de 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
@@ -72,14 +72,14 @@ export default IssueView.extend({
bottomRight: true,
model: this.model
});
- this.popup.on('select', function (property, value) {
+ this.popup.on('select', (property, value) => {
const obj = {};
obj[property] = '' + value;
- SHOULD_NULL.any.forEach(function (p) {
+ SHOULD_NULL.any.forEach(p => {
obj[p] = null;
});
if (SHOULD_NULL[property] != null) {
- SHOULD_NULL[property].forEach(function (p) {
+ SHOULD_NULL[property].forEach(p => {
obj[p] = null;
});
}
@@ -127,9 +127,7 @@ export default IssueView.extend({
index,
selected
}, { silent: true });
- return this.model.fetch(options).done(function () {
- return that.trigger('reset');
- });
+ return this.model.fetch(options).done(() => that.trigger('reset'));
},
openComponentViewer () {
diff --git a/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js b/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js
index 19fbd97d5e7..453e6a5c5f0 100644
--- a/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js
+++ b/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js
@@ -45,37 +45,23 @@ export default WorkspaceListView.extend({
selectedIssueView.$('.js-issue-' + action).click();
};
WorkspaceListView.prototype.bindShortcuts.apply(this, arguments);
- key('right', 'list', function () {
+ key('right', 'list', () => {
const selectedIssue = that.collection.at(that.options.app.state.get('selectedIndex'));
that.options.app.controller.showComponentViewer(selectedIssue);
return false;
});
- key('space', 'list', function () {
+ key('space', 'list', () => {
const selectedIssue = that.collection.at(that.options.app.state.get('selectedIndex'));
selectedIssue.set({ selected: !selectedIssue.get('selected') });
return false;
});
- key('f', 'list', function () {
- return doAction('transition');
- });
- key('a', 'list', function () {
- return doAction('assign');
- });
- key('m', 'list', function () {
- return doAction('assign-to-me');
- });
- key('p', 'list', function () {
- return doAction('plan');
- });
- key('i', 'list', function () {
- return doAction('set-severity');
- });
- key('c', 'list', function () {
- return doAction('comment');
- });
- key('t', 'list', function () {
- return doAction('edit-tags');
- });
+ key('f', 'list', () => doAction('transition'));
+ key('a', 'list', () => doAction('assign'));
+ key('m', 'list', () => doAction('assign-to-me'));
+ key('p', 'list', () => doAction('plan'));
+ key('i', 'list', () => doAction('set-severity'));
+ key('c', 'list', () => doAction('comment'));
+ key('t', 'list', () => doAction('edit-tags'));
},
unbindShortcuts () {
diff --git a/server/sonar-web/src/main/js/apps/maintenance/init.js b/server/sonar-web/src/main/js/apps/maintenance/init.js
index 3b812525570..8f964b5b33e 100644
--- a/server/sonar-web/src/main/js/apps/maintenance/init.js
+++ b/server/sonar-web/src/main/js/apps/maintenance/init.js
@@ -24,7 +24,7 @@ import MainView from './main-view';
const App = new Marionette.Application();
-App.on('start', function (options) {
+App.on('start', options => {
const viewOptions = _.extend(options, {
model: new Backbone.Model()
});
diff --git a/server/sonar-web/src/main/js/apps/maintenance/main-view.js b/server/sonar-web/src/main/js/apps/maintenance/main-view.js
index 751578de956..123a98416a2 100644
--- a/server/sonar-web/src/main/js/apps/maintenance/main-view.js
+++ b/server/sonar-web/src/main/js/apps/maintenance/main-view.js
@@ -36,14 +36,14 @@ export default Marionette.ItemView.extend({
type: 'GET',
url: window.baseUrl + '/api/system/' + (this.options.setup ? 'db_migration_status' : 'status')
};
- this.pollingInternal = setInterval(function () {
+ this.pollingInternal = setInterval(() => {
that.refresh();
}, 5000);
},
refresh () {
const that = this;
- return Backbone.ajax(this.requestOptions).done(function (r) {
+ return Backbone.ajax(this.requestOptions).done(r => {
that.model.set(r);
that.render();
if (that.model.get('status') === 'UP' || that.model.get('state') === 'NO_MIGRATION') {
@@ -64,7 +64,7 @@ export default Marionette.ItemView.extend({
Backbone.ajax({
url: window.baseUrl + '/api/system/migrate_db',
type: 'POST'
- }).done(function (r) {
+ }).done(r => {
that.model.set(r);
that.render();
});
@@ -75,7 +75,7 @@ export default Marionette.ItemView.extend({
},
goHome () {
- setInterval(function () {
+ setInterval(() => {
window.location = window.baseUrl + '/';
}, 2500);
},
diff --git a/server/sonar-web/src/main/js/apps/metrics/create-view.js b/server/sonar-web/src/main/js/apps/metrics/create-view.js
index d8a73fc9d62..1bd036a8e63 100644
--- a/server/sonar-web/src/main/js/apps/metrics/create-view.js
+++ b/server/sonar-web/src/main/js/apps/metrics/create-view.js
@@ -37,13 +37,13 @@ export default FormView.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
that.collection.refresh();
if (that.options.domains.indexOf(metric.get('domain')) === -1) {
that.options.domains.push(metric.get('domain'));
}
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
that.enableForm();
});
diff --git a/server/sonar-web/src/main/js/apps/metrics/delete-view.js b/server/sonar-web/src/main/js/apps/metrics/delete-view.js
index a63999b2e6a..f65f365462d 100644
--- a/server/sonar-web/src/main/js/apps/metrics/delete-view.js
+++ b/server/sonar-web/src/main/js/apps/metrics/delete-view.js
@@ -37,10 +37,10 @@ export default ModalForm.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
collection.refresh();
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
}
diff --git a/server/sonar-web/src/main/js/apps/metrics/form-view.js b/server/sonar-web/src/main/js/apps/metrics/form-view.js
index 93690b03cbe..0bd6f64f5e8 100644
--- a/server/sonar-web/src/main/js/apps/metrics/form-view.js
+++ b/server/sonar-web/src/main/js/apps/metrics/form-view.js
@@ -40,10 +40,8 @@ export default ModalForm.extend({
callback({ id: value, text: value });
},
query (options) {
- const items = that.options.domains.filter(function (d) {
- return d.toLowerCase().indexOf(options.term.toLowerCase()) !== -1;
- });
- const results = items.map(function (item) {
+ const items = that.options.domains.filter(d => d.toLowerCase().indexOf(options.term.toLowerCase()) !== -1);
+ const results = items.map(item => {
return { id: item, text: item };
});
options.callback({ results, more: false });
diff --git a/server/sonar-web/src/main/js/apps/metrics/init.js b/server/sonar-web/src/main/js/apps/metrics/init.js
index 06f12f34ff2..a9422dc979a 100644
--- a/server/sonar-web/src/main/js/apps/metrics/init.js
+++ b/server/sonar-web/src/main/js/apps/metrics/init.js
@@ -60,18 +60,18 @@ const init = function (el) {
};
App.requestDomains = function () {
- return $.get(window.baseUrl + '/api/metrics/domains').done(function (r) {
+ return $.get(window.baseUrl + '/api/metrics/domains').done(r => {
App.domains = r.domains;
});
};
App.requestTypes = function () {
- return $.get(window.baseUrl + '/api/metrics/types').done(function (r) {
+ return $.get(window.baseUrl + '/api/metrics/types').done(r => {
App.types = r.types;
});
};
-App.on('start', function (el) {
- $.when(App.requestDomains(), App.requestTypes()).done(function () {
+App.on('start', el => {
+ $.when(App.requestDomains(), App.requestTypes()).done(() => {
init.call(App, el);
});
});
diff --git a/server/sonar-web/src/main/js/apps/metrics/update-view.js b/server/sonar-web/src/main/js/apps/metrics/update-view.js
index b559f1dc05b..ac82cf0e5bd 100644
--- a/server/sonar-web/src/main/js/apps/metrics/update-view.js
+++ b/server/sonar-web/src/main/js/apps/metrics/update-view.js
@@ -36,10 +36,10 @@ export default FormView.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
that.collection.refresh();
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
diff --git a/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.js b/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.js
index 5d88e24b8d0..ca39f9f430b 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.js
+++ b/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { translate } from '../../../helpers/l10n';
const EmptyOverview = ({ component }) => {
diff --git a/server/sonar-web/src/main/js/apps/overview/components/LeakPeriodLegend.js b/server/sonar-web/src/main/js/apps/overview/components/LeakPeriodLegend.js
index a2129c56b13..113568e1212 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/LeakPeriodLegend.js
+++ b/server/sonar-web/src/main/js/apps/overview/components/LeakPeriodLegend.js
@@ -19,7 +19,6 @@
*/
import React from 'react';
import moment from 'moment';
-
import { getPeriodDate, getPeriodLabel } from '../../../helpers/periods';
import { translateWithParameters } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/overview/components/Timeline.js b/server/sonar-web/src/main/js/apps/overview/components/Timeline.js
index 90a9728f4ca..baa755bae0c 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/Timeline.js
+++ b/server/sonar-web/src/main/js/apps/overview/components/Timeline.js
@@ -20,7 +20,6 @@
import d3 from 'd3';
import React from 'react';
import shallowCompare from 'react-addons-shallow-compare';
-
import { LineChart } from '../../../components/charts/line-chart';
const HEIGHT = 80;
diff --git a/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.js b/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.js
index 842a9680310..1d285126b38 100644
--- a/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.js
+++ b/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.js
@@ -29,9 +29,9 @@ import { getAnalyses } from '../../../store/projectActivity/duck';
type Props = {
analyses?: Array<*>,
- project: string;
- fetchRecentProjectActivity: (project: string) => Promise<*>;
-}
+ project: string,
+ fetchRecentProjectActivity: (project: string) => Promise<*>
+};
class AnalysesList extends React.Component {
mounted: boolean;
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 bfa8c94a754..8c11d412ab2 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
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import enhance from './enhance';
import { DrilldownLink } from '../../../components/shared/drilldown-link';
import { getMetricName } from '../helpers/metrics';
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/Meta.js b/server/sonar-web/src/main/js/apps/overview/meta/Meta.js
index 26be7ed8ea2..61e26530eee 100644
--- a/server/sonar-web/src/main/js/apps/overview/meta/Meta.js
+++ b/server/sonar-web/src/main/js/apps/overview/meta/Meta.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import MetaKey from './MetaKey';
import MetaLinks from './MetaLinks';
import MetaQualityGate from './MetaQualityGate';
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaKey.js b/server/sonar-web/src/main/js/apps/overview/meta/MetaKey.js
index cc1e7f91b70..3098f452ac8 100644
--- a/server/sonar-web/src/main/js/apps/overview/meta/MetaKey.js
+++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaKey.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { translate } from '../../../helpers/l10n';
const MetaKey = ({ component }) => {
diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/EmptyQualityGate.js b/server/sonar-web/src/main/js/apps/overview/qualityGate/EmptyQualityGate.js
index 56e607c05cb..569be5500a6 100644
--- a/server/sonar-web/src/main/js/apps/overview/qualityGate/EmptyQualityGate.js
+++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/EmptyQualityGate.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { translate } from '../../../helpers/l10n';
const EmptyQualityGate = () => {
diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGate.js b/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGate.js
index 219a58d0895..8c8b39565e4 100644
--- a/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGate.js
+++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGate.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import QualityGateConditions from './QualityGateConditions';
import EmptyQualityGate from './EmptyQualityGate';
import { ComponentType, MeasuresListType, PeriodsListType } from '../propTypes';
diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateConditions.js b/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateConditions.js
index fab13539419..0c49b1a7dc2 100644
--- a/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateConditions.js
+++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateConditions.js
@@ -20,7 +20,6 @@
import React from 'react';
import shallowCompare from 'react-addons-shallow-compare';
import sortBy from 'lodash/sortBy';
-
import QualityGateCondition from './QualityGateCondition';
import { ComponentType, ConditionsListType } from '../propTypes';
import { getMeasuresAndMeta } from '../../../api/measures';
diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/QualityGateCondition-test.js b/server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/QualityGateCondition-test.js
index 403719f4318..4c7ce5c7a3e 100644
--- a/server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/QualityGateCondition-test.js
+++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/QualityGateCondition-test.js
@@ -19,7 +19,6 @@
*/
import React from 'react';
import { shallow } from 'enzyme';
-
import QualityGateCondition from '../QualityGateCondition';
import { DrilldownLink } from '../../../../components/shared/drilldown-link';
diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/NameCell.js b/server/sonar-web/src/main/js/apps/permission-templates/components/NameCell.js
index 0e9a8b2e6be..78d1ded45ab 100644
--- a/server/sonar-web/src/main/js/apps/permission-templates/components/NameCell.js
+++ b/server/sonar-web/src/main/js/apps/permission-templates/components/NameCell.js
@@ -24,8 +24,7 @@ import { PermissionTemplateType } from '../propTypes';
export default class NameCell extends React.Component {
static propTypes = {
- permissionTemplate: PermissionTemplateType.isRequired,
- topQualifiers: React.PropTypes.array.isRequired
+ permissionTemplate: PermissionTemplateType.isRequired
};
render () {
diff --git a/server/sonar-web/src/main/js/apps/permission-templates/utils.js b/server/sonar-web/src/main/js/apps/permission-templates/utils.js
index c475b39b3a7..73b25d629c7 100644
--- a/server/sonar-web/src/main/js/apps/permission-templates/utils.js
+++ b/server/sonar-web/src/main/js/apps/permission-templates/utils.js
@@ -38,7 +38,6 @@ export function sortPermissions (permissions) {
*/
export function mergePermissionsToTemplates (permissionTemplates, basePermissions) {
return permissionTemplates.map(permissionTemplate => {
-
// it's important to keep the order of the permission template's permissions
// the same as the order of base permissions
const permissions = basePermissions.map(basePermission => {
diff --git a/server/sonar-web/src/main/js/apps/permission-templates/views/CreateView.js b/server/sonar-web/src/main/js/apps/permission-templates/views/CreateView.js
index bd6ad52409f..07026ad82a9 100644
--- a/server/sonar-web/src/main/js/apps/permission-templates/views/CreateView.js
+++ b/server/sonar-web/src/main/js/apps/permission-templates/views/CreateView.js
@@ -34,10 +34,10 @@ export default FormView.extend({
// do not show global error
400: null
}
- }).done(function (r) {
+ }).done(r => {
that.trigger('done', r);
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
diff --git a/server/sonar-web/src/main/js/apps/permission-templates/views/UpdateView.js b/server/sonar-web/src/main/js/apps/permission-templates/views/UpdateView.js
index 99acd983e5f..7105d2eafaa 100644
--- a/server/sonar-web/src/main/js/apps/permission-templates/views/UpdateView.js
+++ b/server/sonar-web/src/main/js/apps/permission-templates/views/UpdateView.js
@@ -35,10 +35,10 @@ export default FormView.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
that.options.refresh();
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
diff --git a/server/sonar-web/src/main/js/apps/permission-templates/views/UsersView.js b/server/sonar-web/src/main/js/apps/permission-templates/views/UsersView.js
index a5a13a741b2..237d7b20dba 100644
--- a/server/sonar-web/src/main/js/apps/permission-templates/views/UsersView.js
+++ b/server/sonar-web/src/main/js/apps/permission-templates/views/UsersView.js
@@ -35,7 +35,7 @@ export default Modal.extend({
};
},
- onCheckboxChange() {
+ onCheckboxChange () {
const checked = this.$('#grant-to-project-creators').is(':checked');
if (checked) {
addProjectCreatorToTemplate(
diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/PageHeader.js b/server/sonar-web/src/main/js/apps/permissions/global/components/PageHeader.js
index 260c26c9ea0..47d78c927ed 100644
--- a/server/sonar-web/src/main/js/apps/permissions/global/components/PageHeader.js
+++ b/server/sonar-web/src/main/js/apps/permissions/global/components/PageHeader.js
@@ -20,12 +20,10 @@
import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../../helpers/l10n';
-import { loadHolders } from '../store/actions';
import { isPermissionsAppLoading } from '../../../../store/rootReducer';
class PageHeader extends React.Component {
static propTypes = {
- loadHolders: React.PropTypes.func.isRequired,
loading: React.PropTypes.bool
};
@@ -56,11 +54,6 @@ const mapStateToProps = state => ({
loading: isPermissionsAppLoading(state)
});
-const mapDispatchToProps = dispatch => ({
- loadHolders: () => dispatch(loadHolders())
-});
-
export default connect(
- mapStateToProps,
- mapDispatchToProps
+ mapStateToProps
)(PageHeader);
diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js b/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js
index ea5a6f1c4bb..39e0daa10a7 100644
--- a/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js
+++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js
@@ -51,7 +51,7 @@ export default class HoldersList extends React.Component {
}}>
<div className="permission-column-inner">
<a href="#"
- title={`Filter by "${p.name}" permission` }
+ title={`Filter by "${p.name}" permission`}
data-toggle="tooltip"
onClick={this.handlePermissionClick.bind(this, p.key)}>
{p.name}
diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.js b/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.js
index 35a4836ded4..5281cfbcc42 100644
--- a/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.js
+++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.js
@@ -70,7 +70,7 @@ export default class SearchForm extends React.Component {
className="search-box display-inline-block text-middle big-spacer-left"
onSubmit={this.handleSubmit}>
<button className="search-box-submit button-clean">
- <i className="icon-search"></i>
+ <i className="icon-search"/>
</button>
<input
ref="searchInput"
diff --git a/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateForm.js b/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateForm.js
index db31d98063d..8769a2fd768 100644
--- a/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateForm.js
+++ b/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateForm.js
@@ -48,7 +48,7 @@ export default class BulkUpdateForm extends React.Component {
name="replace"
type="text"
placeholder={translate('update_key.replace_example')}
- required/>
+ required={true}/>
</div>
<div className="modal-field">
@@ -61,7 +61,7 @@ export default class BulkUpdateForm extends React.Component {
name="by"
type="text"
placeholder={translate('update_key.by_example')}
- required/>
+ required={true}/>
<button
ref="submit"
id="bulk-update-see-results"
diff --git a/server/sonar-web/src/main/js/apps/project-admin/key/UpdateForm.js b/server/sonar-web/src/main/js/apps/project-admin/key/UpdateForm.js
index 1031ad1ba6c..fddf2e1fccf 100644
--- a/server/sonar-web/src/main/js/apps/project-admin/key/UpdateForm.js
+++ b/server/sonar-web/src/main/js/apps/project-admin/key/UpdateForm.js
@@ -67,7 +67,7 @@ export default class UpdateForm extends React.Component {
value={value}
type="text"
placeholder={translate('update_key.new_key')}
- required
+ required={true}
onChange={this.handleChange.bind(this)}/>
<div className="spacer-top">
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/actions.js b/server/sonar-web/src/main/js/apps/projectActivity/actions.js
index 83115bd1800..7f8b5ede05e 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/actions.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/actions.js
@@ -30,7 +30,7 @@ import {
import { onFail } from '../../store/rootActions';
import { getProjectActivity } from '../../store/rootReducer';
-const rejectOnFail = (dispatch: Function) => (error: any) => {
+const rejectOnFail = (dispatch: Function) => (error: Object) => {
onFail(dispatch)(error);
return Promise.reject();
};
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.js b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.js
index 6dc24183a22..57d8475bf83 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.js
@@ -30,7 +30,7 @@ import './projectActivity.css';
type Props = {
location: { query: { id: string } },
fetchProjectActivity: (project: string) => void,
- filter: ?string,
+ /* eslint-disable react/no-unused-prop-types */
project: { configuration?: { showHistory: boolean } }
};
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageHeader.js b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageHeader.js
index 091a02950f9..ce0725198b4 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageHeader.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageHeader.js
@@ -24,8 +24,7 @@ import { translate } from '../../../helpers/l10n';
type Props = {
changeFilter: (filter: ?string) => void,
- filter: ?string,
- project: string
+ filter: ?string
};
export default class ProjectActivityPageHeader extends React.Component {
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddEventForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddEventForm.js
index da895b642b4..2ab77262ce8 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddEventForm.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddEventForm.js
@@ -31,9 +31,9 @@ type Props = {
type State = {
open: boolean,
- processing: boolean;
- name: string;
-}
+ processing: boolean,
+ name: string
+};
export default class AddEventForm extends React.Component {
mounted: boolean;
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeEventForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeEventForm.js
index 8ae9e6b1cb4..5269374f916 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeEventForm.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeEventForm.js
@@ -33,7 +33,7 @@ type Props = {
type State = {
processing: boolean,
name: string
-}
+};
export default class ChangeEventForm extends React.Component {
mounted: boolean;
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.js
index 482362772ff..3c8c5477747 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.js
@@ -34,7 +34,7 @@ type Props = {
type State = {
open: boolean,
processing: boolean
-}
+};
class RemoveAnalysisForm extends React.Component {
mounted: boolean;
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.js
index 893d164b7af..ed3d879a4f9 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.js
@@ -34,7 +34,7 @@ type Props = {
type State = {
processing: boolean
-}
+};
export default class RemoveVersionForm extends React.Component {
mounted: boolean;
diff --git a/server/sonar-web/src/main/js/apps/projects-admin/main.js b/server/sonar-web/src/main/js/apps/projects-admin/main.js
index c3a240b19db..f83187d8557 100644
--- a/server/sonar-web/src/main/js/apps/projects-admin/main.js
+++ b/server/sonar-web/src/main/js/apps/projects-admin/main.js
@@ -33,11 +33,10 @@ import ListFooter from '../../components/controls/ListFooter';
export default React.createClass({
propTypes: {
- hasProvisionPermission: React.PropTypes.bool.isRequired,
- topLevelQualifiers: React.PropTypes.array.isRequired
+ hasProvisionPermission: React.PropTypes.bool.isRequired
},
- getInitialState() {
+ getInitialState () {
return {
ready: false,
projects: [],
@@ -54,11 +53,11 @@ export default React.createClass({
this.requestProjects = _.debounce(this.requestProjects, 250);
},
- componentDidMount() {
+ componentDidMount () {
this.requestProjects();
},
- getFilters() {
+ getFilters () {
const filters = { ps: PAGE_SIZE };
if (this.state.page !== 1) {
filters.p = this.state.page;
@@ -69,7 +68,7 @@ export default React.createClass({
return filters;
},
- requestProjects() {
+ requestProjects () {
switch (this.state.type) {
case TYPE.ALL:
this.requestAllProjects();
@@ -86,12 +85,12 @@ export default React.createClass({
}
},
- requestGhosts() {
+ requestGhosts () {
const data = this.getFilters();
getGhosts(data).then(r => {
- let projects = r.projects.map(project => {
- return _.extend(project, { id: project.uuid, qualifier: 'TRK' });
- });
+ let projects = r.projects.map(project => (
+ _.extend(project, { id: project.uuid, qualifier: 'TRK' })
+ ));
if (this.state.page > 1) {
projects = [].concat(this.state.projects, projects);
}
@@ -99,12 +98,12 @@ export default React.createClass({
});
},
- requestProvisioned() {
+ requestProvisioned () {
const data = this.getFilters();
getProvisioned(data).then(r => {
- let projects = r.projects.map(project => {
- return _.extend(project, { id: project.uuid, qualifier: 'TRK' });
- });
+ let projects = r.projects.map(project => (
+ _.extend(project, { id: project.uuid, qualifier: 'TRK' })
+ ));
if (this.state.page > 1) {
projects = [].concat(this.state.projects, projects);
}
@@ -112,7 +111,7 @@ export default React.createClass({
});
},
- requestAllProjects() {
+ requestAllProjects () {
const data = this.getFilters();
data.qualifiers = this.state.qualifiers;
getComponents(data).then(r => {
@@ -124,12 +123,12 @@ export default React.createClass({
});
},
- loadMore() {
+ loadMore () {
this.setState({ ready: false, page: this.state.page + 1 },
this.requestProjects);
},
- onSearch(query) {
+ onSearch (query) {
this.setState({
ready: false,
page: 1,
@@ -138,7 +137,7 @@ export default React.createClass({
}, this.requestProjects);
},
- onTypeChanged(newType) {
+ onTypeChanged (newType) {
this.setState({
ready: false,
page: 1,
@@ -149,7 +148,7 @@ export default React.createClass({
}, this.requestProjects);
},
- onQualifierChanged(newQualifier) {
+ onQualifierChanged (newQualifier) {
this.setState({
ready: false,
page: 1,
@@ -160,28 +159,26 @@ export default React.createClass({
}, this.requestProjects);
},
- onProjectSelected(project) {
+ onProjectSelected (project) {
const newSelection = _.uniq([].concat(this.state.selection, project.id));
this.setState({ selection: newSelection });
},
- onProjectDeselected(project) {
+ onProjectDeselected (project) {
const newSelection = _.without(this.state.selection, project.id);
this.setState({ selection: newSelection });
},
- onAllSelected() {
- const newSelection = this.state.projects.map(project => {
- return project.id;
- });
+ onAllSelected () {
+ const newSelection = this.state.projects.map(project => project.id);
this.setState({ selection: newSelection });
},
- onAllDeselected() {
+ onAllDeselected () {
this.setState({ selection: [] });
},
- deleteProjects() {
+ deleteProjects () {
this.setState({ ready: false });
const ids = this.state.selection.join(',');
deleteComponents({ ids }).then(() => {
@@ -189,7 +186,7 @@ export default React.createClass({
});
},
- render() {
+ render () {
return (
<div className="page page-limited">
<Header
diff --git a/server/sonar-web/src/main/js/apps/projects-admin/projects.js b/server/sonar-web/src/main/js/apps/projects-admin/projects.js
index 27387a3e780..d6b002248a4 100644
--- a/server/sonar-web/src/main/js/apps/projects-admin/projects.js
+++ b/server/sonar-web/src/main/js/apps/projects-admin/projects.js
@@ -29,8 +29,7 @@ import { translate } from '../../helpers/l10n';
export default class Projects extends React.Component {
static propTypes = {
projects: React.PropTypes.array.isRequired,
- selection: React.PropTypes.array.isRequired,
- refresh: React.PropTypes.func.isRequired
+ selection: React.PropTypes.array.isRequired
};
componentWillMount () {
diff --git a/server/sonar-web/src/main/js/apps/projects-admin/search.js b/server/sonar-web/src/main/js/apps/projects-admin/search.js
index 24817c916f9..b995ddced12 100644
--- a/server/sonar-web/src/main/js/apps/projects-admin/search.js
+++ b/server/sonar-web/src/main/js/apps/projects-admin/search.js
@@ -30,17 +30,17 @@ export default React.createClass({
onSearch: React.PropTypes.func.isRequired
},
- onSubmit(e) {
+ onSubmit (e) {
e.preventDefault();
this.search();
},
- search() {
+ search () {
const q = this.refs.input.value;
this.props.onSearch(q);
},
- getTypeOptions() {
+ getTypeOptions () {
return [
{ value: TYPE.ALL, label: 'All' },
{ value: TYPE.PROVISIONED, label: 'Provisioned' },
@@ -48,16 +48,14 @@ export default React.createClass({
];
},
- getQualifierOptions() {
+ getQualifierOptions () {
const options = this.props.topLevelQualifiers.map(q => {
return { value: q, label: translate('qualifiers', q) };
});
- return _.sortBy(options, option => {
- return QUALIFIERS_ORDER.indexOf(option.value);
- });
+ return _.sortBy(options, option => QUALIFIERS_ORDER.indexOf(option.value));
},
- renderCheckbox() {
+ renderCheckbox () {
const isAllChecked = this.props.projects.length > 0 &&
this.props.selection.length === this.props.projects.length;
const thirdState = this.props.projects.length > 0 &&
@@ -72,11 +70,11 @@ export default React.createClass({
);
},
- renderSpinner() {
+ renderSpinner () {
return <i className="spinner"/>;
},
- onCheck(checked) {
+ onCheck (checked) {
if (checked) {
this.props.onAllSelected();
} else {
@@ -91,13 +89,13 @@ export default React.createClass({
return <div className="spacer-top alert alert-info">{translate('bulk_deletion.ghosts.description')}</div>;
},
- deleteProjects() {
+ deleteProjects () {
new DeleteView({
deleteProjects: this.props.deleteProjects
}).render();
},
- renderQualifierFilter() {
+ renderQualifierFilter () {
const options = this.getQualifierOptions();
if (options.length < 2) {
return null;
@@ -113,7 +111,7 @@ export default React.createClass({
);
},
- render() {
+ render () {
const isSomethingSelected = this.props.projects.length > 0 && this.props.selection.length > 0;
return (
<div className="panel panel-vertical bordered-bottom spacer-bottom">
@@ -134,7 +132,7 @@ export default React.createClass({
<td className="text-middle">
<form onSubmit={this.onSubmit} className="search-box">
<button className="search-box-submit button-clean">
- <i className="icon-search"></i>
+ <i className="icon-search"/>
</button>
<input onChange={this.search}
value={this.props.query}
diff --git a/server/sonar-web/src/main/js/apps/projects-admin/views/BulkApplyTemplateView.js b/server/sonar-web/src/main/js/apps/projects-admin/views/BulkApplyTemplateView.js
index d2fc1aba72e..c2f216edf35 100644
--- a/server/sonar-web/src/main/js/apps/projects-admin/views/BulkApplyTemplateView.js
+++ b/server/sonar-web/src/main/js/apps/projects-admin/views/BulkApplyTemplateView.js
@@ -62,7 +62,7 @@ export default ModalForm.extend({
return bulkApplyTemplate(data);
},
- bulkApplyToSelected(permissionTemplate) {
+ bulkApplyToSelected (permissionTemplate) {
const { selection } = this.options;
let lastRequest = Promise.resolve();
diff --git a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.js b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.js
index f7c3c04e7ef..2395c64f076 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.js
+++ b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.js
@@ -25,7 +25,6 @@ import { parseUrlQuery } from '../store/utils';
export default class AllProjects extends React.Component {
static propTypes = {
- user: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.bool]),
isFavorite: React.PropTypes.bool.isRequired,
fetchProjects: React.PropTypes.func.isRequired
};
diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCardMeasures.js b/server/sonar-web/src/main/js/apps/projects/components/ProjectCardMeasures.js
index a6ea6ec3e97..eeba0355c19 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCardMeasures.js
+++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCardMeasures.js
@@ -28,8 +28,7 @@ import { translate } from '../../../helpers/l10n';
export default class ProjectCardMeasures extends React.Component {
static propTypes = {
- measures: React.PropTypes.object,
- languages: React.PropTypes.array
+ measures: React.PropTypes.object
};
render () {
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/Filter.js b/server/sonar-web/src/main/js/apps/projects/filters/Filter.js
index cab64031e7d..448f5cb2eb7 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/Filter.js
+++ b/server/sonar-web/src/main/js/apps/projects/filters/Filter.js
@@ -37,9 +37,7 @@ export default class Filter extends React.Component {
halfWidth: React.PropTypes.bool,
- getFilterUrl: React.PropTypes.func.isRequired,
-
- router: React.PropTypes.object
+ getFilterUrl: React.PropTypes.func.isRequired
};
static defaultProps = {
@@ -70,7 +68,7 @@ export default class Filter extends React.Component {
renderOption (option) {
const { property, value, facet, getFacetValueForOption } = this.props;
const className = classNames('facet', 'search-navigator-facet', 'projects-facet', {
- active: option === value,
+ 'active': option === value,
'search-navigator-facet-half': this.props.halfWidth
}, this.props.optionClassName);
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/FilterContainer.js b/server/sonar-web/src/main/js/apps/projects/filters/FilterContainer.js
index c753e163909..c36859517e8 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/FilterContainer.js
+++ b/server/sonar-web/src/main/js/apps/projects/filters/FilterContainer.js
@@ -17,11 +17,11 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import Filter from './Filter';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
import omitBy from 'lodash/omitBy';
import isNil from 'lodash/isNil';
+import Filter from './Filter';
import { getProjectsAppFacetByProperty, getProjectsAppMaxFacetValue } from '../../../store/rootReducer';
const mapStateToProps = (state, ownProps) => ({
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/AddConditionForm.js b/server/sonar-web/src/main/js/apps/quality-gates/components/AddConditionForm.js
index 02722807a43..d3e5cc3c4a4 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/AddConditionForm.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/AddConditionForm.js
@@ -20,7 +20,6 @@
import _ from 'underscore';
import React from 'react';
import Select from 'react-select';
-
import { translate, getLocalizedMetricName, getLocalizedMetricDomain } from '../../../helpers/l10n';
export default function AddConditionForm ({ metrics, onSelect }) {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js
index ae7c34aa548..0109eafa2cb 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js
@@ -19,7 +19,6 @@
*/
import React, { Component } from 'react';
import Select from 'react-select';
-
import ThresholdInput from './ThresholdInput';
import DeleteConditionView from '../views/gate-conditions-delete-view';
import Checkbox from '../../../components/controls/Checkbox';
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js
index ce2dddb2e21..eb0dccd6a41 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js
@@ -20,7 +20,6 @@
import _ from 'underscore';
import React from 'react';
import uniqBy from 'lodash/uniqBy';
-
import ConditionsAlert from './ConditionsAlert';
import AddConditionForm from './AddConditionForm';
import Condition from './Condition';
@@ -107,7 +106,7 @@ export default class Conditions extends React.Component {
<p>{translate('quality_gates.duplicated_conditions')}</p>
<ul className="list-styled spacer-top">
{uniqDuplicates.map(d => (
- <li>{getLocalizedMetricName(d.metric)}</li>
+ <li key={d.metric.key}>{getLocalizedMetricName(d.metric)}</li>
))}
</ul>
</div>
@@ -132,7 +131,7 @@ export default class Conditions extends React.Component {
<th className="thin nowrap">
{translate('quality_gates.conditions.error')}
</th>
- {edit && <th></th>}
+ {edit && <th/>}
</tr>
</thead>
<tbody>
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionsAlert.js b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionsAlert.js
index c2f8d3274a5..34050b70bbc 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionsAlert.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionsAlert.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React, { Component } from 'react';
-
import { translate } from '../../../helpers/l10n';
export default class ConditionsAlert extends Component {
@@ -50,17 +49,17 @@ export default class ConditionsAlert extends Component {
{translate('quality_gates.health_icons')}
<ul>
<li className="little-spacer-top">
- <i className="icon-alert-ok"></i>
+ <i className="icon-alert-ok"/>
{' '}
{translate('alerts.notes.ok')}
</li>
<li className="little-spacer-top">
- <i className="icon-alert-warn"></i>
+ <i className="icon-alert-warn"/>
{' '}
{translate('alerts.notes.warn')}
</li>
<li className="little-spacer-top">
- <i className="icon-alert-error"></i>
+ <i className="icon-alert-error"/>
{' '}
{translate('alerts.notes.error')}
</li>
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.js
index d02601bfe6e..fb34bc951cb 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React, { Component } from 'react';
-
import { fetchQualityGate, setQualityGateAsDefault, unsetQualityGateAsDefault } from '../../../api/quality-gates';
import DetailsHeader from './DetailsHeader';
import DetailsContent from './DetailsContent';
@@ -63,7 +62,7 @@ export default class Details extends Component {
new CopyView({
qualityGate,
- onCopy: (newQualityGate) => {
+ onCopy: newQualityGate => {
onCopy(newQualityGate);
router.push(`/quality_gates/show/${newQualityGate.id}`);
}
@@ -88,7 +87,7 @@ export default class Details extends Component {
new DeleteView({
qualityGate,
- onDelete: (qualityGate) => {
+ onDelete: qualityGate => {
onDelete(qualityGate);
router.replace('/quality_gates');
}
@@ -105,7 +104,7 @@ export default class Details extends Component {
<div className="search-navigator-workspace-header" style={{ top: 30 }}>
<h2 className="search-navigator-header-component">&nbsp;</h2>
</div>
- <div className="search-navigator-workspace-details"></div>
+ <div className="search-navigator-workspace-details"/>
</div>
);
}
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.js b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.js
index 5151d48e5c4..4f00ef69d26 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React, { Component } from 'react';
-
import Conditions from './Conditions';
import Projects from './Projects';
import { translate } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.js b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.js
index fc9675d28d8..d652963da32 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { translate } from '../../../helpers/l10n';
export default function DetailsHeader ({ qualityGate, edit, onRename, onCopy, onSetAsDefault, onDelete }) {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Intro.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Intro.js
index dbb43fbde68..94faf619bbf 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Intro.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Intro.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { translate } from '../../../helpers/l10n';
export default function Intro () {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/List.js b/server/sonar-web/src/main/js/apps/quality-gates/components/List.js
index 66b8ec046ef..8f7ae12eb51 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/List.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/List.js
@@ -19,7 +19,6 @@
*/
import React from 'react';
import { Link } from 'react-router';
-
import { translate } from '../../../helpers/l10n';
export default function List ({ qualityGates }) {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.js b/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.js
index 0ecd1fc56da..ccb8c1f016d 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import CreateView from '../views/create-view';
import { translate } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.js
index 62b974bf76d..72e955ae95f 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React, { Component } from 'react';
-
import ProjectsView from '../views/gate-projects-view';
export default class Projects extends Component {
@@ -57,7 +56,7 @@ export default class Projects extends Component {
render () {
return (
- <div ref="container"></div>
+ <div ref="container"/>
);
}
}
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js
index 9395bac2b25..1f85cd9b919 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js
@@ -18,10 +18,8 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React, { Component } from 'react';
-
import ListHeader from './ListHeader';
import List from './List';
-
import {
fetchQualityGatesAppDetails,
fetchQualityGates as fetchQualityGatesAPI
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/containers/QualityGatesAppContainer.js b/server/sonar-web/src/main/js/apps/quality-gates/containers/QualityGatesAppContainer.js
index 033660a7f38..08a003cd538 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/containers/QualityGatesAppContainer.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/containers/QualityGatesAppContainer.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-
import { setState, addQualityGate, deleteQualityGate } from '../store/actions';
import QualityGateApp from '../components/QualityGatesApp';
import { getQualityGatesAppState } from '../../../store/rootReducer';
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/views/gate-projects-view.js b/server/sonar-web/src/main/js/apps/quality-gates/views/gate-projects-view.js
index 8c4cd9406a3..84ee4e5161a 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/views/gate-projects-view.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/views/gate-projects-view.js
@@ -19,7 +19,6 @@
*/
import _ from 'underscore';
import Marionette from 'backbone.marionette';
-
import Template from '../templates/quality-gate-detail-projects.hbs';
import '../../../components/SelectList';
import { translate } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.js b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.js
index 93020e2dff7..46c0b395ae2 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.js
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.js
@@ -26,6 +26,7 @@ import { ProfileType } from '../propTypes';
export default class ProfileDetails extends React.Component {
static propTypes = {
+ /* eslint-disable react/no-unused-prop-types */
profile: ProfileType,
canAdmin: React.PropTypes.bool,
updateProfiles: React.PropTypes.func
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.js b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.js
index 6e9ddc1c51f..002652f20b8 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.js
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.js
@@ -53,10 +53,10 @@ export default class EvolutionRules extends React.Component {
loadLatestRules () {
const data = {
'available_since': PERIOD_START_MOMENT.format('YYYY-MM-DD'),
- s: 'createdAt',
- asc: false,
- ps: RULES_LIMIT,
- f: 'name,langName,actives'
+ 's': 'createdAt',
+ 'asc': false,
+ 'ps': RULES_LIMIT,
+ 'f': 'name,langName,actives'
};
searchRules(data).then(r => {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/views/ChangeProjectsView.js b/server/sonar-web/src/main/js/apps/quality-profiles/views/ChangeProjectsView.js
index e2c1178a73b..2829cf81df3 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/views/ChangeProjectsView.js
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/views/ChangeProjectsView.js
@@ -63,7 +63,7 @@ export default ModalFormView.extend({
});
},
- onDestroy() {
+ onDestroy () {
this.options.loadProjects();
ModalFormView.prototype.onDestroy.apply(this, arguments);
}
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/views/CreateProfileView.js b/server/sonar-web/src/main/js/apps/quality-profiles/views/CreateProfileView.js
index 60d800bc9fa..f561b33aa05 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/views/CreateProfileView.js
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/views/CreateProfileView.js
@@ -65,7 +65,7 @@ export default ModalFormView.extend({
that.emptyInput($(this));
$(this).addClass('hidden');
});
- importers.forEach(function (importer) {
+ importers.forEach(importer => {
that.$(`.js-importer[data-key="${importer.key}"]`).removeClass('hidden');
});
},
@@ -77,9 +77,9 @@ export default ModalFormView.extend({
getImportersForLanguages (language) {
if (language != null) {
- return this.options.importers.filter(function (importer) {
- return importer.languages.indexOf(language) !== -1;
- });
+ return this.options.importers.filter(importer => (
+ importer.languages.indexOf(language) !== -1
+ ));
} else {
return [];
}
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/views/RestoreProfileView.js b/server/sonar-web/src/main/js/apps/quality-profiles/views/RestoreProfileView.js
index 4fceffda657..874a5726581 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/views/RestoreProfileView.js
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/views/RestoreProfileView.js
@@ -44,7 +44,7 @@ export default ModalFormView.extend({
});
},
- serializeData() {
+ serializeData () {
return {
...ModalFormView.prototype.serializeData.apply(this, arguments),
profile: this.profile,
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.js b/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.js
index 12010610e3e..b4efff30f64 100644
--- a/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.js
+++ b/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.js
@@ -33,7 +33,7 @@ export default class LoginForm extends React.Component {
password: ''
};
- handleSubmit = (e: any) => {
+ handleSubmit = (e: Object) => {
e.preventDefault();
this.props.onSubmit(this.state.login, this.state.password);
};
@@ -50,7 +50,7 @@ export default class LoginForm extends React.Component {
<li key={identityProvider.key}>
<a href={`${window.baseUrl}/sessions/init/${identityProvider.key}`}
style={{ backgroundColor: identityProvider.backgroundColor }}
- title={`Log in with ${identityProvider.name}` }>
+ title={`Log in with ${identityProvider.name}`}>
<img alt={identityProvider.name} width="20" height="20"
src={window.baseUrl + identityProvider.iconPath}/>
<span>Log in with {identityProvider.name}</span>
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js b/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js
index 15f6822e766..3af16978f74 100644
--- a/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js
+++ b/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js
@@ -26,7 +26,7 @@ import { getAppState } from '../../../store/rootReducer';
import { getIdentityProviders } from '../../../api/users';
class LoginFormContainer extends React.Component {
- mounted: bool;
+ mounted: boolean;
static propTypes = {
location: React.PropTypes.object.isRequired
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.js b/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.js
index 276c33809ec..8406042eaf9 100644
--- a/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.js
+++ b/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.js
@@ -31,7 +31,7 @@ export default class Unauthorized extends React.Component {
return (
<div className="text-center">
<p id="unauthorized">
- You're not authorized to access this page. Please contact the administrator.
+ You&apos;re not authorized to access this page. Please contact the administrator.
</p>
{!!message && (
diff --git a/server/sonar-web/src/main/js/apps/settings/components/App.js b/server/sonar-web/src/main/js/apps/settings/components/App.js
index 9a55ff3b008..a2a5ffd14c9 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/App.js
+++ b/server/sonar-web/src/main/js/apps/settings/components/App.js
@@ -32,7 +32,7 @@ import '../styles.css';
type Props = {
component: { key: string },
defaultCategory: ?string,
- fetchSettings(componentKey: ?string): Promise<any>,
+ fetchSettings(componentKey: ?string): Promise<*>,
location: { query: {} }
};
diff --git a/server/sonar-web/src/main/js/apps/settings/components/Definition.js b/server/sonar-web/src/main/js/apps/settings/components/Definition.js
index 7f607de7f78..1fcc33d6c26 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/Definition.js
+++ b/server/sonar-web/src/main/js/apps/settings/components/Definition.js
@@ -28,7 +28,7 @@ import DefinitionChanges from './DefinitionChanges';
import { getPropertyName, getPropertyDescription, getSettingValue, isDefaultOrInherited } from '../utils';
import { translateWithParameters, translate } from '../../../helpers/l10n';
import { resetValue, saveValue } from '../store/actions';
-import { failValidation, passValidation } from '../store/settingsPage/validationMessages/actions';
+import { passValidation } from '../store/settingsPage/validationMessages/actions';
import { cancelChange, changeValue } from '../store/settingsPage/changedValues/actions';
import { TYPE_PASSWORD } from '../constants';
import {
@@ -52,7 +52,6 @@ class Definition extends React.Component {
cancelChange: React.PropTypes.func.isRequired,
saveValue: React.PropTypes.func.isRequired,
resetValue: React.PropTypes.func.isRequired,
- failValidation: React.PropTypes.func.isRequired,
passValidation: React.PropTypes.func.isRequired
};
@@ -197,5 +196,5 @@ const mapStateToProps = (state, ownProps) => ({
export default connect(
mapStateToProps,
- { changeValue, saveValue, resetValue, failValidation, passValidation, cancelChange }
+ { changeValue, saveValue, resetValue, passValidation, cancelChange }
)(Definition);
diff --git a/server/sonar-web/src/main/js/apps/settings/components/DefinitionChanges.js b/server/sonar-web/src/main/js/apps/settings/components/DefinitionChanges.js
index 97d48d20d8b..2e1afc3adbf 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/DefinitionChanges.js
+++ b/server/sonar-web/src/main/js/apps/settings/components/DefinitionChanges.js
@@ -32,13 +32,13 @@ export default class DefinitionChanges extends React.Component {
return shallowCompare(this, nextProps, nextState);
}
- handleSaveClick (e: any) {
+ handleSaveClick (e: Object) {
e.preventDefault();
e.target.blur();
this.props.onSave();
}
- handleCancelChange (e: any) {
+ handleCancelChange (e: Object) {
e.preventDefault();
e.target.blur();
this.props.onCancel();
diff --git a/server/sonar-web/src/main/js/apps/settings/components/DefinitionDefaults.js b/server/sonar-web/src/main/js/apps/settings/components/DefinitionDefaults.js
index 9d561ac6174..830bcac102f 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/DefinitionDefaults.js
+++ b/server/sonar-web/src/main/js/apps/settings/components/DefinitionDefaults.js
@@ -29,7 +29,7 @@ export default class DefinitionDefaults extends React.Component {
onReset: React.PropTypes.func.isRequired
};
- handleReset (e: any) {
+ handleReset (e: Object) {
e.preventDefault();
e.target.blur();
this.props.onReset();
diff --git a/server/sonar-web/src/main/js/apps/settings/components/EmailForm.js b/server/sonar-web/src/main/js/apps/settings/components/EmailForm.js
index 1af5a0a8014..f4e551206b7 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/EmailForm.js
+++ b/server/sonar-web/src/main/js/apps/settings/components/EmailForm.js
@@ -77,7 +77,7 @@ class EmailForm extends React.Component {
<input
id="test-email-to"
type="email"
- required
+ required={true}
value={this.state.recipient}
disabled={this.state.loading}
onChange={e => this.setState({ recipient: e.target.value })}/>
@@ -100,7 +100,7 @@ class EmailForm extends React.Component {
</label>
<textarea
id="test-email-title"
- required
+ required={true}
rows="5"
value={this.state.message}
disabled={this.state.loading}
diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.js b/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.js
index 02fcbfacef2..b2ddc8e6959 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.js
+++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.js
@@ -26,6 +26,7 @@ import { TYPE_PROPERTY_SET } from '../../constants';
export default class Input extends React.Component {
static propTypes = {
+ /* eslint-disable react/no-unused-prop-types */
setting: React.PropTypes.object.isRequired,
value: React.PropTypes.any,
onChange: React.PropTypes.func.isRequired
diff --git a/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js b/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js
index 8474bbaa581..d1c301302bd 100644
--- a/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js
+++ b/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js
@@ -103,7 +103,7 @@ export default class ServerIdApp extends React.Component {
<input
id="server-id-organization"
type="text"
- required
+ required={true}
value={this.state.organization}
disabled={this.state.loading}
onChange={e => this.setState({ organization: e.target.value })}/>
@@ -122,7 +122,7 @@ export default class ServerIdApp extends React.Component {
<input
id="server-id-ip"
type="text"
- required
+ required={true}
value={this.state.ip}
disabled={this.state.loading}
onChange={e => this.setState({ ip: e.target.value })}/>
diff --git a/server/sonar-web/src/main/js/apps/settings/store/values/actions.js b/server/sonar-web/src/main/js/apps/settings/store/values/actions.js
index e088215d7fd..08b98237090 100644
--- a/server/sonar-web/src/main/js/apps/settings/store/values/actions.js
+++ b/server/sonar-web/src/main/js/apps/settings/store/values/actions.js
@@ -19,6 +19,7 @@
*/
// @flow
import type { SettingValue } from '../../types';
+
export const RECEIVE_VALUES: string = 'RECEIVE_VALUES';
/**
diff --git a/server/sonar-web/src/main/js/apps/settings/store/values/reducer.js b/server/sonar-web/src/main/js/apps/settings/store/values/reducer.js
index c57ed067c36..55f2182af2c 100644
--- a/server/sonar-web/src/main/js/apps/settings/store/values/reducer.js
+++ b/server/sonar-web/src/main/js/apps/settings/store/values/reducer.js
@@ -24,7 +24,7 @@ import { actions as appStateActions } from '../../../../store/appState/duck';
type State = { [key: string]: {} };
-const reducer = (state: State = {}, action: any) => {
+const reducer = (state: State = {}, action: Object) => {
if (action.type === RECEIVE_VALUES) {
const settingsByKey = keyBy(action.settings, 'key');
return { ...state, ...settingsByKey };
diff --git a/server/sonar-web/src/main/js/apps/system/__tests__/system-test.js b/server/sonar-web/src/main/js/apps/system/__tests__/system-test.js
index 4e038d05b0a..8061aa198d0 100644
--- a/server/sonar-web/src/main/js/apps/system/__tests__/system-test.js
+++ b/server/sonar-web/src/main/js/apps/system/__tests__/system-test.js
@@ -24,7 +24,7 @@ import ItemBoolean from '../item-boolean';
import ItemObject from '../item-object';
import ItemLogLevel from '../item-log-level';
-describe('Item Value', function () {
+describe('Item Value', () => {
it('should render string', () => {
const result = shallow(<ItemValue value="/some/path/as/an/example"/>);
expect(result.find('code').text()).toBe('/some/path/as/an/example');
@@ -65,7 +65,7 @@ describe('ItemObject', () => {
});
});
-describe('Log Level', function () {
+describe('Log Level', () => {
it('should render select box', () => {
const result = shallow(<ItemLogLevel value="INFO"/>);
expect(result.find('select').length).toBe(1);
diff --git a/server/sonar-web/src/main/js/apps/system/item-boolean.js b/server/sonar-web/src/main/js/apps/system/item-boolean.js
index aa9e92b48fd..c858ec2bd6f 100644
--- a/server/sonar-web/src/main/js/apps/system/item-boolean.js
+++ b/server/sonar-web/src/main/js/apps/system/item-boolean.js
@@ -20,7 +20,7 @@
import React from 'react';
export default React.createClass({
- render() {
+ render () {
if (this.props.value) {
return <i className="icon-check"/>;
} else {
diff --git a/server/sonar-web/src/main/js/apps/system/item-log-level.js b/server/sonar-web/src/main/js/apps/system/item-log-level.js
index 27ac5d84306..77ce23f8144 100644
--- a/server/sonar-web/src/main/js/apps/system/item-log-level.js
+++ b/server/sonar-web/src/main/js/apps/system/item-log-level.js
@@ -28,27 +28,30 @@ export default React.createClass({
return { level: this.props.value };
},
- onChange() {
+ onChange () {
const newValue = this.refs.select.value;
setLogLevel(newValue).then(() => {
this.setState({ level: newValue });
});
},
- render() {
- const options = LOG_LEVELS.map(level => {
- return <option key={level} value={level}>{level}</option>;
- });
+ render () {
+ const options = LOG_LEVELS.map(level => (
+ <option key={level} value={level}>{level}</option>
+ ));
const warning = this.state.level !== 'INFO' ? (
- <div className="alert alert-danger spacer-top" style={{ wordBreak: 'normal' }}>
- {translate('system.log_level.warning')}
- </div>
- ) : null;
- return <div>
- <select ref="select"
+ <div className="alert alert-danger spacer-top" style={{ wordBreak: 'normal' }}>
+ {translate('system.log_level.warning')}
+ </div>
+ ) : null;
+ return (
+ <div>
+ <select
+ ref="select"
onChange={this.onChange}
value={this.state.level}>{options}</select>
- {warning}
- </div>;
+ {warning}
+ </div>
+ );
}
});
diff --git a/server/sonar-web/src/main/js/apps/system/item-object.js b/server/sonar-web/src/main/js/apps/system/item-object.js
index 93652bf7c4a..c8bec3651ed 100644
--- a/server/sonar-web/src/main/js/apps/system/item-object.js
+++ b/server/sonar-web/src/main/js/apps/system/item-object.js
@@ -21,13 +21,19 @@ import React from 'react';
import ItemValue from './item-value';
export default React.createClass({
- render() {
+ render () {
const rows = Object.keys(this.props.value).map(key => {
- return <tr key={key}>
- <td className="thin nowrap">{key}</td>
- <td><ItemValue value={this.props.value[key]}/></td>
- </tr>;
+ return (
+ <tr key={key}>
+ <td className="thin nowrap">{key}</td>
+ <td><ItemValue value={this.props.value[key]}/></td>
+ </tr>
+ );
});
- return <table className="data"><tbody>{rows}</tbody></table>;
+ return (
+ <table className="data">
+ <tbody>{rows}</tbody>
+ </table>
+ );
}
});
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 d3765865f80..94e38d779b7 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
@@ -23,7 +23,7 @@ import ItemObject from './item-object';
import ItemLogLevel from './item-log-level';
export default React.createClass({
- render() {
+ render () {
if (this.props.name === 'Logs Level') {
return <ItemLogLevel value={this.props.value}/>;
}
diff --git a/server/sonar-web/src/main/js/apps/system/main.js b/server/sonar-web/src/main/js/apps/system/main.js
index 23c3af7e015..a95b94220cc 100644
--- a/server/sonar-web/src/main/js/apps/system/main.js
+++ b/server/sonar-web/src/main/js/apps/system/main.js
@@ -28,7 +28,7 @@ const SECTIONS_ORDER = ['SonarQube', 'Database', 'System', 'Elasticsearch State'
'Compute Engine Tasks', 'Compute Engine State', 'Compute Engine Database Connection', 'JvmProperties'];
export default React.createClass({
- componentDidMount() {
+ componentDidMount () {
getSystemInfo().then(info => this.setState({ sections: this.parseSections(info) }));
},
@@ -58,55 +58,57 @@ export default React.createClass({
new RestartModal().render();
},
- render() {
+ render () {
let sections = null;
if (this.state && this.state.sections) {
sections = this.state.sections
- .filter(section => SECTIONS_ORDER.indexOf(section.name)>=0)
- .map(section => {
- return <Section key={section.name} section={section.name} items={section.items}/>;
- });
+ .filter(section => SECTIONS_ORDER.indexOf(section.name) >= 0)
+ .map(section => (
+ <Section key={section.name} section={section.name} items={section.items}/>
+ ));
}
- return <div className="page">
- <header className="page-header">
- <h1 className="page-title">{translate('system_info.page')}</h1>
- <div className="page-actions">
- <a href={window.baseUrl + '/api/system/info'} id="download-link">Download</a>
- <div className="display-inline-block dropdown big-spacer-left">
- <button data-toggle="dropdown">Logs <i className="icon-dropdown"/></button>
- <ul className="dropdown-menu">
- <li>
- <a href={window.baseUrl + '/api/system/logs?process=app'} id="logs-link">
- Main Process
- </a>
- </li>
- <li>
- <a href={window.baseUrl + '/api/system/logs?process=ce'} id="ce-logs-link">
- Compute Engine
- </a>
- </li>
- <li>
- <a href={window.baseUrl + '/api/system/logs?process=es'} id="es-logs-link">
- Elasticsearch
- </a>
- </li>
- <li>
- <a href={window.baseUrl + '/api/system/logs?process=web'} id="web-logs-link">
- Web Server
- </a>
- </li>
- </ul>
- </div>
- <button
- id="restart-server-button"
- className="big-spacer-left"
- onClick={this.handleServerRestart}>
- Restart Server
- </button>
+ return (
+ <div className="page">
+ <header className="page-header">
+ <h1 className="page-title">{translate('system_info.page')}</h1>
+ <div className="page-actions">
+ <a href={window.baseUrl + '/api/system/info'} id="download-link">Download</a>
+ <div className="display-inline-block dropdown big-spacer-left">
+ <button data-toggle="dropdown">Logs <i className="icon-dropdown"/></button>
+ <ul className="dropdown-menu">
+ <li>
+ <a href={window.baseUrl + '/api/system/logs?process=app'} id="logs-link">
+ Main Process
+ </a>
+ </li>
+ <li>
+ <a href={window.baseUrl + '/api/system/logs?process=ce'} id="ce-logs-link">
+ Compute Engine
+ </a>
+ </li>
+ <li>
+ <a href={window.baseUrl + '/api/system/logs?process=es'} id="es-logs-link">
+ Elasticsearch
+ </a>
+ </li>
+ <li>
+ <a href={window.baseUrl + '/api/system/logs?process=web'} id="web-logs-link">
+ Web Server
+ </a>
+ </li>
+ </ul>
+ </div>
+ <button
+ id="restart-server-button"
+ className="big-spacer-left"
+ onClick={this.handleServerRestart}>
+ Restart Server
+ </button>
+ </div>
+ </header>
+ {sections}
</div>
- </header>
- {sections}
- </div>;
+ );
}
});
diff --git a/server/sonar-web/src/main/js/apps/system/section.js b/server/sonar-web/src/main/js/apps/system/section.js
index 42d55466b31..d586946865e 100644
--- a/server/sonar-web/src/main/js/apps/system/section.js
+++ b/server/sonar-web/src/main/js/apps/system/section.js
@@ -21,21 +21,25 @@ import React from 'react';
import ItemValue from './item-value';
export default React.createClass({
- render() {
+ render () {
const items = this.props.items.map(item => {
- return <tr key={item.name}>
- <td className="thin">
- <div style={{ width: '25vw', overflow: 'hidden', textOverflow: 'ellipsis' }}>{item.name}</div>
- </td>
- <td style={{ wordBreak: 'break-all' }}><ItemValue name={item.name} value={item.value}/></td>
- </tr>;
+ return (
+ <tr key={item.name}>
+ <td className="thin">
+ <div style={{ width: '25vw', overflow: 'hidden', textOverflow: 'ellipsis' }}>{item.name}</div>
+ </td>
+ <td style={{ wordBreak: 'break-all' }}><ItemValue name={item.name} value={item.value}/></td>
+ </tr>
+ );
});
- return <div className="big-spacer-bottom">
- <h3 className="spacer-bottom">{this.props.section}</h3>
- <table className="data zebra" id={this.props.section}>
- <tbody>{items}</tbody>
- </table>
- </div>;
+ return (
+ <div className="big-spacer-bottom">
+ <h3 className="spacer-bottom">{this.props.section}</h3>
+ <table className="data zebra" id={this.props.section}>
+ <tbody>{items}</tbody>
+ </table>
+ </div>
+ );
}
});
diff --git a/server/sonar-web/src/main/js/apps/update-center/init.js b/server/sonar-web/src/main/js/apps/update-center/init.js
index 0c7fe76fe83..df0487d4f72 100644
--- a/server/sonar-web/src/main/js/apps/update-center/init.js
+++ b/server/sonar-web/src/main/js/apps/update-center/init.js
@@ -71,9 +71,7 @@ const init = function ({ el, updateCenterActive }) {
});
};
-App.on('start', function (options) {
- return init.call(App, options);
-});
+App.on('start', options => init.call(App, options));
export default function (el, updateCenterActive) {
App.start({ el, updateCenterActive });
diff --git a/server/sonar-web/src/main/js/apps/update-center/plugins.js b/server/sonar-web/src/main/js/apps/update-center/plugins.js
index 868c7acdab7..1c7c261902b 100644
--- a/server/sonar-web/src/main/js/apps/update-center/plugins.js
+++ b/server/sonar-web/src/main/js/apps/update-center/plugins.js
@@ -38,23 +38,19 @@ const Plugins = Backbone.Collection.extend({
parse (r) {
const that = this;
- return r.plugins.map(function (plugin) {
+ return r.plugins.map(plugin => {
let updates = [
that._getLastWithStatus(plugin.updates, 'COMPATIBLE'),
that._getLastWithStatus(plugin.updates, 'REQUIRES_SYSTEM_UPGRADE'),
that._getLastWithStatus(plugin.updates, 'DEPS_REQUIRE_SYSTEM_UPGRADE')
].filter(_.identity);
- updates = updates.map(function (update) {
- return that._extendChangelog(plugin.updates, update);
- });
+ updates = updates.map(update => that._extendChangelog(plugin.updates, update));
return _.extend(plugin, { updates });
});
},
_getLastWithStatus (updates, status) {
- const index = _.findLastIndex(updates, function (update) {
- return update.status === status;
- });
+ const index = _.findLastIndex(updates, update => update.status === status);
return index !== -1 ? updates[index] : null;
},
@@ -115,13 +111,13 @@ const Plugins = Backbone.Collection.extend({
type: 'GET',
url: window.baseUrl + '/api/plugins/pending',
success (r) {
- const installing = r.installing.map(function (plugin) {
+ const installing = r.installing.map(plugin => {
return { key: plugin.key, _status: 'installing' };
});
- const updating = r.updating.map(function (plugin) {
+ const updating = r.updating.map(plugin => {
return { key: plugin.key, _status: 'updating' };
});
- const uninstalling = r.removing.map(function (plugin) {
+ const uninstalling = r.removing.map(plugin => {
return { key: plugin.key, _status: 'uninstalling' };
});
that._installedCount = installing.length;
@@ -142,9 +138,7 @@ const Plugins = Backbone.Collection.extend({
type: 'GET',
url: window.baseUrl + '/api/system/upgrades',
success (r) {
- that._systemUpdates = r.upgrades.map(function (update) {
- return _.extend(update, { _system: true });
- });
+ that._systemUpdates = r.upgrades.map(update => _.extend(update, { _system: true }));
}
};
return Backbone.ajax(opts);
@@ -152,7 +146,7 @@ const Plugins = Backbone.Collection.extend({
fetchInstalled () {
const that = this;
- return $.when(this._fetchInstalled(), this._fetchUpdates(), this._fetchPending()).done(function () {
+ return $.when(this._fetchInstalled(), this._fetchUpdates(), this._fetchPending()).done(() => {
const plugins = new Plugins();
plugins.set(that._installed);
plugins.set(that._updates, { remove: false });
@@ -164,7 +158,7 @@ const Plugins = Backbone.Collection.extend({
fetchUpdates () {
const that = this;
return $.when(this._fetchInstalled(), this._fetchUpdates(), this._fetchPending())
- .done(function () {
+ .done(() => {
const plugins = new Plugins();
plugins.set(that._installed);
plugins.set(that._updates, { remove: true });
@@ -175,7 +169,7 @@ const Plugins = Backbone.Collection.extend({
fetchAvailable () {
const that = this;
- return $.when(this._fetchAvailable(), this._fetchPending()).done(function () {
+ return $.when(this._fetchAvailable(), this._fetchPending()).done(() => {
const plugins = new Plugins();
plugins.set(that._available);
plugins.set(that._pending, { add: false, remove: false });
@@ -185,13 +179,14 @@ const Plugins = Backbone.Collection.extend({
fetchSystemUpgrades () {
const that = this;
- return $.when(this._fetchSystemUpgrades()).done(function () {
+ return $.when(this._fetchSystemUpgrades()).done(() => {
that.reset(that._systemUpdates);
});
},
search (query) {
- this.filter(function (model) {
+ /* eslint-disable array-callback-return */
+ this.filter(model => {
model.set({ _hidden: !model.match(query) });
});
},
@@ -205,7 +200,7 @@ const Plugins = Backbone.Collection.extend({
that._installedCount = 0;
that._updatedCount = 0;
that._uninstalledCount = 0;
- that.forEach(function (model) {
+ that.forEach(model => {
model.unset('_status');
});
that.trigger('change');
diff --git a/server/sonar-web/src/main/js/apps/update-center/search-view.js b/server/sonar-web/src/main/js/apps/update-center/search-view.js
index 2cf558354a8..c316eccdced 100644
--- a/server/sonar-web/src/main/js/apps/update-center/search-view.js
+++ b/server/sonar-web/src/main/js/apps/update-center/search-view.js
@@ -84,7 +84,7 @@ export default Marionette.ItemView.extend({
focusSearch () {
const that = this;
- setTimeout(function () {
+ setTimeout(() => {
that.$('#update-center-search-query').focus();
}, 0);
},
diff --git a/server/sonar-web/src/main/js/apps/users/change-password-view.js b/server/sonar-web/src/main/js/apps/users/change-password-view.js
index fb8f29e3c04..c68e9aabe6b 100644
--- a/server/sonar-web/src/main/js/apps/users/change-password-view.js
+++ b/server/sonar-web/src/main/js/apps/users/change-password-view.js
@@ -43,9 +43,9 @@ export default ModalForm.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
diff --git a/server/sonar-web/src/main/js/apps/users/create-view.js b/server/sonar-web/src/main/js/apps/users/create-view.js
index 8f1768c6a8d..7e233230bc7 100644
--- a/server/sonar-web/src/main/js/apps/users/create-view.js
+++ b/server/sonar-web/src/main/js/apps/users/create-view.js
@@ -38,10 +38,10 @@ export default FormView.extend({
400: null,
500: null
}
- }).done(function () {
+ }).done(() => {
that.collection.refresh();
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
diff --git a/server/sonar-web/src/main/js/apps/users/deactivate-view.js b/server/sonar-web/src/main/js/apps/users/deactivate-view.js
index 1a546ece3f2..4d3c9d2fad3 100644
--- a/server/sonar-web/src/main/js/apps/users/deactivate-view.js
+++ b/server/sonar-web/src/main/js/apps/users/deactivate-view.js
@@ -37,10 +37,10 @@ export default ModalForm.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
collection.total--;
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
}
diff --git a/server/sonar-web/src/main/js/apps/users/form-view.js b/server/sonar-web/src/main/js/apps/users/form-view.js
index 80115329fd2..cbe625b6080 100644
--- a/server/sonar-web/src/main/js/apps/users/form-view.js
+++ b/server/sonar-web/src/main/js/apps/users/form-view.js
@@ -55,9 +55,7 @@ export default ModalForm.extend({
const scmAccounts = this.$('[name="scmAccounts"]').map(function () {
return $(this).val();
}).toArray();
- return scmAccounts.filter(function (value) {
- return !!value;
- });
+ return scmAccounts.filter(value => !!value);
},
addScmAccount () {
diff --git a/server/sonar-web/src/main/js/apps/users/init.js b/server/sonar-web/src/main/js/apps/users/init.js
index 490ea231426..b0247eb0d09 100644
--- a/server/sonar-web/src/main/js/apps/users/init.js
+++ b/server/sonar-web/src/main/js/apps/users/init.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import Marionette from 'backbone.marionette';
-
import Layout from './layout';
import Users from './users';
import HeaderView from './header-view';
@@ -57,7 +56,7 @@ const init = function ({ el, currentUser }, providers) {
this.users.fetch();
};
-App.on('start', function (options) {
+App.on('start', options => {
getIdentityProviders().then(r => init.call(App, options, r.identityProviders));
});
diff --git a/server/sonar-web/src/main/js/apps/users/list-view.js b/server/sonar-web/src/main/js/apps/users/list-view.js
index 3f557d76db8..6caa6cd8736 100644
--- a/server/sonar-web/src/main/js/apps/users/list-view.js
+++ b/server/sonar-web/src/main/js/apps/users/list-view.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import Marionette from 'backbone.marionette';
-
import ListItemView from './list-item-view';
import Template from './templates/users-list.hbs';
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 ff85d106652..8ffac0f2391 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
@@ -20,7 +20,6 @@
import $ from 'jquery';
import _ from 'underscore';
import Clipboard from 'clipboard';
-
import Modal from '../../components/common/modals';
import Template from './templates/users-tokens.hbs';
import { getTokens, generateToken, revokeToken } from '../../api/user-tokens';
@@ -68,7 +67,7 @@ export default Modal.extend({
});
},
- onRevokeTokenFormSubmit(e) {
+ onRevokeTokenFormSubmit (e) {
e.preventDefault();
const tokenName = $(e.currentTarget).data('token');
const token = _.findWhere(this.tokens, { name: `${tokenName}` });
@@ -100,7 +99,7 @@ export default Modal.extend({
Modal.prototype.onDestroy.apply(this, arguments);
},
- serializeData() {
+ serializeData () {
return _.extend(Modal.prototype.serializeData.apply(this, arguments), {
tokens: this.tokens,
newToken: this.newToken,
diff --git a/server/sonar-web/src/main/js/apps/users/update-view.js b/server/sonar-web/src/main/js/apps/users/update-view.js
index c010ed75376..72ab0bda372 100644
--- a/server/sonar-web/src/main/js/apps/users/update-view.js
+++ b/server/sonar-web/src/main/js/apps/users/update-view.js
@@ -34,10 +34,10 @@ export default FormView.extend({
// do not show global error
400: null
}
- }).done(function () {
+ }).done(() => {
that.collection.refresh();
that.destroy();
- }).fail(function (jqXHR) {
+ }).fail(jqXHR => {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Action.js b/server/sonar-web/src/main/js/apps/web-api/components/Action.js
index cfe3a6df465..b6d5165e9ee 100644
--- a/server/sonar-web/src/main/js/apps/web-api/components/Action.js
+++ b/server/sonar-web/src/main/js/apps/web-api/components/Action.js
@@ -19,7 +19,6 @@
*/
import React from 'react';
import { Link } from 'react-router';
-
import { getActionKey } from '../utils';
import Params from './Params';
import ResponseExample from './ResponseExample';
diff --git a/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.js b/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.js
index bf7b8c0d235..8680de0f2b1 100644
--- a/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.js
+++ b/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { translate } from '../../../helpers/l10n';
export default function DeprecatedBadge ({ since }) {
diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Domain.js b/server/sonar-web/src/main/js/apps/web-api/components/Domain.js
index 6fd54950711..6bfed0921c5 100644
--- a/server/sonar-web/src/main/js/apps/web-api/components/Domain.js
+++ b/server/sonar-web/src/main/js/apps/web-api/components/Domain.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import Action from './Action';
import InternalBadge from './InternalBadge';
import { getActionKey } from '../utils';
diff --git a/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.js b/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.js
index 013af802b04..0602d7d0e68 100644
--- a/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.js
+++ b/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { translate } from '../../../helpers/l10n';
export default function InternalBadge () {
diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Params.js b/server/sonar-web/src/main/js/apps/web-api/components/Params.js
index 68649ad2a8b..623eba819f2 100644
--- a/server/sonar-web/src/main/js/apps/web-api/components/Params.js
+++ b/server/sonar-web/src/main/js/apps/web-api/components/Params.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import InternalBadge from './InternalBadge';
import DeprecatedBadge from './DeprecatedBadge';
diff --git a/server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.js b/server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.js
index 70e1791c5b2..177be23b4f8 100644
--- a/server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.js
+++ b/server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.js
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-
import { fetchResponseExample as fetchResponseExampleApi } from '../../../api/web-api';
export default class ResponseExample extends React.Component {
diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Search.js b/server/sonar-web/src/main/js/apps/web-api/components/Search.js
index 0784a4a33ea..51f29c7dfa6 100644
--- a/server/sonar-web/src/main/js/apps/web-api/components/Search.js
+++ b/server/sonar-web/src/main/js/apps/web-api/components/Search.js
@@ -19,7 +19,6 @@
*/
import _ from 'underscore';
import React from 'react';
-
import Checkbox from '../../../components/controls/Checkbox';
import { TooltipsContainer } from '../../../components/mixins/tooltips-mixin';
import { translate } from '../../../helpers/l10n';
@@ -66,6 +65,9 @@ export default class Search extends React.Component {
<span
style={{ cursor: 'pointer' }}
title={translate('api_documentation.internal_tooltip')}
+ tabIndex="0"
+ role="checkbox"
+ aria-checked={showInternal ? 'true' : 'false'}
onClick={onToggleInternal}>
Show Internal API
</span>
@@ -85,6 +87,9 @@ export default class Search extends React.Component {
<span
style={{ cursor: 'pointer' }}
title={translate('api_documentation.deprecation_tooltip')}
+ tabIndex="0"
+ role="checkbox"
+ aria-checked={showOnlyDeprecated ? 'true' : 'false'}
onClick={onToggleDeprecated}>
Show Only Deprecated API
</span>