From d87dac7c73a4070d49f3e974eb6c92c113e1ec16 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 16 Oct 2015 14:39:53 +0200 Subject: [PATCH] do not reload profile details when selecting a project, fix tooltips --- .../apps/quality-profiles/profile-details-view.js | 13 ++++++++++--- .../main/resources/org/sonar/l10n/core.properties | 3 +++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/profile-details-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/profile-details-view.js index 03ea016e555..164e727ac00 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/profile-details-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/profile-details-view.js @@ -17,7 +17,7 @@ export default Marionette.LayoutView.extend({ }, modelEvents: { - 'change': 'render', + 'change': 'onChange', 'flashChangelog': 'flashChangelog' }, @@ -47,6 +47,13 @@ export default Marionette.LayoutView.extend({ }); }, + onChange: function () { + var changed = Object.keys(this.model.changedAttributes()); + if (!(changed.length === 1 && changed[0] === 'projectCount')) { + this.render(); + } + }, + initProjectsSelect: function () { var key = this.model.get('key'); this.projectsSelectList = new window.SelectList({ @@ -73,8 +80,8 @@ export default Marionette.LayoutView.extend({ noResults: t('quality_gates.projects.noResults') }, tooltips: { - select: t('quality_gates.projects.select_hint'), - deselect: t('quality_gates.projects.deselect_hint') + select: t('quality_profiles.projects.select_hint'), + deselect: t('quality_profiles.projects.deselect_hint') } }); this.listenTo(this.projectsSelectList.collection, 'change:selected', this.onProjectsChange); diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index eda4051dd78..6d52e0d462c 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -1821,6 +1821,9 @@ quality_profiles.all_profiles=All Profiles quality_profiles.x_profiles={0} Profiles quality_profiles.x_projects={0} projects quality_profiles.no_results=No profiles found. Try installing a language plugin. +quality_profiles.projects.select_hint=Click to associate this project with the quality profile +quality_profiles.projects.deselect_hint=Click to remove association between this project and the quality profile + -- 2.39.5