From 33039e9bc421eed17ef9dba57310c96f7f0e431a Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 29 Jun 2015 12:18:21 +0300 Subject: [PATCH 1/4] New layout cleanup: Remove second GH trigger path --- endpoints/githubtrigger.py | 13 ++----------- static/js/services/trigger-service.js | 4 ---- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/endpoints/githubtrigger.py b/endpoints/githubtrigger.py index 8954e9119..cd14cd310 100644 --- a/endpoints/githubtrigger.py +++ b/endpoints/githubtrigger.py @@ -18,7 +18,6 @@ client = app.config['HTTPCLIENT'] githubtrigger = Blueprint('callback', __name__) @githubtrigger.route('/github/callback/trigger/', methods=['GET']) -@githubtrigger.route('/github/callback/trigger//__new', methods=['GET']) @route_show_if(features.GITHUB_BUILD) @require_session_login @parse_repository_name @@ -33,18 +32,10 @@ def attach_github_build_trigger(namespace, repository): abort(404, message=msg) trigger = model.create_build_trigger(repo, 'github', token, current_user.db_user()) - - # TODO(jschorr): Remove once the new layout is in place. - admin_path = '%s/%s/%s' % (namespace, repository, 'admin') - full_url = '%s%s%s' % (url_for('web.repository', path=admin_path), '?tab=trigger&new_trigger=', + repo_path = '%s/%s' % (namespace, repository) + full_url = '%s%s%s' % (url_for('web.repository', path=repo_path), '?tab=builds&newtrigger=', trigger.uuid) - if '__new' in request.url: - repo_path = '%s/%s' % (namespace, repository) - full_url = '%s%s%s' % (url_for('web.repository', path=repo_path), '?tab=builds&newtrigger=', - trigger.uuid) - - logger.debug('Redirecting to full url: %s', full_url) return redirect(full_url) diff --git a/static/js/services/trigger-service.js b/static/js/services/trigger-service.js index e597e5628..5826804bc 100644 --- a/static/js/services/trigger-service.js +++ b/static/js/services/trigger-service.js @@ -23,10 +23,6 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K var redirect_uri = KeyService['githubRedirectUri'] + '/trigger/' + namespace + '/' + repository; - if (Config.isNewLayout()) { - redirect_uri += '/__new'; - } - var authorize_url = KeyService['githubTriggerAuthorizeUrl']; var client_id = KeyService['githubTriggerClientId']; From ff3d8bb01399d3b2be212522af5fd958e763a77a Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 29 Jun 2015 12:33:00 +0300 Subject: [PATCH 2/4] Delete the old UI! --- static/directives/entity-reference.html | 41 +- static/directives/entity-search.html | 7 +- static/directives/header-bar.html | 206 ++++++++- static/directives/new-entity-reference.html | 40 -- static/directives/new-header-bar.html | 205 --------- static/directives/new-role-group.html | 17 - static/directives/old-entity-reference.html | 39 -- static/directives/old-header-bar.html | 78 ---- static/directives/old-role-group.html | 6 - static/directives/robots-manager.html | 12 +- static/directives/role-group.html | 18 +- static/js/app.js | 27 -- static/js/core-ui.js | 15 - static/js/directives/ui/entity-reference.js | 28 -- static/js/directives/ui/header-bar.js | 51 +-- static/js/pages/build-package.js | 143 ------ static/js/pages/exp-new-layout.js | 20 - static/js/pages/image-view.js | 5 +- static/js/pages/landing.js | 2 +- static/js/pages/manage-application.js | 7 +- static/js/pages/new-organization.js | 7 +- static/js/pages/new-repo.js | 7 +- static/js/pages/org-admin.js | 110 ----- static/js/pages/org-member-logs.js | 49 -- static/js/pages/org-view.js | 5 +- static/js/pages/repo-admin.js | 399 ---------------- static/js/pages/repo-build.js | 294 ------------ static/js/pages/repo-list.js | 7 +- static/js/pages/repo-view.js | 5 +- static/js/pages/setup.js | 5 +- static/js/pages/superuser.js | 5 +- static/js/pages/team-view.js | 5 +- static/js/pages/tutorial.js | 5 +- static/js/pages/user-admin.js | 222 --------- static/js/pages/user-view.js | 2 +- static/js/services/avatar-service.js | 4 +- static/js/services/features-config.js | 5 - static/js/services/notification-service.js | 14 +- static/partials/build-package.html | 53 --- static/partials/exp-new-layout.html | 10 - static/partials/old-image-view.html | 82 ---- static/partials/old-manage-application.html | 191 -------- static/partials/old-new-organization.html | 94 ---- static/partials/old-new-repo.html | 237 ---------- static/partials/old-org-view.html | 86 ---- static/partials/old-repo-list.html | 74 --- static/partials/old-repo-view.html | 425 ----------------- static/partials/old-team-view.html | 128 ------ static/partials/old-tutorial.html | 3 - static/partials/org-admin.html | 127 ------ static/partials/org-member-logs.html | 7 - static/partials/repo-admin.html | 480 -------------------- static/partials/repo-build.html | 141 ------ static/partials/user-admin.html | 436 ------------------ 54 files changed, 308 insertions(+), 4383 deletions(-) delete mode 100644 static/directives/new-entity-reference.html delete mode 100644 static/directives/new-header-bar.html delete mode 100644 static/directives/new-role-group.html delete mode 100644 static/directives/old-entity-reference.html delete mode 100644 static/directives/old-header-bar.html delete mode 100644 static/directives/old-role-group.html delete mode 100644 static/js/pages/build-package.js delete mode 100644 static/js/pages/exp-new-layout.js delete mode 100644 static/js/pages/org-admin.js delete mode 100644 static/js/pages/org-member-logs.js delete mode 100644 static/js/pages/repo-admin.js delete mode 100644 static/js/pages/repo-build.js delete mode 100644 static/js/pages/user-admin.js delete mode 100644 static/partials/build-package.html delete mode 100644 static/partials/exp-new-layout.html delete mode 100644 static/partials/old-image-view.html delete mode 100644 static/partials/old-manage-application.html delete mode 100644 static/partials/old-new-organization.html delete mode 100644 static/partials/old-new-repo.html delete mode 100644 static/partials/old-org-view.html delete mode 100644 static/partials/old-repo-list.html delete mode 100644 static/partials/old-repo-view.html delete mode 100644 static/partials/old-team-view.html delete mode 100644 static/partials/old-tutorial.html delete mode 100644 static/partials/org-admin.html delete mode 100644 static/partials/org-member-logs.html delete mode 100644 static/partials/repo-admin.html delete mode 100644 static/partials/repo-build.html delete mode 100644 static/partials/user-admin.html diff --git a/static/directives/entity-reference.html b/static/directives/entity-reference.html index 2229bcb0c..f7ec77ed1 100644 --- a/static/directives/entity-reference.html +++ b/static/directives/entity-reference.html @@ -1,3 +1,42 @@ - + + + + + + + {{ entity.name }} + + + + + + + + + + + + + + + + {{ entity.name }} + + + + + + + {{ getPrefix(entity.name) }}+ + {{ getShortenedName(entity.name) }} + + + + + diff --git a/static/directives/entity-search.html b/static/directives/entity-search.html index e25a8a937..fe0e7b432 100644 --- a/static/directives/entity-search.html +++ b/static/directives/entity-search.html @@ -55,12 +55,7 @@ diff --git a/static/directives/header-bar.html b/static/directives/header-bar.html index 43ef0847a..9f8f17762 100644 --- a/static/directives/header-bar.html +++ b/static/directives/header-bar.html @@ -1,3 +1,207 @@ - +
+
+ + + + + +
+ + + +
+
+
No matching results found
+
    +
  • + {{ result.kind }} + + + + + + + {{ result.name }} + + + under organization + + {{ result.organization.name }} + + + + + {{ result.name }} + + + + {{ result.name }} + + + + {{ result.name }} + + + + {{ result.namespace.name }}/{{ result.name }} +
    +
    +
    +
    +
    +
  • +
+
+ +
+
+
diff --git a/static/directives/new-entity-reference.html b/static/directives/new-entity-reference.html deleted file mode 100644 index 22cd701a3..000000000 --- a/static/directives/new-entity-reference.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - {{ entity.name }} - - - - - - - - - - - - - - - - {{ entity.name }} - - - - - - - {{ getPrefix(entity.name) }}+ - {{ getShortenedName(entity.name) }} - - - - - diff --git a/static/directives/new-header-bar.html b/static/directives/new-header-bar.html deleted file mode 100644 index 37bc74e4b..000000000 --- a/static/directives/new-header-bar.html +++ /dev/null @@ -1,205 +0,0 @@ -
-
- - - - - -
- - - -
-
-
No matching results found
-
    -
  • - {{ result.kind }} - - - - - - - {{ result.name }} - - - under organization - - {{ result.organization.name }} - - - - - {{ result.name }} - - - - {{ result.name }} - - - - {{ result.name }} - - - - {{ result.namespace.name }}/{{ result.name }} -
    -
    -
    -
    -
    -
  • -
-
- -
-
-
\ No newline at end of file diff --git a/static/directives/new-role-group.html b/static/directives/new-role-group.html deleted file mode 100644 index 1f07ff729..000000000 --- a/static/directives/new-role-group.html +++ /dev/null @@ -1,17 +0,0 @@ -
- -
diff --git a/static/directives/old-entity-reference.html b/static/directives/old-entity-reference.html deleted file mode 100644 index ac29d12bf..000000000 --- a/static/directives/old-entity-reference.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - {{entity.name}} - {{entity.name}} - - - - - - {{entity.name}} - {{entity.name}} - - - - - - - - - - - - {{ getPrefix(entity.name) }}+{{ getShortenedName(entity.name) }} - - - {{ getPrefix(entity.name) }}+{{ getShortenedName(entity.name) }} - - - - {{getShortenedName(entity.name)}} - - - - - diff --git a/static/directives/old-header-bar.html b/static/directives/old-header-bar.html deleted file mode 100644 index f18a9a9e1..000000000 --- a/static/directives/old-header-bar.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - \ No newline at end of file diff --git a/static/directives/old-role-group.html b/static/directives/old-role-group.html deleted file mode 100644 index d87326d6a..000000000 --- a/static/directives/old-role-group.html +++ /dev/null @@ -1,6 +0,0 @@ -
- -
\ No newline at end of file diff --git a/static/directives/robots-manager.html b/static/directives/robots-manager.html index a7e0185ef..59c671771 100644 --- a/static/directives/robots-manager.html +++ b/static/directives/robots-manager.html @@ -35,16 +35,16 @@ - + - - + + - - - - +
Robot Account NameTeamsDirect Repository PermissionsTeamsDirect Repository Permissions
+ (Not a member of any team) @@ -71,7 +71,7 @@ + (No direct permissions on any repositories) diff --git a/static/directives/role-group.html b/static/directives/role-group.html index e2b71e77e..21c665b5f 100644 --- a/static/directives/role-group.html +++ b/static/directives/role-group.html @@ -1 +1,17 @@ - \ No newline at end of file +
+ +
\ No newline at end of file diff --git a/static/js/app.js b/static/js/app.js index dda1f7fdb..26a779c6e 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -84,12 +84,6 @@ quayApp.config(['$routeProvider', '$locationProvider', 'pages', function($routeP // WARNING WARNING WARNING var layoutProfile = 'layout'; - - // Check for the override flag. - if (window.location.search.indexOf('old-ui=1') >= 0) { - layoutProfile = 'old-layout'; - } - window.console.log('Using layout profile: ' + layoutProfile); var routeBuilder = new AngularRouteBuilder($routeProvider, pages, [ @@ -108,18 +102,9 @@ quayApp.config(['$routeProvider', '$locationProvider', 'pages', function($routeP // Image View .route('/repository/:namespace/:name/image/:image', 'image-view') - // Repo Admin - .route('/repository/:namespace/:name/admin', 'repo-admin') - - // Repo Builds - .route('/repository/:namespace/:name/build', 'repo-build') - // Repo Build View .route('/repository/:namespace/:name/build/:buildid', 'build-view') - // Repo Build Package - .route('/repository/:namespace/:name/build/:buildid/buildpack', 'build-package') - // Repo List .route('/repository/', 'repo-list') @@ -132,24 +117,15 @@ quayApp.config(['$routeProvider', '$locationProvider', 'pages', function($routeP // View Organization .route('/organization/:orgname', 'org-view') - // Organization Admin - .route('/organization/:orgname/admin', 'org-admin') - // View Organization Team .route('/organization/:orgname/teams/:teamname', 'team-view') - // Organization Member Logs - .route('/organization/:orgname/logs/:membername', 'org-member-logs') - // Organization View Application .route('/organization/:orgname/application/:clientid', 'manage-application') // View User .route('/user/:username', 'user-view') - // DEPRECATED: User Admin - .route('/user/', 'user-admin') - // Sign In .route('/signin/', 'signin') @@ -189,9 +165,6 @@ quayApp.config(['$routeProvider', '$locationProvider', 'pages', function($routeP // Confirm Invite .route('/confirminvite', 'confirm-invite') - // Enable/disable experimental layout - .route('/__exp/newlayout', 'exp-new-layout') - // Default: Redirect to the landing page .otherwise({redirectTo: '/'}); }]); diff --git a/static/js/core-ui.js b/static/js/core-ui.js index 42da4c414..f23e18c50 100644 --- a/static/js/core-ui.js +++ b/static/js/core-ui.js @@ -235,21 +235,6 @@ angular.module("core-ui", []) return directiveDefinitionObject; }) - // TODO(jschorr): Remove this once new layout is in prod. - .directive('corTabShim', function() { - var directiveDefinitionObject = { - priority: 3, - replace: false, - transclude: false, - restrict: 'C', - scope: {}, - controller: function($rootScope, $scope, $element, $timeout, $location, UIService) { - UIService.initializeTabs($scope, $element); - } - }; - return directiveDefinitionObject; - }) - .directive('corTabs', function() { var directiveDefinitionObject = { priority: 3, diff --git a/static/js/directives/ui/entity-reference.js b/static/js/directives/ui/entity-reference.js index 929cfb03c..15767a630 100644 --- a/static/js/directives/ui/entity-reference.js +++ b/static/js/directives/ui/entity-reference.js @@ -21,14 +21,6 @@ angular.module('quay').directive('entityReference', function () { }; $scope.getRobotUrl = function(name) { - if (Config.isNewLayout()) { - return $scope.getNewRobotUrl(name); - } else { - return $scope.getOldRobotUrl(name); - } - }; - - $scope.getNewRobotUrl = function(name) { var namespace = $scope.getPrefix(name); if (!namespace) { return ''; @@ -47,26 +39,6 @@ angular.module('quay').directive('entityReference', function () { return '/organization/' + org['name'] + '?tab=robots&showRobot=' + UtilService.textToSafeHtml(name); }; - // TODO(jschorr): Remove when new layout is in prod. - $scope.getOldRobotUrl = function(name) { - var namespace = $scope.getPrefix(name); - if (!namespace) { - return ''; - } - - if (!$scope.getIsAdmin(namespace)) { - return ''; - } - - var org = UserService.getOrganization(namespace); - if (!org) { - // This robot is owned by the user. - return '/user/?tab=robots&showRobot=' + UtilService.textToSafeHtml(name); - } - - return '/organization/' + org['name'] + '/admin?tab=robots&showRobot=' + UtilService.textToSafeHtml(name); - }; - $scope.getTitle = function(entity) { if (!entity) { return ''; } diff --git a/static/js/directives/ui/header-bar.js b/static/js/directives/ui/header-bar.js index 98692ffed..1a8a60508 100644 --- a/static/js/directives/ui/header-bar.js +++ b/static/js/directives/ui/header-bar.js @@ -14,41 +14,36 @@ angular.module('quay').directive('headerBar', function () { }, controller: function($rootScope, $scope, $element, $location, $timeout, hotkeys, UserService, PlanService, ApiService, NotificationService, Config, CreateService, Features) { - $scope.isNewLayout = Config.isNewLayout(); - var hotkeysAdded = false; var userUpdated = function(cUser) { $scope.searchingAllowed = Features.ANONYMOUS_ACCESS || !cUser.anonymous; if (hotkeysAdded) { return; } + hotkeysAdded = true; - if ($scope.isNewLayout) { - hotkeysAdded = true; + // Register hotkeys. + if ($scope.searchingAllowed) { + hotkeys.add({ + combo: '/', + description: 'Show search', + callback: function(e) { + e.preventDefault(); + e.stopPropagation(); + $scope.toggleSearch(); + } + }); + } - // Register hotkeys. - if ($scope.searchingAllowed) { - hotkeys.add({ - combo: '/', - description: 'Show search', - callback: function(e) { - e.preventDefault(); - e.stopPropagation(); - $scope.toggleSearch(); - } - }); - } - - if (!cUser.anonymous) { - hotkeys.add({ - combo: 'alt+c', - description: 'Create new repository', - callback: function(e) { - e.preventDefault(); - e.stopPropagation(); - $location.url('/new'); - } - }); - } + if (!cUser.anonymous) { + hotkeys.add({ + combo: 'alt+c', + description: 'Create new repository', + callback: function(e) { + e.preventDefault(); + e.stopPropagation(); + $location.url('/new'); + } + }); } }; diff --git a/static/js/pages/build-package.js b/static/js/pages/build-package.js deleted file mode 100644 index 09f09a384..000000000 --- a/static/js/pages/build-package.js +++ /dev/null @@ -1,143 +0,0 @@ -(function() { - /** - * Page which displays a build package for a specific build. - */ - angular.module('quayPages').config(['pages', function(pages) { - pages.create('build-package', 'build-package.html', BuildPackageCtrl); - }]); - - function BuildPackageCtrl($scope, Restangular, ApiService, DataFileService, $routeParams, $rootScope, $location, $timeout) { - var namespace = $routeParams.namespace; - var name = $routeParams.name; - var buildid = $routeParams.buildid; - - var params = { - 'repository': namespace + '/' + name, - 'build_uuid': buildid - }; - - $scope.initializeTree = function() { - if ($scope.drawn) { - $scope.tree.notifyResized(); - return; - } - - $scope.drawn = true; - $timeout(function() { - $scope.tree.draw('file-tree-container'); - }, 10); - }; - - var determineDockerfilePath = function() { - var dockerfilePath = 'Dockerfile'; - var dockerfileFolder = ($scope.repobuild['subdirectory'] || ''); - if (dockerfileFolder[0] == '/') { - dockerfileFolder = dockerfileFolder.substr(1); - } - if (dockerfileFolder && dockerfileFolder[dockerfileFolder.length - 1] != '/') { - dockerfileFolder += '/'; - } - dockerfilePath = dockerfileFolder + 'Dockerfile'; - return dockerfilePath; - }; - - var processBuildPack = function(uint8array) { - var archiveread = function(files) { - var getpath = function(file) { - return file.path; - }; - - var findFile = function(path) { - for (var i = 0; i < files.length; ++i) { - var file = files[i]; - if (file.path == path) { - return file; - } - } - return null; - }; - - $scope.tree = new FileTree($.map(files, getpath)); - $($scope.tree).bind('fileClicked', function(e) { - var file = findFile(e.path); - if (file && file.canRead) { - saveAs(file.toBlob(), file.name); - } - }); - - var dockerfilePath = determineDockerfilePath(); - var dockerfile = findFile(dockerfilePath); - if (dockerfile && dockerfile.canRead) { - DataFileService.blobToString(dockerfile.toBlob(), function(result) { - $scope.$apply(function() { - $scope.dockerFilePath = dockerfilePath || 'Dockerfile'; - $scope.dockerFileContents = result; - }); - }); - } - - $scope.loaded = true; - }; - - var notarchive = function() { - DataFileService.arrayToString(uint8array, function(r) { - $scope.dockerFilePath = 'Dockerfile'; - $scope.dockerFileContents = r; - $scope.loaded = true; - }); - }; - - setTimeout(function() { - $scope.$apply(function() { - DataFileService.readDataArrayAsPossibleArchive(uint8array, archiveread, notarchive); - }); - }, 0); - }; - - var downloadBuildPack = function(url) { - $scope.downloadProgress = 0; - $scope.downloading = true; - startDownload(url); - }; - - var startDownload = function(url) { - var onprogress = function(p) { - $scope.downloadProgress = p * 100; - }; - - var onerror = function() { - $scope.downloading = false; - $scope.downloadError = true; - }; - - var onloaded = function(uint8array) { - $scope.downloading = false; - processBuildPack(uint8array); - }; - - DataFileService.downloadDataFileAsArrayBuffer($scope, url, onprogress, onerror, onloaded); - }; - - var getBuildInfo = function() { - $scope.repository_build = ApiService.getRepoBuildStatus(null, params, true).then(function(resp) { - if (!resp['is_writer']) { - $rootScope.title = 'Unknown build'; - $scope.accessDenied = true; - return; - } - - $rootScope.title = 'Repository Build Pack - ' + resp['display_name']; - $scope.repobuild = resp; - $scope.repo = { - 'namespace': namespace, - 'name': name - }; - - downloadBuildPack(resp['archive_url']); - return resp; - }); - }; - - getBuildInfo(); - } -})(); \ No newline at end of file diff --git a/static/js/pages/exp-new-layout.js b/static/js/pages/exp-new-layout.js deleted file mode 100644 index 60c32f21f..000000000 --- a/static/js/pages/exp-new-layout.js +++ /dev/null @@ -1,20 +0,0 @@ -(function() { - /** - * Experiment enable page: New layout - */ - angular.module('quayPages').config(['pages', function(pages) { - pages.create('exp-new-layout', 'exp-new-layout.html', ExpCtrl, { - 'newLayout': true - }); - }]); - - function ExpCtrl($scope, CookieService) { - $scope.isEnabled = CookieService.get('quay.exp-new-layout') == 'true'; - - $scope.setEnabled = function(value) { - $scope.isEnabled = value; - CookieService.putPermanent('quay.exp-new-layout', value.toString()); - document.location.reload(); - }; - } -}()); \ No newline at end of file diff --git a/static/js/pages/image-view.js b/static/js/pages/image-view.js index 347854d3d..69e20a069 100644 --- a/static/js/pages/image-view.js +++ b/static/js/pages/image-view.js @@ -7,10 +7,7 @@ 'newLayout': true, 'title': '{{ image.id }}', 'description': 'Image {{ image.id }}' - }, ['layout']) - - pages.create('image-view', 'old-image-view.html', OldImageViewCtrl, { - }, ['old-layout']); + }) }]); function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, ImageMetadataService) { diff --git a/static/js/pages/landing.js b/static/js/pages/landing.js index ddb012f69..beca5501e 100644 --- a/static/js/pages/landing.js +++ b/static/js/pages/landing.js @@ -18,7 +18,7 @@ }); UserService.updateUserIn($scope, function(user) { - if (!user.anonymous && Config.isNewLayout()) { + if (!user.anonymous) { $location.path('/repository'); return; } diff --git a/static/js/pages/manage-application.js b/static/js/pages/manage-application.js index 5d3a2b5ad..390baf64a 100644 --- a/static/js/pages/manage-application.js +++ b/static/js/pages/manage-application.js @@ -7,12 +7,7 @@ 'newLayout': true, 'title': 'Manage Application {{ application.name }}', 'description': 'Manage an OAuth application' - }, ['layout']); - - pages.create('manage-application', 'old-manage-application.html', ManageApplicationCtrl, { - 'title': 'Manage Application {{ application.name }}', - 'description': 'Manage an OAuth application' - }, ['old-layout']); + }); }]); function ManageApplicationCtrl($scope, $routeParams, $rootScope, $location, $timeout, OAuthService, ApiService, UserService, Config) { diff --git a/static/js/pages/new-organization.js b/static/js/pages/new-organization.js index 37613c1e7..f63de46c4 100644 --- a/static/js/pages/new-organization.js +++ b/static/js/pages/new-organization.js @@ -7,12 +7,7 @@ 'newLayout': true, 'title': 'New Organization', 'description': 'Create a new organization to manage teams and permissions' - }, ['layout']); - - pages.create('new-organization', 'old-new-organization.html', NewOrgCtrl, { - 'title': 'New Organization', - 'description': 'Create a new organization to manage teams and permissions' - }, ['old-layout']); + }); }]); function NewOrgCtrl($scope, $routeParams, $timeout, $location, UserService, PlanService, ApiService, CookieService, Features) { diff --git a/static/js/pages/new-repo.js b/static/js/pages/new-repo.js index fecbddb5c..a4145d735 100644 --- a/static/js/pages/new-repo.js +++ b/static/js/pages/new-repo.js @@ -7,12 +7,7 @@ 'newLayout': true, 'title': 'New Repository', 'description': 'Create a new Docker repository' - }, ['layout']) - - pages.create('new-repo', 'old-new-repo.html', NewRepoCtrl, { - 'title': 'New Repository', - 'description': 'Create a new Docker repository' - }, ['old-layout']); + }) }]); function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService, PlanService, TriggerService, Features) { diff --git a/static/js/pages/org-admin.js b/static/js/pages/org-admin.js deleted file mode 100644 index b655e825b..000000000 --- a/static/js/pages/org-admin.js +++ /dev/null @@ -1,110 +0,0 @@ -(function() { - /** - * DEPRECATED: Organization admin/settings page. - */ - angular.module('quayPages').config(['pages', function(pages) { - pages.create('org-admin', 'org-admin.html', OrgAdminCtrl); - }]); - - function OrgAdminCtrl($rootScope, $scope, $timeout, Restangular, $routeParams, UserService, PlanService, ApiService, Features, UIService) { - var orgname = $routeParams.orgname; - - // Load the list of plans. - if (Features.BILLING) { - 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]; - } - }); - } - - $scope.orgname = orgname; - $scope.membersLoading = true; - $scope.membersFound = null; - $scope.invoiceLoading = true; - $scope.logsShown = 0; - $scope.invoicesShown = 0; - $scope.applicationsShown = 0; - $scope.changingOrganization = false; - - $scope.loadLogs = function() { - $scope.logsShown++; - }; - - $scope.loadApplications = function() { - $scope.applicationsShown++; - }; - - $scope.loadInvoices = function() { - $scope.invoicesShown++; - }; - - $scope.planChanged = function(plan) { - $scope.hasPaidPlan = plan && plan.price > 0; - }; - - $scope.$watch('organizationEmail', function(e) { - UIService.hidePopover('#changeEmailForm'); - }); - - $scope.changeEmail = function() { - UIService.hidePopover('#changeEmailForm'); - - $scope.changingOrganization = true; - var params = { - 'orgname': orgname - }; - - var data = { - 'email': $scope.organizationEmail - }; - - ApiService.changeOrganizationDetails(data, params).then(function(org) { - $scope.changingOrganization = false; - $scope.changeEmailForm.$setPristine(); - $scope.organization = org; - }, function(result) { - $scope.changingOrganization = false; - UIService.showFormError('#changeEmailForm', result); - }); - }; - - $scope.loadMembers = function() { - if ($scope.membersFound) { return; } - $scope.membersLoading = true; - - var params = { - 'orgname': orgname - }; - - ApiService.getOrganizationMembers(null, params).then(function(resp) { - var membersArray = []; - for (var key in resp.members) { - if (resp.members.hasOwnProperty(key)) { - membersArray.push(resp.members[key]); - } - } - - $scope.membersFound = membersArray; - $scope.membersLoading = false; - }); - }; - - var loadOrganization = function() { - $scope.orgResource = ApiService.getOrganizationAsResource({'orgname': orgname}).get(function(org) { - if (org && org.is_admin) { - $scope.organization = org; - $scope.organizationEmail = org.email; - $rootScope.title = orgname + ' (Admin)'; - $rootScope.description = 'Administration page for organization ' + orgname; - } - }); - }; - - // Load the organization. - loadOrganization(); - } -})(); \ No newline at end of file diff --git a/static/js/pages/org-member-logs.js b/static/js/pages/org-member-logs.js deleted file mode 100644 index be131357f..000000000 --- a/static/js/pages/org-member-logs.js +++ /dev/null @@ -1,49 +0,0 @@ -(function() { - /** - * Page for displaying the logs of a member in an organization. - */ - angular.module('quayPages').config(['pages', function(pages) { - pages.create('org-member-logs', 'org-member-logs.html', OrgMemberLogsCtrl); - }]); - - function OrgMemberLogsCtrl($scope, $routeParams, $rootScope, $timeout, Restangular, ApiService) { - var orgname = $routeParams.orgname; - var membername = $routeParams.membername; - - $scope.orgname = orgname; - $scope.memberInfo = null; - $scope.ready = false; - - var loadOrganization = function() { - $scope.orgResource = ApiService.getOrganizationAsResource({'orgname': orgname}).get(function(org) { - $scope.organization = org; - return org; - }); - }; - - var loadMemberInfo = function() { - var params = { - 'orgname': orgname, - 'membername': membername - }; - - $scope.memberResource = ApiService.getOrganizationMemberAsResource(params).get(function(resp) { - $scope.memberInfo = resp.member; - - $rootScope.title = 'Logs for ' + $scope.memberInfo.name + ' (' + $scope.orgname + ')'; - $rootScope.description = 'Shows all the actions of ' + $scope.memberInfo.username + - ' under organization ' + $scope.orgname; - - $timeout(function() { - $scope.ready = true; - }); - - return resp.member; - }); - }; - - // Load the org info and the member info. - loadOrganization(); - loadMemberInfo(); - } -})(); diff --git a/static/js/pages/org-view.js b/static/js/pages/org-view.js index 854304b57..04ae22685 100644 --- a/static/js/pages/org-view.js +++ b/static/js/pages/org-view.js @@ -7,10 +7,7 @@ 'newLayout': true, 'title': 'Organization {{ organization.name }}', 'description': 'Organization {{ organization.name }}' - }, ['layout']) - - pages.create('org-view', 'old-org-view.html', OldOrgViewCtrl, { - }, ['old-layout']); + }) }]); function OrgViewCtrl($scope, $routeParams, $timeout, ApiService, UIService, AvatarService) { diff --git a/static/js/pages/repo-admin.js b/static/js/pages/repo-admin.js deleted file mode 100644 index 22270bf95..000000000 --- a/static/js/pages/repo-admin.js +++ /dev/null @@ -1,399 +0,0 @@ -(function() { - /** - * DEPRECATED: Repository admin/settings page. - */ - angular.module('quayPages').config(['pages', function(pages) { - pages.create('repo-admin', 'repo-admin.html', RepoAdminCtrl); - }]); - - function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerService, $routeParams, - $rootScope, $location, UserService, Config, Features, ExternalNotificationData, UtilService) { - - var namespace = $routeParams.namespace; - var name = $routeParams.name; - - $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; - - $scope.getBadgeFormat = function(format, repo) { - if (!repo) { return; } - - var imageUrl = Config.getUrl('/repository/' + namespace + '/' + name + '/status'); - if (!$scope.repo.is_public) { - imageUrl += '?token=' + $scope.repo.status_token; - } - - var linkUrl = Config.getUrl('/repository/' + namespace + '/' + name); - - switch (format) { - case 'svg': - return imageUrl; - - case 'md': - return '[![Docker Repository on ' + Config.REGISTRY_TITLE_SHORT + '](' + imageUrl + - ' "Docker Repository on ' + Config.REGISTRY_TITLE_SHORT + '")](' + linkUrl + ')'; - - case 'asciidoc': - return 'image:' + imageUrl + '["Docker Repository on ' + Config.REGISTRY_TITLE_SHORT + '", link="' + linkUrl + '"]'; - } - - return ''; - }; - - $scope.buildEntityForPermission = function(name, permission, kind) { - var key = name + ':' + kind; - if ($scope.permissionCache[key]) { - return $scope.permissionCache[key]; - } - - return $scope.permissionCache[key] = { - 'kind': kind, - 'name': name, - 'is_robot': permission.is_robot, - 'is_org_member': permission.is_org_member - }; - }; - - $scope.loadLogs = function() { - $scope.logsShown++; - }; - - $scope.grantRole = function() { - $('#confirmaddoutsideModal').modal('hide'); - var entity = $scope.currentAddEntity; - $scope.addRole(entity.name, 'read', entity.kind, entity.is_org_member) - $scope.currentAddEntity = null; - }; - - $scope.addNewPermission = function(entity) { - // Don't allow duplicates. - if (!entity || !entity.kind || $scope.permissions[entity.kind][entity.name]) { return; } - - if (entity.is_org_member === false) { - $scope.currentAddEntity = entity; - $('#confirmaddoutsideModal').modal('show'); - return; - } - - $scope.addRole(entity.name, 'read', entity.kind); - }; - - $scope.deleteRole = function(entityName, kind) { - var errorHandler = ApiService.errorDisplay('Cannot change permission', function(resp) { - if (resp.status == 409) { - return 'Cannot change permission as you do not have the authority'; - } - }); - - var permissionDelete = Restangular.one(UtilService.getRestUrl('repository', namespace, name, 'permissions', kind, entityName)); - permissionDelete.customDELETE().then(function() { - delete $scope.permissions[kind][entityName]; - }, errorHandler); - }; - - $scope.addRole = function(entityName, role, kind) { - var permission = { - 'role': role, - }; - - var permissionPost = Restangular.one(UtilService.getRestUrl('repository', namespace, name, 'permissions', kind, entityName)); - permissionPost.customPUT(permission).then(function(result) { - $scope.permissions[kind][entityName] = result; - }, ApiService.errorDisplay('Cannot change permission')); - }; - - $scope.setRole = function(role, entityName, kind) { - var permission = $scope.permissions[kind][entityName]; - var currentRole = permission.role; - permission.role = role; - - var permissionPut = Restangular.one(UtilService.getRestUrl('repository', namespace, name, 'permissions', kind, entityName)); - permissionPut.customPUT(permission).then(function() {}, function(resp) { - $scope.permissions[kind][entityName] = {'role': currentRole}; - $scope.changePermError = null; - if (resp.status == 409 || resp.data) { - $scope.changePermError = resp.data || ''; - $('#channgechangepermModal').modal({}); - } else { - $('#cannotchangeModal').modal({}); - } - }); - }; - - $scope.newTokenName = null; - - $scope.createToken = function() { - var data = { - 'friendlyName': $scope.newTokenName - }; - - var params = {'repository': namespace + '/' + name}; - ApiService.createToken(data, params).then(function(newToken) { - $scope.newTokenName = null; - $scope.createTokenForm.$setPristine(); - $scope.tokens[newToken.code] = newToken; - }); - }; - - $scope.deleteToken = function(tokenCode) { - var params = { - 'repository': namespace + '/' + name, - 'code': tokenCode - }; - - ApiService.deleteToken(null, params).then(function() { - delete $scope.tokens[tokenCode]; - }); - }; - - $scope.changeTokenAccess = function(tokenCode, newAccess) { - var role = { - 'role': newAccess - }; - - var params = { - 'repository': namespace + '/' + name, - 'code': tokenCode - }; - - ApiService.changeToken(role, params).then(function(updated) { - $scope.tokens[updated.code] = updated; - }); - }; - - $scope.shownTokenCounter = 0; - - $scope.showToken = function(tokenCode) { - $scope.shownToken = $scope.tokens[tokenCode]; - $scope.shownTokenCounter++; - }; - - $scope.askChangeAccess = function(newAccess) { - $('#make' + newAccess + 'Modal').modal({}); - }; - - $scope.changeAccess = function(newAccess) { - $('#make' + newAccess + 'Modal').modal('hide'); - - var visibility = { - 'visibility': newAccess - }; - - var params = { - 'repository': namespace + '/' + name - }; - - ApiService.changeRepoVisibility(visibility, params).then(function() { - $scope.repo.is_public = newAccess == 'public'; - }, function() { - $('#cannotchangeModal').modal({}); - }); - }; - - $scope.askDelete = function() { - $('#confirmdeleteModal').modal({}); - }; - - $scope.deleteRepo = function() { - $('#confirmdeleteModal').modal('hide'); - - var params = { - 'repository': namespace + '/' + name - }; - - $scope.deleting = true; - ApiService.deleteRepository(null, params).then(function() { - $scope.repo = null; - - setTimeout(function() { - document.location = '/repository/'; - }, 1000); - }, function() { - $scope.deleting = true; - $('#cannotchangeModal').modal({}); - }); - }; - - $scope.showNewNotificationCounter = 0; - - $scope.showNewNotificationDialog = function() { - $scope.showNewNotificationCounter++; - }; - - $scope.handleNotificationCreated = function(notification) { - $scope.notifications.push(notification); - }; - - $scope.handleNotificationDeleted = function(notification) { - var index = $.inArray(notification, $scope.notifications); - if (index < 0) { return; } - $scope.notifications.splice(index, 1); - }; - - $scope.loadNotifications = function() { - var params = { - 'repository': namespace + '/' + name - }; - - $scope.notificationsResource = ApiService.listRepoNotificationsAsResource(params).get( - function(resp) { - $scope.notifications = resp.notifications; - return $scope.notifications; - }); - }; - - $scope.showBuild = function(buildInfo) { - $location.path('/repository/' + namespace + '/' + name + '/build'); - $location.search('current', buildInfo.id); - }; - - $scope.loadTriggerBuildHistory = function(trigger) { - trigger.$loadingHistory = true; - - var params = { - 'repository': namespace + '/' + name, - 'trigger_uuid': trigger.id, - 'limit': 3 - }; - - ApiService.listTriggerRecentBuilds(null, params).then(function(resp) { - trigger.$builds = resp['builds']; - trigger.$loadingHistory = false; - }); - }; - - $scope.loadTriggers = function() { - var params = { - 'repository': namespace + '/' + name - }; - - $scope.triggersResource = ApiService.listBuildTriggersAsResource(params).get(function(resp) { - $scope.triggers = resp.triggers; - - // Check to see if we need to setup any trigger. - var newTriggerId = $routeParams.new_trigger; - if (newTriggerId) { - for (var i = 0; i < $scope.triggers.length; ++i) { - var trigger = $scope.triggers[i]; - if (trigger['id'] == newTriggerId && !trigger['is_active']) { - $scope.setupTrigger(trigger); - break; - } - } - } - - return $scope.triggers; - }); - }; - - $scope.setupTrigger = function(trigger) { - $scope.currentSetupTrigger = trigger; - $scope.showTriggerSetupCounter++; - }; - - $scope.cancelSetupTrigger = function(trigger) { - if ($scope.currentSetupTrigger != trigger) { return; } - - $scope.currentSetupTrigger = null; - $scope.deleteTrigger(trigger); - }; - - $scope.showManualBuildDialog = 0; - - $scope.startTrigger = function(trigger, opt_custom) { - var parameters = TriggerService.getRunParameters(trigger.service); - if (parameters.length && !opt_custom) { - $scope.currentStartTrigger = trigger; - $scope.showManualBuildDialog++; - return; - } - - var params = { - 'repository': namespace + '/' + name, - 'trigger_uuid': trigger.id - }; - - ApiService.manuallyStartBuildTrigger(opt_custom || {}, params).then(function(resp) { - var url = '/repository/' + namespace + '/' + name + '/build?current=' + resp['id']; - document.location = url; - }, ApiService.errorDisplay('Could not start build')); - }; - - $scope.deleteTrigger = function(trigger) { - if (!trigger) { return; } - - var params = { - 'repository': namespace + '/' + name, - 'trigger_uuid': trigger.id - }; - - ApiService.deleteBuildTrigger(null, params).then(function(resp) { - $scope.triggers.splice($scope.triggers.indexOf(trigger), 1); - }); - }; - - var fetchTokens = function() { - var params = { - 'repository': namespace + '/' + name - }; - - ApiService.listRepoTokens(null, params).then(function(resp) { - $scope.tokens = resp.tokens; - }, function() { - $scope.tokens = null; - }); - }; - - var fetchPermissions = function(kind) { - var permissionsFetch = Restangular.one('repository/' + namespace + '/' + name + '/permissions/' + kind + '/'); - permissionsFetch.get().then(function(resp) { - $scope.permissions[kind] = resp.permissions; - $scope.permissions['loading']--; - }, function() { - $scope.permissions[kind] = null; - }); - }; - - var fetchRepository = function() { - var params = { - 'repository': namespace + '/' + name - }; - - $scope.repository = ApiService.getRepoAsResource(params).get(function(repo) { - if (!repo.can_admin) { - $rootScope.title = 'Forbidden'; - $scope.accessDenied = true; - return; - } - - $scope.repo = repo; - $rootScope.title = 'Settings - ' + namespace + '/' + name; - $rootScope.description = 'Administrator settings for ' + namespace + '/' + name + - ': Permissions, notifications and other settings'; - - // Fetch all the permissions and token info for the repository. - fetchPermissions('user'); - fetchPermissions('team'); - fetchTokens(); - - $('.info-icon').popover({ - 'trigger': 'hover', - 'html': true - }); - - return $scope.repo; - }); - }; - - // Fetch the repository. - fetchRepository(); - } -})(); \ No newline at end of file diff --git a/static/js/pages/repo-build.js b/static/js/pages/repo-build.js deleted file mode 100644 index fafc19115..000000000 --- a/static/js/pages/repo-build.js +++ /dev/null @@ -1,294 +0,0 @@ -(function() { - /** - * Repository Build view page. Displays the status of a repository build. - */ - angular.module('quayPages').config(['pages', function(pages) { - pages.create('repo-build', 'repo-build.html', RepoBuildCtrl); - }]); - - function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope, $location, $interval, $sanitize, - ansi2html, AngularViewArray, AngularPollChannel) { - var namespace = $routeParams.namespace; - var name = $routeParams.name; - - // Watch for changes to the current parameter. - $scope.$on('$routeUpdate', function(){ - if ($location.search().current) { - $scope.setCurrentBuild($location.search().current, false); - } - }); - - $scope.builds = null; - $scope.pollChannel = null; - $scope.buildDialogShowCounter = 0; - - $scope.showNewBuildDialog = function() { - $scope.buildDialogShowCounter++; - }; - - $scope.handleBuildStarted = function(newBuild) { - if (!$scope.builds) { return; } - - $scope.builds.unshift(newBuild); - $scope.setCurrentBuild(newBuild['id'], true); - }; - - $scope.adjustLogHeight = function() { - var triggerOffset = 0; - if ($scope.currentBuild && $scope.currentBuild.trigger) { - triggerOffset = 85; - } - $('.build-logs').height($(window).height() - 415 - triggerOffset); - }; - - $scope.askRestartBuild = function(build) { - $('#confirmRestartBuildModal').modal({}); - }; - - $scope.askCancelBuild = function(build) { - bootbox.confirm('Are you sure you want to cancel this build?', function(r) { - if (r) { - var params = { - 'repository': namespace + '/' + name, - 'build_uuid': build.id - }; - - ApiService.cancelRepoBuild(null, params).then(function() { - if (!$scope.builds) { return; } - $scope.builds.splice($.inArray(build, $scope.builds), 1); - - if ($scope.builds.length) { - $scope.currentBuild = $scope.builds[0]; - } else { - $scope.currentBuild = null; - } - }, ApiService.errorDisplay('Cannot cancel build')); - } - }); - }; - - $scope.restartBuild = function(build) { - $('#confirmRestartBuildModal').modal('hide'); - - var subdirectory = build['subdirectory'] || ''; - - var data = { - 'file_id': build['resource_key'], - 'subdirectory': subdirectory, - 'docker_tags': build['tags'] - }; - - if (build['pull_robot']) { - data['pull_robot'] = build['pull_robot']['name']; - } - - var params = { - 'repository': namespace + '/' + name - }; - - ApiService.requestRepoBuild(data, params).then(function(newBuild) { - if (!$scope.builds) { return; } - - $scope.builds.unshift(newBuild); - $scope.setCurrentBuild(newBuild['id'], true); - }); - }; - - $scope.hasLogs = function(container) { - return container.logs.hasEntries; - }; - - $scope.setCurrentBuild = function(buildId, opt_updateURL) { - if (!$scope.builds) { return; } - - // Find the build. - for (var i = 0; i < $scope.builds.length; ++i) { - if ($scope.builds[i].id == buildId) { - $scope.setCurrentBuildInternal(i, $scope.builds[i], opt_updateURL); - return; - } - } - }; - - $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); - var teardown = filter.getTeardownHtml(); - return setup + stream + teardown; - }; - - $scope.setCurrentBuildInternal = function(index, build, opt_updateURL) { - if (build == $scope.currentBuild) { return; } - - $scope.logEntries = null; - $scope.logStartIndex = null; - $scope.currentParentEntry = null; - - $scope.currentBuild = build; - - if (opt_updateURL) { - if (build) { - $location.search('current', build.id); - } else { - $location.search('current', null); - } - } - - // Timeout needed to ensure the log element has been created - // before its height is adjusted. - setTimeout(function() { - $scope.adjustLogHeight(); - }, 1); - - // Stop any existing polling. - if ($scope.pollChannel) { - $scope.pollChannel.stop(); - } - - // Create a new channel for polling the build status and logs. - var conductStatusAndLogRequest = function(callback) { - getBuildStatusAndLogs(build, callback); - }; - - $scope.pollChannel = AngularPollChannel.create($scope, conductStatusAndLogRequest, 5 * 1000 /* 5s */); - $scope.pollChannel.start(); - }; - - var processLogs = function(logs, startIndex, endIndex) { - if (!$scope.logEntries) { $scope.logEntries = []; } - - // If the start index given is less than that requested, then we've received a larger - // pool of logs, and we need to only consider the new ones. - if (startIndex < $scope.logStartIndex) { - logs = logs.slice($scope.logStartIndex - startIndex); - } - - for (var i = 0; i < logs.length; ++i) { - var entry = logs[i]; - var type = entry['type'] || 'entry'; - if (type == 'command' || type == 'phase' || type == 'error') { - entry['logs'] = AngularViewArray.create(); - entry['index'] = $scope.logStartIndex + i; - - $scope.logEntries.push(entry); - $scope.currentParentEntry = entry; - } else if ($scope.currentParentEntry) { - $scope.currentParentEntry['logs'].push(entry); - } - } - - return endIndex; - }; - - var handleLogsData = function(logsData, callback) { - // Process the logs we've received. - $scope.logStartIndex = processLogs(logsData['logs'], logsData['start'], logsData['total']); - - // If the build status is an error, open the last two log entries. - var currentBuild = $scope.currentBuild; - if (currentBuild['phase'] == 'error' && $scope.logEntries.length > 1) { - var openLogEntries = function(entry) { - if (entry.logs) { - entry.logs.setVisible(true); - } - }; - - openLogEntries($scope.logEntries[$scope.logEntries.length - 2]); - openLogEntries($scope.logEntries[$scope.logEntries.length - 1]); - } - - // If the build phase is an error or a complete, then we mark the channel - // as closed. - callback(currentBuild['phase'] != 'error' && currentBuild['phase'] != 'complete'); - }; - - var getBuildStatusAndLogs = function(build, callback) { - var params = { - 'repository': namespace + '/' + name, - 'build_uuid': build.id - }; - - ApiService.getRepoBuildStatus(null, params, true).then(function(resp) { - if (build != $scope.currentBuild) { callback(false); return; } - - // Note: We use extend here rather than replacing as Angular is depending on the - // root build object to remain the same object. - 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); - } - - // Load the updated logs for the build. - var options = { - 'start': $scope.logStartIndex - }; - - ApiService.getRepoBuildLogsAsResource(params, true).withOptions(options).get(function(resp) { - if (build != $scope.currentBuild) { callback(false); return; } - - // If we get a logs url back, then we need to make another XHR request to retrieve the - // data. - if (resp['logs_url']) { - $.ajax({ - url: resp['logs_url'], - }).done(function(r) { - handleLogsData(r, callback); - }); - return; - } - - handleLogsData(resp, callback); - }, function() { - callback(false); - }); - }, function() { - callback(false); - }); - }; - - var fetchRepository = function() { - var params = {'repository': namespace + '/' + name}; - $rootScope.title = 'Loading Repository...'; - $scope.repository = ApiService.getRepoAsResource(params).get(function(repo) { - if (!repo.can_write) { - $rootScope.title = 'Unknown builds'; - $scope.accessDenied = true; - return; - } - - $rootScope.title = 'Repository Builds'; - $scope.repo = repo; - - getBuildInfo(); - }); - }; - - var getBuildInfo = function(repo) { - var params = { - 'repository': namespace + '/' + name - }; - - ApiService.getRepoBuilds(null, params).then(function(resp) { - $scope.builds = resp.builds; - - if ($location.search().current) { - $scope.setCurrentBuild($location.search().current, false); - } else if ($scope.builds.length > 0) { - $scope.setCurrentBuild($scope.builds[0].id, true); - } - }); - }; - - fetchRepository(); - } -})(); \ No newline at end of file diff --git a/static/js/pages/repo-list.js b/static/js/pages/repo-list.js index 9ea73e774..b81c7946d 100644 --- a/static/js/pages/repo-list.js +++ b/static/js/pages/repo-list.js @@ -7,12 +7,7 @@ 'newLayout': true, 'title': 'Repositories', 'description': 'View and manage Docker repositories' - }, ['layout']) - - pages.create('repo-list', 'old-repo-list.html', OldRepoListCtrl, { - 'title': 'Repositories', - 'description': 'View and manage Docker repositories' - }, ['old-layout']); + }) }]); diff --git a/static/js/pages/repo-view.js b/static/js/pages/repo-view.js index aff4f0997..f5324ed5b 100644 --- a/static/js/pages/repo-view.js +++ b/static/js/pages/repo-view.js @@ -7,10 +7,7 @@ 'newLayout': true, 'title': '{{ namespace }}/{{ name }}', 'description': 'Repository {{ namespace }}/{{ name }}' - }, ['layout']) - - pages.create('repo-view', 'old-repo-view.html', OldRepoViewCtrl, { - }, ['old-layout']); + }) }]); function RepoViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel) { diff --git a/static/js/pages/setup.js b/static/js/pages/setup.js index 21a036350..5ed894e76 100644 --- a/static/js/pages/setup.js +++ b/static/js/pages/setup.js @@ -8,10 +8,7 @@ { 'newLayout': true, 'title': 'Enterprise Registry Setup' - }, - - // Note: This page has already been converted, but also needs to be available in the old layout - ['layout', 'old-layout']) + }) }]); function SetupCtrl($scope, $timeout, ApiService, Features, UserService, ContainerService, CoreDialog) { diff --git a/static/js/pages/superuser.js b/static/js/pages/superuser.js index 9717781e9..2cd4b83f2 100644 --- a/static/js/pages/superuser.js +++ b/static/js/pages/superuser.js @@ -7,10 +7,7 @@ { 'newLayout': true, 'title': 'Enterprise Registry Management' - }, - - // Note: This page has already been converted, but also needs to be available in the old layout - ['layout', 'old-layout']) + }) }]); function SuperuserCtrl($scope, $timeout, ApiService, Features, UserService, ContainerService, AngularPollChannel, CoreDialog) { diff --git a/static/js/pages/team-view.js b/static/js/pages/team-view.js index e8f184c96..92a308ecf 100644 --- a/static/js/pages/team-view.js +++ b/static/js/pages/team-view.js @@ -7,10 +7,7 @@ 'newLayout': true, 'title': 'Team {{ teamname }}', 'description': 'Team {{ teamname }}' - }, ['layout']) - - pages.create('team-view', 'old-team-view.html', TeamViewCtrl, { - }, ['old-layout']); + }) }]); function TeamViewCtrl($rootScope, $scope, $timeout, Features, Restangular, ApiService, $routeParams) { diff --git a/static/js/pages/tutorial.js b/static/js/pages/tutorial.js index 6c835e057..aaf8a9be5 100644 --- a/static/js/pages/tutorial.js +++ b/static/js/pages/tutorial.js @@ -7,10 +7,7 @@ 'newLayout': true, 'title': 'Tutorial', 'description': 'Basic tutorial on using Quay.io' - }, ['layout']) - - pages.create('tutorial', 'old-tutorial.html', TutorialCtrl, { - }, ['old-layout']); + }) }]); function TutorialCtrl($scope, AngularTour, AngularTourSignals, UserService, Config, Features) { diff --git a/static/js/pages/user-admin.js b/static/js/pages/user-admin.js deleted file mode 100644 index cb2fe4bcd..000000000 --- a/static/js/pages/user-admin.js +++ /dev/null @@ -1,222 +0,0 @@ -(function() { - /** - * DEPRECATED: User admin/settings page. - */ - angular.module('quayPages').config(['pages', function(pages) { - pages.create('user-admin', 'user-admin.html', UserAdminCtrl, { - 'title': 'User Settings' - }); - }]); - - function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, UserService, CookieService, KeyService, - $routeParams, $http, UIService, Features, Config) { - $scope.Features = Features; - - if ($routeParams['migrate']) { - $('#migrateTab').tab('show') - } - - UserService.updateUserIn($scope, function(user) { - $scope.cuser = jQuery.extend({}, user); - - if ($scope.cuser.logins) { - for (var i = 0; i < $scope.cuser.logins.length; i++) { - var login = $scope.cuser.logins[i]; - login.metadata = login.metadata || {}; - - if (login.service == 'github') { - $scope.hasGithubLogin = true; - $scope.githubLogin = login.metadata['service_username']; - $scope.githubEndpoint = KeyService['githubEndpoint']; - } - - if (login.service == 'google') { - $scope.hasGoogleLogin = true; - $scope.googleLogin = login.metadata['service_username']; - } - } - } - }); - - $scope.readyForPlan = function() { - // Show the subscribe dialog if a plan was requested. - return $routeParams['plan']; - }; - - $scope.loading = true; - $scope.updatingUser = false; - $scope.changePasswordSuccess = false; - $scope.changeEmailSent = false; - $scope.convertStep = 0; - $scope.org = {}; - $scope.githubRedirectUri = KeyService.githubRedirectUri; - $scope.authorizedApps = null; - - $scope.logsShown = 0; - $scope.invoicesShown = 0; - - $scope.USER_PATTERN = USER_PATTERN; - - $scope.loadAuthedApps = function() { - if ($scope.authorizedApps) { return; } - - ApiService.listUserAuthorizations().then(function(resp) { - $scope.authorizedApps = resp['authorizations']; - }); - }; - - $scope.deleteAccess = function(accessTokenInfo) { - var params = { - 'access_token_uuid': accessTokenInfo['uuid'] - }; - - ApiService.deleteUserAuthorization(null, params).then(function(resp) { - $scope.authorizedApps.splice($scope.authorizedApps.indexOf(accessTokenInfo), 1); - }, ApiService.errorDisplay('Could not revoke authorization')); - }; - - $scope.loadLogs = function() { - if (!$scope.hasPaidBusinessPlan) { return; } - $scope.logsShown++; - }; - - $scope.loadInvoices = function() { - $scope.invoicesShown++; - }; - - $scope.planChanged = function(plan) { - $scope.hasPaidPlan = plan && plan.price > 0; - $scope.hasPaidBusinessPlan = PlanService.isOrgCompatible(plan) && plan.price > 0; - }; - - $scope.showConvertForm = function() { - if (Features.BILLING) { - PlanService.getMatchingBusinessPlan(function(plan) { - $scope.org.plan = plan; - }); - - PlanService.getPlans(function(plans) { - $scope.orgPlans = plans; - }); - } - - $scope.convertStep = 1; - }; - - $scope.convertToOrg = function() { - $('#reallyconvertModal').modal({}); - }; - - $scope.reallyConvert = function() { - if (Config.AUTHENTICATION_TYPE != 'Database') { return; } - - $scope.loading = true; - - var data = { - 'adminUser': $scope.org.adminUser, - 'adminPassword': $scope.org.adminPassword, - 'plan': $scope.org.plan ? $scope.org.plan.stripeId : '' - }; - - ApiService.convertUserToOrganization(data).then(function(resp) { - CookieService.putPermanent('quay.namespace', $scope.cuser.username); - UserService.load(); - $location.path('/'); - }, function(resp) { - $scope.loading = false; - if (resp.data.reason == 'invaliduser') { - $('#invalidadminModal').modal({}); - } else { - $('#cannotconvertModal').modal({}); - } - }); - }; - - $scope.changeUsername = function() { - UserService.load(); - - $scope.updatingUser = true; - - ApiService.changeUserDetails($scope.cuser).then(function() { - $scope.updatingUser = false; - - // Reset the form. - delete $scope.cuser['username']; - - $scope.changeUsernameForm.$setPristine(); - }, function(result) { - $scope.updatingUser = false; - UIService.showFormError('#changeUsernameForm', result); - }); - }; - - $scope.changeEmail = function() { - UIService.hidePopover('#changeEmailForm'); - - $scope.updatingUser = true; - $scope.changeEmailSent = false; - - ApiService.changeUserDetails($scope.cuser).then(function() { - $scope.updatingUser = false; - $scope.changeEmailSent = true; - $scope.sentEmail = $scope.cuser.email; - delete $scope.cuser['email']; - }, function(result) { - $scope.updatingUser = false; - UIService.showFormError('#changeEmailForm', result); - }); - }; - - $scope.changePassword = function() { - UIService.hidePopover('#changePasswordForm'); - - $scope.updatingUser = true; - $scope.changePasswordSuccess = false; - - ApiService.changeUserDetails($scope.cuser).then(function(resp) { - - $scope.updatingUser = false; - $scope.changePasswordSuccess = true; - - // Reset the form - delete $scope.cuser['password'] - delete $scope.cuser['repeatPassword'] - - $scope.changePasswordForm.$setPristine(); - - // Reload the user. - UserService.load(); - }, function(result) { - $scope.updatingUser = false; - UIService.showFormError('#changePasswordForm', result); - }); - }; - - $scope.generateClientToken = function() { - var generateToken = function(password) { - var data = { - 'password': password - }; - - ApiService.generateUserClientKey(data).then(function(resp) { - $scope.generatedClientToken = resp['key']; - $('#clientTokenModal').modal({}); - }, ApiService.errorDisplay('Could not generate token')); - }; - - UIService.showPasswordDialog('Enter your password to generated an encrypted version:', generateToken); - }; - - $scope.detachExternalLogin = function(kind) { - var params = { - 'servicename': kind - }; - - ApiService.detachExternalLogin(null, params).then(function() { - $scope.hasGithubLogin = false; - $scope.hasGoogleLogin = false; - UserService.load(); - }, ApiService.errorDisplay('Count not detach service')); - }; - } -})(); \ No newline at end of file diff --git a/static/js/pages/user-view.js b/static/js/pages/user-view.js index 7d2a0035e..f86e505ca 100644 --- a/static/js/pages/user-view.js +++ b/static/js/pages/user-view.js @@ -7,7 +7,7 @@ 'newLayout': true, 'title': 'User {{ user.username }}', 'description': 'User {{ user.username }}' - }, ['layout']) + }) }]); function UserViewCtrl($scope, $routeParams, $timeout, ApiService, UserService, UIService, AvatarService) { diff --git a/static/js/services/avatar-service.js b/static/js/services/avatar-service.js index 8aa3d436a..bfbccb8b7 100644 --- a/static/js/services/avatar-service.js +++ b/static/js/services/avatar-service.js @@ -14,9 +14,7 @@ angular.module('quay').factory('AvatarService', ['Config', '$sanitize', 'md5', break; case 'gravatar': - // TODO(jschorr): Remove once the new layout is in place everywhere. - var default_kind = Config.isNewLayout() ? '404' : 'identicon'; - return '//www.gravatar.com/avatar/' + hash + '?d=' + default_kind + '&size=' + size; + return '//www.gravatar.com/avatar/' + hash + '?d=404&size=' + size; break; } }; diff --git a/static/js/services/features-config.js b/static/js/services/features-config.js index ec7800714..2632aa0d3 100644 --- a/static/js/services/features-config.js +++ b/static/js/services/features-config.js @@ -71,10 +71,5 @@ angular.module('quay').factory('Config', [function() { return value; }; - config.isNewLayout = function() { - // TODO(jschorr): Remove in the cleanup CL. - return true; - }; - return config; }]); \ No newline at end of file diff --git a/static/js/services/notification-service.js b/static/js/services/notification-service.js index 47eddfd2b..7c28d9efd 100644 --- a/static/js/services/notification-service.js +++ b/static/js/services/notification-service.js @@ -56,20 +56,10 @@ function($rootScope, $interval, UserService, ApiService, StringBuilderService, P '

Please upgrade your plan to avoid disruptions in service.', 'page': function(metadata) { var organization = UserService.getOrganization(metadata['namespace']); - - // TODO(jschorr): Remove once the new layout is in prod. - if (Config.isNewLayout()) { - if (organization) { - return '/organization/' + metadata['namespace'] + '?tab=billing'; - } else { - return '/user/' + metadata['namespace'] + '?tab=billing'; - } - } - if (organization) { - return '/organization/' + metadata['namespace'] + '/admin'; + return '/organization/' + metadata['namespace'] + '?tab=billing'; } else { - return '/user'; + return '/user/' + metadata['namespace'] + '?tab=billing'; } } }, diff --git a/static/partials/build-package.html b/static/partials/build-package.html deleted file mode 100644 index 7ed70e98e..000000000 --- a/static/partials/build-package.html +++ /dev/null @@ -1,53 +0,0 @@ -
-
- You do not have permission to view this page -
-
-
- -

- - -

-
- -
- Downloading build pack: -
-
-
-
-
- -
- Error: Could not download the build pack -
- - -
- Reading... -
- -
- - -
- -
-
{{ dockerFilePath }}
-
-
- No Dockerfile found in the build pack -
-
- - -
-
-
-
-
-
diff --git a/static/partials/exp-new-layout.html b/static/partials/exp-new-layout.html deleted file mode 100644 index e9b7edaa0..000000000 --- a/static/partials/exp-new-layout.html +++ /dev/null @@ -1,10 +0,0 @@ -
-
- - Experiment: New Layout -
-
- - -
-
diff --git a/static/partials/old-image-view.html b/static/partials/old-image-view.html deleted file mode 100644 index a4b8eaabb..000000000 --- a/static/partials/old-image-view.html +++ /dev/null @@ -1,82 +0,0 @@ -
-
-
- -

- - -

-
- - -
- -
- - -
-
Full Image ID
-
-
-
-
Created
-
-
Compressed Image Size
-
{{ image.value.size | bytes }} -
- -
Command
-
-
{{ getFormattedCommand(image.value) }}
-
-
- - -
- File Changes: -
-
- -
- - -
- -
-
-
-
- Showing {{(combinedChanges | filter:search | limitTo:50).length}} of {{(combinedChanges | filter:search).length}} results -
-
- -
-
-
-
-
- No matching changes -
-
- - - - {{folder}}/{{getFilename(change.file)}} - -
-
-
-
- - -
-
-
-
-
-
diff --git a/static/partials/old-manage-application.html b/static/partials/old-manage-application.html deleted file mode 100644 index d4101c5a1..000000000 --- a/static/partials/old-manage-application.html +++ /dev/null @@ -1,191 +0,0 @@ -
-
- -
-
- -
-
-
- -

{{ application.name || '(Untitled)' }}

-

- - {{ organization.name }} -

-
-
-
- -
-
- Warning: There is no OAuth Redirect setup for this application. Please enter it in the Settings tab. -
-
- - -
- - - - -
-
- -
-
-
- - -
The name of the application that is displayed to users
-
- -
- - -
The URL to which the application will link in the authorization view
-
- -
- - -
The user friendly description of the application
-
- -
- - -
An e-mail address representing the Avatar for the application. See above for the icon.
-
- -
- - -
Allowed prefix for the application's OAuth redirection/callback URLs
-
- -
- - -
-
-
- - -
-
-
-
-
Deleting an application cannot be undone. Any existing users of your application will break!. Here be dragons!
- -
-
-
-
- - -
-
- Click the button below to generate a new OAuth 2 Access Token. -
- -
- Note: The generated token will act on behalf of user - - {{ user.username }} -
- - - - - -
- - - Generate Access Token - -
- - -
- - - - - - - - - - - - - - - -
Client ID: -
-
Client Secret: - {{ application.client_secret }} - - -
-
-
- -
-
-
-
- - - - - - diff --git a/static/partials/old-new-organization.html b/static/partials/old-new-organization.html deleted file mode 100644 index 0e94be5ec..000000000 --- a/static/partials/old-new-organization.html +++ /dev/null @@ -1,94 +0,0 @@ -
-
-
- -
- -
-
-

Create Organization

- -
-
    -
  • - - Login with an account -
  • -
  • - - Setup your organization -
  • -
  • - - Create teams -
  • -
-
- -
-
- - -
-
- In order to create a new organization, you must first be signed in as the - user that will become an admin for the organization. -
-
-
-
-
-
-
- - -
-
-
-

Setup the new organization

- -
-
- - - This will also be the namespace for your repositories. Must be alphanumeric and all lowercase. -
- -
- - - This address must be different from your account's email. -
- - -
- Choose your organization's plan -
-
- -
- -
-
-
-
-
- - -
-
-
-

Organization Created

-

Manage Teams Now

-
-
-
-
diff --git a/static/partials/old-new-repo.html b/static/partials/old-new-repo.html deleted file mode 100644 index 291e34752..000000000 --- a/static/partials/old-new-repo.html +++ /dev/null @@ -1,237 +0,0 @@ -
-
-
-
-
- -
-
-
- -
-
-
- -
-
- - -
- -
-
-
- - - / - - - - - Repository names must match [a-z0-9_-]+ - -
-
- -
-
Repository Description
-
-
-
-
-
- - -
- -
-
Repository Visibility
-
-
- - - -
- - Anyone can see and pull from this repository. You choose who can push. -
-
-
- - - -
- - You choose who can see, pull and push from/to this repository. -
-
- - -
-
- In order to make this repository private - under your personal namespace - under the organization {{ repo.namespace }}, you will need to upgrade your plan to - - {{ planRequired.title }} - . - This will cost ${{ planRequired.price / 100 }}/month. -
- Upgrade now - or did you mean to create this repository - under {{ user.organizations[0].name }}? -
-
- -
- -
-
- This organization has reached its private repository limit. Please contact your administrator. -
-
-
-
-
- -
- -
-
-
Initialize repository
- -
- -
- - - -
- - -
- - - -
- - -
- - - -
- - -
- - - -
-
-
-
-
- -
- -
-
-
Upload DockerfileArchive
-
-
-
-
-
-
-
-
- -
- -
-
- You will be redirected to authorize via GitHub once the repository has been created -
-
-
- -
- -
- -
-
- -
-
- - - - - - - - - - diff --git a/static/partials/old-org-view.html b/static/partials/old-org-view.html deleted file mode 100644 index 292f3133f..000000000 --- a/static/partials/old-org-view.html +++ /dev/null @@ -1,86 +0,0 @@ -
-
-
-
- - - Create Team - - - Settings -
-
- - - -
-
-
-
- - - {{ team.name }} - - - {{ team.name }} - -
- -
-
- -
- - -
-
-
-
-
- - - - - - - diff --git a/static/partials/old-repo-list.html b/static/partials/old-repo-list.html deleted file mode 100644 index ab482de76..000000000 --- a/static/partials/old-repo-list.html +++ /dev/null @@ -1,74 +0,0 @@ -
-
- - -

Your Repositories

-

Repositories

- -
- - - - -
-
-

You don't have any repositories yet!

-

This organization doesn't have any repositories, or you have not been provided access.

- Click here to learn how to create a repository -
-
-
- -
- -
-

Top Public Repositories

- -
-
diff --git a/static/partials/old-repo-view.html b/static/partials/old-repo-view.html deleted file mode 100644 index 49bad98c1..000000000 --- a/static/partials/old-repo-view.html +++ /dev/null @@ -1,425 +0,0 @@ - - -
-
- -
-

- - -

- -
- - - - - - - - - -
- - -
-
-
-
-
- - -
- - -
- -
-
- This repository is empty -
- -
-
-
How to push a new image to this repository:
-
- First login to the registry (if you have not done so already): -
sudo docker login {{ Config.getDomain() }}
- - Tag an image to this repository: -
sudo docker tag 0u123imageidgoeshere {{ Config.getDomain() }}/{{repo.namespace}}/{{repo.name}}
- - Push the image to this repository: -
sudo docker push {{ Config.getDomain() }}/{{repo.namespace}}/{{repo.name}}
-
-
-
-
- - -
-
- A build is currently processing. If this takes longer than an hour, please contact us -
-
- - -
-
- A push to this repository is in progress. -
-
-
- - -
- -
-
- -
-
- -
-
-
-
-
- - -
-
-
- - - - - {{getTagCount(repo)}} - - - {{imageHistory.value.length}} - - -
- -
- -
-
-
Last Modified
-
- -
- -
-
- -
Total Compressed Size
-
{{ getTotalSize(currentTag) | bytes }} -
-
- - - -
- -
-
- - -
-
-
- -
-
- - - -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- - -
- -
-
-
-
-
-
-
-
-
- -
-
- - - - - - - diff --git a/static/partials/old-team-view.html b/static/partials/old-team-view.html deleted file mode 100644 index 2ff2cd21f..000000000 --- a/static/partials/old-team-view.html +++ /dev/null @@ -1,128 +0,0 @@ -
-
-
-
- -
-
- -
-
- -
- This team has no members -
- -
- No matching team members found -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Team Members
- - - -
Robot Accounts
- - - -
Invited To Join
- - - - - - {{ member.email }} - - - -
- -
-
-
-
-
- -
-
-
- - - - - - diff --git a/static/partials/old-tutorial.html b/static/partials/old-tutorial.html deleted file mode 100644 index c590ac9ff..000000000 --- a/static/partials/old-tutorial.html +++ /dev/null @@ -1,3 +0,0 @@ -
-
-
diff --git a/static/partials/org-admin.html b/static/partials/org-admin.html deleted file mode 100644 index a94784203..000000000 --- a/static/partials/org-admin.html +++ /dev/null @@ -1,127 +0,0 @@ -
-
-
- -
- - - - -
-
- -
-
-
- - -
-
- -
-
Organization's e-mail address
-
-
- - -
-
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
-
-
- Showing {{(membersFound | filter:search | limitTo:50).length}} of {{(membersFound | filter:search).length}} matching members -
-
- -
-
- - - - - - - - - - - - - -
User/Robot AccountTeams
- - - - - - - - - -
-
-
-
-
-
-
diff --git a/static/partials/org-member-logs.html b/static/partials/org-member-logs.html deleted file mode 100644 index 5750ef726..000000000 --- a/static/partials/org-member-logs.html +++ /dev/null @@ -1,7 +0,0 @@ -
-
-
-
-
-
diff --git a/static/partials/repo-admin.html b/static/partials/repo-admin.html deleted file mode 100644 index 6250f96e4..000000000 --- a/static/partials/repo-admin.html +++ /dev/null @@ -1,480 +0,0 @@ -
-
-
- You do not have permission to view this page -
-
-
- -

- - -

-
- -
- - - - -
- -
- -
-
-
- - -
-
-
Status Badge - -
-
-
- 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). -
- - - - - - - - - - - - - - - - - - - - - - - - -
Image (SVG): -
-
Markdown: -
-
AsciiDoc: -
-
-
-
-
- - -
- -
-
Access Permissions - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
User/Team/Robot AccountPermissions
- - - - - - -
- - - -
- -
-
- -
-
-
- - -
-
Access Token Permissions - - -
-
-
- - - - - - - - - - - - - - - - - - - -
Token DescriptionPermissions
- - {{ token.friendlyName }} - -
- - -
-
- -
-
-
-
-
- - -
-
-
Repository Notifications - -
- -
- -
-
- There are no notifications defined for this repository -
-
-
-
-
- - -
- -
-
-
-
- - -
-
-
Build Triggers - -
- -
- -
-
No build triggers defined for this repository
- - - - - - - - - - - - - - - -
Trigger
-
- - Setting up trigger -
-
-
- - Pull Credentials: - - -
-
- - - -
- - - -
- No build trigger types enabled. - -
- -
-
-
-
- - -
- -
-
-
-
- - This repository is currently private. Only users on the permissions list may view and interact with it. - -
- -
-
- -
-
- - This repository is currently public and is visible to all users, and may be pulled by all users. - -
- -
-
-
-
-
- - -
- -
-
-
-
Deleting a repository cannot be undone. Here be dragons!
- -
-
-
-
-
-
-
-
-
- - -
- {{ shownToken.friendlyName }} -
- - -
- - -
- - -
- - - - - - - - - - - - - - - - diff --git a/static/partials/repo-build.html b/static/partials/repo-build.html deleted file mode 100644 index 90ad12992..000000000 --- a/static/partials/repo-build.html +++ /dev/null @@ -1,141 +0,0 @@ -
-
- You do not have permission to view this page -
-
-
- -

- - -

- -
- -
-
- -
-
-
- -
- There are no builds for this repository -
- -
- - - - -
-
-
-
- Triggered by: -
- -
-
- - Started: - - - Build Package - -
- - -
-
- -
-
- -
- -
-
- -
- -
-
- -
-
- -
-
- - -
-
- - -
-
-
-
-
- - - - - {{ build.id }} -
-
-
-
-
- -
-
- - - - -
diff --git a/static/partials/user-admin.html b/static/partials/user-admin.html deleted file mode 100644 index c3a2c1ff9..000000000 --- a/static/partials/user-admin.html +++ /dev/null @@ -1,436 +0,0 @@ -
-
-
- -
- No matching user found -
- -
-
-
- - - {{ user.username }} - -
-
- -
- - - - -
-
- -
-
- -
-
- You have not authorized any external applications -
-
-
- These are the applications you have authorized to view information and perform actions on your behalf. -
- - - - - - - - - - - - - -
Application NameAuthorized PermissionsRevoke
- - - {{ authInfo.application.name }} - - - {{ authInfo.application.name }} - - {{ authInfo.application.organization.name }} - - - {{ scopeInfo.scope }} - - - -
-
-
- -
- - -
-
-
- - -
-
-
- - -
-
-
An e-mail has been sent to {{ sentEmail }} to verify the change.
- -
-
-
- -
-
Account e-mail address
-
- {{ user.email }} -
-
- -
-
Change e-mail address
- -
-
- - -
-
-
-
-
- - -
- -
-
-
Generate Encrypted Password
- -
-
- Due to Docker storing passwords entered on the command line in plaintext, it is highly recommended to use the button below to generate an an encrypted version of your password. -
- -
- This installation is set to require encrypted passwords when - using the Docker command line interface. To generate an encrypted password, click the button below. -
- - -
-
-
- - -
-
-
Change Password
- -
-
-
- - Password changed successfully - -
-
Note: Changing your password will also invalidate any generated encrypted passwords.
- - -
- - - -
-
-
-
-
- - -
-
-
-
- - -
-
-
GitHub Login:
-
-
- - {{githubLogin}} - -
-
- - Account attached to Github Account - -
-
- -
-
-
-
- - -
-
-
Google Login:
-
-
- - {{ googleLogin }} - -
-
- - Account attached to Google Account - -
-
- -
-
-
-
- -
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
-
Change Username
- -
-
-
- - Username changed successfully - -
-
- - -
-
-
-
-
- - -
- -
-
-
- Cannot convert this account into an organization, as it is a member of {{user.organizations.length}} other - organization{{user.organizations.length > 1 ? 's' : ''}}. Please leave - {{user.organizations.length > 1 ? 'those organizations' : 'that organization'}} first. -
-
- -
-
- Note: Converting a user account into an organization cannot be undone -
- - -
-
- - -
-

Convert to organization

- -
-
- -
- - {{ user.username }}
- This will continue to be the namespace for your repositories -
- -
- - - - - The username and password for the account that will become an administrator of the organization. - Note that this account must be a separate registered account from the account that you are - trying to convert, and must already exist. - -
- - -
- -
-
- -
- -
-
-
-
-
-
- -
-
- - - - - - - - - - - - - - - From 3342f2392d0042595b90fd8c6bd2746ed3db4b19 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 29 Jun 2015 12:36:39 +0300 Subject: [PATCH 3/4] Remove long build descriptions (not properly used in the new UI) --- static/directives/repo-view/repo-panel-builds.html | 2 +- .../trigger/bitbucket/trigger-description.html | 12 ------------ .../trigger/custom-git/trigger-description.html | 6 ------ .../trigger/github/trigger-description.html | 12 ------------ .../trigger/gitlab/trigger-description.html | 12 ------------ static/directives/triggered-build-description.html | 2 +- static/js/directives/ui/trigger-description.js | 2 -- 7 files changed, 2 insertions(+), 46 deletions(-) diff --git a/static/directives/repo-view/repo-panel-builds.html b/static/directives/repo-view/repo-panel-builds.html index 435da1b85..33c704503 100644 --- a/static/directives/repo-view/repo-panel-builds.html +++ b/static/directives/repo-view/repo-panel-builds.html @@ -133,7 +133,7 @@
{{ trigger.config.subdir || '/' }} {{ trigger.config.branchtag_regex || 'All' }} diff --git a/static/directives/trigger/bitbucket/trigger-description.html b/static/directives/trigger/bitbucket/trigger-description.html index 997ae746b..5cfa4ecb1 100644 --- a/static/directives/trigger/bitbucket/trigger-description.html +++ b/static/directives/trigger/bitbucket/trigger-description.html @@ -4,16 +4,4 @@ {{ trigger.config.build_source }} -
-
- Branches/Tags: - Matching Regular Expression {{ trigger.config.branchtag_regex }} - (All Branches and Tags) -
- -
- Dockerfile: - {{ TriggerService.getDockerfileLocation(trigger) }} -
-
\ No newline at end of file diff --git a/static/directives/trigger/custom-git/trigger-description.html b/static/directives/trigger/custom-git/trigger-description.html index abd3ecd7d..eb8c53c40 100644 --- a/static/directives/trigger/custom-git/trigger-description.html +++ b/static/directives/trigger/custom-git/trigger-description.html @@ -1,10 +1,4 @@ Push to {{ trigger.config.build_source }} -
-
- Dockerfile: - {{ TriggerService.getDockerfileLocation(trigger) }} -
\ No newline at end of file diff --git a/static/directives/trigger/github/trigger-description.html b/static/directives/trigger/github/trigger-description.html index 668a03785..5a01c4aed 100644 --- a/static/directives/trigger/github/trigger-description.html +++ b/static/directives/trigger/github/trigger-description.html @@ -4,16 +4,4 @@ {{ trigger.config.build_source }} -
-
- Branches/Tags: - Matching Regular Expression {{ trigger.config.branchtag_regex }} - (All Branches and Tags) -
- -
- Dockerfile: - {{ TriggerService.getDockerfileLocation(trigger) }} -
-
\ No newline at end of file diff --git a/static/directives/trigger/gitlab/trigger-description.html b/static/directives/trigger/gitlab/trigger-description.html index 232b110ab..737bed214 100644 --- a/static/directives/trigger/gitlab/trigger-description.html +++ b/static/directives/trigger/gitlab/trigger-description.html @@ -4,16 +4,4 @@ {{ trigger.config.build_source }} -
-
- Branches/Tags: - Matching Regular Expression {{ trigger.config.branchtag_regex }} - (All Branches and Tags) -
- -
- Dockerfile: - {{ TriggerService.getDockerfileLocation(trigger) }} -
-
diff --git a/static/directives/triggered-build-description.html b/static/directives/triggered-build-description.html index 91fb6a23f..990413b69 100644 --- a/static/directives/triggered-build-description.html +++ b/static/directives/triggered-build-description.html @@ -13,7 +13,7 @@
Triggered by -
diff --git a/static/js/directives/ui/trigger-description.js b/static/js/directives/ui/trigger-description.js index f8ad3f630..df7135f16 100644 --- a/static/js/directives/ui/trigger-description.js +++ b/static/js/directives/ui/trigger-description.js @@ -10,10 +10,8 @@ angular.module('quay').directive('triggerDescription', function () { restrict: 'C', scope: { 'trigger': '=trigger', - 'short': '=short' }, controller: function($scope, $element, KeyService, TriggerService) { - // TODO(jschorr): Clean up and remove the 'short' once we're on new layout. $scope.KeyService = KeyService; $scope.TriggerService = TriggerService; TriggerService.populateTemplate($scope, 'trigger-description'); From 892548f5d7603fb949caf82273b53ab770c16ef2 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 29 Jun 2015 12:40:18 +0300 Subject: [PATCH 4/4] Remove old controller code --- static/js/pages/image-view.js | 125 ---------------------------------- static/js/pages/org-view.js | 85 ----------------------- static/js/pages/repo-list.js | 65 ------------------ 3 files changed, 275 deletions(-) diff --git a/static/js/pages/image-view.js b/static/js/pages/image-view.js index 69e20a069..d8d3adc22 100644 --- a/static/js/pages/image-view.js +++ b/static/js/pages/image-view.js @@ -78,129 +78,4 @@ }, 100); }; } - - function OldImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, ImageMetadataService) { - var namespace = $routeParams.namespace; - var name = $routeParams.name; - var imageid = $routeParams.image; - - $scope.getFormattedCommand = ImageMetadataService.getFormattedCommand; - - $scope.parseDate = function(dateString) { - return Date.parse(dateString); - }; - - $scope.getFolder = function(filepath) { - var index = filepath.lastIndexOf('/'); - if (index < 0) { - return ''; - } - return filepath.substr(0, index + 1); - }; - - $scope.getFolders = function(filepath) { - var index = filepath.lastIndexOf('/'); - if (index < 0) { - return ''; - } - - return filepath.substr(0, index).split('/'); - }; - - $scope.getFilename = function(filepath) { - var index = filepath.lastIndexOf('/'); - if (index < 0) { - return filepath; - } - return filepath.substr(index + 1); - }; - - $scope.setFolderFilter = function(folderPath, index) { - var parts = folderPath.split('/'); - parts = parts.slice(0, index + 1); - $scope.setFilter(parts.join('/')); - }; - - $scope.setFilter = function(filter) { - $scope.search = {}; - $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'); - }, 10); - }; - - var fetchRepository = function() { - var params = { - 'repository': namespace + '/' + name - }; - - ApiService.getRepoAsResource(params).get(function(repo) { - $scope.repo = repo; - }); - }; - - var fetchImage = function() { - var params = { - 'repository': namespace + '/' + name, - 'image_id': imageid - }; - - $scope.image = ApiService.getImageAsResource(params).get(function(image) { - if (!$scope.repo) { - $scope.repo = { - 'name': name, - 'namespace': namespace, - 'is_public': true - }; - } - - $rootScope.title = 'View Image - ' + image.id; - $rootScope.description = 'Viewing docker image ' + image.id + ' under repository ' + namespace + '/' + name + - ': Image changes tree and list view'; - - // Fetch the image's changes. - fetchChanges(); - return image; - }); - }; - - var fetchChanges = function() { - var params = { - 'repository': namespace + '/' + name, - '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({ - 'kind': kind, - 'file': c[i] - }); - } - }; - - addCombinedChanges(changes.added, 'added'); - addCombinedChanges(changes.removed, 'removed'); - addCombinedChanges(changes.changed, 'changed'); - - $scope.combinedChanges = combinedChanges; - $scope.imageChanges = changes; - }); - }; - - // Fetch the repository. - fetchRepository(); - - // Fetch the image. - fetchImage(); - } })(); \ No newline at end of file diff --git a/static/js/pages/org-view.js b/static/js/pages/org-view.js index 04ae22685..019116cec 100644 --- a/static/js/pages/org-view.js +++ b/static/js/pages/org-view.js @@ -97,89 +97,4 @@ }); }; } - - function OldOrgViewCtrl($rootScope, $scope, ApiService, $routeParams, CreateService) { - var orgname = $routeParams.orgname; - - $scope.TEAM_PATTERN = TEAM_PATTERN; - $rootScope.title = 'Loading...'; - - $scope.setRole = function(role, teamname) { - var previousRole = $scope.organization.teams[teamname].role; - $scope.organization.teams[teamname].role = role; - - var params = { - 'orgname': orgname, - 'teamname': teamname - }; - - var data = $scope.organization.teams[teamname]; - - ApiService.updateOrganizationTeam(data, params).then(function(resp) { - }, function(resp) { - $scope.organization.teams[teamname].role = previousRole; - $scope.roleError = resp.data || ''; - $('#cannotChangeTeamModal').modal({}); - }); - }; - - $scope.createTeam = function(teamname) { - if (!teamname) { - return; - } - - if ($scope.organization.teams[teamname]) { - $('#team-' + teamname).removeClass('highlight'); - setTimeout(function() { - $('#team-' + teamname).addClass('highlight'); - }, 10); - return; - } - - CreateService.createOrganizationTeam(ApiService, orgname, teamname, function(created) { - $scope.organization.teams[teamname] = created; - }); - }; - - $scope.askDeleteTeam = function(teamname) { - $scope.currentDeleteTeam = teamname; - $('#confirmdeleteModal').modal({}); - }; - - $scope.deleteTeam = function() { - $('#confirmdeleteModal').modal('hide'); - if (!$scope.currentDeleteTeam) { return; } - - var teamname = $scope.currentDeleteTeam; - var params = { - 'orgname': orgname, - 'teamname': teamname - }; - - var errorHandler = ApiService.errorDisplay('Cannot delete team', function() { - $scope.currentDeleteTeam = null; - }); - - ApiService.deleteOrganizationTeam(null, params).then(function() { - delete $scope.organization.teams[teamname]; - $scope.currentDeleteTeam = null; - }, errorHandler); - }; - - var loadOrganization = function() { - $scope.orgResource = ApiService.getOrganizationAsResource({'orgname': orgname}).get(function(org) { - $scope.organization = org; - $rootScope.title = orgname; - $rootScope.description = 'Viewing organization ' + orgname; - - $('.info-icon').popover({ - 'trigger': 'hover', - 'html': true - }); - }); - }; - - // Load the organization. - loadOrganization(); - } })(); \ No newline at end of file diff --git a/static/js/pages/repo-list.js b/static/js/pages/repo-list.js index b81c7946d..67d1320c2 100644 --- a/static/js/pages/repo-list.js +++ b/static/js/pages/repo-list.js @@ -100,69 +100,4 @@ }); }; } - - function OldRepoListCtrl($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); - }); - - // Monitor changes in the namespace. - $scope.$watch('namespace', function(namespace) { - loadMyRepos(namespace); - }); - - $scope.movePublicPage = function(increment) { - if ($scope.publicPageCount == null) { - return; - } - - $scope.page += increment; - if ($scope.page < 1) { - $scope.page = 1; - } - - if ($scope.page > $scope.publicPageCount) { - $scope.page = $scope.publicPageCount; - } - - loadPublicRepos(); - }; - - var loadMyRepos = function(namespace) { - if (!$scope.user || $scope.user.anonymous || !namespace) { - return; - } - - var options = {'public': false, 'sort': true, 'namespace': namespace}; - - $scope.user_repositories = ApiService.listReposAsResource().withOptions(options).get(function(resp) { - return resp.repositories; - }); - }; - - var loadPublicRepos = function() { - var options = { - 'public': true, - 'private': false, - 'sort': true, - 'limit': 10, - 'page': $scope.page, - 'count': $scope.page == 1 - }; - - $scope.public_repositories = ApiService.listReposAsResource().withOptions(options).get(function(resp) { - if (resp.count) { - $scope.publicPageCount = Math.ceil(resp.count / 10); - } - return resp.repositories; - }); - }; - - loadPublicRepos(); - } })();