From 207a75c92856ab60ca38fe52bef1e0a1a399c447 Mon Sep 17 00:00:00 2001 From: griest024 Date: Mon, 13 May 2024 14:47:56 -0400 Subject: [PATCH] feat(cart,order): set redirect token default value (#2780) --- .../billing-address/billing-address-guard-redirect.token.ts | 2 +- .../src/guards/cart-items/cart-items-guard-redirect.token.ts | 2 +- .../in-stock-items/in-stock-items-guard-redirect.token.ts | 2 +- .../guards/order-result/order-result-guard-redirect.token.ts | 2 +- .../payment-method/payment-method-guard-redirect.token.ts | 2 +- libs/cart/routing/src/guards/resolve-cart/redirect.token.ts | 2 +- .../shipping-address/shipping-address-guard-redirect.token.ts | 2 +- .../shipping-method/shipping-method-guard-redirect.token.ts | 2 +- .../src/resolvers/tokens/cart-resolver-redirect.token.ts | 2 +- .../src/resolvers/tokens/empty-cart-resolver-redirect.token.ts | 2 +- .../guards/placed-order/placed-order-guard-redirect.token.ts | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libs/cart/routing/src/guards/billing-address/billing-address-guard-redirect.token.ts b/libs/cart/routing/src/guards/billing-address/billing-address-guard-redirect.token.ts index f1ebfd990c..2cc4788bbb 100644 --- a/libs/cart/routing/src/guards/billing-address/billing-address-guard-redirect.token.ts +++ b/libs/cart/routing/src/guards/billing-address/billing-address-guard-redirect.token.ts @@ -1,3 +1,3 @@ import { InjectionToken } from '@angular/core'; -export const DaffCartBillingAddressGuardRedirectUrl = new InjectionToken('DaffCartBillingAddressGuardRedirectUrl'); +export const DaffCartBillingAddressGuardRedirectUrl = new InjectionToken('DaffCartBillingAddressGuardRedirectUrl', { factory: () => '/' }); diff --git a/libs/cart/routing/src/guards/cart-items/cart-items-guard-redirect.token.ts b/libs/cart/routing/src/guards/cart-items/cart-items-guard-redirect.token.ts index 2d96e25c04..6eeeb0a2db 100644 --- a/libs/cart/routing/src/guards/cart-items/cart-items-guard-redirect.token.ts +++ b/libs/cart/routing/src/guards/cart-items/cart-items-guard-redirect.token.ts @@ -3,4 +3,4 @@ import { InjectionToken } from '@angular/core'; /** * The path to which the user should be redirected if the cart has no items when {@link DaffCartItemsGuard} is invoked. */ -export const DaffCartItemsGuardRedirectUrl = new InjectionToken('DaffCartItemsGuardRedirectUrl'); +export const DaffCartItemsGuardRedirectUrl = new InjectionToken('DaffCartItemsGuardRedirectUrl', { factory: () => '/' }); diff --git a/libs/cart/routing/src/guards/in-stock-items/in-stock-items-guard-redirect.token.ts b/libs/cart/routing/src/guards/in-stock-items/in-stock-items-guard-redirect.token.ts index f4be5aa36f..72105f7684 100644 --- a/libs/cart/routing/src/guards/in-stock-items/in-stock-items-guard-redirect.token.ts +++ b/libs/cart/routing/src/guards/in-stock-items/in-stock-items-guard-redirect.token.ts @@ -3,4 +3,4 @@ import { InjectionToken } from '@angular/core'; /** * The path to which the user should be redirected if the cart has no items when {@link DaffCartInStockItemsGuard} is invoked. */ -export const DaffCartInStockItemsGuardRedirectUrl = new InjectionToken('DaffCartInStockItemsGuardRedirectUrl'); +export const DaffCartInStockItemsGuardRedirectUrl = new InjectionToken('DaffCartInStockItemsGuardRedirectUrl', { factory: () => '/' }); diff --git a/libs/cart/routing/src/guards/order-result/order-result-guard-redirect.token.ts b/libs/cart/routing/src/guards/order-result/order-result-guard-redirect.token.ts index 5b5c82ca54..5a38622069 100644 --- a/libs/cart/routing/src/guards/order-result/order-result-guard-redirect.token.ts +++ b/libs/cart/routing/src/guards/order-result/order-result-guard-redirect.token.ts @@ -1,3 +1,3 @@ import { InjectionToken } from '@angular/core'; -export const DaffCartOrderResultGuardRedirectUrl = new InjectionToken('DaffCartOrderResultGuardRedirectUrl'); +export const DaffCartOrderResultGuardRedirectUrl = new InjectionToken('DaffCartOrderResultGuardRedirectUrl', { factory: () => '/' }); diff --git a/libs/cart/routing/src/guards/payment-method/payment-method-guard-redirect.token.ts b/libs/cart/routing/src/guards/payment-method/payment-method-guard-redirect.token.ts index 99891a778b..fd0d55d851 100644 --- a/libs/cart/routing/src/guards/payment-method/payment-method-guard-redirect.token.ts +++ b/libs/cart/routing/src/guards/payment-method/payment-method-guard-redirect.token.ts @@ -1,3 +1,3 @@ import { InjectionToken } from '@angular/core'; -export const DaffCartPaymentMethodGuardRedirectUrl = new InjectionToken('DaffCartPaymentMethodGuardRedirectUrl'); +export const DaffCartPaymentMethodGuardRedirectUrl = new InjectionToken('DaffCartPaymentMethodGuardRedirectUrl', { factory: () => '/' }); diff --git a/libs/cart/routing/src/guards/resolve-cart/redirect.token.ts b/libs/cart/routing/src/guards/resolve-cart/redirect.token.ts index a57332b8d9..c3fcf5fe9e 100644 --- a/libs/cart/routing/src/guards/resolve-cart/redirect.token.ts +++ b/libs/cart/routing/src/guards/resolve-cart/redirect.token.ts @@ -1,3 +1,3 @@ import { InjectionToken } from '@angular/core'; -export const DaffResolveCartGuardRedirectUrl = new InjectionToken('DaffResolveCartGuardRedirectUrl'); +export const DaffResolveCartGuardRedirectUrl = new InjectionToken('DaffResolveCartGuardRedirectUrl', { factory: () => '/' }); diff --git a/libs/cart/routing/src/guards/shipping-address/shipping-address-guard-redirect.token.ts b/libs/cart/routing/src/guards/shipping-address/shipping-address-guard-redirect.token.ts index 32cf31fd3d..16bd915650 100644 --- a/libs/cart/routing/src/guards/shipping-address/shipping-address-guard-redirect.token.ts +++ b/libs/cart/routing/src/guards/shipping-address/shipping-address-guard-redirect.token.ts @@ -1,3 +1,3 @@ import { InjectionToken } from '@angular/core'; -export const DaffCartShippingAddressGuardRedirectUrl = new InjectionToken('DaffCartShippingAddressGuardRedirectUrl'); +export const DaffCartShippingAddressGuardRedirectUrl = new InjectionToken('DaffCartShippingAddressGuardRedirectUrl', { factory: () => '/' }); diff --git a/libs/cart/routing/src/guards/shipping-method/shipping-method-guard-redirect.token.ts b/libs/cart/routing/src/guards/shipping-method/shipping-method-guard-redirect.token.ts index 42c4c424d7..6bb71cc2b4 100644 --- a/libs/cart/routing/src/guards/shipping-method/shipping-method-guard-redirect.token.ts +++ b/libs/cart/routing/src/guards/shipping-method/shipping-method-guard-redirect.token.ts @@ -1,3 +1,3 @@ import { InjectionToken } from '@angular/core'; -export const DaffCartShippingMethodGuardRedirectUrl = new InjectionToken('DaffCartShippingMethodGuardRedirectUrl'); +export const DaffCartShippingMethodGuardRedirectUrl = new InjectionToken('DaffCartShippingMethodGuardRedirectUrl', { factory: () => '/' }); diff --git a/libs/cart/routing/src/resolvers/tokens/cart-resolver-redirect.token.ts b/libs/cart/routing/src/resolvers/tokens/cart-resolver-redirect.token.ts index fd1b543354..76d07112a8 100644 --- a/libs/cart/routing/src/resolvers/tokens/cart-resolver-redirect.token.ts +++ b/libs/cart/routing/src/resolvers/tokens/cart-resolver-redirect.token.ts @@ -1,3 +1,3 @@ import { InjectionToken } from '@angular/core'; -export const DaffCartResolverRedirectUrl = new InjectionToken('DaffCartResolverRedirectUrl'); +export const DaffCartResolverRedirectUrl = new InjectionToken('DaffCartResolverRedirectUrl', { factory: () => '/' }); diff --git a/libs/cart/routing/src/resolvers/tokens/empty-cart-resolver-redirect.token.ts b/libs/cart/routing/src/resolvers/tokens/empty-cart-resolver-redirect.token.ts index 3d7ac900f4..53590275cf 100644 --- a/libs/cart/routing/src/resolvers/tokens/empty-cart-resolver-redirect.token.ts +++ b/libs/cart/routing/src/resolvers/tokens/empty-cart-resolver-redirect.token.ts @@ -1,3 +1,3 @@ import { InjectionToken } from '@angular/core'; -export const DaffEmptyCartResolverRedirectUrl = new InjectionToken('DaffEmptyCartResolverRedirectUrl'); +export const DaffEmptyCartResolverRedirectUrl = new InjectionToken('DaffEmptyCartResolverRedirectUrl', { factory: () => '/' }); diff --git a/libs/order/routing/src/guards/placed-order/placed-order-guard-redirect.token.ts b/libs/order/routing/src/guards/placed-order/placed-order-guard-redirect.token.ts index 9dbf44fd30..252fa83d76 100644 --- a/libs/order/routing/src/guards/placed-order/placed-order-guard-redirect.token.ts +++ b/libs/order/routing/src/guards/placed-order/placed-order-guard-redirect.token.ts @@ -1,3 +1,3 @@ import { InjectionToken } from '@angular/core'; -export const DaffPlacedOrderGuardRedirectUrl = new InjectionToken('DaffPlacedOrderGuardRedirectUrl'); +export const DaffPlacedOrderGuardRedirectUrl = new InjectionToken('DaffPlacedOrderGuardRedirectUrl', { factory: () => '/' });