diff --git a/integration-libs/opf/base/core/services/opf-endpoints.service.spec.ts b/integration-libs/opf/base/core/services/opf-endpoints.service.spec.ts index aa4a350f936..c5471702ab1 100644 --- a/integration-libs/opf/base/core/services/opf-endpoints.service.spec.ts +++ b/integration-libs/opf/base/core/services/opf-endpoints.service.spec.ts @@ -19,7 +19,7 @@ describe('OpfEndpointsService', () => { beforeEach(() => { opfConfigMock = { opf: { - baseUrl: 'https://elec-spa.com/opf', + opfBaseUrl: 'https://elec-spa.com/opf', }, }; opfApiConfigMock = { @@ -70,7 +70,7 @@ describe('OpfEndpointsService', () => { }); it('should return an empty string when baseUrl is empty', () => { - service['opfConfig'] = { opf: { baseUrl: '' } }; + service['opfConfig'] = { opf: { opfBaseUrl: '' } }; const result = service['getBaseEndpoint'](); expect(result).toEqual(''); }); diff --git a/integration-libs/opf/base/core/services/opf-endpoints.service.ts b/integration-libs/opf/base/core/services/opf-endpoints.service.ts index 7a516abe1fe..e4b34bd70ac 100644 --- a/integration-libs/opf/base/core/services/opf-endpoints.service.ts +++ b/integration-libs/opf/base/core/services/opf-endpoints.service.ts @@ -59,8 +59,8 @@ export class OpfEndpointsService { } private getBaseEndpoint(): string { - if (this.opfConfig && this.opfConfig.opf && this.opfConfig.opf.baseUrl) { - return this.opfConfig.opf.baseUrl; + if (this.opfConfig && this.opfConfig.opf && this.opfConfig.opf.opfBaseUrl) { + return this.opfConfig.opf.opfBaseUrl; } return ''; diff --git a/integration-libs/opf/base/root/config/default-opf-config.ts b/integration-libs/opf/base/root/config/default-opf-config.ts index 1603702be26..892fa7fc041 100644 --- a/integration-libs/opf/base/root/config/default-opf-config.ts +++ b/integration-libs/opf/base/root/config/default-opf-config.ts @@ -8,6 +8,6 @@ import { OpfConfig } from './opf-config'; export const defaultOpfConfig: OpfConfig = { opf: { - baseUrl: '', + opfBaseUrl: '', }, }; diff --git a/integration-libs/opf/base/root/config/opf-config.ts b/integration-libs/opf/base/root/config/opf-config.ts index 69239ad68f0..5fcde7c4cc4 100644 --- a/integration-libs/opf/base/root/config/opf-config.ts +++ b/integration-libs/opf/base/root/config/opf-config.ts @@ -13,7 +13,7 @@ import { Config } from '@spartacus/core'; }) export abstract class OpfConfig { opf?: { - baseUrl?: string; + opfBaseUrl?: string; commerceCloudPublicKey?: string; }; } diff --git a/integration-libs/opf/schematics/add-opf/__snapshots__/index_spec.ts.snap b/integration-libs/opf/schematics/add-opf/__snapshots__/index_spec.ts.snap index c34c3a0ad4a..1c97473974f 100644 --- a/integration-libs/opf/schematics/add-opf/__snapshots__/index_spec.ts.snap +++ b/integration-libs/opf/schematics/add-opf/__snapshots__/index_spec.ts.snap @@ -2,36 +2,22 @@ exports[`Spartacus SAP OPF integration schematics: ng-add SAP OPF feature general setup should add the feature using the lazy loading syntax 1`] = ` "import { NgModule } from '@angular/core'; -import { CmsConfig, I18nConfig, provideConfig } from "@spartacus/core"; -import { opfBaseTranslationChunksConfig, opfBaseTranslations } from "@spartacus/opf/base/assets"; -import { OPF_BASE_FEATURE, OpfBaseRootModule, OpfConfig } from "@spartacus/opf/base/root"; +import { CmsConfig, provideConfig } from "@spartacus/core"; +import { OPF_QUICK_BUY_FEATURE, OpfQuickBuyRootModule } from "@spartacus/opf/quick-buy/root"; @NgModule({ declarations: [], imports: [ - OpfBaseRootModule + OpfQuickBuyRootModule ], providers: [provideConfig({ featureModules: { - [OPF_BASE_FEATURE]: { + [OPF_QUICK_BUY_FEATURE]: { module: () => - import('@spartacus/opf/base').then((m) => m.OpfBaseModule), + import('@spartacus/opf/quick-buy').then((m) => m.OpfQuickBuyModule), }, } - }), - provideConfig({ - i18n: { - resources: opfBaseTranslations, - chunks: opfBaseTranslationChunksConfig, - }, - }), - provideConfig({ - opf: { - baseUrl: "PLACEHOLDER_OPF_BASE_URL", - commerceCloudPublicKey: "PLACEHOLDER_COMMERCE_CLOUD_PUBLIC_KEY", - }, - }) - ] + })] }) export class OpfFeatureModule { } " @@ -39,36 +25,22 @@ export class OpfFeatureModule { } exports[`Spartacus SAP OPF integration schematics: ng-add SAP OPF feature general setup should add the feature using the lazy loading syntax 2`] = ` "import { NgModule } from '@angular/core'; -import { CmsConfig, I18nConfig, provideConfig } from "@spartacus/core"; -import { opfBaseTranslationChunksConfig, opfBaseTranslations } from "@spartacus/opf/base/assets"; -import { OPF_BASE_FEATURE, OpfBaseRootModule, OpfConfig } from "@spartacus/opf/base/root"; +import { CmsConfig, provideConfig } from "@spartacus/core"; +import { OPF_QUICK_BUY_FEATURE, OpfQuickBuyRootModule } from "@spartacus/opf/quick-buy/root"; @NgModule({ declarations: [], imports: [ - OpfBaseRootModule + OpfQuickBuyRootModule ], providers: [provideConfig({ featureModules: { - [OPF_BASE_FEATURE]: { + [OPF_QUICK_BUY_FEATURE]: { module: () => - import('@spartacus/opf/base').then((m) => m.OpfBaseModule), + import('@spartacus/opf/quick-buy').then((m) => m.OpfQuickBuyModule), }, } - }), - provideConfig({ - i18n: { - resources: opfBaseTranslations, - chunks: opfBaseTranslationChunksConfig, - }, - }), - provideConfig({ - opf: { - baseUrl: "PLACEHOLDER_OPF_BASE_URL", - commerceCloudPublicKey: "PLACEHOLDER_COMMERCE_CLOUD_PUBLIC_KEY", - }, - }) - ] + })] }) export class OpfFeatureModule { } " diff --git a/integration-libs/opf/schematics/add-opf/index_spec.ts b/integration-libs/opf/schematics/add-opf/index_spec.ts index 173b1eebfd0..becb979d1ba 100644 --- a/integration-libs/opf/schematics/add-opf/index_spec.ts +++ b/integration-libs/opf/schematics/add-opf/index_spec.ts @@ -13,6 +13,10 @@ import { Schema as WorkspaceOptions } from '@schematics/angular/workspace/schema import { OPF_BASE_FEATURE_NAME, OPF_CHECKOUT_FEATURE_NAME, + OPF_CTA_FEATURE_NAME, + OPF_GLOBAL_FUNCTIONS_FEATURE_NAME, + OPF_PAYMENT_FEATURE_NAME, + OPF_QUICK_BUY_FEATURE_NAME, SPARTACUS_CHECKOUT, SPARTACUS_OPF, SPARTACUS_SCHEMATICS, @@ -72,6 +76,25 @@ describe('Spartacus SAP OPF integration schematics: ng-add', () => { features: [OPF_BASE_FEATURE_NAME], }; + const opfPaymentFeatureOptions: SpartacusOpfOptions = { + ...libraryNoFeaturesOptions, + features: [OPF_PAYMENT_FEATURE_NAME], + }; + + const opfCtaFeatureOptions: SpartacusOpfOptions = { + ...libraryNoFeaturesOptions, + features: [OPF_CTA_FEATURE_NAME], + }; + const opfGlobalFunctionsFeatureOptions: SpartacusOpfOptions = { + ...libraryNoFeaturesOptions, + features: [OPF_GLOBAL_FUNCTIONS_FEATURE_NAME], + }; + + const opfQuickBuyFeatureOptions: SpartacusOpfOptions = { + ...libraryNoFeaturesOptions, + features: [OPF_QUICK_BUY_FEATURE_NAME], + }; + beforeEach(async () => { schematicRunner.registerCollection( SPARTACUS_SCHEMATICS, @@ -129,7 +152,14 @@ describe('Spartacus SAP OPF integration schematics: ng-add', () => { beforeEach(async () => { appTree = await schematicRunner.runSchematic( 'ng-add', - { ...checkoutFeatureOptions, ...opfFeatureOptions }, + { + ...checkoutFeatureOptions, + ...opfFeatureOptions, + ...opfPaymentFeatureOptions, + ...opfCtaFeatureOptions, + ...opfGlobalFunctionsFeatureOptions, + ...opfQuickBuyFeatureOptions, + }, appTree ); }); diff --git a/integration-libs/opf/schematics/add-opf/schema.json b/integration-libs/opf/schematics/add-opf/schema.json index 3e8a6f4d4fd..c106443db2c 100644 --- a/integration-libs/opf/schematics/add-opf/schema.json +++ b/integration-libs/opf/schematics/add-opf/schema.json @@ -25,12 +25,26 @@ "type": "array", "uniqueItems": true, "items": { - "enum": ["OPF-Checkout", "OPF-Base"], + "enum": [ + "OPF-Checkout", + "OPF-Base", + "OPF-Payment", + "OPF-Cta", + "OPF-Global-Functions", + "OPF-Quick-Buy" + ], "type": "string" }, - "default": ["OPF-Checkout", "OPF-Base"] + "default": [ + "OPF-Checkout", + "OPF-Base", + "OPF-Payment", + "OPF-Cta", + "OPF-Global-Functions", + "OPF-Quick-Buy" + ] }, - "baseUrl": { + "opfBaseUrl": { "type": "string", "description": "The base url of Cloud Commerce Adapter for Open Payment Framework integration", "x-prompt": "[OPF] What is the base URL (origin) of your OPF Cloud Commerce Adapter?" diff --git a/projects/schematics/src/shared/lib-configs/integration-libs/opf-schematics-config.ts b/projects/schematics/src/shared/lib-configs/integration-libs/opf-schematics-config.ts index 0469ef6403b..d755feb2729 100644 --- a/projects/schematics/src/shared/lib-configs/integration-libs/opf-schematics-config.ts +++ b/projects/schematics/src/shared/lib-configs/integration-libs/opf-schematics-config.ts @@ -5,30 +5,39 @@ */ import { - CHECKOUT_BASE_FEATURE_NAME, OPF_BASE_FEATURE_NAME, OPF_CHECKOUT_FEATURE_NAME, + OPF_CTA_FEATURE_NAME, + OPF_GLOBAL_FUNCTIONS_FEATURE_NAME, + OPF_PAYMENT_FEATURE_NAME, + OPF_QUICK_BUY_FEATURE_NAME, SPARTACUS_OPF, SPARTACUS_OPF_BASE, - SPARTACUS_OPF_BASE_ASSETS, SPARTACUS_OPF_BASE_ROOT, SPARTACUS_OPF_CHECKOUT, SPARTACUS_OPF_CHECKOUT_ASSETS, SPARTACUS_OPF_CHECKOUT_ROOT, + SPARTACUS_OPF_CTA, + SPARTACUS_OPF_CTA_ROOT, + SPARTACUS_OPF_GLOBAL_FUNCTIONS, + SPARTACUS_OPF_GLOBAL_FUNCTIONS_ROOT, + SPARTACUS_OPF_PAYMENT, + SPARTACUS_OPF_PAYMENT_ASSETS, + SPARTACUS_OPF_PAYMENT_ROOT, + SPARTACUS_OPF_QUICK_BUY, + SPARTACUS_OPF_QUICK_BUY_ROOT, } from '../../libs-constants'; import { AdditionalFeatureConfiguration } from '../../utils/feature-utils'; import { LibraryOptions, SchematicConfig } from '../../utils/lib-utils'; -import { CHECKOUT_BASE_MODULE } from '../checkout-schematics-config'; export interface SpartacusOpfOptions extends LibraryOptions { - baseUrl?: string; + opfBaseUrl?: string; commerceCloudPublicKey?: string; } export const OPF_FOLDER_NAME = 'opf'; export const OPF_MODULE_NAME = 'Opf'; export const OPF_SCSS_FILE_NAME = 'opf.scss'; - export const OPF_CONFIG = 'OpfConfig'; export const OPF_CHECKOUT_FEATURE_NAME_CONSTANT = 'OPF_CHECKOUT_FEATURE'; @@ -41,9 +50,85 @@ export const OPF_CHECKOUT_TRANSLATION_CHUNKS_CONFIG = export const OPF_BASE_FEATURE_NAME_CONSTANT = 'OPF_BASE_FEATURE'; export const OPF_BASE_MODULE = 'OpfBaseModule'; export const OPF_BASE_ROOT_MODULE = 'OpfBaseRootModule'; -export const OPF_BASE_TRANSLATIONS = 'opfBaseTranslations'; -export const OPF_BASE_TRANSLATION_CHUNKS_CONFIG = - 'opfBaseTranslationChunksConfig'; + +export const OPF_GLOBAL_FUNCTIONS_FEATURE_NAME_CONSTANT = + 'OPF_GLOBAL_FUNCTIONS_FEATURE'; +export const OPF_GLOBAL_FUNCTIONS_MODULE = 'OpfGlobalFunctionsModule'; +export const OPF_GLOBAL_FUNCTIONS_ROOT_MODULE = 'OpfGlobalFunctionsRootModule'; + +export const OPF_CTA_FEATURE_NAME_CONSTANT = 'OPF_CTA_FEATURE'; +export const OPF_CTA_MODULE = 'OpfCtaModule'; +export const OPF_CTA_ROOT_MODULE = 'OpfCtaRootModule'; + +export const OPF_QUICK_BUY_FEATURE_NAME_CONSTANT = 'OPF_QUICK_BUY_FEATURE'; +export const OPF_QUICK_BUY_MODULE = 'OpfQuickBuyModule'; +export const OPF_QUICK_BUY_ROOT_MODULE = 'OpfQuickBuyRootModule'; + +export const OPF_PAYMENT_FEATURE_NAME_CONSTANT = 'OPF_PAYMENT_FEATURE'; +export const OPF_PAYMENT_MODULE = 'OpfPaymentModule'; +export const OPF_PAYMENT_ROOT_MODULE = 'OpfPaymentRootModule'; +export const OPF_PAYMENT_TRANSLATIONS = 'opfPaymentTranslations'; +export const OPF_PAYMENT_TRANSLATION_CHUNKS_CONFIG = + 'opfPaymentTranslationChunksConfig'; + +export const OPF_BASE_SCHEMATICS_CONFIG: SchematicConfig = { + library: { + featureName: OPF_BASE_FEATURE_NAME, + mainScope: SPARTACUS_OPF, + featureScope: SPARTACUS_OPF_BASE, + }, + folderName: OPF_FOLDER_NAME, + moduleName: OPF_MODULE_NAME, + featureModule: { + name: OPF_BASE_MODULE, + importPath: SPARTACUS_OPF_BASE, + }, + rootModule: { + name: OPF_BASE_ROOT_MODULE, + importPath: SPARTACUS_OPF_BASE_ROOT, + }, + lazyLoadingChunk: { + moduleSpecifier: SPARTACUS_OPF_BASE_ROOT, + namedImports: [OPF_BASE_FEATURE_NAME_CONSTANT], + }, + styles: { + scssFileName: OPF_SCSS_FILE_NAME, + importStyle: SPARTACUS_OPF, + }, + customConfig: buildOpfConfig, +}; + +export const OPF_PAYMENT_SCHEMATICS_CONFIG: SchematicConfig = { + library: { + featureName: OPF_PAYMENT_FEATURE_NAME, + mainScope: SPARTACUS_OPF, + featureScope: SPARTACUS_OPF_PAYMENT, + }, + folderName: OPF_FOLDER_NAME, + moduleName: OPF_MODULE_NAME, + featureModule: { + name: OPF_PAYMENT_MODULE, + importPath: SPARTACUS_OPF_PAYMENT, + }, + rootModule: { + name: OPF_PAYMENT_ROOT_MODULE, + importPath: SPARTACUS_OPF_PAYMENT_ROOT, + }, + lazyLoadingChunk: { + moduleSpecifier: SPARTACUS_OPF_PAYMENT_ROOT, + namedImports: [OPF_PAYMENT_FEATURE_NAME_CONSTANT], + }, + i18n: { + resources: OPF_PAYMENT_TRANSLATIONS, + chunks: OPF_PAYMENT_TRANSLATION_CHUNKS_CONFIG, + importPath: SPARTACUS_OPF_PAYMENT_ASSETS, + }, + styles: { + scssFileName: OPF_SCSS_FILE_NAME, + importStyle: SPARTACUS_OPF, + }, + customConfig: buildOpfConfig, +}; export const OPF_CHECKOUT_SCHEMATICS_CONFIG: SchematicConfig = { library: { @@ -61,6 +146,10 @@ export const OPF_CHECKOUT_SCHEMATICS_CONFIG: SchematicConfig = { name: OPF_CHECKOUT_ROOT_MODULE, importPath: SPARTACUS_OPF_CHECKOUT_ROOT, }, + lazyLoadingChunk: { + moduleSpecifier: SPARTACUS_OPF_CHECKOUT_ROOT, + namedImports: [OPF_CHECKOUT_FEATURE_NAME_CONSTANT], + }, i18n: { resources: OPF_CHECKOUT_TRANSLATIONS, chunks: OPF_CHECKOUT_TRANSLATION_CHUNKS_CONFIG, @@ -70,46 +159,92 @@ export const OPF_CHECKOUT_SCHEMATICS_CONFIG: SchematicConfig = { scssFileName: OPF_SCSS_FILE_NAME, importStyle: SPARTACUS_OPF, }, - dependencyFeatures: [CHECKOUT_BASE_FEATURE_NAME, OPF_BASE_FEATURE_NAME], - importAfter: [ - { - markerModuleName: CHECKOUT_BASE_MODULE, - featureModuleName: OPF_CHECKOUT_MODULE, - }, - ], customConfig: buildOpfConfig, + dependencyFeatures: [ + OPF_PAYMENT_FEATURE_NAME, + OPF_BASE_FEATURE_NAME, + OPF_CTA_FEATURE_NAME, + OPF_GLOBAL_FUNCTIONS_FEATURE_NAME, + OPF_QUICK_BUY_FEATURE_NAME, + ], }; -export const OPF_BASE_SCHEMATICS_CONFIG: SchematicConfig = { +export const OPF_CTA_SCHEMATICS_CONFIG: SchematicConfig = { library: { - featureName: OPF_BASE_FEATURE_NAME, + featureName: OPF_CTA_FEATURE_NAME, mainScope: SPARTACUS_OPF, - featureScope: SPARTACUS_OPF_BASE, + featureScope: SPARTACUS_OPF_CTA, }, folderName: OPF_FOLDER_NAME, moduleName: OPF_MODULE_NAME, featureModule: { - name: OPF_BASE_MODULE, - importPath: SPARTACUS_OPF_BASE, + name: OPF_CTA_MODULE, + importPath: SPARTACUS_OPF_CTA, }, rootModule: { - name: OPF_BASE_ROOT_MODULE, - importPath: SPARTACUS_OPF_BASE_ROOT, + name: OPF_CTA_ROOT_MODULE, + importPath: SPARTACUS_OPF_CTA_ROOT, }, lazyLoadingChunk: { - moduleSpecifier: SPARTACUS_OPF_BASE_ROOT, - namedImports: [OPF_BASE_FEATURE_NAME_CONSTANT], + moduleSpecifier: SPARTACUS_OPF_CTA_ROOT, + namedImports: [OPF_CTA_FEATURE_NAME_CONSTANT], }, - i18n: { - resources: OPF_BASE_TRANSLATIONS, - chunks: OPF_BASE_TRANSLATION_CHUNKS_CONFIG, - importPath: SPARTACUS_OPF_BASE_ASSETS, + styles: { + scssFileName: OPF_SCSS_FILE_NAME, + importStyle: SPARTACUS_OPF, + }, +}; + +export const OPF_GLOBAL_FUNCTIONS_SCHEMATICS_CONFIG: SchematicConfig = { + library: { + featureName: OPF_GLOBAL_FUNCTIONS_FEATURE_NAME, + mainScope: SPARTACUS_OPF, + featureScope: SPARTACUS_OPF_GLOBAL_FUNCTIONS, + }, + folderName: OPF_FOLDER_NAME, + moduleName: OPF_MODULE_NAME, + featureModule: { + name: OPF_GLOBAL_FUNCTIONS_MODULE, + importPath: SPARTACUS_OPF_GLOBAL_FUNCTIONS, + }, + rootModule: { + name: OPF_GLOBAL_FUNCTIONS_ROOT_MODULE, + importPath: SPARTACUS_OPF_GLOBAL_FUNCTIONS_ROOT, + }, + lazyLoadingChunk: { + moduleSpecifier: SPARTACUS_OPF_GLOBAL_FUNCTIONS_ROOT, + namedImports: [OPF_GLOBAL_FUNCTIONS_FEATURE_NAME_CONSTANT], + }, + styles: { + scssFileName: OPF_SCSS_FILE_NAME, + importStyle: SPARTACUS_OPF, + }, +}; + +export const OPF_QUICK_BUY_SCHEMATICS_CONFIG: SchematicConfig = { + library: { + featureName: OPF_QUICK_BUY_FEATURE_NAME, + mainScope: SPARTACUS_OPF, + featureScope: SPARTACUS_OPF_QUICK_BUY, + }, + folderName: OPF_FOLDER_NAME, + moduleName: OPF_MODULE_NAME, + featureModule: { + name: OPF_QUICK_BUY_MODULE, + importPath: SPARTACUS_OPF_QUICK_BUY, + }, + rootModule: { + name: OPF_QUICK_BUY_ROOT_MODULE, + importPath: SPARTACUS_OPF_QUICK_BUY_ROOT, + }, + lazyLoadingChunk: { + moduleSpecifier: SPARTACUS_OPF_QUICK_BUY_ROOT, + namedImports: [OPF_QUICK_BUY_FEATURE_NAME_CONSTANT], }, styles: { scssFileName: OPF_SCSS_FILE_NAME, importStyle: SPARTACUS_OPF, }, - customConfig: buildOpfConfig, }; function buildOpfConfig( @@ -125,7 +260,7 @@ function buildOpfConfig( ], content: `<${OPF_CONFIG}>{ opf: { - baseUrl: "${options.baseUrl || 'PLACEHOLDER_OPF_BASE_URL'}", + opfBaseUrl: "${options.opfBaseUrl || 'PLACEHOLDER_OPF_BASE_URL'}", commerceCloudPublicKey: "${ options.commerceCloudPublicKey || 'PLACEHOLDER_COMMERCE_CLOUD_PUBLIC_KEY' diff --git a/projects/schematics/src/shared/libs-constants.ts b/projects/schematics/src/shared/libs-constants.ts index 0b32dcb56e6..4846b111af3 100644 --- a/projects/schematics/src/shared/libs-constants.ts +++ b/projects/schematics/src/shared/libs-constants.ts @@ -237,9 +237,22 @@ export const SPARTACUS_OPF_CHECKOUT = `@spartacus/opf/checkout`; export const SPARTACUS_OPF_CHECKOUT_ROOT = `@spartacus/opf/checkout/root`; export const SPARTACUS_OPF_CHECKOUT_ASSETS = `@spartacus/opf/checkout/assets`; +export const SPARTACUS_OPF_PAYMENT = `@spartacus/opf/payment`; +export const SPARTACUS_OPF_PAYMENT_ROOT = `@spartacus/opf/payment/root`; +export const SPARTACUS_OPF_PAYMENT_ASSETS = `@spartacus/opf/payment/assets`; + +export const SPARTACUS_OPF_GLOBAL_FUNCTIONS = `@spartacus/opf/global-functions`; +export const SPARTACUS_OPF_GLOBAL_FUNCTIONS_ROOT = `@spartacus/opf/global-functions/root`; + +export const SPARTACUS_OPF_CTA = `@spartacus/opf/cta`; +export const SPARTACUS_OPF_CTA_ROOT = `@spartacus/opf/cta/root`; + +export const SPARTACUS_OPF_QUICK_BUY = `@spartacus/opf/quick-buy`; +export const SPARTACUS_OPF_QUICK_BUY_ROOT = `@spartacus/opf/quick-buy/root`; + export const SPARTACUS_OPF_BASE = `@spartacus/opf/base`; export const SPARTACUS_OPF_BASE_ROOT = `@spartacus/opf/base/root`; -export const SPARTACUS_OPF_BASE_ASSETS = `@spartacus/opf/base/assets`; + export const SPARTACUS_OMF = '@spartacus/omf'; export const SPARTACUS_OMF_ROOT = '@spartacus/omf/root'; export const SPARTACUS_OMF_ORDER = '@spartacus/omf/order'; @@ -355,6 +368,10 @@ export const CUSTOMER_TICKETING_FEATURE_NAME = 'Customer-Ticketing'; export const OPF_FEATURE_NAME = 'OPF'; export const OPF_CHECKOUT_FEATURE_NAME = 'OPF-Checkout'; export const OPF_BASE_FEATURE_NAME = 'OPF-Base'; +export const OPF_PAYMENT_FEATURE_NAME = 'OPF-Payment'; +export const OPF_CTA_FEATURE_NAME = 'OPF-Cta'; +export const OPF_GLOBAL_FUNCTIONS_FEATURE_NAME = 'OPF-Global-Functions'; +export const OPF_QUICK_BUY_FEATURE_NAME = 'OPF-Quick-Buy'; /***** Feature name end *****/ /***** Feature name start *****/ diff --git a/projects/schematics/src/shared/schematics-config-mappings.ts b/projects/schematics/src/shared/schematics-config-mappings.ts index 83454ea73bc..8aa815d603b 100644 --- a/projects/schematics/src/shared/schematics-config-mappings.ts +++ b/projects/schematics/src/shared/schematics-config-mappings.ts @@ -40,6 +40,10 @@ import { EPD_SCHEMATICS_CONFIG } from './lib-configs/integration-libs/epd-schema import { OPF_BASE_SCHEMATICS_CONFIG, OPF_CHECKOUT_SCHEMATICS_CONFIG, + OPF_CTA_SCHEMATICS_CONFIG, + OPF_GLOBAL_FUNCTIONS_SCHEMATICS_CONFIG, + OPF_PAYMENT_SCHEMATICS_CONFIG, + OPF_QUICK_BUY_SCHEMATICS_CONFIG, } from './lib-configs/integration-libs/opf-schematics-config'; import { S4OM_SCHEMATICS_CONFIG } from './lib-configs/integration-libs/s4om-schematics-config'; @@ -168,6 +172,10 @@ export const SCHEMATICS_CONFIGS: SchematicConfig[] = [ OPF_BASE_SCHEMATICS_CONFIG, OPF_CHECKOUT_SCHEMATICS_CONFIG, + OPF_PAYMENT_SCHEMATICS_CONFIG, + OPF_CTA_SCHEMATICS_CONFIG, + OPF_GLOBAL_FUNCTIONS_SCHEMATICS_CONFIG, + OPF_QUICK_BUY_SCHEMATICS_CONFIG, S4_SERVICE_SCHEMATICS_CONFIG, diff --git a/projects/schematics/src/shared/utils/graph-utils_spec.ts b/projects/schematics/src/shared/utils/graph-utils_spec.ts index 743cab48017..19c59b19251 100644 --- a/projects/schematics/src/shared/utils/graph-utils_spec.ts +++ b/projects/schematics/src/shared/utils/graph-utils_spec.ts @@ -189,7 +189,11 @@ describe('Graph utils', () => { "Personalization", "TMS-AEPL", "TMS-GTM", + "OPF-Quick-Buy", + "OPF-Global-Functions", + "OPF-Cta", "OPF-Base", + "OPF-Payment", "OPF-Checkout", "PDF-Invoices", "Requested-Delivery-Date", diff --git a/projects/storefrontapp/src/app/spartacus/features/opf/opf-feature.module.ts b/projects/storefrontapp/src/app/spartacus/features/opf/opf-feature.module.ts index 0a044785627..13ed200b19e 100644 --- a/projects/storefrontapp/src/app/spartacus/features/opf/opf-feature.module.ts +++ b/projects/storefrontapp/src/app/spartacus/features/opf/opf-feature.module.ts @@ -117,7 +117,7 @@ if (environment.b2b) { }), provideConfig({ opf: { - baseUrl: + opfBaseUrl: 'https://cp96avkh5f-integrati2-d2.opf.commerce.stage.context.cloud.sap/commerce-cloud-adapter-stage/storefront', commerceCloudPublicKey: 'k2N3m3TJPLragwia5ZUvS/qkIPVQoy5qjUkOAB6Db+U=', }, diff --git a/scripts/install/functions.sh b/scripts/install/functions.sh index 7b28acfe870..c8ad7e646e1 100644 --- a/scripts/install/functions.sh +++ b/scripts/install/functions.sh @@ -136,7 +136,7 @@ function add_epd_visualization { function add_opf { if [ "$ADD_OPF" = true ] ; then - ng add @spartacus/opf@${SPARTACUS_VERSION} --base-url ${OPF_BASE_URL} --commerce-cloud-public-key ${OPF_CLIENT_PUBLIC_KEY} --skip-confirmation --no-interactive + ng add @spartacus/opf@${SPARTACUS_VERSION} --opf-base-url ${OPF_BASE_URL} --commerce-cloud-public-key ${OPF_CLIENT_PUBLIC_KEY} --skip-confirmation --no-interactive fi }