From 4c5465f67fdb404bbe983a53c753d1253785661a Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 3 Nov 2016 17:34:38 +0100 Subject: [PATCH] drop global dashboards and measures from ui (#1353) --- .../src/test/java/it/Category1Suite.java | 10 - .../src/test/java/it/Category2Suite.java | 4 +- .../src/test/java/it/Category4Suite.java | 6 - .../DashboardSharingPermissionTest.java | 78 ---- .../SystemAdminPermissionTest.java | 80 ---- .../it/componentDashboard/DashboardTest.java | 134 ------- .../java/it/duplication/DuplicationsTest.java | 9 - .../java/it/measure/ProjectDashboardTest.java | 2 + .../java/it/measure/ProjectWidgetsTest.java | 88 ----- .../it/measureFilter/MeasureFiltersTest.java | 132 ------- .../java/it/measureHistory/HistoryUiTest.java | 77 ---- .../it/qualityGate/QualityGateUiTest.java | 30 -- .../qualityModel/TechnicalDebtWidgetTest.java | 100 ----- .../test/java/it/settings/SettingsTest.java | 10 - .../global-dashboard-sharing-allowed.html | 79 ---- .../change-other-measure-filter-owner.html | 164 -------- .../change-own-measure-filter-owner.html | 134 ------- .../change-shared-global-dashboard-owner.html | 104 ------ .../change-system-measure-filter-owner.html | 89 ----- .../dashboard_extension/xss.html | 94 ----- .../documentation_and_comments_widget.html | 49 --- .../default_widgets/welcome_widget.html | 24 -- .../create-global-dashboards-error.html | 155 -------- .../global_dashboard/default-dashboards.html | 59 --- .../edit-global-dashboards.html | 135 ------- .../global_dashboard/filter-widget-admin.html | 134 ------- .../filter-widget-anonymous.html | 44 --- ...-dashboard-applies-project-permission.html | 79 ---- .../manage-global-dashboard.html | 214 ----------- .../order-global-dashboard.html | 119 ------ .../global_dashboard/project-widget.html | 109 ------ .../DuplicationsTest/duplications_widget.html | 44 --- .../complexity/complexity-widget.html | 44 --- .../should-exclude-new-metrics.html | 74 ---- .../description/description-widget.html | 29 -- .../hotspots/hide-if-no-measures.html | 29 -- .../hotspots/hotspot-metric-widget.html | 34 -- .../copy_measure_filter.html | 139 ------- .../copy_uniqueness_of_name.html | 134 ------- .../MeasureFiltersTest/empty_filter.html | 30 -- .../initial_search_form.html | 34 -- .../link_from_main_header.html | 40 -- .../list_change_columns.html | 134 ------- .../list_delete_column.html | 74 ---- .../MeasureFiltersTest/list_move_columns.html | 74 ---- .../list_sort_by_descending_name.html | 70 ---- .../list_sort_by_ncloc.html | 94 ----- .../MeasureFiltersTest/list_widget.html | 74 ---- .../MeasureFiltersTest/list_widget_sort.html | 136 ------- ...list_widget_warning_if_missing_filter.html | 24 -- .../save_with_special_characters.html | 126 ------- .../MeasureFiltersTest/search-by-key.html | 79 ---- .../MeasureFiltersTest/search-by-name.html | 79 ---- .../MeasureFiltersTest/search_for_files.html | 49 --- .../search_for_projects.html | 64 ---- ...filter-remove-other-filters-favourite.html | 269 -------------- ...ld-display-even-if-one-missing-metric.html | 35 -- .../timeline-widget.html | 40 -- ...uld-display-empty-table-if-no-measure.html | 34 -- .../should-exclude-new-metrics.html | 74 ---- .../time-machine-widget.html | 45 --- ...hould-display-period-alerts-correctly.html | 79 ---- .../display-differential-values.html | 35 -- .../should-have-correct-values.html | 28 -- ...should-open-links-on-measures-service.html | 48 --- .../display-differential-values.html | 24 -- .../technical-debt/is-in-issues-widget.html | 24 -- .../should-have-correct-values.html | 29 -- ...-remediation-cost-on-measures-service.html | 39 -- .../SettingsTest/settings-default-value.html | 29 -- .../allow_users_to_sign_up.html | 4 +- .../config/webpack/webpack.config.base.js | 1 - .../src/main/js/apps/measures/app.js | 202 ---------- .../js/apps/measures/measures-filter-bar.js | 28 -- .../main/js/apps/projects/components/App.js | 2 +- .../js/main/nav/global/global-nav-menu.js | 53 --- .../main/js/main/nav/settings/settings-nav.js | 1 - .../admin_dashboards_controller.rb | 96 ----- .../app/controllers/dashboard_controller.rb | 159 +------- .../app/controllers/dashboards_controller.rb | 196 ---------- .../app/controllers/measures_controller.rb | 350 ------------------ .../app/controllers/widget_controller.rb | 86 ----- .../app/views/admin_dashboards/_list.html.erb | 46 --- .../app/views/admin_dashboards/index.html.erb | 49 --- .../dashboard/_configure_widget.html.erb | 55 --- .../app/views/dashboard/_header.html.erb | 30 -- .../app/views/dashboard/_widget.html.erb | 48 --- .../dashboard/_widget_definition.html.erb | 10 - .../dashboard/_widget_definitions.html.erb | 27 -- .../dashboard/_widget_properties.html.erb | 79 ---- .../views/dashboard/_widget_title.html.erb | 3 - .../app/views/dashboard/configure.html.erb | 110 ------ .../app/views/dashboard/index.html.erb | 41 -- .../dashboards/_available_dashboards.html.erb | 37 -- .../views/dashboards/_create_form.html.erb | 39 -- .../dashboards/_dashboard_operations.html.erb | 17 - .../views/dashboards/_delete_form.html.erb | 27 -- .../app/views/dashboards/_edit_form.html.erb | 46 --- .../views/dashboards/_my_dashboards.html.erb | 48 --- .../app/views/measures/_copy_form.html.erb | 20 - .../app/views/measures/_display.html.erb | 7 - .../app/views/measures/_display_list.html.erb | 231 ------------ .../app/views/measures/_edit_form.html.erb | 20 - .../app/views/measures/_favourites.html.erb | 12 - .../app/views/measures/_favourites2.html.erb | 9 - .../app/views/measures/_qualifiers.html.erb | 11 - .../app/views/measures/_save_as_form.html.erb | 21 -- .../app/views/measures/_search_body.html.erb | 10 - .../views/measures/_search_header.html.erb | 65 ---- .../app/views/measures/_shared_form.html.erb | 30 -- .../app/views/measures/manage.html.erb | 134 ------- .../app/views/measures/search.html.erb | 97 ----- .../WEB-INF/app/views/widget/index.html.erb | 44 --- 113 files changed, 7 insertions(+), 7679 deletions(-) delete mode 100644 it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java delete mode 100644 it/it-tests/src/test/java/it/authorisation/SystemAdminPermissionTest.java delete mode 100644 it/it-tests/src/test/java/it/componentDashboard/DashboardTest.java delete mode 100644 it/it-tests/src/test/java/it/measure/ProjectWidgetsTest.java delete mode 100644 it/it-tests/src/test/java/it/measureFilter/MeasureFiltersTest.java delete mode 100644 it/it-tests/src/test/java/it/measureHistory/HistoryUiTest.java delete mode 100644 it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java delete mode 100644 it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-allowed.html delete mode 100644 it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-other-measure-filter-owner.html delete mode 100644 it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-own-measure-filter-owner.html delete mode 100644 it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner.html delete mode 100644 it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-system-measure-filter-owner.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/xss.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/default_widgets/documentation_and_comments_widget.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/default_widgets/welcome_widget.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/create-global-dashboards-error.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/default-dashboards.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/edit-global-dashboards.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/filter-widget-admin.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/filter-widget-anonymous.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/global-dashboard-applies-project-permission.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/manage-global-dashboard.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/order-global-dashboard.html delete mode 100644 it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/project-widget.html delete mode 100644 it/it-tests/src/test/resources/duplication/DuplicationsTest/duplications_widget.html delete mode 100644 it/it-tests/src/test/resources/measure/ProjectWidgetsTest/complexity/complexity-widget.html delete mode 100644 it/it-tests/src/test/resources/measure/ProjectWidgetsTest/custom_measures/should-exclude-new-metrics.html delete mode 100644 it/it-tests/src/test/resources/measure/ProjectWidgetsTest/description/description-widget.html delete mode 100644 it/it-tests/src/test/resources/measure/ProjectWidgetsTest/hotspots/hide-if-no-measures.html delete mode 100644 it/it-tests/src/test/resources/measure/ProjectWidgetsTest/hotspots/hotspot-metric-widget.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/copy_measure_filter.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/copy_uniqueness_of_name.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/empty_filter.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/initial_search_form.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/link_from_main_header.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_change_columns.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_delete_column.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_move_columns.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_sort_by_descending_name.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_sort_by_ncloc.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget_sort.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget_warning_if_missing_filter.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/save_with_special_characters.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search-by-key.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search-by-name.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search_for_files.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search_for_projects.html delete mode 100644 it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/should-unshare-filter-remove-other-filters-favourite.html delete mode 100644 it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timeline-widget/should-display-even-if-one-missing-metric.html delete mode 100644 it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timeline-widget/timeline-widget.html delete mode 100644 it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/should-display-empty-table-if-no-measure.html delete mode 100644 it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/should-exclude-new-metrics.html delete mode 100644 it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/time-machine-widget.html delete mode 100644 it/it-tests/src/test/resources/qualityGate/QualityGateUiTest/should-display-period-alerts-correctly.html delete mode 100644 it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/display-differential-values.html delete mode 100644 it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/should-have-correct-values.html delete mode 100644 it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-measures-service.html delete mode 100644 it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/display-differential-values.html delete mode 100644 it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/is-in-issues-widget.html delete mode 100644 it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/should-have-correct-values.html delete mode 100644 it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/should-open-remediation-cost-on-measures-service.html delete mode 100644 it/it-tests/src/test/resources/settings/SettingsTest/settings-default-value.html delete mode 100644 server/sonar-web/src/main/js/apps/measures/app.js delete mode 100644 server/sonar-web/src/main/js/apps/measures/measures-filter-bar.js delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/controllers/admin_dashboards_controller.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/admin_dashboards/_list.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definitions.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_available_dashboards.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_dashboard_operations.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_delete_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_my_dashboards.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_favourites.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_favourites2.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_qualifiers.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_save_as_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_search_body.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_search_header.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_shared_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/search.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/widget/index.html.erb diff --git a/it/it-tests/src/test/java/it/Category1Suite.java b/it/it-tests/src/test/java/it/Category1Suite.java index b803337f5dc..efc2f42d24a 100644 --- a/it/it-tests/src/test/java/it/Category1Suite.java +++ b/it/it-tests/src/test/java/it/Category1Suite.java @@ -21,22 +21,17 @@ package it; import com.sonar.orchestrator.Orchestrator; import it.administration.UsersPageTest; -import it.authorisation.DashboardSharingPermissionTest; import it.authorisation.ExecuteAnalysisPermissionTest; import it.authorisation.IssuePermissionTest; import it.authorisation.PermissionSearchTest; import it.authorisation.ProvisioningPermissionTest; import it.authorisation.QualityProfileAdminPermissionTest; -import it.authorisation.SystemAdminPermissionTest; import it.customMeasure.CustomMeasuresTest; import it.i18n.I18nTest; import it.measure.MeasuresWsTest; import it.measure.ProjectDashboardTest; import it.measure.ProjectMeasuresPageTest; -import it.measure.ProjectWidgetsTest; -import it.measureFilter.MeasureFiltersTest; import it.measureHistory.DifferentialPeriodsTest; -import it.measureHistory.HistoryUiTest; import it.measureHistory.SincePreviousVersionHistoryTest; import it.measureHistory.SinceXDaysHistoryTest; import it.measureHistory.TimeMachineTest; @@ -82,24 +77,19 @@ import static util.ItUtils.xooPlugin; QualityGateUiTest.class, QualityGateNotificationTest.class, // authorisation - DashboardSharingPermissionTest.class, ExecuteAnalysisPermissionTest.class, IssuePermissionTest.class, PermissionSearchTest.class, ProvisioningPermissionTest.class, QualityProfileAdminPermissionTest.class, - SystemAdminPermissionTest.class, // custom measure CustomMeasuresTest.class, // measure ProjectMeasuresPageTest.class, ProjectDashboardTest.class, - ProjectWidgetsTest.class, - MeasureFiltersTest.class, MeasuresWsTest.class, // measure history DifferentialPeriodsTest.class, - HistoryUiTest.class, SincePreviousVersionHistoryTest.class, SinceXDaysHistoryTest.class, TimeMachineTest.class, diff --git a/it/it-tests/src/test/java/it/Category2Suite.java b/it/it-tests/src/test/java/it/Category2Suite.java index e30b9d043f6..442918c821f 100644 --- a/it/it-tests/src/test/java/it/Category2Suite.java +++ b/it/it-tests/src/test/java/it/Category2Suite.java @@ -46,7 +46,6 @@ import it.qualityModel.SecurityMeasureTest; import it.qualityModel.TechnicalDebtInIssueChangelogTest; import it.qualityModel.TechnicalDebtMeasureVariationTest; import it.qualityModel.TechnicalDebtTest; -import it.qualityModel.TechnicalDebtWidgetTest; import it.scm.ScmTest; import it.test.CoverageTest; import it.test.CoverageTrackingTest; @@ -95,8 +94,7 @@ import static util.ItUtils.xooPlugin; SecurityMeasureTest.class, TechnicalDebtInIssueChangelogTest.class, TechnicalDebtMeasureVariationTest.class, - TechnicalDebtTest.class, - TechnicalDebtWidgetTest.class + TechnicalDebtTest.class }) public class Category2Suite { diff --git a/it/it-tests/src/test/java/it/Category4Suite.java b/it/it-tests/src/test/java/it/Category4Suite.java index fe2aa8342cf..0924e5bd957 100644 --- a/it/it-tests/src/test/java/it/Category4Suite.java +++ b/it/it-tests/src/test/java/it/Category4Suite.java @@ -24,7 +24,6 @@ import it.analysisExclusion.FileExclusionsTest; import it.analysisExclusion.IssueExclusionsTest; import it.component.ComponentsWsTest; import it.component.ProjectSearchTest; -import it.componentDashboard.DashboardTest; import it.componentSearch.AllProjectsTest; import it.dbCleaner.PurgeTest; import it.duplication.CrossProjectDuplicationsOnRemoveFileTest; @@ -84,8 +83,6 @@ import static util.ItUtils.xooPlugin; PurgeTest.class, // project event EventTest.class, - // component dashboard - DashboardTest.class, // project comparison ProjectComparisonTest.class, // project search @@ -116,9 +113,6 @@ public class Category4Suite { // Used in OAuth2IdentityProviderTest .addPlugin(pluginArtifact("oauth2-auth-plugin")) - // Used in DashboardTest - .addPlugin(pluginArtifact("dashboard-plugin")) - // Used in UiExtensionsTest .addPlugin(pluginArtifact("ui-extensions-plugin")) diff --git a/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java b/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java deleted file mode 100644 index 9eb3496f0b1..00000000000 --- a/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package it.authorisation; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.selenium.Selenese; -import it.Category1Suite; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Test; -import org.sonarqube.ws.client.permission.PermissionsService; -import util.user.UserRule; - -import static util.ItUtils.newAdminWsClient; - -public class DashboardSharingPermissionTest { - - @ClassRule - public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; - - @ClassRule - public static UserRule userRule = UserRule.from(orchestrator); - - static String DASHBOARD_USER = "dashboard_user"; - static String CAN_SHARE_DASHBOARDS = "can_share_dashboards"; - - static PermissionsService permissionsWsClient; - - @BeforeClass - public static void setUpUsers() { - orchestrator.resetData(); - - permissionsWsClient = newAdminWsClient(orchestrator).permissions(); - - userRule.createUser(DASHBOARD_USER, "password"); - userRule.createUser(CAN_SHARE_DASHBOARDS, "password"); - } - - @AfterClass - public static void clearUsers() throws Exception { - userRule.resetUsers(); - } - - @Before - public void resetData() throws Exception { - orchestrator.resetData(); - } - - /** - * SONAR-4136 - */ - @Test - public void share_global_dashboard() throws Exception { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("global-dashboard-sharing-permission", - "/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-allowed.html") - .build(); - orchestrator.executeSelenese(selenese); - } -} diff --git a/it/it-tests/src/test/java/it/authorisation/SystemAdminPermissionTest.java b/it/it-tests/src/test/java/it/authorisation/SystemAdminPermissionTest.java deleted file mode 100644 index 383d2f0cd17..00000000000 --- a/it/it-tests/src/test/java/it/authorisation/SystemAdminPermissionTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package it.authorisation; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.selenium.Selenese; -import it.Category1Suite; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Test; -import util.user.UserRule; - -public class SystemAdminPermissionTest { - - @ClassRule - public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; - - @ClassRule - public static UserRule userRule = UserRule.from(orchestrator); - - @BeforeClass - public static void setUpUsers() { - orchestrator.resetData(); - - userRule.createUser("can_share", "password"); - userRule.createUser("cannot_share", "password"); - } - - @AfterClass - public static void reset() { - userRule.resetUsers(); - } - - /** - * SONAR-4398 - */ - @Test - public void should_change_ownership_of_shared_measure_filter() throws Exception { - // change-own-measure-filter-owner.html - // 1 - as admin, create measure filter, shared with every one - // 2 - as admin, edit filter and set owner to can_share - seleniumSuite("change-measure-filter-ownership", - "/authorisation/SystemAdminPermissionTest/change-own-measure-filter-owner.html", - "/authorisation/SystemAdminPermissionTest/change-other-measure-filter-owner.html", - "/authorisation/SystemAdminPermissionTest/change-system-measure-filter-owner.html"); - } - - /** - * SONAR-4136 - */ - @Test - public void should_change_ownership_of_shared_global_dashboard() throws Exception { - seleniumSuite("change-global-dashboard-ownership", - "/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner.html"); - } - - private void seleniumSuite(String suiteName, String... tests) { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath(suiteName, tests).build(); - orchestrator.executeSelenese(selenese); - } - -} diff --git a/it/it-tests/src/test/java/it/componentDashboard/DashboardTest.java b/it/it-tests/src/test/java/it/componentDashboard/DashboardTest.java deleted file mode 100644 index 3095ea6d560..00000000000 --- a/it/it-tests/src/test/java/it/componentDashboard/DashboardTest.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package it.componentDashboard; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.selenium.Selenese; -import it.Category4Suite; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -import static util.ItUtils.runProjectAnalysis; - -public class DashboardTest { - - @ClassRule - public static Orchestrator orchestrator = Category4Suite.ORCHESTRATOR; - - @BeforeClass - public static void scanProject() { - orchestrator.resetData(); - runProjectAnalysis(orchestrator, "shared/xoo-sample"); - } - - /** - * SONAR-1929 - */ - @Test - public void dashboard_extension() { - seleniumSuite("dashboard_extension", - // SSF-19 - "/componentDashboard/DashboardTest/dashboard_extension/xss.html"); - } - - @Test - @Ignore - public void global_dashboard() { - seleniumSuite("global_dashboard", - // SONAR-3462 - "/componentDashboard/DashboardTest/global_dashboard/edit-global-dashboards.html", - - // SONAR-4630 - "/componentDashboard/DashboardTest/global_dashboard/create-global-dashboards-error.html", - - // SONAR-3462 - "/componentDashboard/DashboardTest/global_dashboard/order-global-dashboard.html", - - // SONAR-1927 SONAR-3467 - "/componentDashboard/DashboardTest/global_dashboard/manage-global-dashboard.html", - - // SONAR-2073 SONAR-3459 - "/componentDashboard/DashboardTest/global_dashboard/filter-widget-admin.html", - - // SONAR-2073 - "/componentDashboard/DashboardTest/global_dashboard/filter-widget-anonymous.html", - - // SONAR-3461 - "/componentDashboard/DashboardTest/global_dashboard/default-dashboards.html", - - // SONAR-3457 SONAR-3563 - "/componentDashboard/DashboardTest/global_dashboard/project-widget.html"); - - // Remove permission from anonymous user - removeGroupPermission("anyone", "sample", "user"); - addUserPermission("admin", "sample", "user"); - seleniumSuite("global_dashboard_project_permissions", - // SONAR-6004 - "/componentDashboard/DashboardTest/global_dashboard/global-dashboard-applies-project-permission.html"); - - // Put back permissions - addGroupPermission("anyone", "sample", "user"); - removeUserPermission("admin", "sample", "user"); - } - - @Test - public void default_widgets() { - seleniumSuite("default_widgets", - "/componentDashboard/DashboardTest/default_widgets/welcome_widget.html", - - // SONAR-4448 - "/componentDashboard/DashboardTest/default_widgets/documentation_and_comments_widget.html"); - } - - private void seleniumSuite(String suiteName, String... tests) { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath(suiteName, tests).build(); - orchestrator.executeSelenese(selenese); - } - - private static void addUserPermission(String login, String projectKey, String permission) { - orchestrator.getServer().adminWsClient().post("api/permissions/add_user", - "login", login, - "projectKey", projectKey, - "permission", permission); - } - - private static void removeUserPermission(String login, String projectKey, String permission) { - orchestrator.getServer().adminWsClient().post("api/permissions/remove_user", - "login", login, - "projectKey", projectKey, - "permission", permission); - } - - private static void addGroupPermission(String groupName, String projectKey, String permission) { - orchestrator.getServer().adminWsClient().post("api/permissions/add_group", - "groupName", groupName, - "projectKey", projectKey, - "permission", permission); - } - - private static void removeGroupPermission(String groupName, String projectKey, String permission) { - orchestrator.getServer().adminWsClient().post("api/permissions/remove_group", - "groupName", groupName, - "projectKey", projectKey, - "permission", permission); - } -} diff --git a/it/it-tests/src/test/java/it/duplication/DuplicationsTest.java b/it/it-tests/src/test/java/it/duplication/DuplicationsTest.java index c4c0f1acdc7..7858b83fd0e 100644 --- a/it/it-tests/src/test/java/it/duplication/DuplicationsTest.java +++ b/it/it-tests/src/test/java/it/duplication/DuplicationsTest.java @@ -140,15 +140,6 @@ public class DuplicationsTest { "api/duplications/show", "duplications_show-expected.json"); } - @Test - public void duplications_widget() throws Exception { - new SeleneseTest( - Selenese.builder().setHtmlTestsInClasspath("duplications_widget", - // SONAR-4347 - "/duplication/DuplicationsTest/duplications_widget.html").build()) - .runOn(orchestrator); - } - private static Resource getComponent(String key) { Resource component = orchestrator.getServer().getWsClient() .find(ResourceQuery.createForMetrics(key, "duplicated_lines", "duplicated_blocks", "duplicated_files", "duplicated_lines_density")); diff --git a/it/it-tests/src/test/java/it/measure/ProjectDashboardTest.java b/it/it-tests/src/test/java/it/measure/ProjectDashboardTest.java index eef29acaf0b..c7e849c441d 100644 --- a/it/it-tests/src/test/java/it/measure/ProjectDashboardTest.java +++ b/it/it-tests/src/test/java/it/measure/ProjectDashboardTest.java @@ -25,6 +25,7 @@ import com.sonar.orchestrator.selenium.Selenese; import it.Category1Suite; import org.junit.Before; import org.junit.ClassRule; +import org.junit.Ignore; import org.junit.Test; import pageobjects.Navigation; import pageobjects.ProjectDashboardPage; @@ -66,6 +67,7 @@ public class ProjectDashboardTest { } @Test + @Ignore("there is no more place to show the error") public void display_a_nice_error_when_requesting_unknown_project() { Navigation nav = Navigation.get(orchestrator); nav.open("/dashboard/index?id=unknown"); diff --git a/it/it-tests/src/test/java/it/measure/ProjectWidgetsTest.java b/it/it-tests/src/test/java/it/measure/ProjectWidgetsTest.java deleted file mode 100644 index aa58f9a57c4..00000000000 --- a/it/it-tests/src/test/java/it/measure/ProjectWidgetsTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package it.measure; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.build.SonarScanner; -import com.sonar.orchestrator.selenium.Selenese; -import it.Category1Suite; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; -import org.sonar.wsclient.services.ResourceQuery; -import util.selenium.SeleneseTest; - -import static util.ItUtils.projectDir; - -public class ProjectWidgetsTest { - - @ClassRule - public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; - - @BeforeClass - public static void inspectProject() { - orchestrator.executeBuild( - SonarScanner.create(projectDir("shared/xoo-sample")) - .setProjectKey("project-widgets-test-project") - .setProjectName("ProjectWidgetsTest Project") - ); - } - - @Test - public void hotspots() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("hotspots", - "/measure/ProjectWidgetsTest/hotspots/hotspot-metric-widget.html", - "/measure/ProjectWidgetsTest/hotspots/hide-if-no-measures.html" - ).build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - - @Test - public void complexity() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("complexity", - "/measure/ProjectWidgetsTest/complexity/complexity-widget.html" - ).build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - - @Test - public void description() { - long projectId = orchestrator.getServer().getWsClient() - .find(ResourceQuery.create("project-widgets-test-project")).getId(); - long qualityGateId = orchestrator.getServer().adminWsClient().qualityGateClient().show("SonarQube way").id(); - orchestrator.getServer().adminWsClient().qualityGateClient().selectProject(qualityGateId, projectId); - - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("description", - "/measure/ProjectWidgetsTest/description/description-widget.html" - ).build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - - @Test - @Ignore - public void custom_measures() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("custom_measures", - "/measure/ProjectWidgetsTest/custom_measures/should-exclude-new-metrics.html" - ).build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - -} diff --git a/it/it-tests/src/test/java/it/measureFilter/MeasureFiltersTest.java b/it/it-tests/src/test/java/it/measureFilter/MeasureFiltersTest.java deleted file mode 100644 index f20fa6eaa2a..00000000000 --- a/it/it-tests/src/test/java/it/measureFilter/MeasureFiltersTest.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package it.measureFilter; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.build.SonarScanner; -import com.sonar.orchestrator.selenium.Selenese; -import it.Category1Suite; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Test; -import org.sonar.wsclient.SonarClient; -import org.sonar.wsclient.user.UserParameters; -import org.sonarqube.ws.client.WsClient; -import util.selenium.SeleneseTest; - -import static util.ItUtils.newAdminWsClient; -import static util.ItUtils.projectDir; - -public class MeasureFiltersTest { - - @ClassRule - public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; - public static WsClient adminWsClient; - - @BeforeClass - public static void scanStruts() { - orchestrator.resetData(); - orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-multi-modules-sample"))); - adminWsClient = newAdminWsClient(orchestrator); - - createUser("user-measure-filters", "User Measure Filters"); - } - - @AfterClass - public static void deleteTestUser() { - deactivateUser("user-measure-filters"); - } - - @Test - public void execute_measure_filters() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("execution_of_measure_filters", - "/measureFilter/MeasureFiltersTest/link_from_main_header.html", - "/measureFilter/MeasureFiltersTest/initial_search_form.html", - "/measureFilter/MeasureFiltersTest/search_for_projects.html", - "/measureFilter/MeasureFiltersTest/search_for_files.html", - // SONAR-4195 - "/measureFilter/MeasureFiltersTest/search-by-key.html", - "/measureFilter/MeasureFiltersTest/search-by-name.html", - "/measureFilter/MeasureFiltersTest/empty_filter.html").build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - - @Test - public void display_measure_filter_as_list() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("display_measure_filter_as_list", - "/measureFilter/MeasureFiltersTest/list_change_columns.html", - "/measureFilter/MeasureFiltersTest/list_delete_column.html", - "/measureFilter/MeasureFiltersTest/list_move_columns.html", - "/measureFilter/MeasureFiltersTest/list_sort_by_descending_name.html", - "/measureFilter/MeasureFiltersTest/list_sort_by_ncloc.html").build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - - @Test - public void share_measure_filters() { - // SONAR-4099 - String user = "user-measures-filter-with-sharing-perm"; - createUser(user, "User Measure Filters with sharing permission"); - - try { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("share_measure_filters", - // SONAR-4469 - "/measureFilter/MeasureFiltersTest/should-unshare-filter-remove-other-filters-favourite.html").build(); - new SeleneseTest(selenese).runOn(orchestrator); - } finally { - deactivateUser(user); - } - } - - @Test - public void copy_measure_filters() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("copy_measure_filters", - "/measureFilter/MeasureFiltersTest/copy_measure_filter.html", - "/measureFilter/MeasureFiltersTest/copy_uniqueness_of_name.html").build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - - @Test - public void manage_measure_filters() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("manage_measure_filters", - "/measureFilter/MeasureFiltersTest/save_with_special_characters.html").build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - - @Test - public void measure_filter_list_widget() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("measure_filter_list_widget", - "/measureFilter/MeasureFiltersTest/list_widget.html", - "/measureFilter/MeasureFiltersTest/list_widget_sort.html", - "/measureFilter/MeasureFiltersTest/list_widget_warning_if_missing_filter.html").build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - - private static void createUser(String login, String name) { - SonarClient client = orchestrator.getServer().adminWsClient(); - UserParameters userCreationParameters = UserParameters.create().login(login).name(name).password("password").passwordConfirmation("password"); - client.userClient().create(userCreationParameters); - } - - private static void deactivateUser(String user) { - orchestrator.getServer().adminWsClient().userClient().deactivate(user); - } -} diff --git a/it/it-tests/src/test/java/it/measureHistory/HistoryUiTest.java b/it/it-tests/src/test/java/it/measureHistory/HistoryUiTest.java deleted file mode 100644 index 94fcc35678b..00000000000 --- a/it/it-tests/src/test/java/it/measureHistory/HistoryUiTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package it.measureHistory; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.build.SonarScanner; -import com.sonar.orchestrator.locator.FileLocation; -import com.sonar.orchestrator.selenium.Selenese; -import it.Category1Suite; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; -import util.selenium.SeleneseTest; - -import static util.ItUtils.projectDir; - -public class HistoryUiTest { - - @ClassRule - public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; - - @BeforeClass - public static void initialize() { - orchestrator.resetData(); - orchestrator.getServer().restoreProfile(FileLocation.ofClasspath("/measureHistory/one-issue-per-line-profile.xml")); - orchestrator.getServer().provisionProject("sample", "sample"); - orchestrator.getServer().associateProjectToQualityProfile("sample", "xoo", "one-issue-per-line"); - analyzeProject("shared/xoo-history-v1", "2014-10-19"); - analyzeProject("shared/xoo-history-v2", "2014-11-13"); - } - - private static void analyzeProject(String path, String date) { - orchestrator.executeBuild(SonarScanner.create(projectDir(path)) - .setProperties("sonar.projectDate", date)); - } - - @Test - public void test_timeline_widget() { - new SeleneseTest(Selenese.builder().setHtmlTestsInClasspath("history-timeline-widget", - "/measureHistory/HistoryUiTest/history-timeline-widget/timeline-widget.html", - // SONAR-3561 - "/measureHistory/HistoryUiTest/history-timeline-widget/should-display-even-if-one-missing-metric.html" - ).build()).runOn(orchestrator); - } - - @Test - @Ignore - public void test_timemachine_widget() { - // Use old way to execute Selenium because 'waitForTextPresent' action is not supported by SeleneseTest - orchestrator.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("history-timemachine-widget", - "/measureHistory/HistoryUiTest/history-timemachine-widget/time-machine-widget.html", - // SONAR-3354 & SONAR-3353 - "/measureHistory/HistoryUiTest/history-timemachine-widget/should-display-empty-table-if-no-measure.html", - // SONAR-3650 - "/measureHistory/HistoryUiTest/history-timemachine-widget/should-exclude-new-metrics.html" - ).build()); - } - -} diff --git a/it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java b/it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java index 399399a49f5..e5c086800d4 100644 --- a/it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java +++ b/it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java @@ -91,32 +91,6 @@ public class QualityGateUiTest { qgClient.destroy(qGate.id()); } - /** - * SONAR-1352 - */ - @Test - public void display_period_alert_on_project_dashboard() { - QualityGateClient qgClient = orchestrator.getServer().adminWsClient().qualityGateClient(); - QualityGate qGate = qgClient.create("AlertsForDashboard"); - qgClient.createCondition(NewCondition.create(qGate.id()).metricKey("lines").operator("LT").warningThreshold("0").errorThreshold("10") - .period(1)); - qgClient.setDefault(qGate.id()); - - // No alert - scanSampleWithDate("2012-01-01"); - - // Red alert because lines number has not changed since previous analysis - scanSample(); - - new SeleneseTest(Selenese.builder() - .setHtmlTestsInClasspath("display-period-alerts", - "/qualityGate/QualityGateUiTest/should-display-period-alerts-correctly.html" - ).build()).runOn(orchestrator); - - qgClient.unsetDefault(); - qgClient.destroy(qGate.id()); - } - @Test public void should_display_quality_gates_page() { Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("should_display_quality_gates_page", @@ -125,10 +99,6 @@ public class QualityGateUiTest { new SeleneseTest(selenese).runOn(orchestrator); } - private void scanSample() { - scanSample(null, null); - } - private void scanSampleWithDate(String date) { scanSample(date, null); } diff --git a/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java b/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java deleted file mode 100644 index 51dc10bd286..00000000000 --- a/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package it.qualityModel; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.build.SonarScanner; -import com.sonar.orchestrator.locator.FileLocation; -import com.sonar.orchestrator.selenium.Selenese; -import it.Category2Suite; -import java.text.SimpleDateFormat; -import java.util.Date; -import org.apache.commons.lang.time.DateUtils; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Test; -import util.selenium.SeleneseTest; - -import static util.ItUtils.projectDir; - -public class TechnicalDebtWidgetTest { - - @ClassRule - public static Orchestrator orchestrator = Category2Suite.ORCHESTRATOR; - - @ClassRule - public static DebtConfigurationRule debtConfiguration = DebtConfigurationRule.create(orchestrator); - - @BeforeClass - public static void init() { - orchestrator.resetData(); - - // Set rating grid values to not depend from default value - debtConfiguration.updateRatingGrid(0.1d, 0.2d, 0.5d, 1d); - - orchestrator.getServer().restoreProfile(FileLocation.ofClasspath("/qualityModel/with-many-rules.xml")); - orchestrator.getServer().provisionProject("com.sonarsource.it.samples:multi-modules-sample", "com.sonarsource.it.samples:multi-modules-sample"); - orchestrator.getServer().associateProjectToQualityProfile("com.sonarsource.it.samples:multi-modules-sample", "xoo", "with-many-rules"); - - // need to execute the build twice in order to have history widgets - // we made some exclusions to have variations in diff mode - scanProject(getPastDate(20), "**/a2/**"); - scanProject(getPastDate(10), ""); - } - - private static void scanProject(String date, String excludes) { - SonarScanner scan = SonarScanner.create(projectDir("shared/xoo-multi-modules-sample")) - .setProperties("sonar.projectDate", date, "sonar.exclusions", excludes); - orchestrator.executeBuild(scan); - } - - /** - * SONAR-4717 - */ - @Test - public void technical_debt_in_issues_widget() { - new SeleneseTest(Selenese.builder() - .setHtmlTestsInClasspath("technical-debt-in-issues-widget", - "/qualityModel/TechnicalDebtWidgetTest/technical-debt/should-have-correct-values.html", - "/qualityModel/TechnicalDebtWidgetTest/technical-debt/should-open-remediation-cost-on-measures-service.html", - "/qualityModel/TechnicalDebtWidgetTest/technical-debt/display-differential-values.html", - // SONAR-4717 - "/qualityModel/TechnicalDebtWidgetTest/technical-debt/is-in-issues-widget.html" - ).build()).runOn(orchestrator); - } - - /** - * SONAR-5450 - */ - @Test - public void debt_overview_widget() { - new SeleneseTest(Selenese.builder() - .setHtmlTestsInClasspath("debt-overview-widget", - "/qualityModel/TechnicalDebtWidgetTest/debt-overview/should-have-correct-values.html", - "/qualityModel/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-measures-service.html", - "/qualityModel/TechnicalDebtWidgetTest/debt-overview/display-differential-values.html" - ).build()).runOn(orchestrator); - } - - private static String getPastDate(int nbPastDays){ - return new SimpleDateFormat("yyyy-MM-dd").format(DateUtils.addDays(new Date(), nbPastDays * -1)); - } - -} diff --git a/it/it-tests/src/test/java/it/settings/SettingsTest.java b/it/it-tests/src/test/java/it/settings/SettingsTest.java index 55dd2015e7f..e9b1ea0a06a 100644 --- a/it/it-tests/src/test/java/it/settings/SettingsTest.java +++ b/it/it-tests/src/test/java/it/settings/SettingsTest.java @@ -20,7 +20,6 @@ package it.settings; import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.selenium.Selenese; import it.Category1Suite; import java.io.IOException; import java.util.List; @@ -35,7 +34,6 @@ import org.sonarqube.ws.client.setting.ResetRequest; import org.sonarqube.ws.client.setting.SetRequest; import org.sonarqube.ws.client.setting.SettingsService; import org.sonarqube.ws.client.setting.ValuesRequest; -import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.newAdminWsClient; @@ -63,14 +61,6 @@ public class SettingsTest { resetSettings(orchestrator, null, PLUGIN_SETTING_KEY); } - // SONAR-4404 - @Test - public void should_get_settings_default_value() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("settings-default-value", - "/settings/SettingsTest/settings-default-value.html").build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - /** * SONAR-3320 */ diff --git a/it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-allowed.html b/it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-allowed.html deleted file mode 100644 index b1530ef944c..00000000000 --- a/it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-allowed.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - global-dashboard-sharing-permission - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sessions/logout
open/dashboards
typeid=logincan_share_dashboards
typeid=passwordpassword
clickAndWaitname=commit
clickcreate-link-dashboard
waitForVisiblecss=div.modal-body
typenameMy shared global dashboard
storeValuenameDASHBOARD_NAME
clickname=shared
clickAndWaitsave-submit
assertTablecss=table.data.2.0exact:${DASHBOARD_NAME}
assertElementPresentdashboard-1-shared
- - diff --git a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-other-measure-filter-owner.html b/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-other-measure-filter-owner.html deleted file mode 100644 index d00edae43b9..00000000000 --- a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-other-measure-filter-owner.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - change-other-measure-filter-owner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
storeEval'filter_'+(new Date()).getTime()FILTER_NAME
open/sessions/logout
open/sessions/new
typelogincan_share
typepasswordpassword
clickAndWaitcommit
open/measures
waitForElementPresentclass=navigator-filter-submit
clickclass=navigator-filter-submit
waitForTextcontent*Save As*
clicksave-as
waitForTextsave-as-filter-form*Save Filter*
typename${FILTER_NAME}
clickname=shared
clickAndWaitsave-as-submit
waitForTextfilter-titleglob:*${FILTER_NAME}*Shared with all users*
open/sessions/logout
open/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/measures
waitForElementPresentid=manage-favorites
clickAndWaitid=manage-favorites
waitForTextshared-filtersglob:*${FILTER_NAME}*
clickedit_system_${FILTER_NAME}
waitForTextedit-filter-form*Edit Filter*
typeselect-filter-owneradmin
clickAndWaitsave-submit
waitForTextfilter-titleglob:*${FILTER_NAME}*Shared with all users*
- - diff --git a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-own-measure-filter-owner.html b/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-own-measure-filter-owner.html deleted file mode 100644 index 0a614ea066d..00000000000 --- a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-own-measure-filter-owner.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - change-own-measure-filter-owner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
storeEval'filter_'+(new Date()).getTime()FILTER_NAME
open/sessions/logout
open/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/measures
waitForElementPresentclass=navigator-filter-submit
clickclass=navigator-filter-submit
waitForTextcontent*Save As*
clicksave-as
waitForTextsave-as-filter-form*Save Filter*
typename${FILTER_NAME}
clickname=shared
clickAndWaitsave-as-submit
waitForTextfilter-titleglob:*${FILTER_NAME}*Shared with all users*
waitForElementPresentid=manage-favorites
clickAndWaitid=manage-favorites
waitForTextmy-filtersglob:*${FILTER_NAME}*
clickedit_${FILTER_NAME}
waitForTextedit-filter-form*Edit Filter*
typeselect-filter-ownercan_share
clickAndWaitsave-submit
waitForTextfilter-titleglob:*${FILTER_NAME}*Shared by can_share*
- - diff --git a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner.html b/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner.html deleted file mode 100644 index 5f705e1c480..00000000000 --- a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - change-shared-global-dashboard-owner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sessions/logout
open/dashboards
typeloginadmin
typepasswordadmin
clickAndWaitcommit
waitForVisiblecreate-link-dashboard
clickcreate-link-dashboard
waitForVisiblecss=div.modal-body
typenameshared-global-dashboard
storeValuenameDASHBOARD_NAME
clickname=shared
clickAndWaitsave-submit
waitForVisibleedit-${DASHBOARD_NAME}
clickedit-${DASHBOARD_NAME}
waitForVisiblecss=div.modal-body
typeselect-dashboard-ownercan_share
clickAndWaitsave-submit
waitForTextdashboardsglob:*can_share*
- - diff --git a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-system-measure-filter-owner.html b/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-system-measure-filter-owner.html deleted file mode 100644 index d7177a44057..00000000000 --- a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-system-measure-filter-owner.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - change-system-measure-filter-owner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
storeEval'filter_'+(new Date()).getTime()FILTER_NAME
open/sessions/logout
open/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/measures
waitForElementPresentid=manage-favorites
clickAndWaitid=manage-favorites
waitForTextshared-filtersglob:*My favourites*
clickedit_system_my-favourites
waitForTextedit-filter-form*Edit Filter*
typeselect-filter-owneradmin
clickAndWaitsave-submit
waitForTextfilter-titleglob:*My favourites*Shared with all users*
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/xss.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/xss.html deleted file mode 100644 index 4d0bf427f52..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/xss.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - xss - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
xss
open/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/dashboards
clickid=create-link-dashboard
waitForVisiblecreate-dashboard-form
typeid=name<script>alert('xss in name')</script>
typeid=description<script>alert('xss in description')</script>
clickAndWaitid=save-submit
waitForTextdashboards*<script>alert('xss in name')</script>*<script>alert('xss in description')</script>*
clickid=delete-%3Cscript%3Ealert%28%27xss%20in%20name%27%29%3C%2Fscript%3E
waitForVisibledelete-dashboard-form
clickAndWaitid=confirm-submit
assertNotTextdashboards*alert*
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/default_widgets/documentation_and_comments_widget.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/default_widgets/documentation_and_comments_widget.html deleted file mode 100644 index ae5a977fbae..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/default_widgets/documentation_and_comments_widget.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - description-widget - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
description-widget
open/widget?id=documentation_comments&resource=sample
waitForTextm_public_documented_api_density*60.0%*
waitForTextm_public_api*5*
waitForTextm_public_undocumented_api*2*
waitForTextm_comment_lines_density*18.8%*
waitForTextm_comment_lines*3*
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/default_widgets/welcome_widget.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/default_widgets/welcome_widget.html deleted file mode 100644 index cf632d486e1..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/default_widgets/welcome_widget.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - welcome_widget - - - - - - - - - - - - - - - -
open/widget/index/welcome
waitForTextblock_1*Welcome to SonarQube*
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/create-global-dashboards-error.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/create-global-dashboards-error.html deleted file mode 100644 index 0e310957f59..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/create-global-dashboards-error.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - create-global-dashboards-error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
create-global-dashboards-error
open/sessions/login
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/dashboards
clickcreate-link-dashboard
waitForVisiblecss=div.modal-head > h2
typename=nameGLOBAL
clickAndWaitid=save-submit
clickcreate-link-dashboard
waitForVisiblecss=div.modal-head > h2
typename=nameGLOBAL
clickid=save-submit
waitForVisiblecss=p.error
waitForTextcss=p.errorA dashboard already exists with the same name
typename=nameGLOBAL2
clickAndWaitid=save-submit
waitForTextdashboards*GLOBAL*GLOBAL2*
clickid=delete-GLOBAL
waitForVisiblecss=div.modal-head > h2
waitForTextcss=.modal-bodyDo you want to delete this dashboard?
clickAndWaitconfirm-submit
clickid=delete-GLOBAL2
waitForVisiblecss=div.modal-head > h2
waitForTextcss=.modal-bodyDo you want to delete this dashboard?
clickAndWaitconfirm-submit
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/default-dashboards.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/default-dashboards.html deleted file mode 100644 index 3bc101132a4..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/default-dashboards.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - default-dashboards - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
default-dashboards
open/sessions/login
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/admin_dashboards
waitForTextbody*Global Dashboards*
waitForTextactiveGlobal*Home*
assertElementNotPresentremove-Home
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/edit-global-dashboards.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/edit-global-dashboards.html deleted file mode 100644 index 120d29971dc..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/edit-global-dashboards.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - edit-global-dashboards - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
edit-global-dashboards
open/sessions/login
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/dashboards
clickcreate-link-dashboard
waitForVisiblecss=div.modal-head > h2
typename=nameGLOBAL
clickAndWaitid=save-submit
clickAndWaitid=unfollow-GLOBAL
assertTableid=shared-dashboards.1.0GLOBAL
assertTableid=shared-dashboards.1.4Configure widgets Edit Delete Follow
clickid=edit-GLOBAL
waitForVisiblecss=div.modal-head > h2
typename=descriptionDescription Shared
clickname=shared
clickAndWaitid=save-submit
waitForTextPresentDescription Shared
clickid=delete-GLOBAL
waitForVisiblecss=div.modal-head > h2
waitForTextcss=.modal-bodyDo you want to delete this dashboard?
clickAndWaitconfirm-submit
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/filter-widget-admin.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/filter-widget-admin.html deleted file mode 100644 index d9f8a46e98a..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/filter-widget-admin.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - filter-widget-admin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
filter-widget-admin
open/sessions/login
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/dashboards
clickcreate-link-dashboard
waitForVisiblecss=div.modal-head > h2
typename=nameAllFilters
clickAndWaitid=save-submit
clickAndWaitid=configure-AllFilters
clickAndWaitid=add-widget-measure_filter_list
selectid=filterlabel=Projects
clickAndWaitname=commit
assertTableid=measures-table.1.2*Sample*
clickAndWaitid=add-widget-measure_filter_list
selectid=filterlabel=My favourites
clickAndWaitname=commit
waitForTextxpath=(//div[contains(@class,"widget-title")])[1]My favourites
open/dashboards
clickid=delete-AllFilters
waitForVisiblecss=div.modal-head > h2
waitForTextcss=.modal-bodyDo you want to delete this dashboard?
clickconfirm-submit
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/filter-widget-anonymous.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/filter-widget-anonymous.html deleted file mode 100644 index 8df4603a026..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/filter-widget-anonymous.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - filter-widget-amonymous - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
filter-widget-amonymous
open/sessions/logout
assertTextPresentHome
waitForTextcontent*Welcome to SonarQube*
assertNotTextcontent*My favourites*
waitForTextcontent*Sample*
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/global-dashboard-applies-project-permission.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/global-dashboard-applies-project-permission.html deleted file mode 100644 index 0d6ffeda3f0..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/global-dashboard-applies-project-permission.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - filter-widget-amonymous - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
filter-widget-amonymous
open/sessions/logout
assertTextPresentHome
waitForTextcontent*Welcome to SonarQube*
assertNotTextcontent*My favourites*
assertNotTextcontent*Sample*
open/sessions/login
typeloginadmin
typepasswordadmin
clickAndWaitcommit
waitForTextcontent*Welcome to SonarQube*
waitForTextcontent*My favourites*
waitForTextcontent*Sample*
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/manage-global-dashboard.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/manage-global-dashboard.html deleted file mode 100644 index 717172c66a4..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/manage-global-dashboard.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - manage-global-dashboard - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
manage-global-dashboard
open/sessions/login
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/dashboards
waitForTextcontent*My Global Dashboards*
assertNotTextcontent*My Project Dashboards*
waitForTextcontent*Available Dashboards*
clickcreate-link-dashboard
waitForVisiblecss=div.modal-head > h2
typename=nameNewGlobalDashboard
typename=descriptionDashboard description
clickAndWaitid=save-submit
clickAndWaitid=configure-NewGlobalDashboard
clickAndWaitcss=img[alt="Layout333333"]
clickAndWaitid=add-widget-measure_filter_list
waitForTextdashboard-column-1*Measure Filter as List*
waitForVisiblefilter
selectid=filterlabel=Projects
clickAndWaitname=commit
waitForTextdashboard-column-1*Projects*
clickAndWaitid=add-widget-complexity
waitForTextdashboard-column-1*Project*
clickcss=a.select2-choice
type//input[@class='widget-select-prj-complexity']sample
clickAndWaitname=commit
waitForTextdashboard-column-1*Sample*
waitForElementPresentlink=NewGlobalDashboard
clickAndWaitlink=NewGlobalDashboard
waitForTextdashboard-column-1*Sample*
assertTextPresentProjects
clickAndWaitlink=Configure widgets
clicklink=Delete
clickAndWaitlink=Back to dashboard
open/dashboards
clickid=delete-NewGlobalDashboard
waitForVisiblecss=div.modal-head > h2
waitForTextcss=.modal-bodyDo you want to delete this dashboard?
clickconfirm-submit
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/order-global-dashboard.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/order-global-dashboard.html deleted file mode 100644 index e105b03e6d6..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/order-global-dashboard.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - order-global-dashboard - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
order-global-dashboard
open/sessions/login
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/dashboards
clickcreate-link-dashboard
waitForVisiblecss=div.modal-head > h2
typename=namePersonal
clickAndWaitid=save-submit
waitForTextdashboards*Home*Personal*
clickAndWaitid=up-Personal
assertTableid=dashboards.1.0Personal*
assertTableid=dashboards.2.0Home
clickAndWaitid=down-Personal
assertTableid=dashboards.1.0Home*
assertTableid=dashboards.2.0Personal
clickid=delete-Personal
waitForVisiblecss=div.modal-head > h2
waitForTextcss=.modal-bodyDo you want to delete this dashboard?
clickconfirm-submit
- - diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/project-widget.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/project-widget.html deleted file mode 100644 index 995085bcf42..00000000000 --- a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/project-widget.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - project-widget - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
project-widget
open/sessions/login
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/dashboards
clickcreate-link-dashboard
waitForVisiblecss=div.modal-head > h2
typename=nameProjectWidgets
clickAndWaitid=save-submit
clickAndWaitid=configure-ProjectWidgets
clickAndWaitid=add-widget-complexity
assertElementNotPresentxpath=(//div[contains(@class,"widget-title")])
assertTextPresentexact:Project *
type//input[@class='widget-select-prj-complexity']sample
clickname=commit
waitForTextxpath=(//div[contains(@class,"widget-title")])[1]Sample
assertElementPresentlink=Sample
assertElementPresentm_class_complexity
- - diff --git a/it/it-tests/src/test/resources/duplication/DuplicationsTest/duplications_widget.html b/it/it-tests/src/test/resources/duplication/DuplicationsTest/duplications_widget.html deleted file mode 100644 index ba4ea62c858..00000000000 --- a/it/it-tests/src/test/resources/duplication/DuplicationsTest/duplications_widget.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - description-widget - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
description-widget
open/widget?id=duplications&resource=file-duplications
waitForTextm_duplicated_lines_density*63.7%*
waitForTextm_duplicated_lines*293*
waitForTextm_duplicated_blocks*9*
waitForTextm_duplicated_files*8*
- - diff --git a/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/complexity/complexity-widget.html b/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/complexity/complexity-widget.html deleted file mode 100644 index eebb7c89465..00000000000 --- a/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/complexity/complexity-widget.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - complexity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
complexity
open/widget?id=complexity&resource=project-widgets-test-project&metric1=complexity&metric2=ncloc&chartTitle=MyWidget
waitForTextblock_1*Complexity*
waitForTextm_class_complexity3.0
waitForTextm_file_complexity3.0
waitForTextm_complexity3
- - diff --git a/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/custom_measures/should-exclude-new-metrics.html b/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/custom_measures/should-exclude-new-metrics.html deleted file mode 100644 index 1f059bb1017..00000000000 --- a/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/custom_measures/should-exclude-new-metrics.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - should-exclude-new-metrics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
should-exclude-new-metrics
open/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
clickAndWaitlink=Configure widgets
waitForTextid=content*History Table*
clickAndWaitid=add-widget-custom_measures
waitForTextid=content*Metric 1*
assertElementPresent//div[@class='widget_props' and @style='']//option[text()='Overall condition coverage']
assertElementNotPresent//div[@class='widget_props' and @style='']//option[text()='Overall new condition coverage']
clicklink=Delete
- - diff --git a/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/description/description-widget.html b/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/description/description-widget.html deleted file mode 100644 index 9306c1fad32..00000000000 --- a/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/description/description-widget.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - description-widget - - - - - - - - - - - - - - - - - - - - -
description-widget
open/widget?id=description&resource=project-widgets-test-project
waitForTextblock_1*ProjectWidgetsTest Project*project-widgets-test-project*Profiles:*Basic*Quality Gate*SonarQube way*
- - diff --git a/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/hotspots/hide-if-no-measures.html b/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/hotspots/hide-if-no-measures.html deleted file mode 100644 index 53abb62658a..00000000000 --- a/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/hotspots/hide-if-no-measures.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - hide-if-no-measures - - - - - - - - - - - - - - - - - - - - -
open/widget?id=hotspot_metric&resource=project-widgets-test-project&metric=dit
assertElementPresentblock_1
assertNotTextblock_1*Depth*
- - diff --git a/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/hotspots/hotspot-metric-widget.html b/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/hotspots/hotspot-metric-widget.html deleted file mode 100644 index 685f4d9d1c3..00000000000 --- a/it/it-tests/src/test/resources/measure/ProjectWidgetsTest/hotspots/hotspot-metric-widget.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - hotspot_metric - - - - - - - - - - - - - - - - - - - - - - - - - -
hotspot_metric
open/widget?id=hotspot_metric&resource=project-widgets-test-project&metric=ncloc&title=NewTitle
waitForTextclass=hotspot_metric*NewTitle*Sample.xoo*
assertElementPresentlink=Sample.xoo
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/copy_measure_filter.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/copy_measure_filter.html deleted file mode 100644 index e88d2a374c5..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/copy_measure_filter.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - copy_measure_filter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
storeEval'list_'+(new Date()).getTime()FILTER_NAME
open/sessions/logout
open/sessions/new
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
waitForElementPresentcss=.js-user-authenticated
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Files']
clickAndWaitclass=navigator-filter-submit
clickid=save-as
waitForElementPresentsave-as-filter-form
typeid=name${FILTER_NAME}
clickid=save-as-submit
waitForTextfilter-title*${FILTER_NAME}*
clickid=copy
waitForElementPresentcopy-filter-form
typeid=namecopy of ${FILTER_NAME}
typeid=descriptiondescription of copy
clickAndWaitid=copy-submit
waitForTextfilter-title*copy of ${FILTER_NAME}*
waitForTextfilter-description*description of copy*
clickcss=.navigator-filter[title='Components: Files']
clickcss=label[title='Files']
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/copy_uniqueness_of_name.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/copy_uniqueness_of_name.html deleted file mode 100644 index 33c575f7dc2..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/copy_uniqueness_of_name.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - copy_uniqueness_of_name - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
storejavascript{'list_'+(new Date()).getTime()}FILTER_NAME
open/sessions/logout
open/sessions/new
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
waitForElementPresentcss=.js-user-authenticated
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Files']
clickAndWaitclass=navigator-filter-submit
clickid=save-as
waitForElementPresentsave-as-filter-form
typeid=name${FILTER_NAME}
clickid=save-as-submit
waitForTextfilter-title*${FILTER_NAME}*
clickid=copy
waitForElementPresentcopy-filter-form
typeid=name${FILTER_NAME}
clickid=copy-submit
waitForTextcopy-filter-form*Name already exists*
typeid=namecopy of ${FILTER_NAME}
clickid=copy-submit
waitForTextfilter-title*copy of ${FILTER_NAME}*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/empty_filter.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/empty_filter.html deleted file mode 100644 index 6101b19390f..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/empty_filter.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - empty_filter - - - - - - - - - - - - - - - - - - - - - -
open/measures/search
waitForTextmeasures-table*No data*
assertNotTextmeasures-table*Struts*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/initial_search_form.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/initial_search_form.html deleted file mode 100644 index da7acf86b7e..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/initial_search_form.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - initial_search_form - - - - - - - - - - - - - - - - - - - - - - - - - -
open/measures
waitForElementPresentname=qualifiers[]
waitForTextclass=navigator-filters*More Criteria*
assertElementNotPresentmeasures-table
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/link_from_main_header.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/link_from_main_header.html deleted file mode 100644 index d86e9acd38b..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/link_from_main_header.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - link_from_main_header - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/
waitForElementPresentlink=Measures
clickAndWaitlink=Measures
assertLocation*/measures*
assertElementPresentclass=navigator-filters
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_change_columns.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_change_columns.html deleted file mode 100644 index 2e7b51c505c..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_change_columns.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - configure-table-columns - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sessions/logout
open/sessions/new
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
waitForElementPresentcss=.js-user-authenticated
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Files']
clickAndWaitclass=navigator-filter-submit
clickAndWaitid=change-display
clickclass=select2-choice
typecss=.select2-with-searchbox .select2-inputComplexity
keyPressAndWaitcss=.select2-with-searchbox .select2-input\13
clickAndWaitid=add-metric
waitForTextmeasures-table*Name*Cmpx*
clickclass=select2-choice
typecss=.select2-with-searchbox .select2-inputComment lines
keyPressAndWaitcss=.select2-with-searchbox .select2-input\13
selectid=select-periodlabel=since previous analysis
clickAndWaitid=add-metric
waitForTextmeasures-table*Name*Cmpx*Comment lines*last*
clickAndWaitid=exit-edit
waitForTextmeasures-table*Name*Cmpx*Comment lines*last*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_delete_column.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_delete_column.html deleted file mode 100644 index 85b19ab0ac6..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_delete_column.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - delete_column - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Files']
clickAndWaitclass=navigator-filter-submit
clickAndWaitid=change-display
waitForTextmeasures-table*Name*Last Analysis*LOC*
clickdelete-date
waitForTextmeasures-table*Name*LOC*
assertNotTextmeasures-table*Last Analysis*
clickAndWaitid=exit-edit
waitForTextmeasures-table*Name*LOC*
assertNotTextmeasures-table*Last Analysis*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_move_columns.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_move_columns.html deleted file mode 100644 index d209eb3ac9d..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_move_columns.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - move_columns - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Files']
clickAndWaitclass=navigator-filter-submit
clickAndWaitid=change-display
waitForTextmeasures-table*Name*Last Analysis*LOC*
clickleft-date
waitForTextmeasures-table*Last Analysis*Name*LOC*
clickright-name
waitForTextmeasures-table*Last Analysis*LOC*Name*
clickAndWaitid=exit-edit
waitForTextmeasures-table*Last Analysis*LOC*Name*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_sort_by_descending_name.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_sort_by_descending_name.html deleted file mode 100644 index e7fb0df8579..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_sort_by_descending_name.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - list_sort_by_descending_name - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Files']
clickAndWaitclass=navigator-filter-submit
assertElementPresentmeasures-table
clickAndWaitlink=Name
waitForTextmeasures-table*b2/HelloB2.xoo*b1/HelloB1.xoo*a2/HelloA2.xoo*a1/HelloA1.xoo*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_sort_by_ncloc.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_sort_by_ncloc.html deleted file mode 100644 index d389f54b006..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_sort_by_ncloc.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - list_sort_by_ncloc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Files']
clickAndWaitclass=navigator-filter-submit
assertElementPresentmeasures-table
waitForTextcss=#measures-table tfoot*4 results*
clickAndWaitlink=LOC
waitForTextcss=#measures-table tbody tr:nth-of-type(1)*a2/HelloA2.xoo*
waitForTextcss=#measures-table tfoot*4 results*
clickAndWaitlink=LOC
waitForTextcss=#measures-table tfoot*4 results*
waitForTextcss=#measures-table tbody tr:nth-of-type(4)*a2/HelloA2.xoo*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget.html deleted file mode 100644 index dd38f5d361f..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - list_widget - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sessions/logout
open/measures/manage
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
waitForElementPresentcss=.js-user-authenticated
clickAndWaitxpath=(//table[contains(@id, 'shared-filters')]//a[contains(text(),'Projects')])
storeEvalwindow.location.pathname.split('/')[3]FILTER_ID
open/widget?id=measure_filter_list&filter=${FILTER_ID}
waitForTextblock_1*Name*Version*LOC*Last Analysis*
waitForTextblock_1*Multi-modules Sample*1.0-SNAPSHOT*
assertNotTextblock_1*Module A*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget_sort.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget_sort.html deleted file mode 100644 index 8cddf927986..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget_sort.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - list_widget_sort - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
storeEval'sort_widget_'+(new Date()).getTime()FILTER_NAME
open/sessions/logout
open/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitname=commit
waitForElementPresentcss=.js-user-authenticated
open/measures
waitForTextclass=navigator-filters*More Criteria*
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Files']
clickAndWaitclass=navigator-filter-submit
clickid=save-as
waitForElementPresentsave-as-filter-form
typename${FILTER_NAME}
clickAndWaitid=save-as-submit
storeEvalwindow.location.pathname.split('/')[3]FILTER_ID
open/widget?id=measure_filter_list&filter=${FILTER_ID}
waitForTextblock_1*Name*LOC*
waitForTextblock_1*a1/HelloA1.xoo*a2/HelloA2.xoo*b1/HelloB1.xoo*b2/HelloB2.xoo*
clicklink=LOC
waitForTextcss=#block_1 tbody tr:nth-of-type(1)*a2/HelloA2.xoo*
clicklink=LOC
waitForTextcss=#block_1 tbody tr:nth-of-type(4)*a2/HelloA2*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget_warning_if_missing_filter.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget_warning_if_missing_filter.html deleted file mode 100644 index aaa29436daf..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/list_widget_warning_if_missing_filter.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - list_widget - - - - - - - - - - - - - - - -
open/widget?id=measure_filter_list
waitForTextblock_1*This widget is configured to display a measure filter that does not exist anymore.*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/save_with_special_characters.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/save_with_special_characters.html deleted file mode 100644 index a757677af9d..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/save_with_special_characters.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - save_with_special_characters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sessions/logout
open/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
waitForElementPresentcss=.js-user-authenticated
open/measures
waitForElementPresentname=qualifiers[]
clickAndWaitclass=navigator-filter-submit
clickid=save-as
waitForElementPresentsave-as-filter-form
typeid=namespecial $àé'@"
typeid=descriptiondescription with special characters " ' éà
clickAndWaitid=save-as-submit
waitForTextfilter-description*description with special characters " ' éà*
clickclass=navigator-filter-favorite
clickAndWaitid=manage-favorites
waitForTextmy-filters*special $àé'@"*description with special characters " ' éà*
clickid=delete_special-ae
waitForElementPresentconfirm-submit
clickid=confirm-submit
waitForNotTextmy-filters*special $àé'@"*
- - - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search-by-key.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search-by-key.html deleted file mode 100644 index ddc4d9d33eb..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search-by-key.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - search-by-key - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Projects']
clickclass=navigator-filter-more-criteria
clickcss=label[data-property='keySearch']
typecss=#filter-keySearch input[name='keySearch']multi-modules
clickAndWaitclass=navigator-filter-submit
waitForTextmeasures-table*Sonar :: Integration Tests :: Multi-modules Sample*
waitForTextcss=#measures-table tfoot*1 results*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search-by-name.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search-by-name.html deleted file mode 100644 index ea7a389711a..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search-by-name.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - search-by-name - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Projects']
clickclass=navigator-filter-more-criteria
clickcss=label[data-property='nameSearch']
typecss=#filter-nameSearch input[name='nameSearch']Integration
clickAndWaitclass=navigator-filter-submit
waitForTextmeasures-table*Sonar :: Integration Tests :: Multi-modules Sample*
waitForTextcss=#measures-table tfoot*1 results*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search_for_files.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search_for_files.html deleted file mode 100644 index 6c55db2b97f..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search_for_files.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - search_for_files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Files']
clickAndWaitclass=navigator-filter-submit
waitForTextmeasures-table*a1/HelloA1.xoo*a2/HelloA2.xoo*b1/HelloB1.xoo*b2/HelloB2.xoo*
waitForTextcss=#measures-table tfoot*4 results*
assertNotTextmeasures-table*Module A*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search_for_projects.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search_for_projects.html deleted file mode 100644 index 4a61aef1395..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/search_for_projects.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - search_for_projects_by_default - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Projects']
clickAndWaitclass=navigator-filter-submit
assertElementPresentmeasures-table
waitForTextmeasures-table*Sonar :: Integration Tests :: Multi-modules Sample*
- - diff --git a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/should-unshare-filter-remove-other-filters-favourite.html b/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/should-unshare-filter-remove-other-filters-favourite.html deleted file mode 100644 index 885412059bb..00000000000 --- a/it/it-tests/src/test/resources/measureFilter/MeasureFiltersTest/should-unshare-filter-remove-other-filters-favourite.html +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - should_save_issue_filters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
storeEval'filter_'+(new Date()).getTime()FILTER_NAME
open/sessions/logout
open/sessions/new
typeloginuser-measures-filter-with-sharing-perm
typepasswordpassword
clickAndWaitcommit
waitForElementPresentcss=.js-user-authenticated
open/measures
clickcss=.navigator-filter[title='Components: Any']
clickcss=label[title='Projects']
clickAndWaitclass=navigator-filter-submit
clickid=save-as
waitForTextsave-as-filter-form*Save Filter*
typeid=nameuser_${FILTER_NAME}
clickid=shared
clickid=save-as-submit
waitForTextfilter-title*user_${FILTER_NAME}*Shared with all users*
open/sessions/logout
open/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
waitForElementPresentcss=.js-user-authenticated
open/measures/manage
waitForTextcontent*My Measures Filters*
waitForTextshared-filters*user_${FILTER_NAME}*
clickid=star-user_${FILTER_NAME}
open/sessions/logout
open/sessions/new
typeloginuser-measures-filter-with-sharing-perm
typepasswordpassword
clickAndWaitcommit
waitForElementPresentcss=.js-user-authenticated
open/measures
clickclass=navigator-filter-favorite
clickAndWaitid=manage-favorites
waitForTextmy-filters*user_${FILTER_NAME}*
clickid=edit_user_${FILTER_NAME}
waitForTextedit-filter-form*Edit Filter*
clickshared
clickAndWaitid=save-submit
waitForTextfilter-title*user_${FILTER_NAME}*Private*
open/sessions/logout
open/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
waitForElementPresentcss=.js-user-authenticated
open/measures/manage
waitForTextcontent*My Measures Filters*
assertNotTextshared-filters*user_${FILTER_NAME}*
- - diff --git a/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timeline-widget/should-display-even-if-one-missing-metric.html b/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timeline-widget/should-display-even-if-one-missing-metric.html deleted file mode 100644 index 1b23ceab818..00000000000 --- a/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timeline-widget/should-display-even-if-one-missing-metric.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - -timeline - - - - - - - - - - - - - - - - - - - - - - - - - - -
timeline
open/widget?id=timeline&resource=sample&metric1=complexity&metric2=commits
waitForElementPresenttimeline-chart-1
waitForTextblock_1*Complexity*
assertTextNotPresentblock_1*Commits*
- - diff --git a/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timeline-widget/timeline-widget.html b/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timeline-widget/timeline-widget.html deleted file mode 100644 index ef8294aa227..00000000000 --- a/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timeline-widget/timeline-widget.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - -timeline - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
timeline
open/widget?id=timeline&resource=sample&metric1=complexity&metric2=ncloc&chartTitle=MyWidget
assertElementPresenttimeline-chart-1
assertElementPresent//h3[text()='MyWidget']
waitForTextblock_1*Complexity*
waitForTextblock_1*Lines of Code*
- - diff --git a/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/should-display-empty-table-if-no-measure.html b/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/should-display-empty-table-if-no-measure.html deleted file mode 100644 index f7d15b04500..00000000000 --- a/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/should-display-empty-table-if-no-measure.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - should-display-empty-table-if-no-measure - - - - - - - - - - - - - - - - - - - - - - - - - -
time_machine
open/widget?id=time_machine&resource=sample&metric1=coverage&metric2=line_coverage&metric3=tests&displaySparkLine=true
waitForTextblock_1*Coverage*Line Coverage*Unit Tests*
assertElementNotPresent//img
- - diff --git a/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/should-exclude-new-metrics.html b/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/should-exclude-new-metrics.html deleted file mode 100644 index f8610592a9c..00000000000 --- a/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/should-exclude-new-metrics.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - should-exclude-new-metrics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
should-exclude-new-metrics
open/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
clickAndWaitlink=Configure widgets
waitForTextPresentHistory Table
clickAndWaitid=add-widget-time_machine
waitForTextPresentHistory Table
assertElementPresent//option[text()='Overall Condition Coverage']
assertElementNotPresent//div[@class='widget_props' and @style='']//option[text()='Overall New Condition Coverage']
clicklink=Delete
- - diff --git a/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/time-machine-widget.html b/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/time-machine-widget.html deleted file mode 100644 index b5f8b4c2284..00000000000 --- a/it/it-tests/src/test/resources/measureHistory/HistoryUiTest/history-timemachine-widget/time-machine-widget.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - -time_machine - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
time_machine
open/widget?id=time_machine&resource=sample&metric1=complexity&metric2=ncloc&metric3=violations&displaySparkLine=true&title=ViveLeSud
waitForTextblock_1*ViveLeSud*
waitForTextblock_1*Complexity*6*11*
waitForTextblock_1*Lines of Code*24*40*
waitForTextblock_1*Issues*26*43*
waitForElementPresentcss=svg path
- - diff --git a/it/it-tests/src/test/resources/qualityGate/QualityGateUiTest/should-display-period-alerts-correctly.html b/it/it-tests/src/test/resources/qualityGate/QualityGateUiTest/should-display-period-alerts-correctly.html deleted file mode 100644 index 3a1f8699e13..00000000000 --- a/it/it-tests/src/test/resources/qualityGate/QualityGateUiTest/should-display-period-alerts-correctly.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - should-display-alerts-correctly-history-page - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
should-display-alerts-correctly-history-page
open/sessions/login
typeloginadmin
typepasswordadmin
clickAndWaitcommit
waitForElementPresentcss=.js-user-authenticated
open/widget?id=alerts&resource=sample
waitForTextclass=alertsglob:*Lines*0 < 10*since previous analysis*
waitForTextclass=alert_ERROR0
- - diff --git a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/display-differential-values.html b/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/display-differential-values.html deleted file mode 100644 index de5a4b33d1b..00000000000 --- a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/display-differential-values.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/widget?id=debt_overview&resource=com.sonarsource.it.samples:multi-modules-sample&period=1

-
waitForTextbody*29.1% (-1.2)*
waitForTextbody*C*
assertNotTextbody*C (*
- - diff --git a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/should-have-correct-values.html b/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/should-have-correct-values.html deleted file mode 100644 index 6b7091b7662..00000000000 --- a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/should-have-correct-values.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -
should-have-correct-values
open/widget?id=debt_overview&resource=com.sonarsource.it.samples:multi-modules-sample
waitForTextbody*Maintainability Rating*C*Technical Debt Ratio*29.1%*
- - diff --git a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-measures-service.html b/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-measures-service.html deleted file mode 100644 index 97a8cec43cc..00000000000 --- a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-measures-service.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
should-open-links-on-measures-service
open/widget?id=debt_overview&resource=com.sonarsource.it.samples:multi-modules-sample
clickAndWaitlink=C
waitForTextcontent*Maintainability Rating*C*
open/widget?id=debt_overview&resource=com.sonarsource.it.samples:multi-modules-sample
clickAndWaitlink=29.1%
waitForTextcontent*Technical Debt Ratio*29.1%*
- - diff --git a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/display-differential-values.html b/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/display-differential-values.html deleted file mode 100644 index 53d098987af..00000000000 --- a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/display-differential-values.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - display-differential-values - - - - - - - - - - - - - - - -
open/widget?id=rules&resource=com.sonarsource.it.samples:multi-modules-sample&period=1
waitForTextblock_1*7h 25min*(+1h 58min)*
- - diff --git a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/is-in-issues-widget.html b/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/is-in-issues-widget.html deleted file mode 100644 index 60d52a22fae..00000000000 --- a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/is-in-issues-widget.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - display-differential-values - - - - - - - - - - - - - - - -
open/widget?id=rules&amp;resource=com.sonarsource.it.samples:multi-modules-sample
waitForTextbody*Technical Debt*
- - diff --git a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/should-have-correct-values.html b/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/should-have-correct-values.html deleted file mode 100644 index fe9e416e7a4..00000000000 --- a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/should-have-correct-values.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - should-have-correct-values - - - - - - - - - - - - - - - - - - - - -
should-have-correct-values
open/widget?id=rules&resource=com.sonarsource.it.samples:multi-modules-sample
waitForTextblock_1*7h 25min*
- - diff --git a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/should-open-remediation-cost-on-measures-service.html b/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/should-open-remediation-cost-on-measures-service.html deleted file mode 100644 index 1bbedd07fb5..00000000000 --- a/it/it-tests/src/test/resources/qualityModel/TechnicalDebtWidgetTest/technical-debt/should-open-remediation-cost-on-measures-service.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - should-open-remediationcost-on-drilldown-service - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
should-open-remediationcost-on-drilldown-service
open/widget?id=rules&resource=com.sonarsource.it.samples:multi-modules-sample
clickAndWaitlink=7h 25min
waitForTextcontent*Technical Debt*7h 25min*
waitForTextcontent*HelloA1*
- - diff --git a/it/it-tests/src/test/resources/settings/SettingsTest/settings-default-value.html b/it/it-tests/src/test/resources/settings/SettingsTest/settings-default-value.html deleted file mode 100644 index cb585def8c8..00000000000 --- a/it/it-tests/src/test/resources/settings/SettingsTest/settings-default-value.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - settings-default-value - - - - - - - - - - - - - - - - - - - - -
settings-default-value
open/widget?id=widget-displaying-properties
waitForTextsome-propertyaDefaultValue
- - diff --git a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/allow_users_to_sign_up.html b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/allow_users_to_sign_up.html index 7538eaf5a11..f2f7881c084 100644 --- a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/allow_users_to_sign_up.html +++ b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/allow_users_to_sign_up.html @@ -55,8 +55,8 @@ waitForText - infomsg - *Please log in* + global-navigation + *Log in* open diff --git a/server/sonar-web/config/webpack/webpack.config.base.js b/server/sonar-web/config/webpack/webpack.config.base.js index 275b0d4c13e..336f414ec60 100644 --- a/server/sonar-web/config/webpack/webpack.config.base.js +++ b/server/sonar-web/config/webpack/webpack.config.base.js @@ -40,7 +40,6 @@ module.exports = { 'issues': './src/main/js/apps/issues/app.js', 'maintenance': './src/main/js/apps/maintenance/app.js', 'markdown': './src/main/js/apps/markdown/app.js', - 'measures': './src/main/js/apps/measures/app.js', 'metrics': './src/main/js/apps/metrics/app.js', 'overview': './src/main/js/apps/overview/app.js', 'permission-templates': './src/main/js/apps/permission-templates/app.js', diff --git a/server/sonar-web/src/main/js/apps/measures/app.js b/server/sonar-web/src/main/js/apps/measures/app.js deleted file mode 100644 index f3ce71cbaaf..00000000000 --- a/server/sonar-web/src/main/js/apps/measures/app.js +++ /dev/null @@ -1,202 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import _ from 'underscore'; -import Marionette from 'backbone.marionette'; -import FilterBar from './measures-filter-bar'; -import BaseFilters from '../../components/navigator/filters/base-filters'; -import CheckboxFilterView from '../../components/navigator/filters/checkbox-filters'; -import ChoiceFilters from '../../components/navigator/filters/choice-filters'; -import AjaxSelectFilters from '../../components/navigator/filters/ajax-select-filters'; -import FavoriteFilters from '../../components/navigator/filters/favorite-filters'; -import RangeFilters from '../../components/navigator/filters/range-filters'; -import StringFilterView from '../../components/navigator/filters/string-filters'; -import MetricFilterView from '../../components/navigator/filters/metric-filters'; -import { translate } from '../../helpers/l10n'; - -const NavigatorApp = new Marionette.Application(); - -const newLastAnalysisFilter = function () { - return new BaseFilters.Filter({ - name: translate('measure_filter.criteria.last_analysis'), - propertyFrom: 'ageMinDays', - propertyTo: 'ageMaxDays', - type: RangeFilters.RangeFilterView, - placeholder: translate('measure_filter.criteria.age.days'), - enabled: false, - optional: true - }); -}; - -const newMetricFilter = function (property) { - return new BaseFilters.Filter({ - property, - name: translate('measure_filter.criteria.metric'), - type: MetricFilterView, - metrics: window.SS.metrics, - periods: window.SS.metricPeriods, - operations: { 'eq': '=', 'lt': '<', 'lte': '≤', 'gt': '>', 'gte': '≥' }, - enabled: false, - optional: true - }); -}; - -const newNameFilter = function () { - return new BaseFilters.Filter({ - name: translate('measure_filter.name_contains'), - property: 'nameSearch', - type: StringFilterView, - enabled: false, - optional: true - }); -}; - -const newAlertFilter = function () { - return new BaseFilters.Filter({ - name: translate('measure_filter.criteria.alert'), - property: 'alertLevels[]', - type: ChoiceFilters.ChoiceFilterView, - enabled: false, - optional: true, - choices: { - 'error': translate('measure_filter.criteria.alert.error'), - 'warn': translate('measure_filter.criteria.alert.warn'), - 'ok': translate('measure_filter.criteria.alert.ok') - } - }); -}; - -const showAlert = text => { - const alert = document.createElement('div'); - alert.classList.add('alert', 'alert-warning'); - alert.textContent = text; - - const container = document.querySelector('.navigator-details'); - container.insertBefore(alert, container.firstChild); -}; - -const init = function () { - NavigatorApp.addRegions({ filtersRegion: '.navigator-filters' }); - - this.filters = new BaseFilters.Filters(); - - if (_.isObject(window.SS.favorites)) { - this.filters.add([ - new BaseFilters.Filter({ - type: FavoriteFilters.FavoriteFilterView, - enabled: true, - optional: false, - choices: window.SS.favorites, - favoriteUrl: '/measures/filter', - manageUrl: '/measures/manage' - }) - ]); - } - - this.filters.add([ - new BaseFilters.Filter({ - name: translate('measure_filter.criteria.components'), - property: 'qualifiers[]', - type: ChoiceFilters.ChoiceFilterView, - enabled: true, - optional: false, - choices: window.SS.qualifiers, - defaultValue: translate('any') - }), - - new BaseFilters.Filter({ - name: translate('measure_filter.criteria.components_of'), - property: 'base', - type: AjaxSelectFilters.ComponentFilterView, - multiple: false, - enabled: false, - optional: true - }), - - new BaseFilters.Filter({ - name: translate('measure_filter.criteria.only_favorites'), - property: 'onFavourites', - type: CheckboxFilterView, - enabled: false, - optional: true - }), - - new BaseFilters.Filter({ - name: translate('measure_filter.criteria.date'), - propertyFrom: 'fromDate', - propertyTo: 'toDate', - type: RangeFilters.DateRangeFilterView, - enabled: false, - optional: true - }), - - new BaseFilters.Filter({ - name: translate('measure_filter.criteria.key_contains'), - property: 'keySearch', - type: StringFilterView, - enabled: false, - optional: true - }) - ]); - - this.filters.add([ - newLastAnalysisFilter(), - newMetricFilter('c3'), - newMetricFilter('c2'), - newMetricFilter('c1'), - newNameFilter(), - newAlertFilter() - ]); - - this.filterBarView = new FilterBar({ - collection: this.filters, - extra: { - sort: '', - asc: false - } - }); - - this.filtersRegion.show(this.filterBarView); - - if (window.queryParams) { - NavigatorApp.filterBarView.restoreFromQuery(window.queryParams); - } - key.setScope('list'); - - if (window.queryParams) { - const qualifiersFilter = window.queryParams.find(p => p.key === 'qualifiers[]'); - const noQualifiers = !qualifiersFilter || !qualifiersFilter.value || !qualifiersFilter.value.length; - - const baseFilter = window.queryParams.find(p => p.key === 'base'); - const noBase = !baseFilter || !baseFilter.value || !baseFilter.value.length; - - const favoritesFilter = window.queryParams.find(p => p.key === 'onFavourites'); - const noFavorites = !favoritesFilter || !favoritesFilter.value; - - if (noQualifiers && noBase && noFavorites) { - showAlert(translate('measures.select_components')); - } - } -}; - -NavigatorApp.on('start', function () { - init.call(NavigatorApp); -}); - -window.sonarqube.appStarted.then(options => NavigatorApp.start(options)); diff --git a/server/sonar-web/src/main/js/apps/measures/measures-filter-bar.js b/server/sonar-web/src/main/js/apps/measures/measures-filter-bar.js deleted file mode 100644 index 33dfbedae4d..00000000000 --- a/server/sonar-web/src/main/js/apps/measures/measures-filter-bar.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import $ from 'jquery'; -import FilterBarView from '../../components/navigator/filters/filter-bar'; - -export default FilterBarView.extend({ - template () { - return $('#filter-bar-template').html(); - } -}); - diff --git a/server/sonar-web/src/main/js/apps/projects/components/App.js b/server/sonar-web/src/main/js/apps/projects/components/App.js index f58788129d8..a6513662112 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/App.js +++ b/server/sonar-web/src/main/js/apps/projects/components/App.js @@ -31,7 +31,7 @@ import '../styles.css'; export default class App extends React.Component { static propTypes = { - user: React.PropTypes.object, + user: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.bool]), fetchProjects: React.PropTypes.func.isRequired }; diff --git a/server/sonar-web/src/main/js/main/nav/global/global-nav-menu.js b/server/sonar-web/src/main/js/main/nav/global/global-nav-menu.js index 3f76148af2e..1b00795944e 100644 --- a/server/sonar-web/src/main/js/main/nav/global/global-nav-menu.js +++ b/server/sonar-web/src/main/js/main/nav/global/global-nav-menu.js @@ -29,48 +29,6 @@ export default React.createClass({ return { globalDashboards: [], globalPages: [] }; }, - renderDashboardLink (dashboard) { - const url = `${window.baseUrl}/dashboard/index?did=${encodeURIComponent(dashboard.key)}`; - const name = this.getLocalizedDashboardName(dashboard.name); - return ( -
  • - {name} -
  • - ); - }, - - renderDashboardsManagementLink () { - const url = window.baseUrl + '/dashboards'; - return ( -
  • - {translate('dashboard.manage_dashboards')} -
  • - ); - }, - - renderDashboards () { - if (window.SS.user) { - // do not render dashboards menu for authenticated users - return null; - } - - const dashboards = this.props.globalDashboards.map(this.renderDashboardLink); - const canManageDashboards = !!window.SS.user; - return ( -
  • - - {translate('layout.dashboards')}  - - - -
  • - ); - }, - renderProjects () { const url = window.baseUrl + '/projects'; return ( @@ -89,15 +47,6 @@ export default React.createClass({ ); }, - renderMeasuresLink () { - const url = window.baseUrl + '/measures/search?qualifiers[]=TRK'; - return ( -
  • - {translate('layout.measures')} -
  • - ); - }, - renderRulesLink () { const url = window.baseUrl + '/coding_rules'; return ( @@ -167,10 +116,8 @@ export default React.createClass({ render () { return ( diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/admin_dashboards_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/admin_dashboards_controller.rb deleted file mode 100644 index 7336c98a363..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/admin_dashboards_controller.rb +++ /dev/null @@ -1,96 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class AdminDashboardsController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - - before_filter :admin_required - before_filter :load_default_dashboards - - def index - ids=@actives.map(&:dashboard_id) - @shared_dashboards=Dashboard.find(:all, :conditions => {:shared => true}).sort { |a, b| a.name.downcase<=>b.name.downcase } - @shared_dashboards.reject! { |s| ids.include?(s.id) } - end - - def down - verify_post_request - position(+1) - redirect_to :action => 'index' - end - - def up - verify_post_request - position(-1) - redirect_to :action => 'index' - end - - def add - verify_post_request - dashboard=Dashboard.find(params[:id]) - if dashboard and dashboard.shared? - last_index = @actives.max_by(&:order_index).order_index - - ActiveDashboard.create(:dashboard => dashboard, :order_index => last_index+1) - flash[:notice]='Default dashboard added.' - end - - redirect_to :action => 'index' - end - - def remove - verify_post_request - - to_be_removed = ActiveDashboard.find(params[:id]) - not_found unless to_be_removed - - remaining_defaults = @actives.select { |a| (a.global? == to_be_removed.global? && a.id != to_be_removed.id) } - if remaining_defaults.size == 0 - flash[:error]='At least one dashboard must be defined as default.' - else - to_be_removed.destroy - flash[:notice]='Dashboard removed from default dashboards.' - end - - redirect_to :action => 'index' - end - - private - - def load_default_dashboards - @actives=ActiveDashboard.default_dashboards - end - - def position(offset) - to_move = @actives.find { |a| a.id == params[:id].to_i } - if to_move - dashboards_same_type=@actives.select { |a| (a.global? == to_move.global?) }.sort_by(&:order_index) - - index = dashboards_same_type.index(to_move) - dashboards_same_type[index], dashboards_same_type[index + offset] = dashboards_same_type[index + offset], dashboards_same_type[index] - - dashboards_same_type.each_with_index do |a, i| - a.order_index=i+1 - a.save - end - end - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb index fc2247ec8de..4fb0a3fc1e6 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb @@ -22,8 +22,6 @@ class DashboardController < ApplicationController SECTION=Navigation::SECTION_RESOURCE - before_filter :login_required, :except => [:index] - def index if params[:id] @resource = Project.by_key(params[:id]) @@ -58,148 +56,13 @@ class DashboardController < ApplicationController if logged_in? return redirect_to :controller => 'account' else - load_dashboard() - load_authorized_widget_definitions() - end - end - end - - def configure - load_dashboard() - - @category=params[:category] - load_widget_definitions(@category) - end - - def set_layout - verify_post_request - dashboard=Dashboard.find(params[:did]) - if dashboard.editable_by?(current_user) - dashboard.column_layout=params[:layout] - dashboard.save! - columns=dashboard.column_layout.split('-') - dashboard.widgets.find(:all, :conditions => ["column_index > ?", columns.size()]).each do |widget| - widget.column_index=columns.size() - widget.save - end - end - redirect_to :action => 'configure', :did => dashboard.id, :id => params[:id] - end - - def set_dashboard - verify_post_request - load_dashboard() - - dashboardstate=params[:dashboardstate] - - columns=dashboardstate.split(";") - all_ids=[] - columns.each_with_index do |col, index| - ids=col.split(",") - ids.each_with_index do |id, order| - widget=@dashboard.widgets.to_a.find { |i| i.id==id.to_i() } - if widget - widget.column_index=index+1 - widget.row_index=order+1 - widget.save! - all_ids< {:status => 'ok'} - end - - def add_widget - verify_post_request - dashboard=Dashboard.find(params[:did]) - widget_id=nil - if dashboard.editable_by?(current_user) - definition=java_facade.getWidget(params[:widget]) - if definition - first_column_widgets=dashboard.widgets.select { |w| w.column_index==1 }.sort_by { |w| w.row_index } - new_widget=dashboard.widgets.create(:widget_key => definition.getId(), - :name => definition.getTitle(), - :column_index => 1, - :row_index => 1, - :configured => !(definition.hasRequiredProperties() || (!definition.isGlobal))) - widget_id=new_widget.id - first_column_widgets.each_with_index do |w, index| - w.row_index=index+2 - w.save - end - end - end - redirect_to :action => 'configure', :did => dashboard.id, :id => params[:id], :highlight => widget_id, :category => params[:category] - end - - def save_widget - verify_post_request - widget=Widget.find(params[:wid]) - #TODO check owner of dashboard - Widget.transaction do - widget.properties.clear - widget.java_definition.getWidgetProperties().each do |java_property| - value=params[java_property.key()] || java_property.defaultValue() - if value && !value.empty? - prop = widget.properties.build(:kee => java_property.key, :text_value => value) - prop.save! - end - end - widget.resource_id=Project.by_key(params[:resource_id]).id if params[:resource_id].present? - widget.configured=true - widget.save! - render :update do |page| - page.redirect_to(url_for(:action => 'configure', :did => widget.dashboard_id, :id => params[:id])) + return redirect_to :controller => 'projects' end end end - def widget_definitions - @category=params[:category] - load_dashboard() - load_widget_definitions(@category) - render :partial => 'widget_definitions', :locals => {:category => @category} - end - private - def load_dashboard - active=nil - @dashboard=nil - - if logged_in? - if params[:did] - @dashboard=Dashboard.first(:conditions => ['id=? AND user_id=?', params[:did].to_i, current_user.id]) - elsif params[:name] - @dashboard=Dashboard.first(:conditions => ['name=? AND user_id=?', params[:name], current_user.id]) - else - active=ActiveDashboard.user_dashboards(current_user).first - end - end - - unless active or @dashboard - # anonymous or not found in user dashboards - if params[:did] - @dashboard=Dashboard.first(:conditions => ['id=? AND shared=?', params[:did].to_i, true]) - elsif params[:name] - @dashboard=Dashboard.first(:conditions => ['name=? AND shared=?', params[:name], true]) - else - active=ActiveDashboard.user_dashboards(nil).first - end - end - - unless @dashboard - @dashboard=(active && active.dashboard) - end - - not_found('dashboard') unless @dashboard - - @dashboard_configuration=Api::DashboardConfiguration.new(@dashboard, :period_index => params[:period], :snapshot => @snapshot) if @dashboard && @snapshot - end - def project_not_found flash[:error] = message('dashboard.project_not_found') redirect_to :action => :index @@ -208,24 +71,4 @@ class DashboardController < ApplicationController def project_not_analyzed render :action => 'empty' end - - def load_authorized_widget_definitions - @authorized_widget_definitions=java_facade.getWidgets().select do |widget| - roles = widget.getUserRoles() - roles.empty? || roles.any? { |role| (role=='user') || (role=='viewer') || has_role?(role, @resource) } - end - end - - def load_widget_definitions(filter_on_category) - @widget_definitions=java_facade.getWidgets().to_a.sort {|w1,w2| widgetL10nName(w1) <=> widgetL10nName(w2)} - - @widget_categories=@widget_definitions.map(&:getWidgetCategories).to_a.flatten.uniq.sort - unless filter_on_category.blank? - @widget_definitions=@widget_definitions.select { |definition| definition.getWidgetCategories().to_a.include?(filter_on_category) } - end - end - - def widgetL10nName(widget) - Api::Utils.message('widget.' + widget.id + '.name') - end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb deleted file mode 100644 index 7baf8e59600..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb +++ /dev/null @@ -1,196 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class DashboardsController < ApplicationController - - SECTION=Navigation::SECTION_RESOURCE - - before_filter :login_required - - def index - @actives=ActiveDashboard.user_dashboards(current_user) - @shared_dashboards=Dashboard.all(:conditions => ['(shared=? or user_id=?)', true, current_user.id]) - active_ids=@actives.map(&:dashboard_id) - @shared_dashboards.reject! { |d| active_ids.include?(d.id) } - @shared_dashboards=Api::Utils.insensitive_sort(@shared_dashboards, &:name) - end - - def create_form - @global = true - @dashboard = Dashboard.new - render :partial => 'create_form' - end - - def create - verify_post_request - @global = true - @dashboard = Dashboard.new() - @dashboard.user_id = current_user.id - load_dashboard_from_params(@dashboard) - - active_dashboard = current_user.active_dashboards.to_a.find { |ad| ad.name==@dashboard.name } - if active_dashboard - @dashboard.errors.add_to_base(Api::Utils.message('dashboard.error_create_existing_name')) - render :partial => 'dashboards/create_form', :status => 400 - elsif @dashboard.save - add_default_dashboards_if_first_user_dashboard(@dashboard.global?) - last_index=current_user.active_dashboards.max_by(&:order_index).order_index - current_user.active_dashboards.create(:dashboard => @dashboard, :user => current_user, :order_index => (last_index+1)) - render :text => CGI.escapeHTML(params[:resource]), :highlight => @dashboard.id, :status => 200 - else - render :partial => 'dashboards/create_form', :status => 400 - end - end - - def edit_form - @dashboard = Dashboard.find(params[:id]) - if @dashboard.editable_by?(current_user) - render :partial => 'edit_form' - else - access_denied - end - end - - def update - verify_post_request - @dashboard = Dashboard.find(params[:id]) - dashboard_owner = @dashboard.user - if @dashboard.editable_by?(current_user) - load_dashboard_from_params(@dashboard) - if @dashboard.save - - # SONAR-4979 If the dashboard is no more shared, current user has to unfollow it if he was following it - unless @dashboard.shared - active = current_user.active_dashboards.to_a.find { |a| (a.user_id == dashboard_owner.id) && (a.dashboard_id == @dashboard.id)} - active.destroy if active - end - - render :text => CGI.escapeHTML(params[:resource]), :status => 200 - else - @dashboard.user = dashboard_owner - render :partial => 'dashboards/edit_form', :status => 400 - end - else - access_denied - end - end - - def delete_form - @dashboard = Dashboard.find(params[:id]) - if @dashboard.editable_by?(current_user) - render :partial => 'delete_form' - else - access_denied - end - end - - def delete - verify_post_request - @dashboard=Dashboard.find(params[:id]) - - access_denied unless @dashboard.editable_by?(current_user) - - if @dashboard.destroy - flash[:warning]=Api::Utils.message('dashboard.default_restored') if ActiveDashboard.count(:conditions => {:user_id => current_user.id})==0 - render :text => CGI.escapeHTML(params[:resource]), :status => 200 - else - @dashboard.errors.add(message('dashboard.error_delete_default'), ' ') - render :partial => 'dashboards/delete_form', :status => 400 - end - end - - def down - verify_post_request - position(+1) - end - - def up - verify_post_request - position(-1) - end - - def follow - verify_post_request - dashboard=Dashboard.find(params[:id]) - - add_default_dashboards_if_first_user_dashboard(dashboard.global?) - active_dashboard = current_user.active_dashboards.to_a.find { |ad| ad.name==dashboard.name } - if active_dashboard - flash[:error]=Api::Utils.message('dashboard.error_follow_existing_name') - else - last_active_dashboard=current_user.active_dashboards.max_by(&:order_index) - current_user.active_dashboards.create(:dashboard => dashboard, :user => current_user, :order_index => (last_active_dashboard ? last_active_dashboard.order_index+1 : 1)) - end - - redirect_to :action => 'index' - end - - def unfollow - verify_post_request - dashboard=Dashboard.find(params[:id]) - - add_default_dashboards_if_first_user_dashboard(dashboard.global?) - ActiveDashboard.destroy_all(:user_id => current_user.id, :dashboard_id => params[:id].to_i) - - if ActiveDashboard.count(:conditions => {:user_id => current_user.id})==0 - flash[:notice]=Api::Utils.message('dashboard.default_restored') - end - - redirect_to :action => 'index' - end - - - private - - def position(offset) - dashboard=Dashboard.find(params[:id]) - - add_default_dashboards_if_first_user_dashboard(dashboard.global?) - actives=current_user.active_dashboards.select { |a| a.global? == dashboard.global? }.sort_by(&:order_index) - - index = actives.index { |a| a.dashboard_id == dashboard.id } - if index - actives[index], actives[index + offset] = actives[index + offset], actives[index] - - actives.each_with_index do |a, i| - a.order_index=i+1 - a.save - end - end - - redirect_to :action => 'index' - end - - def load_dashboard_from_params(dashboard) - dashboard.name = params[:name] - dashboard.description = params[:description] - dashboard.shared = params[:shared].present? - dashboard.column_layout = Dashboard::DEFAULT_LAYOUT if !dashboard.column_layout - dashboard.user = User.find_active_by_login(params[:owner]) unless params[:owner].nil? - end - - def add_default_dashboards_if_first_user_dashboard(global) - unless current_user.active_dashboards.any? { |a| a.global? == global } - ActiveDashboard.default_dashboards.select { |a| a.global? == global }.each do |default_active| - current_user.active_dashboards.create(:dashboard => default_active.dashboard, :user => current_user, :order_index => default_active.order_index) - end - end - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb deleted file mode 100644 index 4d4ea18e494..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb +++ /dev/null @@ -1,350 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class MeasuresController < ApplicationController - - SECTION=Navigation::SECTION_MEASURES - - # GET /measures/index - def index - @filter = MeasureFilter.new - render :action => 'search' - end - - def search - if params[:id] - @filter = find_filter(params[:id]) - else - @filter = MeasureFilter.new - end - @filter.criteria=criteria_params - - # SONAR-4997 - # Only list display is now managed - @filter.set_criteria_value(:display, 'list') - @filter.execute(self, :user => current_user) - - if request.xhr? - render :partial => 'measures/display', :locals => {:filter => @filter, :edit_mode => false, :widget_id => params[:widget_id]} - end - end - - # Load existing filter - # GET /measures/filter/ - def filter - require_parameters :id - - @filter = find_filter(params[:id]) - @filter.load_criteria_from_data - # criteria can be overridden - @filter.override_criteria(criteria_params) - - # SONAR-4997 - # Only list display is now managed - @filter.set_criteria_value(:display, 'list') - - @filter.execute(self, :user => current_user) - @unchanged = true - - render :action => 'search' - end - - # GET /measures/save_as_form?[id=][&criteria] - def save_as_form - if params[:id].present? - @filter = find_filter(params[:id]) - else - @filter = MeasureFilter.new - end - @filter.criteria=criteria_params_without_page_id - @filter.convert_criteria_to_data - render :partial => 'measures/save_as_form' - end - - # POST /measures/save_as?[id=]&name=[¶meters] - def save_as - verify_post_request - access_denied unless logged_in? - - add_to_favourites=false - if params[:id].present? - @filter = find_filter(params[:id]) - else - @filter = MeasureFilter.new - @filter.user_id=current_user.id - add_to_favourites=true - end - @filter.name=params[:name] - @filter.description=params[:description] - @filter.shared=(params[:shared]=='true') - @filter.data=URI.unescape(params[:data]) - if @filter.save - current_user.favourited_measure_filters<<@filter if add_to_favourites - render :text => @filter.id.to_s, :status => 200 - else - render_measures_error(@filter) - end - end - - # POST /measures/save?id=&[criteria] - def save - verify_post_request - require_parameters :id - access_denied unless logged_in? - - @filter = find_filter(params[:id]) - @filter.criteria=criteria_params_without_page_id - @filter.convert_criteria_to_data - unless @filter.save - flash[:error]='Error' - end - redirect_to :action => 'filter', :id => @filter.id - end - - # GET /measures/manage - def manage - access_denied unless logged_in? - @filter = MeasureFilter.new - @shared_filters = MeasureFilter.all(:include => :user, - :conditions => ['shared=? and (user_id is null or user_id<>?)', true, current_user.id]) - Api::Utils.insensitive_sort!(@shared_filters) { |elt| elt.name } - @fav_filter_ids = current_user.measure_filter_favourites.map { |fav| fav.measure_filter_id } - end - - # GET /measures/edit_form/ - def edit_form - require_parameters :id - @filter = find_filter(params[:id]) - render :partial => 'measures/edit_form' - end - - # POST /measures/edit/?name=&description=&shared= - def edit - verify_post_request - access_denied unless logged_in? - require_parameters :id - - @filter = MeasureFilter.find(params[:id]) - access_denied unless @filter.owner?(current_user) || has_role?(:admin) - - @filter.name=params[:name] - @filter.description=params[:description] - @filter.shared=(params[:shared]=='true') - if has_role?(:admin) && params[:owner] - @filter.user = User.find_by_login(params[:owner]) - end - - if @filter.save - # SONAR-4469 - # If filter become unshared then remove all favorite filters linked to it, expect favorite of filter's owner - MeasureFilterFavourite.delete_all(['user_id<>? and measure_filter_id=?', @filter.user.id, params[:id]]) if params[:shared]!='true' - - render :text => @filter.id.to_s, :status => 200 - else - render_measures_error(@filter) - end - end - - # GET /measures/copy_form/ - def copy_form - require_parameters :id - @filter = find_filter(params[:id]) - @filter.shared = false - @filter.user_id = nil - render :partial => 'measures/copy_form' - end - - # POST /measures/copy/?name=&description= - def copy - verify_post_request - access_denied unless logged_in? - require_parameters :id - - source = find_filter(params[:id]) - target = MeasureFilter.new - target.name=params[:name] - target.description=params[:description] - target.user_id=current_user.id - target.shared=(params[:shared]=='true') - target.data=source.data - if target.save - current_user.favourited_measure_filters << target - render :text => target.id.to_s, :status => 200 - else - render_measures_error(target) - end - end - - # POST /measures/delete/ - def delete - verify_post_request - access_denied unless logged_in? - require_parameters :id - - @filter = find_filter(params[:id]) - @filter.destroy - redirect_to :action => 'manage' - end - - def favourites - verify_ajax_request - render :partial => 'measures/favourites' - end - - # POST /measures/toggle_fav/ - def toggle_fav - access_denied unless logged_in? - require_parameters :id - - favourites = MeasureFilterFavourite.all(:conditions => ['user_id=? and measure_filter_id=?', current_user.id, params[:id]]) - if favourites.empty? - filter = find_filter(params[:id]) - current_user.favourited_measure_filters< is_favourite.to_s, :status => 200 - end - - # - # GET /measures/search_filter? - # - # -- Example - # curl -v -u admin:admin 'http://localhost:9000/measures/search_filter?filter=123&metrics=ncloc,complexity - # &fields=name,longName,date,links,favorite,measureTrend,measureStatus,measureVariation&pageSize=100&page=1&sort=metric:ncloc&asc=true' - # - def search_filter - require_parameters :filter - - fields = (params[:fields].split(',') if params[:fields]) || [] - display_links = fields.include?('links') - display_variation = fields.include?('measureVariation') - metrics = params[:metrics].split(',') if params[:metrics] - - filter = find_filter(params[:filter]) - filter.load_criteria_from_data - filter.override_criteria(criteria_params) - filter.metrics= params[:metrics].split(',') if metrics - filter.require_links= display_links - # Force the display to none in case this value was saved to 'list' in the db - filter.set_criteria_value('display', 'none') - filter.execute(self, :user => current_user) - - hash = {} - components_json = [] - filter.rows.each do |row| - component = row.resource - component_hash = {} - component_hash[:key] = component.key - component_hash[:name] = component.name if fields.include?('name') && component.name - component_hash[:longName] = component.long_name if fields.include?('longName') && component.long_name - component_hash[:qualifier] = component.qualifier if component.qualifier - component_hash[:favorite] = logged_in? && current_user.favourite?(component.id) if fields.include?('favourite') - component_hash[:date] = Api::Utils.format_datetime(row.analysis.created_at) if fields.include?('date') && row.analysis.created_at - component_hash[:fdate] = human_short_date(row.analysis.created_at) if fields.include?('date') && row.analysis.created_at - - if display_links && row.links - links_hash = {} - row.links.each do |link| - links_hash[:name] = link.name if link.name - links_hash[:type] = link.link_type if link.link_type - links_hash[:url] = link.href if link.href - end - component_hash[:links] = links_hash - end - - if metrics - component_hash[:measures] = {} - row.measures.each do |measure| - component_hash[:measures][measure.metric.key] = {} - component_hash[:measures][measure.metric.key][:val] = measure.value if measure.value - component_hash[:measures][measure.metric.key][:fval] = measure.formatted_value if measure.value - component_hash[:measures][measure.metric.key][:text] = measure.data if measure.data - component_hash[:measures][measure.metric.key][:status] = measure.alert_status if fields.include?('measureStatus') && measure.alert_status - component_hash[:measures][measure.metric.key][:p1] = measure.variation_value_1 if display_variation && measure.variation_value_1 - component_hash[:measures][measure.metric.key][:p2] = measure.variation_value_2 if display_variation && measure.variation_value_2 - component_hash[:measures][measure.metric.key][:p3] = measure.variation_value_3 if display_variation && measure.variation_value_3 - component_hash[:measures][measure.metric.key][:p4] = measure.variation_value_4 if display_variation && measure.variation_value_4 - component_hash[:measures][measure.metric.key][:p5] = measure.variation_value_5 if display_variation && measure.variation_value_5 - end - end - components_json << component_hash - end - - hash[:metrics] = {} - filter.metrics.each do |metric| - hash[:metrics][metric.key] = { - :name => metric.short_name, - :type => metric.val_type, - :direction => metric.direction - } - hash[:metrics][metric.key][:worstValue] = metric.worst_value if metric.worst_value - hash[:metrics][metric.key][:bestValue] = metric.best_value if metric.best_value - end - - hash[:components] = components_json - hash[:maxResultsReached] = filter.security_exclusions - hash[:paging] = {} - hash[:paging][:page] = filter.pagination.page - hash[:paging][:pages] = filter.pagination.pages - hash[:paging][:pageSize] = filter.pagination.limit - hash[:paging][:total] = filter.pagination.count - - respond_to do |format| - format.json { render :json => hash } - end - end - - - private - - def find_filter(id) - filter = MeasureFilter.find(id) - access_denied unless filter.shared || filter.owner?(current_user) - filter - end - - def criteria_params_without_page_id - params.merge({:controller => nil, :action => nil, :search => nil, :widget_id => nil, :edit => nil}) - params.delete(:page) - params - end - - def criteria_params - params.merge({:controller => nil, :action => nil, :search => nil, :widget_id => nil, :edit => nil}) - end - - def render_measures_error(filter) - errors = [] - filter.errors.full_messages.each { |msg| errors<' } - render :text => errors, :status => 400 - end - - def human_short_date(date) - if Date.today - date.to_date == 0 - date.strftime('%H:%M') - else - l(date.to_date) - end - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb deleted file mode 100644 index c40d8764c50..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb +++ /dev/null @@ -1,86 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class WidgetController < ApplicationController - helper :dashboard - - SECTION=Navigation::SECTION_RESOURCE - - def index - load_resource - load_widget - params[:layout]='false' - render :action => 'index' - end - - def show - load_resource - load_widget - begin - render :inline => @widget_definition.getTarget().getTemplate(), :locals => { - :widget_properties => @widget.properties_as_hash, :widget => @widget, :dashboard_configuration => @dashboard_configuration - } - rescue => error - logger.error(message('dashboard.cannot_render_widget_x', :params => [@widget_definition.getId(), error]), error) - render :status => 500 - end - - end - - private - - def load_resource - if params[:resource] - @resource=Project.by_key(params[:resource]) - not_found("Resource not found") unless @resource - access_denied unless has_role?(:user, @resource) - - @project=@resource - @snapshot = @resource.last_snapshot - end - end - - def load_widget - widget_key=params[:id] - @widget_definition = java_facade.getWidget(widget_key) - not_found('Unknown widget') unless @widget_definition - - authorized=(@widget_definition.getUserRoles().size==0) - unless authorized - @widget_definition.getUserRoles().each do |role| - authorized=(role=='user') || (role=='viewer') || has_role?(role, @resource) - break if authorized - end - end - access_denied unless authorized - - @widget=Widget.new(:widget_key => widget_key) - @widget.id=1 - @widget_definition.getWidgetProperties().each do |property_definition| - value = params[property_definition.key()] - @widget.properties< @widget, - :kee => property_definition.key(), - :text_value => (value.blank? ? property_definition.defaultValue : value) - ) - end - @dashboard_configuration=Api::DashboardConfiguration.new(nil, :period_index => params[:period], :snapshot => @snapshot) - @widget_width = params[:widget_width] || '350px' - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/admin_dashboards/_list.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/admin_dashboards/_list.html.erb deleted file mode 100644 index ae9e6bea1dd..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/admin_dashboards/_list.html.erb +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - <% if active_dashboards.empty? %> - - - - <% else %> - <% active_dashboards.each_with_index do |active, index| %> - - - - - - - <% end %> - <% end %> - -
    <%= message('name') -%><%= message('shared_by') -%><%= message('order') -%><%= message('operations') -%>
    <%= message('dashboard.no_dashboard') -%>
    -
    <%= h(active.name(true)) -%>
    -
    <%= active.dashboard.description -%>
    -
    - <%= h(active.dashboard.user_name || message('dashboard.username.default')) -%> - - <% if index > 0 %> - <%= link_to '', {:action => :up, :id => active.id}, :method => :post, :id => "up-#{u active.name}", :class => 'icon-move-up' %> - <% else %> - <%= image_tag('transparent_16.gif') %> - <% end %> - <% if index < active_dashboards.size-1 %> - <%= link_to '', {:action => :down, :id => active.id}, :method => :post, :id => "down-#{u active.name}", :class => 'icon-move-down' %> - <% else %> - <%= image_tag('transparent_16.gif') %> - <% end %> - - <% if active_dashboards.size() > 1 %> - <%= link_to 'Remove from defaults', {:action => :remove, :id => active.id}, {:confirm => 'Are you sure to remove it from default dashboards?', :method => :post, :id => "remove-#{u active.name}", :class => 'link-action'} %> - <% end %> -
    diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb deleted file mode 100644 index e57ce66c4c3..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb +++ /dev/null @@ -1,49 +0,0 @@ -
    - - - <%= render :partial => 'list', :locals => {:active_dashboards => @actives.select(&:global?), :group => 'activeGlobal'} %> - - - - - - - - - - - - - - <% if @shared_dashboards.empty? %> - - - - <% else %> - <% @shared_dashboards.each do |dashboard| %> - - - - - - - <% end %> - <% end %> - -
    <%= message('name') -%><%= message('shared_by') -%><%= message('global') -%><%= message('operations') -%>
    <%= message('dashboard.no_dashboard') -%>
    -
    <%= h(dashboard.name(true)) -%>
    -
    <%= dashboard.description -%>
    -
    - <%= h(dashboard.user_name || message('dashboard.username.default')) -%> - - <%= boolean_icon(dashboard.global) -%> - - <%= link_to 'Add to defaults', {:action => 'add', :id => dashboard.id}, {:method => :post, :id => "add-#{u dashboard.name}", :class => 'link-action'} %> -
    -
    diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb deleted file mode 100644 index b3f6a8dcbaa..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb +++ /dev/null @@ -1,55 +0,0 @@ -<% - switch_to_widget_resource(widget) - widget_body=widget_body(widget) - default_layout=(widget.layout=='DEFAULT') -%> - -
    -
    - <% if widget.java_definition.isEditable() || (!widget.java_definition.global) %> - <%= message('edit') -%> - <% end %> - <%= message('delete') -%> -
    -
    - <%= h message('widget.' + widget.java_definition.getId() + '.name', :default => widget.java_definition.getTitle()) -%> -
    -
    - -
    - <%= render :partial => 'widget_properties', :locals => {:widget => widget} -%> -
    - -<%= render :partial => 'widget_title', :locals => {:widget => widget} -%> -
    -
    - <% if !widget_body %> -
    - <% if default_layout %> -
    - <%= message('widget.error_occurred_please_read_logs', :params => [widget.key]) -%> -
    -
    - <% else %> - <%= message('widget.error_occurred_please_read_logs', :params => [widget.key]) -%> - <% end %> -
    - <% elsif widget_body.include? '<' %> - <% - - if default_layout - %> -
    - <% end %> - <%= widget_body -%> - <% if default_layout %> -
    -
    - <% end %> - <% else %> -

    <%= message('no_data') -%>

    - <% end %> -
    -
    - -<% restore_global_resource %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb deleted file mode 100644 index 0b13c900ff9..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb +++ /dev/null @@ -1,30 +0,0 @@ - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb deleted file mode 100644 index b706fd19076..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb +++ /dev/null @@ -1,48 +0,0 @@ -<% - switch_to_widget_resource(widget) - widget_body=widget_body(widget) - default_layout=(widget.java_definition.getWidgetLayout().name()=='DEFAULT') -%> - -<% if !widget.configured %> - - -<% elsif !widget_body %> -
    - <% if default_layout %> -
    - <%= message('widget.error_occurred_please_read_logs', :params => [widget.key]) -%> -
    -
    - <% else %> - <%= message('widget.error_occurred_please_read_logs', :params => [widget.key]) -%> - <% end %> -
    - -<% elsif widget_body.include?('<') %> -
    - <%= render :partial => 'widget_title', :locals => {:widget => widget} -%> - -
    - <% if default_layout %> -
    - <%= widget_body -%> -
    -
    - <% else %> - <%= widget_body -%> - <% end %> - -
    -
    -
    -<% end %> - -<% restore_global_resource %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb deleted file mode 100644 index c0ab98601ff..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -
    -

    <%= h message("widget.#{definition.id}.name", :default => definition.title) -%>

    - -

    <%= h message("widget.#{definition.id}.description", :default => definition.description) -%>

    - - <% form_tag dashboard_action(:add_widget, :widget => definition.id) do -%> - - - <% end -%> -
    \ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definitions.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definitions.html.erb deleted file mode 100644 index 64ed279cc23..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definitions.html.erb +++ /dev/null @@ -1,27 +0,0 @@ - - - - - -
    - - <%= image_tag 'loading.gif', :style => 'vertical-align: top; display: none', :id => 'filter-widgets-loading' -%> - - Search: - -
    - -<% @widget_definitions.each do |definition| %> - <%= render :partial => 'widget_definition', :locals => {:definition => definition, :dashboard => @dashboard, :resource => @resource, :category => category} %> -<% end %> - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb deleted file mode 100644 index c333abd9e9e..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb +++ /dev/null @@ -1,79 +0,0 @@ -
    - - - - - <% if !widget.java_definition.global %> - - - - - <% end %> - - <% widget.java_definition.getWidgetProperties().each do |property_def| %> - - - - - <% end %> - - - - - -
    <%= message('widget.resource_id') %> * - <%= resource_select_tag 'resource_id', { - :resource_type_property => 'supportsGlobalDashboards', - :selected_resource => widget.resource, - :width => '250px', - :html_id => "widget-#{widget.id}-select-prj-#{widget.key.parameterize}", - :html_class => "widget-select-prj-#{widget.key.parameterize}" - } -%> -
    <%= message("widget." + widget.key + ".property." + property_def.key() + ".name", :default => property_def.key()) -%><%= " *" unless property_def.optional() -%> - <%= property_value_field(property_def, widget.property_text_value(property_def.key()), widget) -%> -
    - <% - # Old key used for retro-compatibility - property_description = message("widget." + widget.key + ".param." + property_def.key(), :default => '') - property_description = message("widget." + widget.key + ".property." + property_def.key() + ".desc", :default => property_def.description()) unless property_description != '' - -%> - - <% unless property_description.blank? -%> -
    <%= property_description -%>
    - <% end %> - <% if !property_def.defaultValue.blank? || property_def.type.name == PropertyType::TYPE_BOOLEAN -%> -
    <%= message('default') %>: <%= h(default_value property_def) -%>
    - <% end -%> -
    -
    - <%= submit_tag message('save'), :id => "widget-#{widget.id}-save-#{widget.key.parameterize}", :class => "widget-save-#{widget.key.parameterize}" -%> - <% if widget.configured %> - <%= message('cancel') -%> - <% end %> -
    - <%= hidden_field_tag "widgetid", "", :class => "widgetid" %> -
    - - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb deleted file mode 100644 index 0c9fb7ae468..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<% unless widget_title(widget).blank? %> -
    <%= widget_title(widget) -%>
    -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb deleted file mode 100644 index 48b2288e5fa..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb +++ /dev/null @@ -1,110 +0,0 @@ -<% content_for :script do %> - - -<% end %> - -
    - <%= render :partial => 'header', :locals => {:back => true} %> - -
    -
    - <%= render :partial => 'widget_definitions', :locals => {:category => @category} -%> -
    - -
    - <% {'100%', 'layout100.png', - '50%-50%', 'layout5050.png', - '30%-70%', 'layout3070.png', - '70%-30%', 'layout7030.png', - '33%-33%-33%', 'layout333333.png' - }.each_pair do |layout, picto| %> -
    - <%= link_to image_tag(picto), dashboard_action(:set_layout, :layout => layout), :method => :post, :title => layout %> -
    - <% end %> -
    -
    - - <% - columns=@dashboard.column_layout.split('-') - for index in 1..columns.size() - %> -
    -
    0 <%= index>1 ? "5px" : "0px" -%>;"> - <% - @dashboard.widgets.select { |widget| widget.column_index==index && widget.java_definition }.sort_by { |widget| widget.row_index }.each do |widget| - %> -
    - <%= render :partial => 'configure_widget', :locals => {:widget => widget} %> -
    - <% - end - %> - -
    -
    - <% end %> -
    - - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb deleted file mode 100644 index 132fe9ded98..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb +++ /dev/null @@ -1,41 +0,0 @@ -<% content_for :script do %> - - -<% end %> - - -
    - <% if @resource -%> - - <% end -%> - <%= render :partial => 'header', :locals => {:back => false} %> -
    - <% - columns=@dashboard.column_layout.split('-') - for index in 1..columns.size() - %> - -
    -
    0 <%= index>1 ? "5px" : "0px" -%>;"> - <% - @dashboard.widgets.select { |widget| widget.column_index==index }.sort_by { |widget| widget.row_index }.each do |widget| - widget_definition=@authorized_widget_definitions.find { |wd| wd.getId()==widget.widget_key } - if widget_definition - %> - <%= render :partial => 'widget', :locals => {:widget => widget} %> - <% - reset_cycle - end - end - %> -
    -
    - <% end %> -
    -
    -
    - - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_available_dashboards.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_available_dashboards.html.erb deleted file mode 100644 index 2f80d7fefdf..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_available_dashboards.html.erb +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - <% if @shared_dashboards.nil? || @shared_dashboards.empty? %> - - - - <% else - @shared_dashboards.each do |dashboard| %> - - - - - - <%= render :partial => 'dashboard_operations', :locals => {:dashboard => dashboard, :can_be_disabled => true, :subscription_action => 'follow'} %> - - <% end - end - %> - -
    <%= message('name') -%><%= message('shared') -%><%= message('owner') -%> <%= message('operations') -%>
    <%= message('dashboard.no_dashboard') -%>
    - <%= link_to h(dashboard.name(true)), {:controller => :dashboard, :action => :index, :did => dashboard.id}, - :id => "view-#{u dashboard.name}" %> -
    <%= h dashboard.description -%>
    -
    - <% if (dashboard.shared) %><% end %> - - <%= h(dashboard.user_name || message('dashboard.username.default')) -%> -  
    diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb deleted file mode 100644 index c139061537b..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -
    - -
    - - - -
    -
    - - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_dashboard_operations.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_dashboard_operations.html.erb deleted file mode 100644 index ae66c82c2d7..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_dashboard_operations.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - - <% if dashboard.editable_by?(current_user) %> - <%= link_to message('dashboard.configure_widgets'), {:controller => :dashboard, :action => :configure, :did => dashboard.id}, - :id => "configure-#{u dashboard.name}", :class => 'link-action' %> - <%= link_to message('edit'), {:action => :edit_form, :id => dashboard.id}, - :id => "edit-#{u dashboard.name}", :class => 'open-modal' %> - - <% if can_be_disabled %> - <%= link_to message('delete'), {:action => :delete_form, :id => dashboard.id}, - :id => "delete-#{u dashboard.name}", :class => 'open-modal text-danger' %> - <% end %> - <% end %> - <% if can_be_disabled %> - <%= link_to message(subscription_action), {:action => subscription_action.to_sym, :id => dashboard.id}, :method => :post, - :id => "#{subscription_action}-#{u dashboard.name}" %> - <% end %> - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_delete_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_delete_form.html.erb deleted file mode 100644 index b5494ee17bd..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_delete_form.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -
    - - -
    - - - -
    -
    - - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb deleted file mode 100644 index 09c82c5d924..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb +++ /dev/null @@ -1,46 +0,0 @@ -
    - - -
    - - - -
    -
    - - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_my_dashboards.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_my_dashboards.html.erb deleted file mode 100644 index 5b3b526756d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_my_dashboards.html.erb +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - <% if @actives.nil? || @actives.empty? %> - - - - <% else %> - <% @actives.map(&:dashboard).each_with_index do |dashboard, index| %> - - - - - - <%= render :partial => 'dashboard_operations', :locals => {:dashboard => dashboard, :can_be_disabled => @actives.length > 1, :subscription_action => 'unfollow'} %> - - <% end - end - %> - -
    <%= message('name') -%><%= message('shared') -%><%= message('owner') -%><%= message('order') -%><%= message('operations') -%>
    <%= message('dashboard.no_dashboard') -%>
    - <%= link_to h(dashboard.name(true)), {:controller => :dashboard, :action => :index, :did => dashboard.id}, - :id => "view-#{u dashboard.name}" %> -
    <%= h dashboard.description -%>
    -
    - <% if (dashboard.shared) %><% end %> - - <%= h(dashboard.user_name || message('dashboard.username.default')) -%> - - <% if index > 0 %> - <%= link_to '', {:action => :up, :id => dashboard.id}, :method => :post, :id => "up-#{u dashboard.name}", :class => "icon-move-up" %> - <% else %> - <%= image_tag('transparent_16.gif') %> - <% end %> - <% if index < @actives.size-1 %> - <%= link_to '', {:action => :down, :id => dashboard.id}, :method => :post, :id => "down-#{u dashboard.name}", :class => "icon-move-down" %> - <% else %> - <%= image_tag('transparent_16.gif') %> - <% end %> -
    diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb deleted file mode 100644 index c18d3b3b4fd..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -
    - -
    - - - <%= render :partial => 'shared_form' %> - - -
    -
    - \ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display.html.erb deleted file mode 100644 index 22f30d97b77..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<% if !filter.errors.empty? %> - <% filter.errors.full_messages.each do |message| %> -
    <%= h message %>
    - <% end %> -<% elsif filter.rows && filter.display %> - <%= render :partial => 'measures/display_list', :locals => {:filter => filter, :edit_mode => edit_mode, :widget_id => widget_id} -%> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb deleted file mode 100644 index c3e904234bf..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb +++ /dev/null @@ -1,231 +0,0 @@ -
    - -<% - display_favourites = logged_in? - colspan = filter.display.columns.size - colspan += 1 if display_favourites - if edit_mode - content_for :script do -%> - - <% - end - %> - - - - - -
    - <%= metric_select_tag 'metric', Metric.all.reject { |m| m.hidden || m.data? }, - :html_id => 'select-metric', - :allow_empty => true, - :key_prefix => 'metric:', - :extra_values => [ - [message('measure_filter.col.key'), 'key'], - [message('measure_filter.col.name'), 'name'], - [message('measure_filter.col.short_name'), 'short_name'], - [message('measure_filter.col.description'), 'description'], - [message('measure_filter.col.version'), 'version'], - [message('measure_filter.col.date'), 'date'], - [message('measure_filter.col.project_creation_date'), 'project_creation_date'], - [message('measure_filter.col.links'), 'links'] - ] - -%> - - - - - <%= message 'close' -%> -
    -<% - end -%> - - - - - <% if display_favourites %> - - <% end %> - <% filter.display.columns.each do |column| %> - <%= list_column_html(filter, column, widget_id) -%> - <% end %> - - - - - <% if edit_mode %> - - <% if display_favourites %> - - <% end %> - <% filter.display.columns.each_with_index do |column, index| %> - - <% end %> - <% end %> - - <% if filter.base_row %> - - <% if display_favourites %> - - <% end %> - <% filter.display.columns.each do |column| %> - - <% end %> - - <% end %> - - <% filter.rows.each do |row| %> - - <% if display_favourites %> - - <% end %> - <% filter.display.columns.each do |column| %> - - <% end %> - - <% end %> - - <% if filter.rows.empty? %> - - - - <% end %> - - - <% if widget_id %> - <%= table_pagination(filter.pagination, :colspan => colspan, :id => "measure_filter_foot#{widget_id}", :include_loading_icon => true) { |label, page_id| - link_to_function label, "refreshList#{widget_id}('#{filter.criteria[:sort]}', #{filter.criteria[:asc]}, '#{page_id}')" - } -%> - <% else %> - <%= table_pagination(filter.pagination, :colspan => colspan, :id => "measure_filter_foot#{widget_id}", :include_loading_icon => true) { |label, page_id| - link_to(label, filter.criteria.merge({:page => page_id})) - } -%> - <% end %> -
    - <%= image_tag("controls/resultset_previous.png", :alt => message('move_left')) -%> - <%= image_tag("cross-gray.png", :alt => message('measure_filter.delete_column')) -%> - <%= image_tag("controls/resultset_next.png", :alt => message('move_right')) -%> -
    <%= link_to_favourite(filter.base_row.resource) -%> - <%= list_cell_html(column, filter.base_row) -%> -
    <%= link_to_favourite(row.resource) -%> - <%= list_cell_html(column, row) -%> -
    <%= message 'no_data' -%>
    -
    diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb deleted file mode 100644 index bbbd2da0a31..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -
    - -
    - - - <%= render :partial => 'shared_form', :locals => {:display_owner => true} %> - - -
    -
    - \ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_favourites.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_favourites.html.erb deleted file mode 100644 index 77124eb9e98..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_favourites.html.erb +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_favourites2.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_favourites2.html.erb deleted file mode 100644 index 27387dfe7b3..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_favourites2.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% if logged_in? %> - { - <% current_user.favourited_measure_filters.each do |filter| %> - "<%= h filter.id -%>": "<%= escape_javascript filter.name -%>", - <% end %> - } -<% else %> - null -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_qualifiers.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_qualifiers.html.erb deleted file mode 100644 index 349bad62bc1..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_qualifiers.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -{ -<% - qualifiers = Api::Utils.java_facade.getResourceTypesForFilter().map do |resource_type| - [message("qualifiers.#{resource_type.getQualifier()}"), resource_type.getQualifier()] - end - - qualifiers.each do |q| -%> - '<%= h q[1] -%>': '<%= h q[0] -%>', -<% end %> -} diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_save_as_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_save_as_form.html.erb deleted file mode 100644 index 00ecb3aa7a1..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_save_as_form.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -
    - - -
    - - - <%= render :partial => 'shared_form' %> - - -
    -
    - \ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_search_body.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_search_body.html.erb deleted file mode 100644 index ac365ce8836..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_search_body.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<% - if @filter && @filter.display - edit_mode = (params[:edit]=='true') -%> - <% if @filter.security_exclusions %> -

    <%= message('results_not_display_due_to_security') -%>

    - <% end %> - - <%= render :partial => 'measures/display', :locals => {:filter => @filter, :edit_mode => edit_mode, :widget_id => nil} -%> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_search_header.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_search_header.html.erb deleted file mode 100644 index fa098e97750..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_search_header.html.erb +++ /dev/null @@ -1,65 +0,0 @@ -<% - if @filter && @filter.display - edit_mode = (params[:edit]=='true') -%> - -

    - <% if @filter.id && @filter.name.present? %> - <%= h @filter.name -%> - - <% if !@filter.shared %> - [<%= message 'measure_filter.private' -%>] - <% elsif logged_in? && @filter.user_id==current_user.id %> - [<%= message 'measure_filter.shared_with_all_users' -%>] - <% elsif @filter.user_id && @filter.user %> - [<%= message 'shared_by' -%> <%= @filter.user.name -%>] - <% else %> - [<%= message 'shared_by' -%> Sonar] - <% end %> - - <% else %> - <%= message('layout.measures') -%> - <% end %> -

    - -
    -
    - - - <% unless edit_mode %> - <% if logged_in? %> - <% if @filter.id %> - - <% end %> - - <% if !defined?(@unchanged) && @filter.id && @filter.owner?(current_user) %> - - <% end %> - - <% unless @filter.id %> - - <% end %> - - <% if @filter.id && @filter.owner?(current_user) %> - - <% end %> - <% end %> - <% end %> -
    - - <% unless edit_mode %> - <% if @filter.display %> -
    - -
    - <% end %> - <% end %> -
    - - <% if @filter.description.present? %> -
    <%= h @filter.description -%>
    - <% end %> - -<% else %> -

    <%= message('layout.measures') -%>

    -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_shared_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_shared_form.html.erb deleted file mode 100644 index c53de5eab58..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_shared_form.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -<% if !local_assigns.has_key? :display_owner - display_owner = false - end %> -