Merge pull request #2056 from coreos-inc/js-error-fixes

Small JS error fixes
This commit is contained in:
josephschorr 2016-10-31 13:15:49 -04:00 committed by GitHub
commit 48935d7208
3 changed files with 16 additions and 0 deletions

View file

@ -99,6 +99,10 @@ angular.module('quay').directive('setupTriggerDialog', function () {
}; };
$scope.activate = function() { $scope.activate = function() {
if (!$scope.trigger) {
return;
}
var params = { var params = {
'repository': $scope.repository.namespace + '/' + $scope.repository.name, 'repository': $scope.repository.namespace + '/' + $scope.repository.name,
'trigger_uuid': $scope.trigger.id 'trigger_uuid': $scope.trigger.id
@ -123,6 +127,10 @@ angular.module('quay').directive('setupTriggerDialog', function () {
}); });
ApiService.activateBuildTrigger(data, params).then(function(resp) { ApiService.activateBuildTrigger(data, params).then(function(resp) {
if (!$scope.trigger) {
return;
}
$scope.trigger['is_active'] = true; $scope.trigger['is_active'] = true;
$scope.trigger['config'] = resp['config']; $scope.trigger['config'] = resp['config'];
$scope.trigger['pull_robot'] = resp['pull_robot']; $scope.trigger['pull_robot'] = resp['pull_robot'];

View file

@ -171,6 +171,10 @@ function(ApiService, CookieService, $rootScope, Config, $location) {
userService.deleteNamespace = function(info, callback) { userService.deleteNamespace = function(info, callback) {
var namespace = info.user ? info.user.username : info.organization.name; var namespace = info.user ? info.user.username : info.organization.name;
if (!namespace) {
return;
}
var deleteNamespaceItself = function() { var deleteNamespaceItself = function() {
info.progress = 1; info.progress = 1;
info.progressMessage = 'Deleting namespace...'; info.progressMessage = 'Deleting namespace...';

View file

@ -81,6 +81,10 @@
function initMunchkin() { function initMunchkin() {
if(didInit === false) { if(didInit === false) {
didInit = true; didInit = true;
if (!Munchkin || !Munchkin.init) {
return;
}
Munchkin.init('{{ munchkin_key }}'); Munchkin.init('{{ munchkin_key }}');
window.__quay_munchkin_queue.forEach(function(queue_item) { window.__quay_munchkin_queue.forEach(function(queue_item) {
Munchkin.munchkinFunction.apply(Munchkin, queue_item); Munchkin.munchkinFunction.apply(Munchkin, queue_item);