|
|
|
import { Route } from '@angular/router';
|
|
|
|
import { AuthGuard } from 'app/core/auth/guards/auth.guard';
|
|
|
|
import { NoAuthGuard } from 'app/core/auth/guards/noAuth.guard';
|
|
|
|
import { LayoutComponent } from 'app/layout/layout.component';
|
|
|
|
import { InitialDataResolver } from 'app/app.resolvers';
|
|
|
|
|
|
|
|
// @formatter:off
|
|
|
|
/* eslint-disable max-len */
|
|
|
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
|
|
export const appRoutes: Route[] = [
|
|
|
|
|
|
|
|
// Redirect empty path to '/example'
|
|
|
|
{path: '', pathMatch : 'full', redirectTo: 'dashboard'},
|
|
|
|
|
|
|
|
// Redirect signed in user to the '/example'
|
|
|
|
//
|
|
|
|
// After the user signs in, the sign in page will redirect the user to the 'signed-in-redirect'
|
|
|
|
// path. Below is another redirection for that path to redirect the user to the desired
|
|
|
|
// location. This is a small convenience to keep all main routes together here on this file.
|
|
|
|
{path: 'signed-in-redirect', pathMatch : 'full', redirectTo: 'dashboard'},
|
|
|
|
|
|
|
|
// Auth routes for guests
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
canActivate: [NoAuthGuard],
|
|
|
|
canActivateChild: [NoAuthGuard],
|
|
|
|
component: LayoutComponent,
|
|
|
|
data: {
|
|
|
|
layout: 'empty'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{path: 'confirmation-required', loadChildren: () => import('app/pages/auth/confirmation-required/confirmation-required.module').then(m => m.AuthConfirmationRequiredModule)},
|
|
|
|
{path: 'forgot-password', loadChildren: () => import('app/pages/auth/forgot-password/forgot-password.module').then(m => m.AuthForgotPasswordModule)},
|
|
|
|
{path: 'reset-password', loadChildren: () => import('app/pages/auth/reset-password/reset-password.module').then(m => m.AuthResetPasswordModule)},
|
|
|
|
{path: 'sign-in', loadChildren: () => import('app/pages/auth/sign-in/sign-in.module').then(m => m.AuthSignInModule)},
|
|
|
|
{path: 'sign-up', loadChildren: () => import('app/pages/auth/sign-up/sign-up.module').then(m => m.AuthSignUpModule)}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
// Auth routes for authenticated users
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
canActivate: [AuthGuard],
|
|
|
|
canActivateChild: [AuthGuard],
|
|
|
|
component: LayoutComponent,
|
|
|
|
data: {
|
|
|
|
layout: 'empty'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{path: 'sign-out', loadChildren: () => import('app/pages/auth/sign-out/sign-out.module').then(m => m.AuthSignOutModule)},
|
|
|
|
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
// Admin routes
|
|
|
|
{
|
|
|
|
path : '',
|
|
|
|
canActivate: [AuthGuard],
|
|
|
|
canActivateChild: [AuthGuard],
|
|
|
|
component : LayoutComponent,
|
|
|
|
resolve : {
|
|
|
|
initialData: InitialDataResolver,
|
|
|
|
},
|
|
|
|
children : [
|
|
|
|
{path: 'dashboard', loadChildren: () => import('app/pages/admin/Dashboard/dashboard.module').then(m => m.DashboardModule)},
|
|
|
|
{path: 'coupons', loadChildren: () => import('app/pages/admin/Coupons/coupons.module').then(m => m.CouponsModule)},
|
|
|
|
{path: 'products', loadChildren: () => import('app/pages/admin/Products/products.module').then(m => m.ProductsModule)},
|
|
|
|
{path: 'followers', loadChildren: () => import('app/pages/admin/Followers/followers.module').then(m => m.FollowersModule)},
|
|
|
|
{path: 'desires', loadChildren: () => import('app/pages/admin/Monthly_Desires/desires.module').then(m => m.DesiresModule)},
|
|
|
|
{path: 'profile', loadChildren: () => import('app/pages/admin/Profile/profile.module').then(m => m.ProfileModule)},
|
|
|
|
]
|
|
|
|
}
|
|
|
|
];
|