diff --git a/src/app/features/dvnt-account/config/account.config.ts b/src/app/features/dvnt-account/config/account.config.ts index e861ce2..5bdc696 100644 --- a/src/app/features/dvnt-account/config/account.config.ts +++ b/src/app/features/dvnt-account/config/account.config.ts @@ -5,6 +5,7 @@ import { } from '@spartacus/core'; import { LayoutConfig } from '@spartacus/storefront'; +import { DvntAddressBookComponent } from '../dvnt-address-book/dvnt-address-book.component'; import { DvntConsentManagementComponent } from '../dvnt-consent-management/dvnt-consent-management.component'; import { DvntForgotPasswordComponent } from '../dvnt-forgot-password/dvnt-forgot-password.component'; import { DvntLoginCustomerComponent } from '../dvnt-login-customer/dvnt-login-customer.component'; @@ -36,6 +37,9 @@ export const accountCmsConfig = { ConsentManagementComponent: { component: DvntConsentManagementComponent, }, + AccountAddressBookComponent: { + component: DvntAddressBookComponent, + }, }, }; @@ -67,6 +71,11 @@ export const staticComponents: { flexType: 'DvntConsentManagementComponent', uid: 'DvntConsentManagementComponent', }, + DvntAddressBookComponent: { + typeCode: 'DvntAddressBookComponent', + flexType: 'DvntAddressBookComponent', + uid: 'DvntAddressBookComponent', + }, }; export function cmsStructureConfig(): CmsStructureConfig { @@ -87,6 +96,14 @@ const accountTranslationOverwrites = { 'I want to create an account and I am confirming that I have read and agreed with the', }, }, + address: { + addressBook: { + header: { + manage: `Manage all the shipping addresses you want (work place, home address ...)`, + manually: `This way you won't have to enter the shipping address manually with each order.`, + }, + }, + }, }, }; diff --git a/src/app/features/dvnt-account/dvnt-account.module.ts b/src/app/features/dvnt-account/dvnt-account.module.ts index d6eccfa..00e76b6 100644 --- a/src/app/features/dvnt-account/dvnt-account.module.ts +++ b/src/app/features/dvnt-account/dvnt-account.module.ts @@ -12,6 +12,7 @@ import { accountTranslationsConfig, cmsStructureConfig, } from './config/account.config'; +import { DvntAddressBookComponent } from './dvnt-address-book/dvnt-address-book.component'; import { DvntConsentFormComponent } from './dvnt-consent-management/dvnt-consent-form/dvnt-consent-form.component'; import { DvntConsentManagementComponent } from './dvnt-consent-management/dvnt-consent-management.component'; import { DvntForgotPasswordComponent } from './dvnt-forgot-password/dvnt-forgot-password.component'; @@ -23,6 +24,7 @@ import { DvntSharedModule } from '../dvnt-shared/dvnt-shared.module'; @NgModule({ declarations: [ + DvntAddressBookComponent, DvntConsentFormComponent, DvntConsentManagementComponent, DvntForgotPasswordComponent, @@ -47,6 +49,7 @@ import { DvntSharedModule } from '../dvnt-shared/dvnt-shared.module'; ConfigModule.withConfig(accountLayoutConfig), ], entryComponents: [ + DvntAddressBookComponent, DvntConsentManagementComponent, DvntForgotPasswordComponent, DvntLoginCustomerComponent, diff --git a/src/app/features/dvnt-account/dvnt-address-book/dvnt-address-book.component.html b/src/app/features/dvnt-account/dvnt-address-book/dvnt-address-book.component.html new file mode 100644 index 0000000..db3de0a --- /dev/null +++ b/src/app/features/dvnt-account/dvnt-address-book/dvnt-address-book.component.html @@ -0,0 +1,64 @@ +
+

+ {{ 'addressBook.header.manage' | cxTranslate }} + {{ 'addressBook.header.manually' | cxTranslate }} +

+ + +
+
+ +
+
+ +
+ +
+
+ + +

+ {{ 'addressBook.addNewShippingAddress' | cxTranslate }} +

+ +
+ + +

+ {{ 'addressBook.editShippingAddress' | cxTranslate }} +

+ +
+
+ + + + diff --git a/src/app/features/dvnt-account/dvnt-address-book/dvnt-address-book.component.scss b/src/app/features/dvnt-account/dvnt-address-book/dvnt-address-book.component.scss new file mode 100644 index 0000000..8d650da --- /dev/null +++ b/src/app/features/dvnt-account/dvnt-address-book/dvnt-address-book.component.scss @@ -0,0 +1,9 @@ +.address-book-header-label { + border-bottom: 1px solid var(--ssf-light-primary); + margin: 0 0 40px; + padding: 0 0 20px; +} + +.add-new-address { + margin-top: 40px; +} diff --git a/src/app/features/dvnt-account/dvnt-address-book/dvnt-address-book.component.ts b/src/app/features/dvnt-account/dvnt-address-book/dvnt-address-book.component.ts new file mode 100644 index 0000000..cd42c49 --- /dev/null +++ b/src/app/features/dvnt-account/dvnt-address-book/dvnt-address-book.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core'; +import { AddressBookComponent } from '@spartacus/storefront'; + +@Component({ + selector: 'app-dvnt-address-book', + templateUrl: './dvnt-address-book.component.html', + styleUrls: ['./dvnt-address-book.component.scss'], +}) +export class DvntAddressBookComponent extends AddressBookComponent {} diff --git a/src/app/features/dvnt-checkout/dvnt-checkout.module.ts b/src/app/features/dvnt-checkout/dvnt-checkout.module.ts index 8b06d5a..e832ae6 100644 --- a/src/app/features/dvnt-checkout/dvnt-checkout.module.ts +++ b/src/app/features/dvnt-checkout/dvnt-checkout.module.ts @@ -1,17 +1,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { DvntShippingAddressComponent } from './dvnt-shipping/dvnt-shipping-address.component'; import { ConfigModule, FeaturesConfigModule } from '@spartacus/core'; -import { DvntCheckoutProgressComponent } from './dvnt-checkout-progress/dvnt-checkout-progress.component'; -import { - checkoutCmsConfig, - checkoutLayoutConfig, - checkoutTranslationsConfig, - staticCmsConfigFactory, -} from './config/checkout.config'; -import { SharedModule } from '../../shared/shared.module'; import { - AddressFormModule, CardModule, CartCouponModule, CartSharedModule, @@ -19,13 +9,23 @@ import { PromotionsModule, SpinnerModule, } from '@spartacus/storefront'; -import { DvntSharedModule } from '../dvnt-shared/dvnt-shared.module'; + +import { + checkoutCmsConfig, + checkoutLayoutConfig, + checkoutTranslationsConfig, + staticCmsConfigFactory, +} from './config/checkout.config'; +import { CheckoutReviewPageLayoutHandler } from './CheckoutReviewPageLayoutHandler'; import { DvntCheckoutOrderSummaryComponent } from './dvnt-order-summary/dvnt-checkout-order-summary.component'; +import { DvntCheckoutProgressComponent } from './dvnt-checkout-progress/dvnt-checkout-progress.component'; import { DvntDeliveryModeComponent } from './dvnt-delivery-mode/dvnt-delivery-mode.component'; -import { DvntPaymentMethodModule } from './dvnt-payment-method/dvnt-payment-method.module'; -import { DvntOrderReviewModule } from './dvnt-order-review/dvnt-order-review.module'; import { DvntOrderConfirmationModule } from './dvnt-order-confirmation/dvnt-order-confirmation.module'; -import { CheckoutReviewPageLayoutHandler } from './CheckoutReviewPageLayoutHandler'; +import { DvntOrderReviewModule } from './dvnt-order-review/dvnt-order-review.module'; +import { DvntPaymentMethodModule } from './dvnt-payment-method/dvnt-payment-method.module'; +import { DvntSharedModule } from '../dvnt-shared/dvnt-shared.module'; +import { DvntShippingAddressComponent } from './dvnt-shipping/dvnt-shipping-address.component'; +import { SharedModule } from '../../shared/shared.module'; @NgModule({ declarations: [ @@ -37,21 +37,20 @@ import { CheckoutReviewPageLayoutHandler } from './CheckoutReviewPageLayoutHandl imports: [ CommonModule, SharedModule, - ConfigModule.withConfig(checkoutTranslationsConfig), - ConfigModule.withConfig(checkoutCmsConfig), - ConfigModule.withConfig(checkoutLayoutConfig), - ConfigModule.withConfigFactory(staticCmsConfigFactory), CardModule, - AddressFormModule, - SpinnerModule, - DvntSharedModule, CartCouponModule, - FeaturesConfigModule, CartSharedModule, + FeaturesConfigModule, + SpinnerModule, PromotionsModule, - DvntPaymentMethodModule, - DvntOrderReviewModule, DvntOrderConfirmationModule, + DvntOrderReviewModule, + DvntPaymentMethodModule, + DvntSharedModule, + ConfigModule.withConfig(checkoutTranslationsConfig), + ConfigModule.withConfig(checkoutCmsConfig), + ConfigModule.withConfig(checkoutLayoutConfig), + ConfigModule.withConfigFactory(staticCmsConfigFactory), ], providers: [ { diff --git a/src/app/features/dvnt-checkout/dvnt-shipping/dvnt-shipping-address.component.html b/src/app/features/dvnt-checkout/dvnt-shipping/dvnt-shipping-address.component.html index cdce4b4..56ebb6a 100644 --- a/src/app/features/dvnt-checkout/dvnt-shipping/dvnt-shipping-address.component.html +++ b/src/app/features/dvnt-checkout/dvnt-shipping/dvnt-shipping-address.component.html @@ -21,10 +21,10 @@

>
@@ -42,12 +42,12 @@

{{ 'checkout.backToCart' | cxTranslate }} @@ -56,21 +56,21 @@

- + [showTitleCode]="true" + > - + [addressData]="setAddress" + [setAsDefaultField]="!isGuestCheckout" + [showTitleCode]="true" + cancelBtnLabel="{{ 'checkout.backToCart' | cxTranslate }}" + > diff --git a/src/app/features/dvnt-shared/components/dvnt-address-card/dvnt-address-card.component.html b/src/app/features/dvnt-shared/components/dvnt-address-card/dvnt-address-card.component.html new file mode 100644 index 0000000..16e2234 --- /dev/null +++ b/src/app/features/dvnt-shared/components/dvnt-address-card/dvnt-address-card.component.html @@ -0,0 +1,60 @@ +
+
+

+ {{ address?.firstName }} {{ address?.lastName }} +

+

+ {{ address?.line1 }} +

+

+ {{ address?.line2 }} +

+

+ {{ address?.town }}, + {{ + address?.country?.isocode + }}{{ address?.region?.isocode }} +

+

+ {{ address?.postalCode }} +

+

+ {{ address?.phone }} +

+
+ +
+ + + {{ 'addressBook.areYouSureToDeleteAddress' | cxTranslate }} + + +
+ + +
+
+ + +
+ + +
+
+
+
diff --git a/src/app/features/dvnt-shared/components/dvnt-address-card/dvnt-address-card.component.scss b/src/app/features/dvnt-shared/components/dvnt-address-card/dvnt-address-card.component.scss new file mode 100644 index 0000000..5af0b35 --- /dev/null +++ b/src/app/features/dvnt-shared/components/dvnt-address-card/dvnt-address-card.component.scss @@ -0,0 +1,51 @@ +.address-card-container { + align-items: center; + border-bottom: 1px solid var(--ssf-light-primary); + display: flex; + justify-content: space-between; + padding: 20px 0; + + .column { + display: flex; + flex-direction: column; + } + + .left-container { + @extend .column; + + .address-card-label { + margin: 0; + } + + .address-card-label-name { + @extend .address-card-label; + + font-weight: bold; + } + + .address-card-label-phone { + @extend .address-card-label; + + margin-top: 20px; + } + } + + .right-container { + @extend .column; + + .address-card-action-buttons { + display: flex; + margin-top: 20px; + + button { + &:last-of-type { + margin-left: 20px; + } + } + } + } + + .align-center { + align-items: center; + } +} diff --git a/src/app/features/dvnt-shared/components/dvnt-address-card/dvnt-address-card.component.ts b/src/app/features/dvnt-shared/components/dvnt-address-card/dvnt-address-card.component.ts new file mode 100644 index 0000000..eb673a1 --- /dev/null +++ b/src/app/features/dvnt-shared/components/dvnt-address-card/dvnt-address-card.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core'; +import { AddressCardComponent } from '@spartacus/storefront'; + +@Component({ + selector: 'app-dvnt-address-card', + templateUrl: './dvnt-address-card.component.html', + styleUrls: ['./dvnt-address-card.component.scss'], +}) +export class DvntAddressCardComponent extends AddressCardComponent {} diff --git a/src/app/features/dvnt-shared/components/dvnt-address-form/dvnt-address-form.component.html b/src/app/features/dvnt-shared/components/dvnt-address-form/dvnt-address-form.component.html new file mode 100644 index 0000000..5c7f84f --- /dev/null +++ b/src/app/features/dvnt-shared/components/dvnt-address-form/dvnt-address-form.component.html @@ -0,0 +1,213 @@ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
diff --git a/src/app/features/dvnt-shared/components/dvnt-address-form/dvnt-address-form.component.scss b/src/app/features/dvnt-shared/components/dvnt-address-form/dvnt-address-form.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/features/dvnt-shared/components/dvnt-address-form/dvnt-address-form.component.ts b/src/app/features/dvnt-shared/components/dvnt-address-form/dvnt-address-form.component.ts new file mode 100644 index 0000000..98318b7 --- /dev/null +++ b/src/app/features/dvnt-shared/components/dvnt-address-form/dvnt-address-form.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core'; +import { AddressFormComponent } from '@spartacus/storefront'; + +@Component({ + selector: 'app-dvnt-address-form', + templateUrl: './dvnt-address-form.component.html', + styleUrls: ['./dvnt-address-form.component.scss'], +}) +export class DvntAddressFormComponent extends AddressFormComponent {} diff --git a/src/app/features/dvnt-shared/dvnt-shared.module.ts b/src/app/features/dvnt-shared/dvnt-shared.module.ts index cbc3b14..d55a1bd 100644 --- a/src/app/features/dvnt-shared/dvnt-shared.module.ts +++ b/src/app/features/dvnt-shared/dvnt-shared.module.ts @@ -14,10 +14,12 @@ import { ItemCounterModule, } from '@spartacus/storefront'; +import { NgSelectModule } from '@ng-select/ng-select'; import { SwiperModule } from 'ngx-swiper-wrapper'; import { SWIPER_CONFIG } from 'ngx-swiper-wrapper'; import { SwiperConfigInterface } from 'ngx-swiper-wrapper'; +import { DvntAddressCardComponent } from './components/dvnt-address-card/dvnt-address-card.component'; import { DvntAppliedCouponsComponent } from './components/dvnt-applied-coupons/dvnt-applied-coupons.component'; import { DvntCardComponent } from './components/dvnt-card/dvnt-card.component'; import { DvntCarouselProductsComponent } from './components/dvnt-carousel-products/dvnt-carousel-products.component'; @@ -31,6 +33,7 @@ import { DvntIconComponent } from './components/dvnt-icon/dvnt-icon.component'; import { DvntPaginationComponent } from './components/dvnt-pagination/dvnt-pagination.component'; import { SharedModule } from '../../shared/shared.module'; import { sharedTranslationsConfig } from './config/shared.config'; +import { DvntAddressFormComponent } from './components/dvnt-address-form/dvnt-address-form.component'; const DEFAULT_SWIPER_CONFIG: SwiperConfigInterface = { a11y: true, @@ -42,6 +45,8 @@ const DEFAULT_SWIPER_CONFIG: SwiperConfigInterface = { @NgModule({ declarations: [ + DvntAddressCardComponent, + DvntAddressFormComponent, DvntAppliedCouponsComponent, DvntCardComponent, DvntCarouselProductsComponent, @@ -66,9 +71,12 @@ const DEFAULT_SWIPER_CONFIG: SwiperConfigInterface = { SharedModule, FeaturesConfigModule, ItemCounterModule, + NgSelectModule, ConfigModule.withConfig(sharedTranslationsConfig), ], exports: [ + DvntAddressCardComponent, + DvntAddressFormComponent, DvntAppliedCouponsComponent, DvntCardComponent, DvntCarouselProductsComponent, diff --git a/src/styles/base/_buttons.scss b/src/styles/base/_buttons.scss index f9ec377..afd5bc9 100644 --- a/src/styles/base/_buttons.scss +++ b/src/styles/base/_buttons.scss @@ -116,7 +116,7 @@ } &:hover { - color: var(--ssf-dark-primary-lighten); + color: var(--ssf-color-primary); } } }