From 52903276bb805ed85d098ff9160f4e547c50c0a1 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 15 Sep 2015 10:51:56 +0200 Subject: [PATCH] SONAR-6160 Show a notification when user reaches the last issue / rule --- .../templates/coding-rules-workspace-list.hbs | 5 +++-- .../apps/issues/templates/issues-workspace-list.hbs | 5 +++-- .../js/components/navigator/workspace-list-view.js | 11 +++++++++-- .../src/main/less/components/search-navigator.less | 1 + .../src/main/resources/org/sonar/l10n/core.properties | 1 + 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list.hbs index 37421cb75c2..a4020b26627 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list.hbs @@ -1,5 +1,6 @@
-
- +
+ +
 
{{t 'the_end'}}
diff --git a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list.hbs b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list.hbs index 37421cb75c2..a4020b26627 100644 --- a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list.hbs +++ b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list.hbs @@ -1,5 +1,6 @@
-
- +
+ +
 
{{t 'the_end'}}
diff --git a/server/sonar-web/src/main/js/components/navigator/workspace-list-view.js b/server/sonar-web/src/main/js/components/navigator/workspace-list-view.js index a9c1831c835..90092b1bb02 100644 --- a/server/sonar-web/src/main/js/components/navigator/workspace-list-view.js +++ b/server/sonar-web/src/main/js/components/navigator/workspace-list-view.js @@ -24,7 +24,8 @@ define(function () { return Marionette.CompositeView.extend({ ui: { - loadMore: '.js-more' + loadMore: '.js-more', + lastElementReached: '.js-last-element-reached' }, childViewOptions: function () { @@ -49,8 +50,14 @@ define(function () { this.unbindShortcuts(); }, + onRender: function () { + this.toggleLoadMore(); + }, + toggleLoadMore: function () { - this.ui.loadMore.toggle(!this.options.app.state.get('maxResultsReached')); + var maxResultsReached = this.options.app.state.get('maxResultsReached'); + this.ui.loadMore.toggle(!maxResultsReached); + this.ui.lastElementReached.toggle(maxResultsReached); }, bindScrollEvents: function () { diff --git a/server/sonar-web/src/main/less/components/search-navigator.less b/server/sonar-web/src/main/less/components/search-navigator.less index 957c1180fbb..1f15099c2fe 100644 --- a/server/sonar-web/src/main/less/components/search-navigator.less +++ b/server/sonar-web/src/main/less/components/search-navigator.less @@ -511,6 +511,7 @@ .search-navigator-workspace-list-more { margin-top: 10px; + margin-bottom: 10px; padding: 5px 10px; text-align: center; } 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 4a5d04c377c..5fb13b140bc 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -158,6 +158,7 @@ sub_views=Sub-views table=Table technical_debt=Technical Debt template=Template +the_end=The End title=Title to=To to.downcase=to -- 2.39.5