diff --git a/core-libs/setup/tsconfig.spec.json b/core-libs/setup/tsconfig.spec.json index 3e0f3a58ddb..438662b8264 100644 --- a/core-libs/setup/tsconfig.spec.json +++ b/core-libs/setup/tsconfig.spec.json @@ -392,15 +392,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/asm/tsconfig.schematics.json b/feature-libs/asm/tsconfig.schematics.json index fa6ce48d3ae..98ce0b069f0 100644 --- a/feature-libs/asm/tsconfig.schematics.json +++ b/feature-libs/asm/tsconfig.schematics.json @@ -389,15 +389,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/cart/base/root/models/cart.model.ts b/feature-libs/cart/base/root/models/cart.model.ts index ccd5c549df8..9c77d1760bd 100644 --- a/feature-libs/cart/base/root/models/cart.model.ts +++ b/feature-libs/cart/base/root/models/cart.model.ts @@ -119,8 +119,6 @@ export interface CartItemComponentOptions { export interface OrderEntry { orderCode?: string; - //TODO CHHI Where to put this? Depends on the library dependencies - //between cart, quote and product-configurator quoteCode?: string; basePrice?: Price; deliveryMode?: DeliveryMode; diff --git a/feature-libs/cart/tsconfig.schematics.json b/feature-libs/cart/tsconfig.schematics.json index fa6ce48d3ae..98ce0b069f0 100644 --- a/feature-libs/cart/tsconfig.schematics.json +++ b/feature-libs/cart/tsconfig.schematics.json @@ -389,15 +389,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/checkout/b2b/components/checkout-delivery-address/checkout-delivery-address.component.spec.ts b/feature-libs/checkout/b2b/components/checkout-delivery-address/checkout-delivery-address.component.spec.ts index 0d63c0b9e60..3ab1a9adca9 100644 --- a/feature-libs/checkout/b2b/components/checkout-delivery-address/checkout-delivery-address.component.spec.ts +++ b/feature-libs/checkout/b2b/components/checkout-delivery-address/checkout-delivery-address.component.spec.ts @@ -143,6 +143,8 @@ class MockCardComponent { content: Card; @Input() fitToContainer: boolean; + @Input() + index: number; } describe('B2BCheckoutDeliveryAddressComponent', () => { diff --git a/feature-libs/checkout/b2b/components/checkout-review-submit/checkout-review-submit.component.spec.ts b/feature-libs/checkout/b2b/components/checkout-review-submit/checkout-review-submit.component.spec.ts index 9179d72fde1..5d7d7c6dd4e 100644 --- a/feature-libs/checkout/b2b/components/checkout-review-submit/checkout-review-submit.component.spec.ts +++ b/feature-libs/checkout/b2b/components/checkout-review-submit/checkout-review-submit.component.spec.ts @@ -30,7 +30,7 @@ import { QueryState, UserCostCenterService, } from '@spartacus/core'; -import { Card, PromotionsModule } from '@spartacus/storefront'; +import { Card, OutletModule, PromotionsModule } from '@spartacus/storefront'; import { IconTestingModule } from 'projects/storefrontlib/cms-components/misc/icon/testing/icon-testing.module'; import { BehaviorSubject, Observable, of } from 'rxjs'; import { B2BCheckoutReviewSubmitComponent } from './checkout-review-submit.component'; @@ -221,6 +221,7 @@ describe('B2BCheckoutReviewSubmitComponent', () => { PromotionsModule, RouterTestingModule, IconTestingModule, + OutletModule, ], declarations: [ B2BCheckoutReviewSubmitComponent, diff --git a/feature-libs/checkout/base/components/checkout-delivery-address/checkout-delivery-address.component.spec.ts b/feature-libs/checkout/base/components/checkout-delivery-address/checkout-delivery-address.component.spec.ts index e4219775fe4..1dad5745da6 100644 --- a/feature-libs/checkout/base/components/checkout-delivery-address/checkout-delivery-address.component.spec.ts +++ b/feature-libs/checkout/base/components/checkout-delivery-address/checkout-delivery-address.component.spec.ts @@ -9,11 +9,11 @@ import { } from '@spartacus/checkout/base/root'; import { Address, + FeaturesConfig, + FeaturesConfigModule, GlobalMessageService, I18nTestingModule, UserAddressService, - FeaturesConfig, - FeaturesConfigModule, } from '@spartacus/core'; import { Card } from '@spartacus/storefront'; import { EMPTY, of } from 'rxjs'; @@ -92,6 +92,7 @@ class MockAddressFormComponent { @Input() cancelBtnLabel: string; @Input() showTitleCode: boolean; @Input() setAsDefaultField: boolean; + @Input() addressData: Address; } @Component({ @@ -111,6 +112,8 @@ class MockCardComponent { content: Card; @Input() fitToContainer: boolean; + @Input() + index: number; } class MockCheckoutDeliveryModesFacade diff --git a/feature-libs/checkout/base/components/checkout-delivery-mode/checkout-delivery-mode.component.spec.ts b/feature-libs/checkout/base/components/checkout-delivery-mode/checkout-delivery-mode.component.spec.ts index 595d94d5356..19d552192b4 100644 --- a/feature-libs/checkout/base/components/checkout-delivery-mode/checkout-delivery-mode.component.spec.ts +++ b/feature-libs/checkout/base/components/checkout-delivery-mode/checkout-delivery-mode.component.spec.ts @@ -11,6 +11,7 @@ import { } from '@spartacus/cart/base/root'; import { CheckoutDeliveryModesFacade } from '@spartacus/checkout/base/root'; import { + FeaturesConfigModule, GlobalMessageService, GlobalMessageType, I18nTestingModule, @@ -118,7 +119,12 @@ describe('CheckoutDeliveryModeComponent', () => { beforeEach( waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, I18nTestingModule, OutletModule], + imports: [ + ReactiveFormsModule, + I18nTestingModule, + OutletModule, + FeaturesConfigModule, + ], declarations: [CheckoutDeliveryModeComponent, MockSpinnerComponent], providers: [ { diff --git a/feature-libs/checkout/base/components/checkout-delivery-mode/checkout-delivery-mode.module.ts b/feature-libs/checkout/base/components/checkout-delivery-mode/checkout-delivery-mode.module.ts index 994f76717ed..7286faa09a5 100644 --- a/feature-libs/checkout/base/components/checkout-delivery-mode/checkout-delivery-mode.module.ts +++ b/feature-libs/checkout/base/components/checkout-delivery-mode/checkout-delivery-mode.module.ts @@ -31,7 +31,6 @@ import { CheckoutDeliveryModeComponent } from './checkout-delivery-mode.componen OutletModule, PageComponentModule, FeaturesConfigModule, - FeaturesConfigModule, ], providers: [ provideDefaultConfig({ diff --git a/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-form/checkout-payment-form.component.spec.ts b/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-form/checkout-payment-form.component.spec.ts index ee948cff11c..2e5cb096013 100644 --- a/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-form/checkout-payment-form.component.spec.ts +++ b/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-form/checkout-payment-form.component.spec.ts @@ -21,6 +21,7 @@ import { FormErrorsModule, ICON_TYPE, LaunchDialogService, + NgSelectA11yModule, } from '@spartacus/storefront'; import { EMPTY, Observable, of } from 'rxjs'; import { CheckoutPaymentFormComponent } from './checkout-payment-form.component'; @@ -180,6 +181,7 @@ describe('CheckoutPaymentFormComponent', () => { imports: [ ReactiveFormsModule, NgSelectModule, + NgSelectA11yModule, I18nTestingModule, FormErrorsModule, ], diff --git a/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-method.component.spec.ts b/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-method.component.spec.ts index 4c7007da1b4..f65db3396c1 100644 --- a/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-method.component.spec.ts +++ b/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-method.component.spec.ts @@ -150,6 +150,10 @@ class MockPaymentFormComponent { paymentMethodsCount: number; @Input() setAsDefaultField: boolean; + @Input() + loading: boolean; + @Input() + paymentDetails?: PaymentDetails; } @Component({ diff --git a/feature-libs/checkout/base/components/checkout-place-order/checkout-place-order.component.spec.ts b/feature-libs/checkout/base/components/checkout-place-order/checkout-place-order.component.spec.ts index dd84cb3e865..7d07f2b0c45 100644 --- a/feature-libs/checkout/base/components/checkout-place-order/checkout-place-order.component.spec.ts +++ b/feature-libs/checkout/base/components/checkout-place-order/checkout-place-order.component.spec.ts @@ -1,10 +1,18 @@ import { Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { UntypedFormGroup, ReactiveFormsModule } from '@angular/forms'; +import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; -import { I18nTestingModule, RoutingService } from '@spartacus/core'; +import { + GlobalMessageService, + I18nTestingModule, + RoutingService, +} from '@spartacus/core'; import { OrderFacade } from '@spartacus/order/root'; -import { LaunchDialogService, LAUNCH_CALLER } from '@spartacus/storefront'; +import { + AtMessageModule, + LaunchDialogService, + LAUNCH_CALLER, +} from '@spartacus/storefront'; import { of } from 'rxjs'; import { CheckoutPlaceOrderComponent } from './checkout-place-order.component'; import createSpy = jasmine.createSpy; @@ -42,12 +50,18 @@ describe('CheckoutPlaceOrderComponent', () => { beforeEach( waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, RouterTestingModule, I18nTestingModule], + imports: [ + ReactiveFormsModule, + RouterTestingModule, + I18nTestingModule, + AtMessageModule, + ], declarations: [MockUrlPipe, CheckoutPlaceOrderComponent], providers: [ { provide: OrderFacade, useClass: MockOrderFacade }, { provide: RoutingService, useClass: MockRoutingService }, { provide: LaunchDialogService, useClass: MockLaunchDialogService }, + { provide: GlobalMessageService, useValue: {} }, ], }).compileComponents(); }) diff --git a/feature-libs/checkout/base/components/checkout-review-submit/checkout-review-submit.component.spec.ts b/feature-libs/checkout/base/components/checkout-review-submit/checkout-review-submit.component.spec.ts index f9a1cd90b95..e9de27f3f0e 100644 --- a/feature-libs/checkout/base/components/checkout-review-submit/checkout-review-submit.component.spec.ts +++ b/feature-libs/checkout/base/components/checkout-review-submit/checkout-review-submit.component.spec.ts @@ -17,7 +17,7 @@ import { CheckoutStepType, } from '@spartacus/checkout/base/root'; import { Address, Country, I18nTestingModule } from '@spartacus/core'; -import { Card, PromotionsModule } from '@spartacus/storefront'; +import { Card, OutletModule, PromotionsModule } from '@spartacus/storefront'; import { IconTestingModule } from 'projects/storefrontlib/cms-components/misc/icon/testing/icon-testing.module'; import { of } from 'rxjs'; import { CheckoutStepService } from '../services/checkout-step.service'; @@ -149,6 +149,7 @@ describe('CheckoutReviewSubmitComponent', () => { PromotionsModule, RouterTestingModule, IconTestingModule, + OutletModule, ], declarations: [ CheckoutReviewSubmitComponent, diff --git a/feature-libs/checkout/base/components/checkout-review-submit/checkout-review-submit.module.ts b/feature-libs/checkout/base/components/checkout-review-submit/checkout-review-submit.module.ts index 2414205b933..334e59b90f7 100644 --- a/feature-libs/checkout/base/components/checkout-review-submit/checkout-review-submit.module.ts +++ b/feature-libs/checkout/base/components/checkout-review-submit/checkout-review-submit.module.ts @@ -9,6 +9,7 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { CmsConfig, + FeaturesConfigModule, I18nModule, provideDefaultConfig, UrlModule, @@ -33,6 +34,7 @@ import { CheckoutReviewSubmitComponent } from './checkout-review-submit.componen PromotionsModule, IconModule, OutletModule, + FeaturesConfigModule, ], providers: [ provideDefaultConfig({ diff --git a/feature-libs/checkout/base/components/checkout-review/checkout-review-shipping/checkout-review-shipping.component.spec.ts b/feature-libs/checkout/base/components/checkout-review/checkout-review-shipping/checkout-review-shipping.component.spec.ts index 6319b1d3c5e..2fdb5b847c8 100644 --- a/feature-libs/checkout/base/components/checkout-review/checkout-review-shipping/checkout-review-shipping.component.spec.ts +++ b/feature-libs/checkout/base/components/checkout-review/checkout-review-shipping/checkout-review-shipping.component.spec.ts @@ -11,12 +11,19 @@ import { IconTestingModule } from 'projects/storefrontlib/cms-components/misc/ic import { of } from 'rxjs'; import createSpy = jasmine.createSpy; -import { ChangeDetectorRef, Pipe, PipeTransform } from '@angular/core'; +import { + ChangeDetectorRef, + Component, + Input, + Pipe, + PipeTransform, +} from '@angular/core'; import { ActiveCartFacade, DeliveryMode, OrderEntry, } from '@spartacus/cart/base/root'; +import { Card, OutletModule } from '@spartacus/storefront'; import { CheckoutStepService } from '../../services/checkout-step.service'; import { CheckoutReviewShippingComponent } from './checkout-review-shipping.component'; @@ -107,14 +114,38 @@ class MockUrlPipe implements PipeTransform { transform(): any {} } +@Component({ + selector: 'cx-card', + template: '', +}) +class MockCardComponent { + @Input() + border: boolean; + @Input() + content: Card; + @Input() + fitToContainer: boolean; + @Input() + index: number; +} + describe('CheckoutReviewShippingComponent', () => { let component: CheckoutReviewShippingComponent; let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [I18nTestingModule, RouterTestingModule, IconTestingModule], - declarations: [CheckoutReviewShippingComponent, MockUrlPipe], + imports: [ + I18nTestingModule, + RouterTestingModule, + IconTestingModule, + OutletModule, + ], + declarations: [ + CheckoutReviewShippingComponent, + MockUrlPipe, + MockCardComponent, + ], providers: [ { provide: CheckoutDeliveryAddressFacade, diff --git a/feature-libs/checkout/scheduled-replenishment/components/checkout-place-order/checkout-place-order.component.spec.ts b/feature-libs/checkout/scheduled-replenishment/components/checkout-place-order/checkout-place-order.component.spec.ts index ad8433fdf99..83b5aa7873b 100644 --- a/feature-libs/checkout/scheduled-replenishment/components/checkout-place-order/checkout-place-order.component.spec.ts +++ b/feature-libs/checkout/scheduled-replenishment/components/checkout-place-order/checkout-place-order.component.spec.ts @@ -2,7 +2,11 @@ import { Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; -import { I18nTestingModule, RoutingService } from '@spartacus/core'; +import { + GlobalMessageService, + I18nTestingModule, + RoutingService, +} from '@spartacus/core'; import { DaysOfWeek, OrderFacade, @@ -11,7 +15,11 @@ import { ScheduledReplenishmentOrderFacade, ScheduleReplenishmentForm, } from '@spartacus/order/root'; -import { LaunchDialogService, LAUNCH_CALLER } from '@spartacus/storefront'; +import { + AtMessageModule, + LaunchDialogService, + LAUNCH_CALLER, +} from '@spartacus/storefront'; import { BehaviorSubject, EMPTY, of } from 'rxjs'; import { CheckoutReplenishmentFormService } from '../services/checkout-replenishment-form.service'; import { CheckoutScheduledReplenishmentPlaceOrderComponent } from './checkout-place-order.component'; @@ -85,7 +93,12 @@ describe('CheckoutScheduledReplenishmentPlaceOrderComponent', () => { beforeEach( waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, RouterTestingModule, I18nTestingModule], + imports: [ + ReactiveFormsModule, + RouterTestingModule, + I18nTestingModule, + AtMessageModule, + ], declarations: [ MockUrlPipe, CheckoutScheduledReplenishmentPlaceOrderComponent, @@ -102,6 +115,10 @@ describe('CheckoutScheduledReplenishmentPlaceOrderComponent', () => { provide: ScheduledReplenishmentOrderFacade, useClass: MockScheduledReplenishmentOrderFacade, }, + { + provide: GlobalMessageService, + useValue: {}, + }, ], }).compileComponents(); }) diff --git a/feature-libs/checkout/tsconfig.schematics.json b/feature-libs/checkout/tsconfig.schematics.json index fa6ce48d3ae..98ce0b069f0 100644 --- a/feature-libs/checkout/tsconfig.schematics.json +++ b/feature-libs/checkout/tsconfig.schematics.json @@ -389,15 +389,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/customer-ticketing/tsconfig.schematics.json b/feature-libs/customer-ticketing/tsconfig.schematics.json index 7fed492a7f6..8714945cf6d 100644 --- a/feature-libs/customer-ticketing/tsconfig.schematics.json +++ b/feature-libs/customer-ticketing/tsconfig.schematics.json @@ -402,15 +402,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/order/tsconfig.schematics.json b/feature-libs/order/tsconfig.schematics.json index fa6ce48d3ae..98ce0b069f0 100644 --- a/feature-libs/order/tsconfig.schematics.json +++ b/feature-libs/order/tsconfig.schematics.json @@ -389,15 +389,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/organization/tsconfig.schematics.json b/feature-libs/organization/tsconfig.schematics.json index fa6ce48d3ae..98ce0b069f0 100644 --- a/feature-libs/organization/tsconfig.schematics.json +++ b/feature-libs/organization/tsconfig.schematics.json @@ -389,15 +389,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/pdf-invoices/tsconfig.schematics.json b/feature-libs/pdf-invoices/tsconfig.schematics.json index 7fed492a7f6..8714945cf6d 100644 --- a/feature-libs/pdf-invoices/tsconfig.schematics.json +++ b/feature-libs/pdf-invoices/tsconfig.schematics.json @@ -402,15 +402,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/pickup-in-store/tsconfig.schematics.json b/feature-libs/pickup-in-store/tsconfig.schematics.json index 66ecd404891..4fa08974773 100644 --- a/feature-libs/pickup-in-store/tsconfig.schematics.json +++ b/feature-libs/pickup-in-store/tsconfig.schematics.json @@ -405,15 +405,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/product-configurator/tsconfig.schematics.json b/feature-libs/product-configurator/tsconfig.schematics.json index fa6ce48d3ae..98ce0b069f0 100644 --- a/feature-libs/product-configurator/tsconfig.schematics.json +++ b/feature-libs/product-configurator/tsconfig.schematics.json @@ -389,15 +389,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/product/tsconfig.schematics.json b/feature-libs/product/tsconfig.schematics.json index fa6ce48d3ae..98ce0b069f0 100644 --- a/feature-libs/product/tsconfig.schematics.json +++ b/feature-libs/product/tsconfig.schematics.json @@ -389,15 +389,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/qualtrics/tsconfig.schematics.json b/feature-libs/qualtrics/tsconfig.schematics.json index fa6ce48d3ae..98ce0b069f0 100644 --- a/feature-libs/qualtrics/tsconfig.schematics.json +++ b/feature-libs/qualtrics/tsconfig.schematics.json @@ -389,15 +389,18 @@ "../../feature-libs/qualtrics/root/public_api" ], "@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"], + "@spartacus/quote/components/aware": [ + "../../feature-libs/quote/components/aware/public_api" + ], "@spartacus/quote/components": [ "../../feature-libs/quote/components/public_api" ], + "@spartacus/quote/components/request-button": [ + "../../feature-libs/quote/components/request-button/public_api" + ], "@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"], "@spartacus/quote": ["../../feature-libs/quote/public_api"], "@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"], - "@spartacus/quote/quote-aware": [ - "../../feature-libs/quote/quote-aware/public_api" - ], "@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"], "@spartacus/requested-delivery-date/assets": [ "../../feature-libs/requested-delivery-date/assets/public_api" diff --git a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.spec.ts b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.spec.ts index c34bc028928..38073f0cb83 100644 --- a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.spec.ts +++ b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.spec.ts @@ -51,7 +51,7 @@ const mockQuote: Quote = { const testMappings: ConfirmActionDialogMappingConfig = { BUYER_OFFER: { EDIT: { - i18nKey: 'quote.actions.confirmDialog.buyer_offer.edit', + i18nKeyPrefix: 'quote.actions.confirmDialog.buyer_offer.edit', showWarningNote: true, showExpirationDate: true, showSuccessMessage: false, @@ -60,7 +60,7 @@ const testMappings: ConfirmActionDialogMappingConfig = { }, BUYER: { SUBMIT: { - i18nKey: 'quote.actions.confirmDialog.buyer.submit', + i18nKeyPrefix: 'quote.actions.confirmDialog.buyer.submit', showWarningNote: false, showExpirationDate: false, showSuccessMessage: true, @@ -69,7 +69,7 @@ const testMappings: ConfirmActionDialogMappingConfig = { }, EXPIRED: { REQUOTE: { - i18nKey: 'quote.actions.confirmDialog.expired.requote', + i18nKeyPrefix: 'quote.actions.confirmDialog.expired.requote', showWarningNote: true, showExpirationDate: false, showSuccessMessage: false, @@ -78,7 +78,7 @@ const testMappings: ConfirmActionDialogMappingConfig = { }, ALL: { EDIT: { - i18nKey: 'quote.confirmActionDialog.all.edit', + i18nKeyPrefix: 'quote.confirmActionDialog.all.edit', showWarningNote: true, showExpirationDate: false, showSuccessMessage: false, @@ -322,8 +322,6 @@ describe('QuoteActionsByRoleComponent', () => { }); describe('Threshold check', () => { - const attributeName = 'disabled'; - const allowedActionsSubmit = [ { type: QuoteActionType.SUBMIT, isPrimary: true }, ]; @@ -348,7 +346,7 @@ describe('QuoteActionsByRoleComponent', () => { expect, htmlElem, '.btn:first-child', - attributeName + 'disabled' ); }); @@ -360,7 +358,7 @@ describe('QuoteActionsByRoleComponent', () => { expect, htmlElem, '.btn:first-child', - attributeName + 'disabled' ); }); @@ -373,7 +371,7 @@ describe('QuoteActionsByRoleComponent', () => { expect, htmlElem, '.btn:first-child', - attributeName + 'disabled' ); expect(globalMessageService.add).toHaveBeenCalled(); }); @@ -387,7 +385,7 @@ describe('QuoteActionsByRoleComponent', () => { expect, htmlElem, '.btn:first-child', - attributeName + 'disabled' ); }); @@ -399,7 +397,7 @@ describe('QuoteActionsByRoleComponent', () => { expect, htmlElem, '.btn:first-child', - attributeName + 'disabled' ); }); @@ -542,7 +540,7 @@ describe('QuoteActionsByRoleComponent', () => { QuoteState.BUYER_OFFER ) ).toEqual({ - i18nKey: 'quote.actions.confirmDialog.buyer_offer.edit', + i18nKeyPrefix: 'quote.actions.confirmDialog.buyer_offer.edit', showWarningNote: true, showExpirationDate: true, showSuccessMessage: false, @@ -556,7 +554,7 @@ describe('QuoteActionsByRoleComponent', () => { QuoteState.BUYER_DRAFT ) ).toEqual({ - i18nKey: 'quote.confirmActionDialog.all.edit', + i18nKeyPrefix: 'quote.confirmActionDialog.all.edit', showWarningNote: true, showExpirationDate: false, showSuccessMessage: false, @@ -599,6 +597,16 @@ describe('QuoteActionsByRoleComponent', () => { expect(globalMessageService.add).not.toHaveBeenCalled(); }); + it("should perform quote action once if dialog was closed a few times selecting 'no', before finally selecting 'yes'", () => { + context.successMessage = undefined; + component['handleConfirmationDialogClose'](QuoteActionType.EDIT, context); + launchDialogService.closeDialog('no'); + component['handleConfirmationDialogClose'](QuoteActionType.EDIT, context); + launchDialogService.closeDialog('yes'); + expect(facade.performQuoteAction).toHaveBeenCalledTimes(1); + expect(globalMessageService.add).not.toHaveBeenCalled(); + }); + it("should perform quote action if dialog was closed selecting 'yes' and display the given success message", () => { component['handleConfirmationDialogClose']( QuoteActionType.SUBMIT, diff --git a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.ts b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.ts index 71839000645..c9f89a6db55 100644 --- a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.ts +++ b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.ts @@ -41,7 +41,7 @@ export class QuoteActionsByRoleComponent implements OnInit, OnDestroy { protected launchDialogService = inject(LaunchDialogService); protected viewContainerRef = inject(ViewContainerRef); protected globalMessageService = inject(GlobalMessageService); - protected config = inject(QuoteUIConfig); + protected quoteUIConfig = inject(QuoteUIConfig); protected activeCartFacade = inject(ActiveCartFacade); quoteDetails$: Observable = this.quoteFacade.getQuoteDetails(); @@ -115,6 +115,8 @@ export class QuoteActionsByRoleComponent implements OnInit, OnDestroy { action: QuoteActionType, context: ConfirmationContext ) { + this.subscription.unsubscribe(); + this.subscription = new Subscription(); this.subscription.add( this.launchDialogService.dialogClose .pipe( @@ -164,7 +166,7 @@ export class QuoteActionsByRoleComponent implements OnInit, OnDestroy { state: QuoteState, cartIsEmpty: boolean ): boolean { - const mappingConfig = this.config.quote?.confirmActionDialogMapping; + const mappingConfig = this.quoteUIConfig.quote?.confirmActionDialogMapping; const dialogConfig = mappingConfig?.[state]?.[action] ?? mappingConfig?.[this.stateToRoleTypeForDialogConfig(state)]?.[action] ?? @@ -182,18 +184,19 @@ export class QuoteActionsByRoleComponent implements OnInit, OnDestroy { const dialogConfig = this.getDialogConfig(action, quote.state); const confirmationContext: ConfirmationContext = { quote: quote, - title: dialogConfig.i18nKey + '.title', - confirmNote: dialogConfig.i18nKey + '.confirmNote', + title: dialogConfig.i18nKeyPrefix + '.title', + confirmNote: dialogConfig.i18nKeyPrefix + '.confirmNote', }; if (dialogConfig.showWarningNote) { - confirmationContext.warningNote = dialogConfig.i18nKey + '.warningNote'; + confirmationContext.warningNote = + dialogConfig.i18nKeyPrefix + '.warningNote'; } if (dialogConfig.showExpirationDate) { confirmationContext.validity = 'quote.actions.confirmDialog.validity'; } if (dialogConfig.showSuccessMessage) { confirmationContext.successMessage = - dialogConfig.i18nKey + '.successMessage'; + dialogConfig.i18nKeyPrefix + '.successMessage'; } return confirmationContext; } @@ -202,7 +205,7 @@ export class QuoteActionsByRoleComponent implements OnInit, OnDestroy { action: QuoteActionType, state: QuoteState ): ConfirmActionDialogConfig { - const mappingConfig = this.config.quote?.confirmActionDialogMapping; + const mappingConfig = this.quoteUIConfig.quote?.confirmActionDialogMapping; const config = mappingConfig?.[state]?.[action] ?? diff --git a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.module.ts b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.module.ts index 26c4b0e0a61..36dc3874d56 100644 --- a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.module.ts +++ b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.module.ts @@ -6,8 +6,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { QuoteCoreConfig } from '@spartacus/quote/core'; -import { QuoteActionType } from '@spartacus/quote/root'; import { AuthGuard, CmsConfig, @@ -19,34 +17,6 @@ import { QuoteActionsByRoleComponent } from './quote-actions-by-role.component'; @NgModule({ imports: [CommonModule, I18nModule], providers: [ - provideDefaultConfig({ - quote: { - actions: { - primaryActions: [ - QuoteActionType.APPROVE, - QuoteActionType.CHECKOUT, - QuoteActionType.SUBMIT, - QuoteActionType.REQUOTE, - ], - actionsOrderByState: { - BUYER_DRAFT: [ - QuoteActionType.SUBMIT, - QuoteActionType.EDIT, - QuoteActionType.CANCEL, - ], - BUYER_OFFER: [ - QuoteActionType.CHECKOUT, - QuoteActionType.EDIT, - QuoteActionType.CANCEL, - ], - CANCELLED: [QuoteActionType.REQUOTE], - EXPIRED: [QuoteActionType.REQUOTE, QuoteActionType.CANCEL], - SELLER_REQUEST: [QuoteActionType.SUBMIT, QuoteActionType.EDIT], - SELLER_DRAFT: [QuoteActionType.SUBMIT, QuoteActionType.EDIT], - }, - }, - }, - }), provideDefaultConfig({ cmsComponents: { QuoteActionsByRoleComponent: { diff --git a/feature-libs/quote/components/actions/confirm-dialog/quote-actions-confirm-dialog.component.ts b/feature-libs/quote/components/actions/confirm-dialog/quote-actions-confirm-dialog.component.ts index 507ad68c3f2..4c0b9d25ab1 100644 --- a/feature-libs/quote/components/actions/confirm-dialog/quote-actions-confirm-dialog.component.ts +++ b/feature-libs/quote/components/actions/confirm-dialog/quote-actions-confirm-dialog.component.ts @@ -27,7 +27,7 @@ import { ConfirmationContext } from './quote-actions-confirm-dialog.model'; }) export class QuoteActionsConfirmDialogComponent implements OnInit { protected launchDialogService = inject(LaunchDialogService); - protected config = inject(QuoteCoreConfig); + protected quoteCoreConfig = inject(QuoteCoreConfig); iconTypes = ICON_TYPE; diff --git a/feature-libs/quote/components/actions/link/quote-actions-link.component.html b/feature-libs/quote/components/actions/link/quote-actions-link.component.html index 956ff6dc244..ea51f96e36a 100644 --- a/feature-libs/quote/components/actions/link/quote-actions-link.component.html +++ b/feature-libs/quote/components/actions/link/quote-actions-link.component.html @@ -2,17 +2,17 @@
diff --git a/feature-libs/quote/components/actions/link/quote-actions-link.component.spec.ts b/feature-libs/quote/components/actions/link/quote-actions-link.component.spec.ts index fb713eba35a..e0fc3e64710 100644 --- a/feature-libs/quote/components/actions/link/quote-actions-link.component.spec.ts +++ b/feature-libs/quote/components/actions/link/quote-actions-link.component.spec.ts @@ -115,14 +115,14 @@ describe('QuoteActionsLinkComponent', () => { CommonQuoteTestUtilsService.expectNumberOfElementsPresent( expect, htmlElem, - 'button.link', + 'a.link', 2 ); CommonQuoteTestUtilsService.expectElementToContainText( expect, htmlElem, - 'button.link', + 'a.link', 'quote.actions.link.newCart', 0 ); @@ -130,7 +130,7 @@ describe('QuoteActionsLinkComponent', () => { CommonQuoteTestUtilsService.expectElementToContainText( expect, htmlElem, - 'button.link', + 'a.link', 'quote.actions.link.quotes', 1 ); @@ -140,7 +140,7 @@ describe('QuoteActionsLinkComponent', () => { spyOn(component, 'goToNewCart').and.callThrough(); const link = CommonQuoteTestUtilsService.getHTMLElement( htmlElem, - 'button.link', + 'a.link', 0 ); link.click(); @@ -152,7 +152,7 @@ describe('QuoteActionsLinkComponent', () => { fixture.detectChanges(); const link = CommonQuoteTestUtilsService.getHTMLElement( htmlElem, - 'button.link', + 'a.link', 1 ); link.click(); diff --git a/feature-libs/quote/components/aware/ng-package.json b/feature-libs/quote/components/aware/ng-package.json new file mode 100644 index 00000000000..2a9c6221b0e --- /dev/null +++ b/feature-libs/quote/components/aware/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "./public_api.ts" + } +} diff --git a/feature-libs/quote/quote-aware/public_api.ts b/feature-libs/quote/components/aware/public_api.ts similarity index 58% rename from feature-libs/quote/quote-aware/public_api.ts rename to feature-libs/quote/components/aware/public_api.ts index 374411b4c44..902a1930859 100644 --- a/feature-libs/quote/quote-aware/public_api.ts +++ b/feature-libs/quote/components/aware/public_api.ts @@ -4,4 +4,5 @@ * SPDX-License-Identifier: Apache-2.0 */ -export * from './quote-aware.module'; +export * from './quote-aware.component.module'; +export * from './quote-aware.component'; diff --git a/feature-libs/quote/quote-aware/component/quote-aware.component.html b/feature-libs/quote/components/aware/quote-aware.component.html similarity index 100% rename from feature-libs/quote/quote-aware/component/quote-aware.component.html rename to feature-libs/quote/components/aware/quote-aware.component.html diff --git a/feature-libs/quote/quote-aware/component/quote-aware.component.module.ts b/feature-libs/quote/components/aware/quote-aware.component.module.ts similarity index 100% rename from feature-libs/quote/quote-aware/component/quote-aware.component.module.ts rename to feature-libs/quote/components/aware/quote-aware.component.module.ts diff --git a/feature-libs/quote/quote-aware/component/quote-aware.component.spec.ts b/feature-libs/quote/components/aware/quote-aware.component.spec.ts similarity index 100% rename from feature-libs/quote/quote-aware/component/quote-aware.component.spec.ts rename to feature-libs/quote/components/aware/quote-aware.component.spec.ts diff --git a/feature-libs/quote/quote-aware/component/quote-aware.component.ts b/feature-libs/quote/components/aware/quote-aware.component.ts similarity index 100% rename from feature-libs/quote/quote-aware/component/quote-aware.component.ts rename to feature-libs/quote/components/aware/quote-aware.component.ts diff --git a/feature-libs/quote/components/comments/quote-comments.component.ts b/feature-libs/quote/components/comments/quote-comments.component.ts index 83bf3a6af6f..bff27582c67 100644 --- a/feature-libs/quote/components/comments/quote-comments.component.ts +++ b/feature-libs/quote/components/comments/quote-comments.component.ts @@ -34,7 +34,7 @@ export class QuoteCommentsComponent { protected quoteItemsComponentService = inject(QuoteItemsComponentService); protected eventService = inject(EventService); protected translationService = inject(TranslationService); - protected config = inject(QuoteUIConfig); + protected quoteUIConfig = inject(QuoteUIConfig); protected document = inject(DOCUMENT); @ViewChild(MessagingComponent) commentsComponent: MessagingComponent; @@ -103,7 +103,8 @@ export class QuoteCommentsComponent { protected prepareMessagingConfigs(): MessagingConfigs { return { charactersLimit: - this.config.quote?.maxCharsForComments ?? DEFAULT_COMMENT_MAX_CHARS, + this.quoteUIConfig.quote?.maxCharsForComments ?? + DEFAULT_COMMENT_MAX_CHARS, displayAddMessageSection: this.quoteDetails$.pipe( map((quote) => quote.isEditable) ), diff --git a/feature-libs/quote/components/config/augmented-config.model.ts b/feature-libs/quote/components/config/augmented-config.model.ts deleted file mode 100644 index 1ba1337b4df..00000000000 --- a/feature-libs/quote/components/config/augmented-config.model.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 SAP Spartacus team - * - * SPDX-License-Identifier: Apache-2.0 - */ - -import { QuoteUIConfig } from './quote-ui.config'; - -declare module '@spartacus/core' { - interface Config extends QuoteUIConfig {} -} diff --git a/feature-libs/quote/components/config/default-quote-ui.config.ts b/feature-libs/quote/components/config/default-quote-ui.config.ts index bd7d7489457..8616b5cd19f 100644 --- a/feature-libs/quote/components/config/default-quote-ui.config.ts +++ b/feature-libs/quote/components/config/default-quote-ui.config.ts @@ -22,32 +22,32 @@ const defaultConfirmActionDialogConfig = { const defaultDialogMappings: ConfirmActionDialogMappingConfig = { BUYER_OFFER: { EDIT: { - i18nKey: 'quote.actions.confirmDialog.buyer_offer.edit', + i18nKeyPrefix: 'quote.actions.confirmDialog.buyer_offer.edit', showWarningNote: true, showExpirationDate: true, showSuccessMessage: false, showOnlyWhenCartIsNotEmpty: false, }, CANCEL: { - i18nKey: 'quote.actions.confirmDialog.buyer_offer.cancel', + i18nKeyPrefix: 'quote.actions.confirmDialog.buyer_offer.cancel', ...defaultConfirmActionDialogConfig, }, CHECKOUT: { - i18nKey: 'quote.actions.confirmDialog.buyer_offer.checkout', + i18nKeyPrefix: 'quote.actions.confirmDialog.buyer_offer.checkout', ...defaultConfirmActionDialogConfig, showSuccessMessage: false, }, }, EXPIRED: { EDIT: { - i18nKey: 'quote.actions.confirmDialog.expired.edit', + i18nKeyPrefix: 'quote.actions.confirmDialog.expired.edit', showWarningNote: true, showExpirationDate: false, showSuccessMessage: false, showOnlyWhenCartIsNotEmpty: false, }, REQUOTE: { - i18nKey: 'quote.actions.confirmDialog.expired.requote', + i18nKeyPrefix: 'quote.actions.confirmDialog.expired.requote', showWarningNote: true, showExpirationDate: false, showSuccessMessage: false, @@ -56,34 +56,34 @@ const defaultDialogMappings: ConfirmActionDialogMappingConfig = { }, BUYER: { SUBMIT: { - i18nKey: 'quote.actions.confirmDialog.buyer.submit', + i18nKeyPrefix: 'quote.actions.confirmDialog.buyer.submit', ...defaultConfirmActionDialogConfig, }, CANCEL: { - i18nKey: 'quote.actions.confirmDialog.buyer.cancel', + i18nKeyPrefix: 'quote.actions.confirmDialog.buyer.cancel', ...defaultConfirmActionDialogConfig, }, }, SELLER: { SUBMIT: { - i18nKey: 'quote.actions.confirmDialog.seller.submit', + i18nKeyPrefix: 'quote.actions.confirmDialog.seller.submit', ...defaultConfirmActionDialogConfig, showWarningNote: true, }, }, SELLERAPPROVER: { SUBMIT: { - i18nKey: 'quote.actions.confirmDialog.sellerapprover.submit', + i18nKeyPrefix: 'quote.actions.confirmDialog.sellerapprover.submit', ...defaultConfirmActionDialogConfig, }, REJECT: { - i18nKey: 'quote.actions.confirmDialog.sellerapprover.reject', + i18nKeyPrefix: 'quote.actions.confirmDialog.sellerapprover.reject', ...defaultConfirmActionDialogConfig, }, }, ALL: { EDIT: { - i18nKey: 'quote.actions.confirmDialog.all.edit', + i18nKeyPrefix: 'quote.actions.confirmDialog.all.edit', showWarningNote: true, showExpirationDate: false, showSuccessMessage: false, diff --git a/feature-libs/quote/components/config/index.ts b/feature-libs/quote/components/config/index.ts index c239f6d73bd..e8d3adbcda5 100644 --- a/feature-libs/quote/components/config/index.ts +++ b/feature-libs/quote/components/config/index.ts @@ -5,4 +5,3 @@ */ export * from './quote-ui.config'; -import './augmented-config.model'; diff --git a/feature-libs/quote/components/config/quote-ui.config.ts b/feature-libs/quote/components/config/quote-ui.config.ts index dd3c155b513..ec9d60492df 100644 --- a/feature-libs/quote/components/config/quote-ui.config.ts +++ b/feature-libs/quote/components/config/quote-ui.config.ts @@ -22,7 +22,7 @@ export interface QuoteUIConfigFragment { } export type ConfirmActionDialogConfig = { - i18nKey: string; + i18nKeyPrefix: string; showWarningNote: boolean; showExpirationDate: boolean; showSuccessMessage: boolean; @@ -49,3 +49,7 @@ export type ConfirmActionDialogMappingConfig = { export abstract class QuoteUIConfig { quote?: QuoteUIConfigFragment; } + +declare module '@spartacus/core' { + interface Config extends QuoteUIConfig {} +} diff --git a/feature-libs/quote/components/header/overview/quote-header-overview.component.html b/feature-libs/quote/components/header/overview/quote-header-overview.component.html index 79932722048..036adfde512 100644 --- a/feature-libs/quote/components/header/overview/quote-header-overview.component.html +++ b/feature-libs/quote/components/header/overview/quote-header-overview.component.html @@ -17,11 +17,11 @@

getQuoteInformation(quoteDetails.name, quoteDetails.description) | async " - [truncateText]="true" + [truncateParagraphText]="true" [charactersLimit]="getCharactersLimitForCardTile()" >