moved Angular routes to separate module; load Webpack bundle before other main scripts
This commit is contained in:
parent
8dc9cf21d7
commit
615e233671
14 changed files with 186 additions and 167 deletions
|
@ -1,5 +1,4 @@
|
|||
import * as Raven from 'raven-js';
|
||||
import { RouteBuilder } from './route-builder/route-builder.service';
|
||||
|
||||
|
||||
quayConfig.$inject = [
|
||||
|
@ -7,10 +6,6 @@ quayConfig.$inject = [
|
|||
'cfpLoadingBarProvider',
|
||||
'$tooltipProvider',
|
||||
'$compileProvider',
|
||||
'$routeProvider',
|
||||
'$locationProvider',
|
||||
'pages',
|
||||
'RouteBuilderProvider',
|
||||
'RestangularProvider',
|
||||
'$analyticsProvider',
|
||||
];
|
||||
|
@ -20,17 +15,13 @@ export function quayConfig(
|
|||
cfpLoadingBarProvider,
|
||||
$tooltipProvider,
|
||||
$compileProvider,
|
||||
$routeProvider,
|
||||
$locationProvider,
|
||||
pages,
|
||||
RouteBuilderProvider,
|
||||
RestangularProvider,
|
||||
$analyticsProvider) {
|
||||
cfpLoadingBarProvider.includeSpinner = false;
|
||||
|
||||
// decorate the tooltip getter
|
||||
var tooltipFactory = $tooltipProvider.$get[$tooltipProvider.$get.length - 1];
|
||||
$tooltipProvider.$get[$tooltipProvider.$get.length - 1] = function($window) {
|
||||
$tooltipProvider.$get[$tooltipProvider.$get.length - 1] = function($window: ng.IWindowService) {
|
||||
if ('ontouchstart' in $window) {
|
||||
var existing = tooltipFactory.apply(this, arguments);
|
||||
return function(element) {
|
||||
|
@ -51,132 +42,6 @@ export function quayConfig(
|
|||
$compileProvider.debugInfoEnabled(false);
|
||||
}
|
||||
|
||||
$locationProvider.html5Mode(true);
|
||||
|
||||
// WARNING WARNING WARNING
|
||||
// If you add a route here, you must add a corresponding route in thr endpoints/web.py
|
||||
// index rule to make sure that deep links directly deep into the app continue to work.
|
||||
// WARNING WARNING WARNING
|
||||
|
||||
var layoutProfile: string = 'layout';
|
||||
|
||||
var routeBuilder: RouteBuilder = new RouteBuilderProvider.$get()($routeProvider, pages, [
|
||||
// Start with the old pages (if we asked for it).
|
||||
{id: 'old-layout', templatePath: '/static/partials/'},
|
||||
|
||||
// Fallback back combined new/existing pages.
|
||||
{id: 'layout', templatePath: '/static/partials/'}
|
||||
], layoutProfile);
|
||||
|
||||
if ((<any>window).__features.SUPER_USERS) {
|
||||
// QE Management
|
||||
routeBuilder.route('/superuser/', 'superuser')
|
||||
|
||||
// QE Setup
|
||||
.route('/setup/', 'setup');
|
||||
}
|
||||
|
||||
routeBuilder
|
||||
// Repository View
|
||||
.route('/repository/:namespace/:name', 'repo-view')
|
||||
.route('/repository/:namespace/:name/tag/:tag', 'repo-view')
|
||||
|
||||
// Image View
|
||||
.route('/repository/:namespace/:name/image/:image', 'image-view')
|
||||
|
||||
// Repo Build View
|
||||
.route('/repository/:namespace/:name/build/:buildid', 'build-view')
|
||||
|
||||
// Create repository notification
|
||||
.route('/repository/:namespace/:name/create-notification', 'create-repository-notification')
|
||||
|
||||
// Repo List
|
||||
.route('/repository/', 'repo-list')
|
||||
|
||||
// Organizations
|
||||
.route('/organizations/', 'organizations')
|
||||
|
||||
// New Organization
|
||||
.route('/organizations/new/', 'new-organization')
|
||||
|
||||
// View Organization
|
||||
.route('/organization/:orgname', 'org-view')
|
||||
|
||||
// View Organization Team
|
||||
.route('/organization/:orgname/teams/:teamname', 'team-view')
|
||||
|
||||
// Organization View Application
|
||||
.route('/organization/:orgname/application/:clientid', 'manage-application')
|
||||
|
||||
// View Organization Billing
|
||||
.route('/organization/:orgname/billing', 'billing')
|
||||
|
||||
// View Organization Billing Invoices
|
||||
.route('/organization/:orgname/billing/invoices', 'invoices')
|
||||
|
||||
// View User
|
||||
.route('/user/:username', 'user-view')
|
||||
|
||||
// View User Billing
|
||||
.route('/user/:username/billing', 'billing')
|
||||
|
||||
// View User Billing Invoices
|
||||
.route('/user/:username/billing/invoices', 'invoices')
|
||||
|
||||
// Sign In
|
||||
.route('/signin/', 'signin')
|
||||
|
||||
// New Repository
|
||||
.route('/new/', 'new-repo')
|
||||
|
||||
// Plans
|
||||
.route('/plans/', 'plans')
|
||||
|
||||
// Tutorial
|
||||
.route('/tutorial/', 'tutorial')
|
||||
|
||||
// Contact
|
||||
.route('/contact/', 'contact')
|
||||
|
||||
// About
|
||||
.route('/about/', 'about')
|
||||
|
||||
// Security
|
||||
.route('/security/', 'security')
|
||||
|
||||
// TOS
|
||||
.route('/tos', 'tos')
|
||||
|
||||
// Privacy
|
||||
.route('/privacy', 'privacy')
|
||||
|
||||
// Change username
|
||||
.route('/updateuser', 'update-user')
|
||||
|
||||
// Landing Page
|
||||
.route('/', 'landing')
|
||||
|
||||
// Tour
|
||||
.route('/tour/', 'tour')
|
||||
.route('/tour/features', 'tour')
|
||||
.route('/tour/organizations', 'tour')
|
||||
.route('/tour/enterprise', 'tour')
|
||||
|
||||
// Confirm Invite
|
||||
.route('/confirminvite', 'confirm-invite')
|
||||
|
||||
// Enterprise marketing page
|
||||
.route('/enterprise', 'enterprise')
|
||||
|
||||
// Public Repo Experiments
|
||||
.route('/__exp/publicRepo', 'public-repo-exp')
|
||||
|
||||
// 404/403
|
||||
.route('/:catchall', 'error-view')
|
||||
.route('/:catch/:all', 'error-view')
|
||||
.route('/:catch/:all/:things', 'error-view')
|
||||
.route('/:catch/:all/:things/:here', 'error-view');
|
||||
|
||||
// Configure compile provider to add additional URL prefixes to the sanitization list. We use
|
||||
// these on the Contact page.
|
||||
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|irc):/);
|
||||
|
|
Reference in a new issue