2017-02-17 10:55:52 +00:00
|
|
|
import { RouteBuilderImpl } from './services/route-builder/route-builder.service.impl';
|
|
|
|
import { RouteBuilder } from './services/route-builder/route-builder.service';
|
|
|
|
import { PageService } from './services/page/page.service';
|
|
|
|
import * as ng from '@types/angular';
|
2017-04-05 21:14:08 +00:00
|
|
|
import { NgModule } from 'ng-metadata/core';
|
2017-02-17 10:55:52 +00:00
|
|
|
import { INJECTED_FEATURES } from './constants/injected-values.constant';
|
2017-04-05 21:14:08 +00:00
|
|
|
import { QuayPagesModule } from './quay-pages.module';
|
2017-02-17 10:55:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Module containing client-side routing configuration.
|
|
|
|
*/
|
|
|
|
@NgModule({
|
|
|
|
imports: [
|
2017-04-05 21:14:08 +00:00
|
|
|
QuayPagesModule.name,
|
2017-02-17 10:55:52 +00:00
|
|
|
'ngRoute',
|
|
|
|
],
|
|
|
|
declarations: [],
|
2017-04-05 21:14:08 +00:00
|
|
|
providers: [
|
|
|
|
provideRoutes,
|
|
|
|
],
|
2017-02-17 10:55:52 +00:00
|
|
|
})
|
2017-04-05 21:14:08 +00:00
|
|
|
export class QuayRoutesModule {
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
}
|
2017-02-17 10:55:52 +00:00
|
|
|
|
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
/**
|
|
|
|
* Provider function for setting up client-side routing.
|
|
|
|
* See https://hotell.gitbooks.io/ng-metadata/content/docs/recipes/startup-logic.html
|
|
|
|
*/
|
|
|
|
provideRoutes.$inject = [
|
|
|
|
'$routeProvider',
|
|
|
|
'$locationProvider',
|
|
|
|
'pages',
|
|
|
|
];
|
|
|
|
function provideRoutes($routeProvider: ng.route.IRouteProvider,
|
|
|
|
$locationProvider: ng.ILocationProvider,
|
|
|
|
pageServiceProvider: PageService): void {
|
|
|
|
$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
|
|
|
|
|
|
|
|
const routeBuilder: RouteBuilder = new RouteBuilderImpl($routeProvider, pageServiceProvider.$get());
|
|
|
|
|
|
|
|
if (INJECTED_FEATURES.SUPER_USERS) {
|
|
|
|
// QE Management
|
|
|
|
routeBuilder.route('/superuser/', 'superuser')
|
|
|
|
// QE Setup
|
|
|
|
.route('/setup/', 'setup');
|
|
|
|
}
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
routeBuilder
|
2017-04-07 21:25:44 +00:00
|
|
|
// Search
|
|
|
|
.route('/search', 'search')
|
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Application View
|
|
|
|
.route('/application/:namespace/:name', 'app-view')
|
2017-03-23 21:16:19 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Repo List
|
|
|
|
.route('/application/', 'app-list')
|
2017-03-23 21:16:19 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Repository View
|
|
|
|
.route('/repository/:namespace/:name', 'repo-view')
|
|
|
|
.route('/repository/:namespace/:name/tag/:tag', 'repo-view')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Image View
|
|
|
|
.route('/repository/:namespace/:name/image/:image', 'image-view')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Repo Build View
|
|
|
|
.route('/repository/:namespace/:name/build/:buildid', 'build-view')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Repo Trigger View
|
|
|
|
.route('/repository/:namespace/:name/trigger/:triggerid', 'trigger-setup')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Create repository notification
|
|
|
|
.route('/repository/:namespace/:name/create-notification', 'create-repository-notification')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Repo List
|
|
|
|
.route('/repository/', 'repo-list')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Organizations
|
|
|
|
.route('/organizations/', 'organizations')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// New Organization
|
|
|
|
.route('/organizations/new/', 'new-organization')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// View Organization
|
|
|
|
.route('/organization/:orgname', 'org-view')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// View Organization Team
|
|
|
|
.route('/organization/:orgname/teams/:teamname', 'team-view')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Organization View Application
|
|
|
|
.route('/organization/:orgname/application/:clientid', 'manage-application')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// View Organization Billing
|
|
|
|
.route('/organization/:orgname/billing', 'billing')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// View Organization Billing Invoices
|
|
|
|
.route('/organization/:orgname/billing/invoices', 'invoices')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// View User
|
|
|
|
.route('/user/:username', 'user-view')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// View User Billing
|
|
|
|
.route('/user/:username/billing', 'billing')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// View User Billing Invoices
|
|
|
|
.route('/user/:username/billing/invoices', 'invoices')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Sign In
|
|
|
|
.route('/signin/', 'signin')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// New Repository
|
|
|
|
.route('/new/', 'new-repo')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Plans
|
|
|
|
.route('/plans/', 'plans')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Tutorial
|
|
|
|
.route('/tutorial/', 'tutorial')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Contact
|
|
|
|
.route('/contact/', 'contact')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// About
|
|
|
|
.route('/about/', 'about')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Security
|
|
|
|
.route('/security/', 'security')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// TOS
|
|
|
|
.route('/tos', 'tos')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Privacy
|
|
|
|
.route('/privacy', 'privacy')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Change username
|
|
|
|
.route('/updateuser', 'update-user')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Landing Page
|
|
|
|
.route('/', 'landing')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Tour
|
|
|
|
.route('/tour/', 'tour')
|
|
|
|
.route('/tour/features', 'tour')
|
|
|
|
.route('/tour/organizations', 'tour')
|
|
|
|
.route('/tour/enterprise', 'tour')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// Confirm Invite
|
|
|
|
.route('/confirminvite', 'confirm-invite')
|
2017-02-17 10:55:52 +00:00
|
|
|
|
2017-04-05 21:14:08 +00:00
|
|
|
// 404/403
|
|
|
|
.route('/:catchall', 'error-view')
|
|
|
|
.route('/:catch/:all', 'error-view')
|
|
|
|
.route('/:catch/:all/:things', 'error-view')
|
|
|
|
.route('/:catch/:all/:things/:here', 'error-view');
|
2017-02-17 10:55:52 +00:00
|
|
|
}
|