Merge remote-tracking branch 'origin/master' into touchdown

Conflicts:
	test/data/test.db
This commit is contained in:
Jake Moshenko 2014-05-21 14:43:57 -04:00
commit 8c3448080c
62 changed files with 581 additions and 339 deletions

View file

@ -1,5 +1,5 @@
var TEAM_PATTERN = '^[a-zA-Z][a-zA-Z0-9]+$';
var ROBOT_PATTERN = '^[a-zA-Z][a-zA-Z0-9]+$';
var ROBOT_PATTERN = '^[a-zA-Z][a-zA-Z0-9]{3,29}$';
function getRestUrl(args) {
var url = '';
@ -61,7 +61,7 @@ function getFirstTextLine(commentString) {
function createRobotAccount(ApiService, is_org, orgname, name, callback) {
ApiService.createRobot(is_org ? orgname : null, null, {'robot_shortname': name}).then(callback, function(resp) {
bootbox.dialog({
"message": resp.data ? resp.data : 'The robot account could not be created',
"message": resp.data ? resp.data['message'] : 'The robot account could not be created',
"title": "Cannot create robot account",
"buttons": {
"close": {
@ -84,7 +84,7 @@ function createOrganizationTeam(ApiService, orgname, teamname, callback) {
'teamname': teamname
};
ApiService.updateOrganizationTeam(data, params).then(callback, function() {
ApiService.updateOrganizationTeam(data, params).then(callback, function(resp) {
bootbox.dialog({
"message": resp.data ? resp.data : 'The team could not be created',
"title": "Cannot create team",
@ -3829,6 +3829,8 @@ quayApp.directive('setupTriggerDialog', function () {
var modalSetup = false;
$scope.show = function() {
if (!$scope.trigger || !$scope.repository) { return; }
$scope.activating = false;
$scope.pullEntity = null;
$scope.publicPull = true;
@ -3838,7 +3840,7 @@ quayApp.directive('setupTriggerDialog', function () {
if (!modalSetup) {
$('#setupTriggerModal').on('hidden.bs.modal', function () {
if ($scope.trigger['is_active']) { return; }
if (!$scope.trigger || $scope.trigger['is_active']) { return; }
$scope.$apply(function() {
$scope.cancelSetupTrigger();

View file

@ -4,11 +4,16 @@ $.fn.clipboardCopy = function() {
clip.on('complete', function() {
// Resets the animation.
var elem = $('#clipboardCopied')[0];
if (!elem) {
return;
}
elem.style.display = 'none';
elem.classList.remove('animated');
// Show the notification.
setTimeout(function() {
if (!elem) { return; }
elem.style.display = 'inline-block';
elem.classList.add('animated');
}, 10);
@ -1071,7 +1076,6 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
$scope.currentParentEntry = null;
$scope.currentBuild = build;
$scope.currentBuildIndex = index;
if (opt_updateURL) {
if (build) {
@ -1149,8 +1153,18 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
ApiService.getRepoBuildStatus(null, params, true).then(function(resp) {
// Note: We use extend here rather than replacing as Angular is depending on the
// root build object to remain the same object.
$.extend(true, $scope.builds[$scope.currentBuildIndex], resp);
var currentBuild = $scope.builds[$scope.currentBuildIndex];
var matchingBuilds = $.grep($scope.builds, function(elem) {
return elem['id'] == resp['id']
});
var currentBuild = matchingBuilds.length > 0 ? matchingBuilds[0] : null;
if (currentBuild) {
currentBuild = $.extend(true, currentBuild, resp);
} else {
currentBuild = resp;
$scope.builds.push(currentBuild);
}
checkPollTimer();
// Load the updated logs for the build.
@ -1239,12 +1253,12 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, $routeParams
$scope.getBadgeFormat = function(format, repo) {
if (!repo) { return; }
var imageUrl = Config.getUrl('/' + namespace + '/' + name + '/status');
var imageUrl = Config.getUrl('/repository/' + namespace + '/' + name + '/status');
if (!$scope.repo.is_public) {
imageUrl += '?token=' + $scope.repo.status_token;
}
var linkUrl = Config.getUrl('/' + namespace + '/' + name);
var linkUrl = Config.getUrl('/repository/' + namespace + '/' + name);
switch (format) {
case 'svg':
@ -1642,12 +1656,14 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use
$scope.cuser = jQuery.extend({}, user);
for (var i = 0; i < $scope.cuser.logins.length; i++) {
if ($scope.cuser.logins[i].service == 'github') {
var githubId = $scope.cuser.logins[i].service_identifier;
$http.get('https://api.github.com/user/' + githubId).success(function(resp) {
$scope.githubLogin = resp.login;
});
if ($scope.cuser.logins) {
for (var i = 0; i < $scope.cuser.logins.length; i++) {
if ($scope.cuser.logins[i].service == 'github') {
var githubId = $scope.cuser.logins[i].service_identifier;
$http.get('https://api.github.com/user/' + githubId).success(function(resp) {
$scope.githubLogin = resp.login;
});
}
}
}
});
@ -1940,7 +1956,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService
$scope.githubClientId = KeyService.githubClientId;
$scope.repo = {
'is_public': 1,
'is_public': 0,
'description': '',
'initialize': ''
};
@ -1959,9 +1975,6 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService
// Determine whether private repositories are allowed for the namespace.
checkPrivateAllowed();
// Default to private repos for organizations.
$scope.repo.is_public = isUserNamespace ? '1' : '0';
});
$scope.changeNamespace = function(namespace) {