You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/08/15 15:16:36 UTC
[10/12] git commit: AMBARI-6865. Visiting Hosts page causes the table
to flash twice (should only show the spinner once, not twice). (akovalenko)
AMBARI-6865. Visiting Hosts page causes the table to flash twice (should only show the spinner once, not twice). (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/412900be
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/412900be
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/412900be
Branch: refs/heads/branch-alerts-dev
Commit: 412900be450ff1b7e09fff5e793a68549c7e2b6f
Parents: d79289b
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Thu Aug 14 19:41:29 2014 +0300
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Fri Aug 15 09:15:57 2014 -0400
----------------------------------------------------------------------
ambari-web/app/templates/main/menu_item.hbs | 2 +-
ambari-web/app/views/common/table_view.js | 6 +++---
ambari-web/app/views/main/host.js | 3 +++
ambari-web/app/views/main/menu.js | 6 ++++++
4 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/412900be/ambari-web/app/templates/main/menu_item.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/menu_item.hbs b/ambari-web/app/templates/main/menu_item.hbs
index 278e3e9..e5ee05d 100644
--- a/ambari-web/app/templates/main/menu_item.hbs
+++ b/ambari-web/app/templates/main/menu_item.hbs
@@ -17,7 +17,7 @@
}}
-<a href="#/main/{{unbound view.content.routing}}">
+<a href="#" {{action goToSection view.content.routing target="view"}}>
{{{unbound view.content.label}}}
{{#if view.alertsCount}}
<span class="label label-important alerts-count">
http://git-wip-us.apache.org/repos/asf/ambari/blob/412900be/ambari-web/app/views/common/table_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/table_view.js b/ambari-web/app/views/common/table_view.js
index a234675..29f87b9 100644
--- a/ambari-web/app/views/common/table_view.js
+++ b/ambari-web/app/views/common/table_view.js
@@ -89,10 +89,11 @@ App.TableView = Em.View.extend(App.UserPref, {
var name = this.get('controller.name');
var self = this;
var filterConditions = App.db.getFilterConditions(name);
- if ((filterConditions && name != 'mainHostController') || (filterConditions && this.get('controller.showFilterConditionsFirstLoad'))) {
+ if (filterConditions) {
this.set('filterConditions', filterConditions);
- this.get('controller').set('showFilterConditionsFirstLoad', false);
+
var childViews = this.get('childViews');
+
filterConditions.forEach(function (condition, index, filteredConditions) {
var view = !Em.isNone(condition.iColumn) && childViews.findProperty('column', condition.iColumn);
if (view) {
@@ -111,7 +112,6 @@ App.TableView = Em.View.extend(App.UserPref, {
}
});
} else {
- this.clearFilters();
this.set('tableFilteringComplete', true);
}
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/412900be/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index e9c90fd..f85c88c 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -193,6 +193,9 @@ App.MainHostView = App.TableView.extend(App.TableServerProvider, {
* Restore filter properties in view
*/
willInsertElement: function () {
+ if (!this.get('controller.showFilterConditionsFirstLoad')) {
+ this.clearFilterCondition();
+ }
this._super();
this.set('startIndex', this.get('controller.startIndex'));
this.addObserver('pageContent.@each.selected', this, this.selectedHostsObserver);
http://git-wip-us.apache.org/repos/asf/ambari/blob/412900be/ambari-web/app/views/main/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js
index b81c90c..fbb2b7c 100644
--- a/ambari-web/app/views/main/menu.js
+++ b/ambari-web/app/views/main/menu.js
@@ -117,6 +117,12 @@ App.MainMenuView = Em.CollectionView.extend({
isViewsItem: function () {
return this.get('content').routing == 'views';
}.property(''),
+ goToSection: function (event) {
+ if (event.context === 'hosts') {
+ App.router.set('mainHostController.showFilterConditionsFirstLoad', false);
+ }
+ App.router.route('main/' + event.context);
+ },
goToCategory: function (event) {
var itemName = this.get('content').routing;
// route to correct category of current menu item