diff --git a/static/directives/trigger-description.html b/static/directives/trigger-description.html index 91000dd1e..b39771a95 100644 --- a/static/directives/trigger-description.html +++ b/static/directives/trigger-description.html @@ -1,7 +1,10 @@ - Push to GitHub repository {{ trigger.config.build_source }} + Push to GitHub Enterprise repository + + {{ trigger.config.build_source }} +
Branches/Tags: diff --git a/static/js/app.js b/static/js/app.js index 3d1e86727..f422dc1f4 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1729,14 +1729,22 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading keyService['githubEndpoint'] = oauth['GITHUB_LOGIN_CONFIG']['GITHUB_ENDPOINT']; + keyService['githubTriggerEndpoint'] = oauth['GITHUB_TRIGGER_CONFIG']['GITHUB_ENDPOINT']; keyService['githubTriggerAuthorizeUrl'] = oauth['GITHUB_TRIGGER_CONFIG']['AUTHORIZE_ENDPOINT']; keyService['githubLoginScope'] = 'user:email'; keyService['googleLoginScope'] = 'openid email'; keyService.isEnterprise = function(service) { - var isGithubEnterprise = keyService['githubLoginUrl'].indexOf('https://github.com/') < 0; - return service == 'github' && isGithubEnterprise; + switch (service) { + case 'github': + return keyService['githubLoginUrl'].indexOf('https://github.com/') < 0; + + case 'github-trigger': + return keyService['githubTriggerAuthorizeUrl'].indexOf('https://github.com/') < 0; + } + + return false; }; keyService.getExternalLoginUrl = function(service, action) { @@ -4806,7 +4814,9 @@ quayApp.directive('triggerDescription', function () { 'trigger': '=trigger', 'short': '=short' }, - controller: function($scope, $element) { + controller: function($scope, $element, KeyService, TriggerService) { + $scope.KeyService = KeyService; + $scope.TriggerService = TriggerService; } }; return directiveDefinitionObject; diff --git a/static/js/controllers.js b/static/js/controllers.js index 6a4051e50..4f7515ff6 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -59,13 +59,13 @@ function PlansCtrl($scope, $location, UserService, PlanService, $routeParams) { $scope.signedIn = function() { $('#signinModal').modal('hide'); - PlanService.handleNotedPlan(); + PlanService.handleNotedPlan(); }; - + $scope.buyNow = function(plan) { PlanService.notePlan(plan); if ($scope.user && !$scope.user.anonymous) { - PlanService.handleNotedPlan(); + PlanService.handleNotedPlan(); } else { $('#signinModal').modal({}); } @@ -77,7 +77,7 @@ function PlansCtrl($scope, $location, UserService, PlanService, $routeParams) { if ($scope && $routeParams['trial-plan']) { $scope.buyNow($routeParams['trial-plan']); - } + } }, /* include the personal plan */ true); } @@ -94,7 +94,7 @@ function TutorialCtrl($scope, AngularTour, AngularTourSignals, UserService, Conf 'steps': [ { 'title': 'Welcome to the ' + Config.REGISTRY_TITLE_SHORT + ' tutorial!', - 'templateUrl': '/static/tutorial/welcome.html' + 'templateUrl': '/static/tutorial/welcome.html' }, { 'title': 'Sign in to get started', @@ -235,7 +235,7 @@ function RepoListCtrl($scope, $sanitize, Restangular, UserService, ApiService) { $scope.namespace = null; $scope.page = 1; $scope.publicPageCount = null; - + // Monitor changes in the user. UserService.updateUserIn($scope, function() { loadMyRepos($scope.namespace); @@ -269,7 +269,7 @@ function RepoListCtrl($scope, $sanitize, Restangular, UserService, ApiService) { } var options = {'public': false, 'sort': true, 'namespace': namespace}; - + $scope.user_repositories = ApiService.listReposAsResource().withOptions(options).get(function(resp) { return resp.repositories; }); @@ -318,7 +318,7 @@ function LandingCtrl($scope, UserService, ApiService, Features, Config) { if (namespace == $scope.user.username) { return true; } - + if ($scope.user.organizations) { for (var i = 0; i < $scope.user.organizations.length; ++i) { var org = $scope.user.organizations[i]; @@ -483,7 +483,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi $scope.currentPullCommand = $scope.pullCommands[0]; }; - + $scope.showNewBuildDialog = function() { $scope.buildDialogShowCounter++; }; @@ -655,7 +655,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi $scope.setImage = function(imageId, opt_updateURL) { if (!$scope.images) { return; } - + var image = null; for (var i = 0; i < $scope.images.length; ++i) { var currentImage = $scope.images[i]; @@ -691,7 +691,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi // We must find a good default. for (tagName in repo.tags) { if (!proposedTag || tagName == 'latest') { - proposedTag = repo.tags[tagName]; + proposedTag = repo.tags[tagName]; } } } @@ -702,7 +702,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi if ($scope.tree) { $scope.tree.setTag(proposedTag.name); - } + } if (opt_updateURL) { $location.search('image', null); @@ -871,7 +871,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi }; var listImages = function() { - var params = {'repository': namespace + '/' + name}; + var params = {'repository': namespace + '/' + name}; $scope.imageHistory = ApiService.listRepositoryImagesAsResource(params).get(function(resp) { $scope.images = resp.images; $scope.specificImages = []; @@ -971,7 +971,7 @@ function BuildPackageCtrl($scope, Restangular, ApiService, DataFileService, $rou return dockerfilePath; }; - var processBuildPack = function(uint8array) { + var processBuildPack = function(uint8array) { var archiveread = function(files) { var getpath = function(file) { return file.path; @@ -1056,7 +1056,7 @@ function BuildPackageCtrl($scope, Restangular, ApiService, DataFileService, $rou $scope.accessDenied = true; return; } - + $rootScope.title = 'Repository Build Pack - ' + resp['display_name']; $scope.repobuild = resp; $scope.repo = { @@ -1115,7 +1115,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope $('#confirmRestartBuildModal').modal('hide'); var subdirectory = ''; - if (build['job_config']) { + if (build['job_config']) { subdirectory = build['job_config']['build_subdir'] || ''; } @@ -1159,7 +1159,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope $scope.processANSI = function(message, container) { var filter = container.logs._filter = (container.logs._filter || ansi2html.create()); - + // Note: order is important here. var setup = filter.getSetupHtml(); var stream = filter.addInputToStream(message); @@ -1194,7 +1194,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope if ($scope.pollChannel) { $scope.pollChannel.stop(); } - + // Create a new channel for polling the build status and logs. var conductStatusAndLogRequest = function(callback) { getBuildStatusAndLogs(build, callback); @@ -1230,7 +1230,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope return endIndex; }; - var getBuildStatusAndLogs = function(build, callback) { + var getBuildStatusAndLogs = function(build, callback) { var params = { 'repository': namespace + '/' + name, 'build_uuid': build.id @@ -1258,9 +1258,9 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope 'start': $scope.logStartIndex }; - ApiService.getRepoBuildLogsAsResource(params, true).withOptions(options).get(function(resp) { + ApiService.getRepoBuildLogsAsResource(params, true).withOptions(options).get(function(resp) { if (build != $scope.currentBuild) { callback(false); return; } - + // Process the logs we've received. $scope.logStartIndex = processLogs(resp['logs'], resp['start'], resp['total']); @@ -1323,7 +1323,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope fetchRepository(); } -function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerService, $routeParams, +function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerService, $routeParams, $rootScope, $location, UserService, Config, Features, ExternalNotificationData) { var namespace = $routeParams.namespace; @@ -1331,11 +1331,12 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi $scope.Features = Features; $scope.TriggerService = TriggerService; + $scope.KeyService = KeyService; $scope.permissions = {'team': [], 'user': [], 'loading': 2}; $scope.logsShown = 0; $scope.deleting = false; - + $scope.permissionCache = {}; $scope.showTriggerSetupCounter = 0; @@ -1436,7 +1437,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi var permission = $scope.permissions[kind][entityName]; var currentRole = permission.role; permission.role = role; - + var permissionPut = Restangular.one(getRestUrl('repository', namespace, name, 'permissions', kind, entityName)); permissionPut.customPUT(permission).then(function() {}, function(resp) { $scope.permissions[kind][entityName] = {'role': currentRole}; @@ -1534,7 +1535,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi $scope.deleting = true; ApiService.deleteRepository(null, params).then(function() { $scope.repo = null; - + setTimeout(function() { document.location = '/repository/'; }, 1000); @@ -1545,7 +1546,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi }; $scope.showNewNotificationCounter = 0; - + $scope.showNewNotificationDialog = function() { $scope.showNewNotificationCounter++; }; @@ -1629,7 +1630,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi }; $scope.showManualBuildDialog = 0; - + $scope.startTrigger = function(trigger, opt_custom) { var parameters = TriggerService.getRunParameters(trigger.service); if (parameters.length && !opt_custom) { @@ -1765,7 +1766,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use $scope.logsShown = 0; $scope.invoicesShown = 0; - + $scope.loadAuthedApps = function() { if ($scope.authorizedApps) { return; } @@ -1808,7 +1809,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use $scope.orgPlans = plans; }); } - + $scope.convertStep = 1; }; @@ -1883,7 +1884,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use UserService.load(); }, function(result) { $scope.updatingUser = false; - UIService.showFormError('#changePasswordForm', result); + UIService.showFormError('#changePasswordForm', result); }); }; @@ -1900,7 +1901,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use }; } -function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, ImageMetadataService) { +function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, ImageMetadataService) { var namespace = $routeParams.namespace; var name = $routeParams.name; var imageid = $routeParams.image; @@ -1924,7 +1925,7 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I if (index < 0) { return ''; } - + return filepath.substr(0, index).split('/'); }; @@ -1947,10 +1948,10 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I $scope.search['$'] = filter; document.getElementById('change-filter').value = filter; }; - + $scope.initializeTree = function() { if ($scope.tree) { return; } - + $scope.tree = new ImageFileChangeTree($scope.image, $scope.combinedChanges); $timeout(function() { $scope.tree.draw('changes-tree-container'); @@ -1970,7 +1971,7 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I var fetchImage = function() { var params = { 'repository': namespace + '/' + name, - 'image_id': imageid + 'image_id': imageid }; $scope.image = ApiService.getImageAsResource(params).get(function(image) { @@ -1995,14 +1996,14 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I var fetchChanges = function() { var params = { 'repository': namespace + '/' + name, - 'image_id': imageid + 'image_id': imageid }; ApiService.getImageChanges(null, params).then(function(changes) { var combinedChanges = []; var addCombinedChanges = function(c, kind) { for (var i = 0; i < c.length; ++i) { - combinedChanges.push({ + combinedChanges.push({ 'kind': kind, 'file': c[i] }); @@ -2046,7 +2047,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService $scope.$watch('repo.namespace', function(namespace) { // Note: Can initially be undefined. if (!namespace) { return; } - + var isUserNamespace = (namespace == $scope.user.username); $scope.planRequired = null; @@ -2083,7 +2084,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService } } }); - + return true; }; @@ -2156,7 +2157,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService var isUserNamespace = $scope.isUserNamespace; ApiService.getPrivateAllowed(isUserNamespace ? null : $scope.repo.namespace).then(function(resp) { $scope.checkingPlan = false; - + if (resp['privateAllowed']) { $scope.planRequired = null; return; @@ -2198,8 +2199,8 @@ function OrgViewCtrl($rootScope, $scope, ApiService, $routeParams) { { 'id': 'creator', 'title': 'Creator', 'kind': 'success' }, { 'id': 'admin', 'title': 'Admin', 'kind': 'primary' } ]; - - $scope.setRole = function(role, teamname) { + + $scope.setRole = function(role, teamname) { var previousRole = $scope.organization.teams[teamname].role; $scope.organization.teams[teamname].role = role; @@ -2211,7 +2212,7 @@ function OrgViewCtrl($rootScope, $scope, ApiService, $routeParams) { var data = $scope.organization.teams[teamname]; ApiService.updateOrganizationTeam(data, params).then(function(resp) { - }, function(resp) { + }, function(resp) { $scope.organization.teams[teamname].role = previousRole; $scope.roleError = resp.data || ''; $('#cannotChangeTeamModal').modal({}); @@ -2286,7 +2287,7 @@ function OrgAdminCtrl($rootScope, $scope, $timeout, Restangular, $routeParams, U PlanService.getPlans(function(plans) { $scope.plans = plans; $scope.plan_map = {}; - + for (var i = 0; i < plans.length; ++i) { $scope.plan_map[plans[i].stripeId] = plans[i]; } @@ -2301,7 +2302,7 @@ function OrgAdminCtrl($rootScope, $scope, $timeout, Restangular, $routeParams, U $scope.invoicesShown = 0; $scope.applicationsShown = 0; $scope.changingOrganization = false; - + $scope.loadLogs = function() { $scope.logsShown++; }; @@ -2424,7 +2425,7 @@ function TeamViewCtrl($rootScope, $scope, $timeout, Features, Restangular, ApiSe $scope.addNewMember = function(member) { if (!member || $scope.memberMap[member.name]) { return; } - + var params = { 'orgname': orgname, 'teamname': teamname, @@ -2519,7 +2520,7 @@ function TeamViewCtrl($rootScope, $scope, $timeout, Features, Restangular, ApiSe $scope.membersResource = ApiService.getOrganizationTeamMembersAsResource(params).get(function(resp) { $scope.members = resp.members; $scope.canEditMembers = resp.can_edit; - + $('.info-icon').popover({ 'trigger': 'hover', 'html': true @@ -2667,7 +2668,7 @@ function OrgMemberLogsCtrl($scope, $routeParams, $rootScope, $timeout, Restangul }); return resp.member; - }); + }); }; // Load the org info and the member info. @@ -2763,7 +2764,7 @@ function ManageApplicationCtrl($scope, $routeParams, $rootScope, $location, $tim ' under organization ' + $scope.orgname; return resp; - }); + }); }; diff --git a/static/partials/repo-admin.html b/static/partials/repo-admin.html index 27e4c8d64..78add8642 100644 --- a/static/partials/repo-admin.html +++ b/static/partials/repo-admin.html @@ -12,7 +12,7 @@ subsection="'Admin'">
- +
@@ -30,8 +30,8 @@
- -
+ +
@@ -48,7 +48,7 @@ Note: This repository is currently private. Publishing this badge will reveal the status information of your repository (and links may not work for unregistered users).
- + @@ -77,12 +77,12 @@
- +
- + - + -
+