Merge pull request #2625 from charltonaustin/fix_robot_display_error
fix(frontend): fixed changing location
This commit is contained in:
commit
339aeb59f1
4 changed files with 12 additions and 10 deletions
static/js
|
@ -38,7 +38,8 @@ angular.module('quay').directive('signupForm', function () {
|
||||||
$scope.userRegistered({'username': $scope.newUser.username});
|
$scope.userRegistered({'username': $scope.newUser.username});
|
||||||
|
|
||||||
if (!$scope.awaitingConfirmation && !$scope.inviteCode) {
|
if (!$scope.awaitingConfirmation && !$scope.inviteCode) {
|
||||||
document.location = '/';
|
$location.path("/");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UserService.load();
|
UserService.load();
|
||||||
|
|
|
@ -12,7 +12,7 @@ angular.module('quay').directive('teamsManager', function () {
|
||||||
'organization': '=organization',
|
'organization': '=organization',
|
||||||
'isEnabled': '=isEnabled'
|
'isEnabled': '=isEnabled'
|
||||||
},
|
},
|
||||||
controller: function($scope, $element, ApiService, $timeout, UserService, TableService, UIService, Config, Features) {
|
controller: function($scope, $element, ApiService, $timeout, UserService, TableService, UIService, Config, Features, $location) {
|
||||||
$scope.TableService = TableService;
|
$scope.TableService = TableService;
|
||||||
$scope.Config = Config;
|
$scope.Config = Config;
|
||||||
$scope.Features = Features;
|
$scope.Features = Features;
|
||||||
|
@ -151,7 +151,7 @@ angular.module('quay').directive('teamsManager', function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.viewTeam = function(teamName) {
|
$scope.viewTeam = function(teamName) {
|
||||||
document.location = '/organization/' + $scope.organization.name + '/teams/' + teamName;
|
$location.path('/organization/' + $scope.organization.name + '/teams/' + teamName);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.showMembers = function(value) {
|
$scope.showMembers = function(value) {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
});
|
});
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
function BuildViewCtrl($scope, ApiService, $routeParams, AngularPollChannel, CookieService) {
|
function BuildViewCtrl($scope, ApiService, $routeParams, AngularPollChannel, CookieService, $location) {
|
||||||
$scope.namespace = $routeParams.namespace;
|
$scope.namespace = $routeParams.namespace;
|
||||||
$scope.name = $routeParams.name;
|
$scope.name = $routeParams.name;
|
||||||
$scope.build_uuid = $routeParams.buildid;
|
$scope.build_uuid = $routeParams.buildid;
|
||||||
|
@ -51,8 +51,9 @@
|
||||||
'build_uuid': build.id
|
'build_uuid': build.id
|
||||||
};
|
};
|
||||||
|
|
||||||
ApiService.cancelRepoBuild(null, params).then(function() {
|
ApiService.cancelRepoBuild(null, params).then(function () {
|
||||||
document.location = '/repository/' + $scope.namespace + '/' + $scope.name;
|
$location.path('/repository/' + $scope.namespace + '/' + $scope.name);
|
||||||
|
|
||||||
}, ApiService.errorDisplay('Cannot cancel build'));
|
}, ApiService.errorDisplay('Cannot cancel build'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
* Helper service for loading, changing and working with subscription plans.
|
* Helper service for loading, changing and working with subscription plans.
|
||||||
*/
|
*/
|
||||||
angular.module('quay')
|
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 plans = null;
|
||||||
var planDict = {};
|
var planDict = {};
|
||||||
var planService = {};
|
var planService = {};
|
||||||
|
@ -67,9 +67,9 @@ function(KeyService, UserService, CookieService, ApiService, Features, Config) {
|
||||||
|
|
||||||
planService.getPlan(planId, function(plan) {
|
planService.getPlan(planId, function(plan) {
|
||||||
if (planService.isOrgCompatible(plan)) {
|
if (planService.isOrgCompatible(plan)) {
|
||||||
document.location = '/organizations/new/?plan=' + planId;
|
$location.path('/organizations/new/?plan=' + planId);
|
||||||
} else {
|
} else {
|
||||||
document.location = '/user?plan=' + planId;
|
$location.path('/user?plan=' + planId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue