fix(frontend): fixed changing location

before we were setting the location on the window when we should have been just using Angular $location service instead

[TESTING -> tested locally with docker compose and a complete build]

- [ ] It works!
- [ ] Comments provide sufficient explanations for the next contributor
- [ ] Tests cover changes and corner cases
- [ ] Follows Quay syntax patterns and format
This commit is contained in:
Charlton Austin 2017-05-05 15:10:06 -04:00
parent a6b7560fdc
commit 6e533e3627
4 changed files with 12 additions and 10 deletions

View file

@ -2,9 +2,9 @@
* Helper service for loading, changing and working with subscription plans.
*/
angular.module('quay')
.factory('PlanService', ['KeyService', 'UserService', 'CookieService', 'ApiService', 'Features', 'Config',
.factory('PlanService', ['KeyService', 'UserService', 'CookieService', 'ApiService', 'Features', 'Config', '$location',
function(KeyService, UserService, CookieService, ApiService, Features, Config) {
function(KeyService, UserService, CookieService, ApiService, Features, Config, $location) {
var plans = null;
var planDict = {};
var planService = {};
@ -67,9 +67,9 @@ function(KeyService, UserService, CookieService, ApiService, Features, Config) {
planService.getPlan(planId, function(plan) {
if (planService.isOrgCompatible(plan)) {
document.location = '/organizations/new/?plan=' + planId;
$location.path('/organizations/new/?plan=' + planId);
} else {
document.location = '/user?plan=' + planId;
$location.path('/user?plan=' + planId);
}
});
});