Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Fix issue where app wall filters were only semi cleared after being r…
Browse files Browse the repository at this point in the history
…eset #2 (#1077)

* Fix issue where app wall filters were only semi cleared after being reset
Bug was...
- 1 cf, in app wall select cluster, org and space
- Add a second cf and return to app wall
- Filters all showed as being reset while under the hood old filter was
still being applied.

* Change to existing fix for 2nd cf and app-wall
Ensure existing filters for org + space are used except when new cf
had been detected

* gate check

* gate check
  • Loading branch information
richard-cox authored and nwmac committed Jun 7, 2017
1 parent 5eac89c commit 3652f3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
19 changes: 10 additions & 9 deletions components/cloud-foundry/src/view/applications/list/list.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
// Width at which we automatically switch to the grid layout
var FORCE_GRID_LAYOUT_WIDTH = 640;

// If we have previous apps show the stale values from cache. This avoids showing a blank screen for the majority
// use case where nothing has changed.
// If we have previous apps then show the stale values from cache. This avoids showing a blank screen for
// the majority of use cases where nothing has changed.
this.ready = this.model.hasApps;

// Force card layout on smaller screen sizes - listen for resize events
Expand Down Expand Up @@ -206,8 +206,15 @@
if (this.model.filterLastCluster) {
var intersection = _.intersection(this.model.filterLastCluster, clusterGuids);
if (this.model.filterLastCluster.length !== intersection.length || clusterGuids.length !== intersection.length) {
// Set of GUIDs has changed, so reset the filter
// Set of GUIDs has changed, so reset the all filters. This avoids confusion for users when they add a new cf
// and don't see any new apps due to a pre-existing filter.
this.model.filterParams.cnsiGuid = 'all';
this.model.filterParams.orgGuid = 'all';
this.model.filterParams.spaceGuid = 'all';
// Also up front reset local filter values
this.filter.cnsiGuid = this.model.filterParams.cnsiGuid;
this.filter.orgGuid = this.model.filterParams.orgGuid;
this.filter.spaceGuid = this.model.filterParams.spaceGuid;
}
}

Expand Down Expand Up @@ -253,9 +260,6 @@
}
});
} else {
// Ensure any previous values are wiped
that.model.filterParams.orgGuid = 'all';
that.filter.orgGuid = that.model.filterParams.orgGuid;
return this.$q.resolve();
}
},
Expand Down Expand Up @@ -293,9 +297,6 @@
}
});
} else {
// Ensure any previous values are wiped
that.model.filterParams.spaceGuid = 'all';
that.filter.spaceGuid = that.model.filterParams.spaceGuid;
return this.$q.resolve();
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@
appModel.filterParams.spaceGuid = 'junk3';

setUp();
// Kick of a digest, we only make a call when we have a valid org
$scope.$digest();
$httpBackend.flush();

check(allFilterValue, 3, allFilterValue, 1, allFilterValue, 1);
});
Expand All @@ -449,7 +448,6 @@
appModel.filterParams.cnsiGuid = 'junk1';

setUp();
// Kick of a digest, we only make a call when we have a valid org
$scope.$digest();

check(allFilterValue, 3, allFilterValue, 1, allFilterValue, 1);
Expand All @@ -461,7 +459,6 @@
appModel.filterParams.orgGuid = 'junk2';

setUp();
// Kick of a digest, we only make a call when we have a valid org
$scope.$digest();

check(cnsiGuid, 3, allFilterValue, 3, allFilterValue, 1);
Expand Down

0 comments on commit 3652f3b

Please sign in to comment.