commit38d03588b1Merge:8e987d06f4aa3bAuthor: ncoronel <ncoronel@quo.ar> Date: Wed Aug 26 10:25:23 2026 -0300 Merge branch 'fix/cart-expiration-notification' of https://gitea.quo.ar/tbianchini/shopit-front into fix/cart-expiration-notification commit8e987d0ce6Author: ncoronel <ncoronel@quo.ar> Date: Wed Aug 26 10:02:26 2026 -0300 fix(purchase-status): clear cart on approved purchase commite171b9a233Author: ncoronel <ncoronel@quo.ar> Date: Tue Aug 25 17:06:07 2026 -0300 refactor(checkout): use purchase id route segment commit643d43adeaAuthor: ncoronel <ncoronel@quo.ar> Date: Tue Aug 25 17:05:59 2026 -0300 fix(checkout): handle expired purchase exits commitd89d01b511Author: ncoronel <ncoronel@quo.ar> Date: Tue Aug 25 16:47:17 2026 -0300 fix(checkout): refresh expired carts commiteeb245209bAuthor: ncoronel <ncoronel@quo.ar> Date: Tue Aug 25 16:46:12 2026 -0300 fix(checkout): show backend start errors commit9d3754c2d8Author: ncoronel <ncoronel@quo.ar> Date: Tue Aug 25 16:33:44 2026 -0300 fix(cart): refresh state after expiration commit6f4aa3b1bdAuthor: ncoronel <ncoronel@quo.ar> Date: Wed Aug 26 10:02:26 2026 -0300 fix(purchase-status): clear cart on approved purchase commit2b342ec235Author: ncoronel <ncoronel@quo.ar> Date: Tue Aug 25 17:06:07 2026 -0300 refactor(checkout): use purchase id route segment commitd06b146104Author: ncoronel <ncoronel@quo.ar> Date: Tue Aug 25 17:05:59 2026 -0300 fix(checkout): handle expired purchase exits commitf4e0a9e028Author: ncoronel <ncoronel@quo.ar> Date: Tue Aug 25 16:47:17 2026 -0300 fix(checkout): refresh expired carts commit8c2b738806Author: ncoronel <ncoronel@quo.ar> Date: Tue Aug 25 16:46:12 2026 -0300 fix(checkout): show backend start errors commit1362d0c163Author: ncoronel <ncoronel@quo.ar> Date: Tue Aug 25 16:33:44 2026 -0300 fix(cart): refresh state after expiration
209 lines
6.8 KiB
TypeScript
209 lines
6.8 KiB
TypeScript
import { Routes } from '@angular/router';
|
|
|
|
import { SimpleLayoutComponent } from '../../core/layout/simple-layout/simple-layout.component';
|
|
import { StoreLayoutComponent } from '../../core/layout/store-layout/store-layout.component';
|
|
import { authGuard, guestOnlyGuard } from '../../core/services/auth/auth.guards';
|
|
import { LoginPageComponent } from './pages/login-page/login-page.component';
|
|
import { hasMenuGuard } from '../../core/guards/menu.guard';
|
|
import { productDetailResolver } from './pages/product-detail-page/product-detail-page.resolver';
|
|
import { RecoverPasswordCodePageComponent } from './pages/recover-password-code-page/recover-password-code-page.component';
|
|
import { RecoverPasswordPageComponent } from './pages/recover-password-page/recover-password-page.component';
|
|
import { ResetPasswordPageComponent } from './pages/reset-password-page/reset-password-page.component';
|
|
import { RegisterPageComponent } from './pages/register-page/register-page.component';
|
|
import { StoreHomePageComponent } from './pages/store-home-page/store-home-page.component';
|
|
import { storeHomeCatalogResolver } from './pages/store-home-page/store-home-page.resolver';
|
|
import { checkoutPendingPurchaseGuard } from './pages/checkout-page/checkout-page.guard';
|
|
|
|
export const routes: Routes = [
|
|
{
|
|
path: '',
|
|
component: StoreLayoutComponent,
|
|
children: [
|
|
{
|
|
path: '',
|
|
component: StoreHomePageComponent,
|
|
canActivate: [hasMenuGuard('index')],
|
|
resolve: {
|
|
catalogData: storeHomeCatalogResolver,
|
|
},
|
|
},
|
|
{
|
|
path: 'login',
|
|
canActivate: [guestOnlyGuard],
|
|
component: SimpleLayoutComponent,
|
|
children: [
|
|
{
|
|
path: '',
|
|
component: LoginPageComponent,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: 'register',
|
|
canActivate: [guestOnlyGuard],
|
|
component: SimpleLayoutComponent,
|
|
children: [
|
|
{
|
|
path: '',
|
|
component: RegisterPageComponent,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: 'recuperar-contrasena',
|
|
canActivate: [guestOnlyGuard],
|
|
component: SimpleLayoutComponent,
|
|
children: [
|
|
{
|
|
path: '',
|
|
component: RecoverPasswordPageComponent,
|
|
},
|
|
{
|
|
path: 'codigo',
|
|
component: RecoverPasswordCodePageComponent,
|
|
},
|
|
{
|
|
path: 'restablecer',
|
|
component: ResetPasswordPageComponent,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: 'buscar',
|
|
loadComponent: () =>
|
|
import('./pages/search-page/search-page.component').then((m) => m.SearchPageComponent),
|
|
},
|
|
{
|
|
path: 'categoria/:id',
|
|
loadComponent: () =>
|
|
import('./pages/category-items-page/category-items-page.component').then(
|
|
(m) => m.CategoryItemsPageComponent,
|
|
),
|
|
},
|
|
{
|
|
path: 'producto/:id',
|
|
canActivate: [hasMenuGuard('product.detail')],
|
|
resolve: {
|
|
productDetailData: productDetailResolver,
|
|
},
|
|
loadComponent: () =>
|
|
import('./pages/product-detail-page/product-detail-page.component').then(
|
|
(m) => m.ProductDetailPageComponent,
|
|
),
|
|
},
|
|
{
|
|
path: 'checkout/status',
|
|
component: SimpleLayoutComponent,
|
|
children: [
|
|
{
|
|
path: ':id',
|
|
loadComponent: () =>
|
|
import('./pages/purchase-status-page/purchase-status-page.component').then(
|
|
(m) => m.PurchaseStatusPageComponent,
|
|
),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: 'checkout/:id',
|
|
canActivate: [authGuard, hasMenuGuard('checkout')],
|
|
canDeactivate: [checkoutPendingPurchaseGuard],
|
|
loadComponent: () =>
|
|
import('./pages/checkout-page/checkout-page.component').then(
|
|
(m) => m.CheckoutPageComponent,
|
|
),
|
|
},
|
|
{
|
|
path: 'ayuda',
|
|
canActivate: [hasMenuGuard('help')],
|
|
data: {
|
|
menuCode: 'help',
|
|
navigationLabel: 'Secciones de ayuda',
|
|
},
|
|
loadComponent: () =>
|
|
import('./components/menu-page-layout/menu-page-layout.component').then(
|
|
(m) => m.MenuPageLayoutComponent,
|
|
),
|
|
children: [
|
|
{
|
|
path: 'preguntas-frecuentes',
|
|
canActivate: [hasMenuGuard('help.faq')],
|
|
loadComponent: () =>
|
|
import('./pages/help-page/pages/faq-page/faq-page').then((m) => m.FaqPage),
|
|
},
|
|
{
|
|
path: 'contacto',
|
|
canActivate: [hasMenuGuard('help.contact')],
|
|
loadComponent: () =>
|
|
import('./pages/help-page/pages/contact-page/contact-page').then(
|
|
(m) => m.ContactPage,
|
|
),
|
|
},
|
|
{
|
|
path: '',
|
|
redirectTo: 'preguntas-frecuentes',
|
|
pathMatch: 'full',
|
|
},
|
|
{
|
|
path: '**',
|
|
loadComponent: () =>
|
|
import('./pages/help-page/pages/pending-help-page/pending-help-page').then(
|
|
(m) => m.PendingHelpPage,
|
|
),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: 'mi-cuenta',
|
|
canActivate: [authGuard, hasMenuGuard('account')],
|
|
data: {
|
|
menuCode: 'account',
|
|
navigationLabel: 'Secciones de mi cuenta',
|
|
},
|
|
loadComponent: () =>
|
|
import('./components/menu-page-layout/menu-page-layout.component').then(
|
|
(m) => m.MenuPageLayoutComponent,
|
|
),
|
|
children: [
|
|
{
|
|
path: 'datos-personales',
|
|
canActivate: [hasMenuGuard('account.profile')],
|
|
loadComponent: () =>
|
|
import('./pages/account-page/pages/profile-page/profile-page').then(
|
|
(m) => m.ProfilePage,
|
|
),
|
|
},
|
|
{
|
|
path: 'compras',
|
|
canActivate: [hasMenuGuard('account.purchases')],
|
|
loadComponent: () =>
|
|
import('./pages/account-page/pages/purchases-page/purchases-page').then(
|
|
(m) => m.PurchasesPage,
|
|
),
|
|
},
|
|
{
|
|
path: 'compras/:id',
|
|
loadComponent: () =>
|
|
import('./pages/account-page/pages/purchase-detail-page/purchase-detail-page').then(
|
|
(m) => m.PurchaseDetailPage,
|
|
),
|
|
},
|
|
{
|
|
path: 'tickets',
|
|
canActivate: [hasMenuGuard('account.tickets')],
|
|
loadComponent: () =>
|
|
import('./pages/account-page/pages/tickets-page/tickets-page').then(
|
|
(m) => m.TicketsPage,
|
|
),
|
|
},
|
|
{
|
|
path: '',
|
|
redirectTo: 'datos-personales',
|
|
pathMatch: 'full',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
];
|