From 32627f3c2aed34443e218b495998d7c5d6913934 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 2 Nov 2016 16:10:20 -0400 Subject: [PATCH] Remove setup and superuser routes when SUPER_USERS is not enabled Fixes #2064 --- static/js/app.js | 14 ++++++++------ static/js/pages/error-view.js | 4 ++-- static/partials/error-view.html | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index 47dfc0e7d..7a6ed75d7 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -109,6 +109,14 @@ quayApp.config(['$routeProvider', '$locationProvider', 'pages', function($routeP {id: 'layout', templatePath: '/static/partials/'} ], layoutProfile); + if (window.__features.SUPER_USERS) { + // QE Management + routeBuilder.route('/superuser/', 'superuser') + + // QE Setup + .route('/setup/', 'setup'); + } + routeBuilder // Repository View .route('/repository/:namespace/:name', 'repo-view') @@ -162,12 +170,6 @@ quayApp.config(['$routeProvider', '$locationProvider', 'pages', function($routeP // New Repository .route('/new/', 'new-repo') - // ER Management - .route('/superuser/', 'superuser') - - // ER Setup - .route('/setup/', 'setup') - // Plans .route('/plans/', 'plans') diff --git a/static/js/pages/error-view.js b/static/js/pages/error-view.js index 9f13cb717..e81e94ac3 100644 --- a/static/js/pages/error-view.js +++ b/static/js/pages/error-view.js @@ -11,7 +11,7 @@ }]); function ErrorViewCtrl($scope, ApiService, $routeParams, UserService) { - $scope.info = window.__error_info; - $scope.code = window.__error_code; + $scope.info = window.__error_info || {}; + $scope.code = window.__error_code || 404; } }()); \ No newline at end of file diff --git a/static/partials/error-view.html b/static/partials/error-view.html index df17e4bc3..fe53d8fb2 100644 --- a/static/partials/error-view.html +++ b/static/partials/error-view.html @@ -11,10 +11,10 @@

Return to the main page

-

+

Create this namespace or return to the main page

-

+

Create this repository or return to the main page