diff --git a/.env-cmdrc b/.env-cmdrc index e32846775ef..a8bec18cc0b 100644 --- a/.env-cmdrc +++ b/.env-cmdrc @@ -34,6 +34,10 @@ "CX_B2B": "true", "CX_CPQ": "true" }, + "segment-refs": { + "CX_BASE_URL": "https://api.cg79x9wuu9-eccommerc1-p7-public.model-t.myhybris.cloud", + "CX_SEGMENT_REFS": "true" + }, "b2c": { "CX_B2B": "false", "CX_CDS": "false" @@ -42,9 +46,13 @@ "CX_B2B": "true" }, "s4om": { - "CX_BASE_URL": "https://backoffice.c2twgq1sul-sapcxteam1-d11-public.model-t.myhybris.cloud", - "CX_CDC": "false", + "CX_BASE_URL": "https://api.cg79x9wuu9-eccommerc1-s8-public.model-t.myhybris.cloud", "CX_B2B": "true", - "CX_S4OM": "true" + "CX_S4OM": "true", + "CX_REQUESTED_DELIVERY_DATE": "true" + }, + "requested-delivery-date": { + "CX_BASE_URL": "https://api.cg79x9wuu9-eccommerc1-s8-public.model-t.myhybris.cloud", + "CX_REQUESTED_DELIVERY_DATE": "true" } } diff --git a/.github/api-extractor-action/package-lock.json b/.github/api-extractor-action/package-lock.json index 5a0f6880dfc..6c5642f561a 100644 --- a/.github/api-extractor-action/package-lock.json +++ b/.github/api-extractor-action/package-lock.json @@ -273,15 +273,14 @@ "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "node_modules/@azure/ms-rest-js": { - "version": "2.6.6", - "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.6.tgz", - "integrity": "sha512-WYIda8VvrkZE68xHgOxUXvjThxNf1nnGPPe0rAljqK5HJHIZ12Pi3YhEDOn3Ge7UnwaaM3eFO0VtAy4nGVI27Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz", + "integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==", "dependencies": { "@azure/core-auth": "^1.1.4", "abort-controller": "^3.0.0", "form-data": "^2.5.0", "node-fetch": "^2.6.7", - "tough-cookie": "^3.0.1", "tslib": "^1.10.0", "tunnel": "0.0.6", "uuid": "^8.3.2", @@ -590,14 +589,6 @@ "node": ">= 0.12" } }, - "node_modules/ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==", - "engines": { - "node": ">=4" - } - }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -679,45 +670,19 @@ "node": ">= 0.6.0" } }, - "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "engines": { - "node": ">=6" - } - }, "node_modules/sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } }, - "node_modules/tough-cookie": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", - "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", - "dependencies": { - "ip-regex": "^2.1.0", - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -1038,15 +1003,14 @@ } }, "@azure/ms-rest-js": { - "version": "2.6.6", - "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.6.tgz", - "integrity": "sha512-WYIda8VvrkZE68xHgOxUXvjThxNf1nnGPPe0rAljqK5HJHIZ12Pi3YhEDOn3Ge7UnwaaM3eFO0VtAy4nGVI27Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz", + "integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==", "requires": { "@azure/core-auth": "^1.1.4", "abort-controller": "^3.0.0", "form-data": "^2.5.0", "node-fetch": "^2.6.7", - "tough-cookie": "^3.0.1", "tslib": "^1.10.0", "tunnel": "0.0.6", "uuid": "^8.3.2", @@ -1326,11 +1290,6 @@ "mime-types": "^2.1.12" } }, - "ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==" - }, "is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -1383,35 +1342,15 @@ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - }, - "tough-cookie": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", - "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", - "requires": { - "ip-regex": "^2.1.0", - "psl": "^1.1.28", - "punycode": "^2.1.1" - } + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" }, "tr46": { "version": "0.0.3", diff --git a/.github/cache-builded-libs/package-lock.json b/.github/cache-builded-libs/package-lock.json index 5d9826d0f42..ec717395065 100644 --- a/.github/cache-builded-libs/package-lock.json +++ b/.github/cache-builded-libs/package-lock.json @@ -140,15 +140,14 @@ } }, "@azure/ms-rest-js": { - "version": "2.6.6", - "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.6.tgz", - "integrity": "sha512-WYIda8VvrkZE68xHgOxUXvjThxNf1nnGPPe0rAljqK5HJHIZ12Pi3YhEDOn3Ge7UnwaaM3eFO0VtAy4nGVI27Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz", + "integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==", "requires": { "@azure/core-auth": "^1.1.4", "abort-controller": "^3.0.0", "form-data": "^2.5.0", "node-fetch": "^2.6.7", - "tough-cookie": "^3.0.1", "tslib": "^1.10.0", "tunnel": "0.0.6", "uuid": "^8.3.2", @@ -164,15 +163,6 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "xml2js": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", - "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", - "requires": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - } } } }, @@ -447,11 +437,6 @@ "mime-types": "^2.1.12" } }, - "ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==" - }, "is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -499,35 +484,15 @@ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" }, - "psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" - }, - "punycode": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.2.0.tgz", - "integrity": "sha512-LN6QV1IJ9ZhxWTNdktaPClrNfp8xdSAYS0Zk2ddX7XsXZAxckMHPCBcHRo0cTcEIgYPRiGEkmji3Idkh2yFtYw==" - }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - }, - "tough-cookie": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", - "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", - "requires": { - "ip-regex": "^2.1.0", - "psl": "^1.1.28", - "punycode": "^2.1.1" - } + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" }, "tr46": { "version": "0.0.3", @@ -579,6 +544,15 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, + "xml2js": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + } + }, "xmlbuilder": { "version": "11.0.1", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", diff --git a/.gitignore b/.gitignore index 3bf7256d69f..5bc4d855cbc 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ scripts/install/config.sh *.launch .settings/ *.sublime-workspace +*.swp # IDE - VSCode .vscode/settings.json diff --git a/ci-scripts/unit-tests.sh b/ci-scripts/unit-tests.sh index 16c55e9dce9..7f77ee450f0 100755 --- a/ci-scripts/unit-tests.sh +++ b/ci-scripts/unit-tests.sh @@ -4,16 +4,15 @@ set -o pipefail EXCLUDE_APPLICATIONS=storefrontapp EXCLUDE_JEST=storefrontstyles,schematics,setup -EXCLUDE_INTEGRATION_LIBS=cdc,cds,digital-payments,epd-visualization,s4om echo "-----" function run_affected_unit_tests { echo "Running JASMINE unit tests and code coverage for AFFECTED libraries" - npx nx affected --target=test --exclude="$EXCLUDE_APPLICATIONS,$EXCLUDE_JEST,$EXCLUDE_INTEGRATION_LIBS" -- --no-watch --source-map --code-coverage --browsers ChromeHeadless + npx nx affected --target=test --exclude="$EXCLUDE_APPLICATIONS,$EXCLUDE_JEST" -- --no-watch --source-map --code-coverage --browsers ChromeHeadless echo "Running JEST (mostly schematics) unit tests and code coverage for AFFECTED libraries" - npx nx affected --target=test-jest --exclude="$EXCLUDE_APPLICATIONS,$EXCLUDE_INTEGRATION_LIBS" -- --coverage --runInBand + npx nx affected --target=test-jest --exclude="$EXCLUDE_APPLICATIONS" -- --coverage --runInBand } function run_all_unit_tests { diff --git a/core-libs/setup/package.json b/core-libs/setup/package.json index 052c5037a2c..77c1944a24a 100644 --- a/core-libs/setup/package.json +++ b/core-libs/setup/package.json @@ -1,6 +1,6 @@ { "name": "@spartacus/setup", - "version": "5.0.0", + "version": "6.3.0-1", "description": "Includes features that makes Spartacus and it's setup easier and streamlined.", "keywords": [ "spartacus", @@ -20,10 +20,10 @@ }, "peerDependencies": { "@angular/core": "^15.2.4", - "@spartacus/cart": "5.0.0", - "@spartacus/core": "5.0.0", - "@spartacus/order": "5.0.0", - "@spartacus/user": "5.0.0" + "@spartacus/cart": "6.3.0-1", + "@spartacus/core": "6.3.0-1", + "@spartacus/order": "6.3.0-1", + "@spartacus/user": "6.3.0-1" }, "optionalDependencies": { "@angular/platform-server": "^15.2.4", diff --git a/core-libs/setup/tsconfig.spec.json b/core-libs/setup/tsconfig.spec.json index 7711b9215a5..4c0cbc4a3e3 100644 --- a/core-libs/setup/tsconfig.spec.json +++ b/core-libs/setup/tsconfig.spec.json @@ -393,6 +393,21 @@ "@spartacus/qualtrics/root": [ "../../feature-libs/qualtrics/root/public_api" ], + "@spartacus/requested-delivery-date/assets": [ + "../../feature-libs/requested-delivery-date/assets/public_api" + ], + "@spartacus/requested-delivery-date/core": [ + "../../feature-libs/requested-delivery-date/core/public_api" + ], + "@spartacus/requested-delivery-date": [ + "../../feature-libs/requested-delivery-date/public_api" + ], + "@spartacus/requested-delivery-date/occ": [ + "../../feature-libs/requested-delivery-date/occ/public_api" + ], + "@spartacus/requested-delivery-date/root": [ + "../../feature-libs/requested-delivery-date/root/public_api" + ], "@spartacus/smartedit/core": [ "../../feature-libs/smartedit/core/public_api" ], @@ -478,6 +493,9 @@ "@spartacus/cdc/organization/administration": [ "../../integration-libs/cdc/organization/administration/public_api" ], + "@spartacus/cdc/organization/user-registration": [ + "../../integration-libs/cdc/organization/user-registration/public_api" + ], "@spartacus/cdc/root": ["../../integration-libs/cdc/root/public_api"], "@spartacus/cdc/user-account": [ "../../integration-libs/cdc/user-account/public_api" @@ -515,6 +533,12 @@ ], "@spartacus/s4om": ["../../integration-libs/s4om/public_api"], "@spartacus/s4om/root": ["../../integration-libs/s4om/root/public_api"], + "@spartacus/segment-refs": [ + "../../integration-libs/segment-refs/public_api" + ], + "@spartacus/segment-refs/root": [ + "../../integration-libs/segment-refs/root/public_api" + ], "@spartacus/assets": ["../../projects/assets/src/public_api"], "@spartacus/core": ["../../projects/core/public_api"], "@spartacus/storefront": ["../../projects/storefrontlib/public_api"] diff --git a/docs/assets/github-branch-selector.png b/docs/assets/github-branch-selector.png deleted file mode 100644 index 88545b95b4d..00000000000 Binary files a/docs/assets/github-branch-selector.png and /dev/null differ diff --git a/docs/libs/creating-lib.md b/docs/libs/creating-lib.md index 2e65c2e28c7..de95d5edb93 100644 --- a/docs/libs/creating-lib.md +++ b/docs/libs/creating-lib.md @@ -335,7 +335,6 @@ The following files should be modified: - `projects/storefrontapp/src/environments/models/build.process.env.d.ts` - if creating a feature that can be toggled on/off, add your feature environment variable to the `Env` interface located in this file - `projects/storefrontapp/src/environments/environment.ts` - if creating a feature that can be toggled on/off, set you feature for development as enabled or disabled by default - `projects/storefrontapp/src/environments/environment.prod.ts` - if creating a feature that can be toggled on/off, pass the created env. variable to your feature -- look for `EXCLUDE_INTEGRATION_LIBS` in the entire codebase, and add the new library to the comma separated string `IF AND ONLY IF` it is a new integration library. - Root `package.json` @@ -353,9 +352,6 @@ Also, add the new lib to the `build:libs` and `test:libs` scripts. - `ci-scripts/unit-tests.sh` -`IF AND ONLY IF` you are creating a new integration-lib, then include the library's name to the command separated string for `EXCLUDE_INTEGRATION_LIBS`. - - ### Sample data release entry ONLY if applicable diff --git a/docs/self-publishing-spartacus-libraries.md b/docs/self-publishing-spartacus-libraries.md index d8679751204..24dee4f7d70 100644 --- a/docs/self-publishing-spartacus-libraries.md +++ b/docs/self-publishing-spartacus-libraries.md @@ -35,22 +35,18 @@ For more information about using Verdaccio or another registry software, see the git clone https://github.com/SAP/spartacus.git && cd spartacus ``` -1. Use the branch or tag name to check out the branch of the required release version. +1. Use the tag name to check out the required release version. - For example, the following command checks out the first code-frozen 5.0.0 release, which is in branch `release/5.0.0-CF1`: + For example, the following command checks out the 6.1.0 release: ```bash - git checkout release/5.0.0-CF1 + git checkout 6.1.0 ``` - When choosing a tag or branch, use the specific major.minor.patch (for example, `5.0.0`) of the release you want to use. The latest release is always recommended. + When specifying the tag of the release version, use the specific major.minor.patch (for example, `6.1.0`) of the release you want to use. The latest release is always recommended. You can use the `git branch` command to confirm which branch you are on. - **Note:** You can use the dropdown menu for switching branches in the top left of the main page of the [Spartacus GitHub repository](https://github.com/SAP/spartacus) to see which releases are available. Click on **develop**, enter `release/5` in the search field that appears in the dropdown menu, and you will see all of the available releases for version 5.0.0 and newer, as shown in the following example: - - ![GitHub Branch Selector](./assets/github-branch-selector.png) - 1. Run the following command to install packages and then build the libraries: ```bash @@ -116,35 +112,32 @@ This procedure can be used to create a fresh application. ## Upgrading an Existing Spartacus App -Before upgrading your Spartacus app to version 5.0, you first need to make sure your Angular libraries are up to date. Spartacus 5.0 requires Angular 14. +Before upgrading your Spartacus app to version 6.0, you first need to make sure your Angular libraries are up to date. Spartacus 6.0 requires Angular 15. ### Upgrading Your Angular Libraries -You can upgrade your application to Angular 14 as follows: - -- Start by upgrading Angular to version 13, and verify that all breaking changes have been addressed. -- When you have updated to Angular 13, you can then upgrade to Angular 14. - -You might have to append the `--force` flag if you encounter a mismatch between peer dependencies during the migration. The following is an example command that upgrades Angular to version 13. +When upgrading your Angular libraries to version 15, you might have to append the `--force` flag if you encounter a mismatch between peer dependencies during the migration. The following is an example command that upgrades Angular to version 15. ```bash -ng update @angular/cli@13 --force +ng update @angular/cli@15 --force ``` -Afterwards, you need to upgrade third party dependencies to the version that is compatible with Angular 14, such as `@ng-bootstrap/ng-bootstrap`, `@ng-select/ng-select` or `@ngrx/store`. +Afterwards, you need to upgrade third party dependencies to the version that is compatible with Angular 15, such as `ngx-infinite-scroll`, `@ng-select/ng-select` or `@ngrx/store`. For more information, see the official [Angular Update Guide](https://update.angular.io/). -### Upgrading Your Spartacus App to 5.0 +### Upgrading Your Spartacus App to 6.0 -Spartacus 5.0 includes many new features and fixes. Since this update is a major release, some of the updates may also be breaking changes for your application. In this case, additional work on your side may be required to fix issues that result from upgrading from 4.x to 5.0. +Spartacus 6.0 includes many new features and fixes. Since this update is a major release, some of the updates may also be breaking changes for your application. In this case, additional work on your side may be required to fix issues that result from upgrading from 5.2 to 6.0. + +**Note:** You must start with a version 5.2 composable storefront app to be able to update to version 6.0. **Note:** In the following procedure, Verdaccio is used as an example of registry software, but you can use any proxy registry software that is similar to npm. These steps assume that your proxy registry is already running in a terminal window. For more information about using Verdaccio or another registry software, see the [Prerequisites](#prerequisites) section, above. -1. To update your Spartacus app to version 5.0, run the following command in the workspace of your Angular application: +1. To update your Spartacus app to version 6.0, run the following command in the workspace of your Angular application: ```bash - ng update @spartacus/schematics@latest + ng update @spartacus/schematics@6.0.0 ``` 1. Follow the onscreen instructions that appear after running the command. @@ -153,7 +146,11 @@ Spartacus 5.0 includes many new features and fixes. Since this update is a major If you are using Verdaccio, you can end the script by selecting `Exit`. Do not force-close the script; doing so will prevent cleanup from running, and as a result, the script may not run correctly in the future. 1. Inspect your code for comments that begin with `// TODO:Spartacus`. For detailed information about each added comment, see the following: - - [Typescript Breaking Changes in Composable Storefront 5.0](https://help.sap.com/doc/typescript-breaking-changes-in-composable-storefront-50/5/en-US/typescript-changes-version-5.html) + - [Typescript Breaking Changes in Composable Storefront 6.0](https://help.sap.com/doc/typescript-breaking-changes-in-composable-storefront-60/6.0/en-US/typescript-changes-version-6.html) + - [Technical Changes in Composable Storefront 6.0](https://help.sap.com/docs/SAP_COMMERCE_COMPOSABLE_STOREFRONT/10a8bc7f635b4e3db6f6bb7880e58a7d/93ffb557d3c14922bda14dfc8b4250b4.html?locale=en-US&version=6.0#loio93ffb557d3c14922bda14dfc8b4250b4) + - [Changes to Styles in Composable Storefront 6.0](https://help.sap.com/docs/SAP_COMMERCE_COMPOSABLE_STOREFRONT/10a8bc7f635b4e3db6f6bb7880e58a7d/d008d0179ea141bf84fde6ec98244ae5.html?locale=en-US&version=6.0#loiod008d0179ea141bf84fde6ec98244ae5) + - [Changes to HTML in Composable Storefront 6.0](https://help.sap.com/docs/SAP_COMMERCE_COMPOSABLE_STOREFRONT/10a8bc7f635b4e3db6f6bb7880e58a7d/f6ecd8ecdc6042dca6552c0c16448e0c.html?locale=en-US&version=6.0#loiof6ecd8ecdc6042dca6552c0c16448e0c) + - [Changes to Sample Data in Composable Storefront 6.0](https://help.sap.com/docs/SAP_COMMERCE_COMPOSABLE_STOREFRONT/10a8bc7f635b4e3db6f6bb7880e58a7d/911c4c3a9e8c4d51a9ac4cc48cd4fda6.html?locale=en-US&version=6.0#loio911c4c3a9e8c4d51a9ac4cc48cd4fda6) **Note:** The process might also downgrade some dependencies (namely RxJS), because Spartacus does not yet support the newer version. @@ -161,12 +158,6 @@ Spartacus 5.0 includes many new features and fixes. Since this update is a major You should now be running with the latest libraries installed. You can open `node_modules` and check the `@spartacus` libraries that were installed. -### Additional Information - -There are other important details to be aware of when upgrading your Spartacus app to version 5.0, such as the removal of NG Bootstrap, the removal of ModalServices and related code, and the addition of new entry points to the `@spartacus/cart` and `@spartacus/checkout` libraries. - -For more information, see [Updating to Composable Storefront Version 5.0](https://help.sap.com/docs/SAP_COMMERCE_COMPOSABLE_STOREFRONT/6d285368b1014628aebbe0aa2c74cd9d/7266f6f01edb4328b4e09df299ea09be.html) on the SAP Help Portal. - ## Sharing the Local Repository Other team members may want to consume the locally-available libraries. It is recommended that you set up a server where you can install the npm-like registry of your choice, and where you can publish locally-built Spartacus libraries. diff --git a/extra-webpack.config.js b/extra-webpack.config.js index 23568878b1d..663f036087e 100644 --- a/extra-webpack.config.js +++ b/extra-webpack.config.js @@ -42,6 +42,10 @@ module.exports = { '@spartacus/asm': path.join(__dirname, 'feature-libs/asm'), '@spartacus/smartedit': path.join(__dirname, 'feature-libs/smartedit'), '@spartacus/qualtrics': path.join(__dirname, 'feature-libs/qualtrics'), + '@spartacus/requested-delivery-date': path.join( + __dirname, + 'feature-libs/requested-delivery-date' + ), '@spartacus/tracking': path.join(__dirname, 'feature-libs/tracking'), '@spartacus/cart': path.join(__dirname, 'feature-libs/cart'), '@spartacus/order': path.join(__dirname, 'feature-libs/order'), @@ -53,7 +57,10 @@ module.exports = { __dirname, 'feature-libs/customer-ticketing' ), - '@spartacus/pickup-in-store': path.join(__dirname, 'feature-libs/pickup-in-store'), + '@spartacus/pickup-in-store': path.join( + __dirname, + 'feature-libs/pickup-in-store' + ), '@spartacus/s4om': path.join(__dirname, 'integration-libs/s4om'), }, }, diff --git a/feature-libs/asm/assets/translations/en/asm.ts b/feature-libs/asm/assets/translations/en/asm.ts index f3c2a437f53..6385c875d2c 100644 --- a/feature-libs/asm/assets/translations/en/asm.ts +++ b/feature-libs/asm/assets/translations/en/asm.ts @@ -17,6 +17,8 @@ export const asm = { saveInactiveCartAlertInfo: 'The identified cart is an inactive cart. To take further actions on this cart, save it first.', activeCartAlertInfo: 'The identified cart is an active cart.', + startCustomerEmulationAlertInfo: + 'Customer emulation has started. Any actions you do will reflect the effects on the customer account.', toggleUi: { collapse: 'Hide ASM', expand: 'Show ASM', diff --git a/feature-libs/asm/components/asm-bind-cart/asm-bind-cart.component.spec.ts b/feature-libs/asm/components/asm-bind-cart/asm-bind-cart.component.spec.ts index f5c802cbbbf..b7d5788ceae 100644 --- a/feature-libs/asm/components/asm-bind-cart/asm-bind-cart.component.spec.ts +++ b/feature-libs/asm/components/asm-bind-cart/asm-bind-cart.component.spec.ts @@ -362,6 +362,10 @@ describe('AsmBindCartComponent', () => { spyOn(asmComponentService, 'getSearchParameter').and.returnValue( 'active' ); + spyOn(asmComponentService, 'getDeepLinkUrlParams').and.returnValue({ + cartType: 'active', + customerId: '123', + }); component.ngOnInit(); expect(component.displayBindCartBtn$.next).toHaveBeenCalledWith(false); diff --git a/feature-libs/asm/components/asm-bind-cart/asm-bind-cart.component.ts b/feature-libs/asm/components/asm-bind-cart/asm-bind-cart.component.ts index cc75f1fc9b4..1a7140f7092 100644 --- a/feature-libs/asm/components/asm-bind-cart/asm-bind-cart.component.ts +++ b/feature-libs/asm/components/asm-bind-cart/asm-bind-cart.component.ts @@ -300,6 +300,7 @@ export class AsmBindCartComponent implements OnInit, OnDestroy { ); } + // TODO(CXSPA-3090): Remove optional service flags in 7.0 protected subscribeForDeeplinkCart(): void { if (this.featureConfig?.isLevel('6.2')) { this.subscription.add( @@ -313,6 +314,25 @@ export class AsmBindCartComponent implements OnInit, OnDestroy { ) ) .subscribe(() => { + // TODO(CXSPA-3090): Remove feature flag in 7.0. + if (this.featureConfig?.isLevel('6.3')) { + const cartType = + this.asmComponentService?.getSearchParameter('cartType'); + if (cartType === 'inactive' || cartType === 'active') { + this.displayBindCartBtn$.next(false); + this.displaySaveCartBtn$.next(cartType === 'inactive'); + this.deepLinkCartId = + this.asmComponentService?.getSearchParameter( + 'cartId' + ) as string; + this.cartId.setValue(this.deepLinkCartId); + this.asmComponentService?.setShowDeeplinkCartInfoAlert(true); + this.asmComponentService?.handleDeepLinkNavigation(); + } + return; + } + + // TODO(CXSPA-3090): Remove this implementation in 7.0 if (this.isDeepLinkInactiveCart()) { this.displayBindCartBtn$.next(false); this.displaySaveCartBtn$.next(true); @@ -328,6 +348,9 @@ export class AsmBindCartComponent implements OnInit, OnDestroy { } } + /** + * @deprecated in 6.3: Will be removed in CXSPA-3090. + */ protected onDeeplinkCart(): void { this.deepLinkCartId = this.asmComponentService?.getSearchParameter( 'cartId' @@ -336,11 +359,17 @@ export class AsmBindCartComponent implements OnInit, OnDestroy { this.asmComponentService?.setShowDeeplinkCartInfoAlert(true); } + /** + * @deprecated in 6.3: Will be removed in CXSPA-3090. + */ protected isDeepLinkInactiveCart(): boolean { const cartType = this.asmComponentService?.getSearchParameter('cartType'); return cartType === 'inactive'; } + /** + * @deprecated in 6.3: Will be removed in CXSPA-3090. + */ protected isDeepLinkActiveCart(): boolean { const cartType = this.asmComponentService?.getSearchParameter('cartType'); return cartType === 'active'; @@ -392,6 +421,9 @@ export class AsmBindCartComponent implements OnInit, OnDestroy { }); } + /** + * @deprecated in 6.3: Will be removed in CXSPA-3090. + */ protected goToActiveCartDetail(): void { this.routing?.go({ cxRoute: 'cart' }); } diff --git a/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.spec.ts b/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.spec.ts index 52738f58258..a73b3a605b8 100644 --- a/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.spec.ts +++ b/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.spec.ts @@ -67,6 +67,16 @@ const errorResponse: HttpErrorModel = { }, ], }; + +const duplicatedUidErrorResponse: HttpErrorModel = { + details: [ + { + message: 'Duplicate User id', + type: 'AssistedServiceDuplicatedUidError', + }, + ], +}; + @Component({ selector: 'cx-icon', template: '', @@ -191,6 +201,17 @@ describe('AsmCreateCustomerFormComponent', () => { ); }); + it('should show duplicated uid error with duplicate User id', () => { + component.createdCustomer = createdCustomerData; + // @ts-ignore + component.onRegisterUserFail(duplicatedUidErrorResponse); + expect(component.showDialogBackendErrorAlerts[0]).toBeTruthy(); + expect(component.backendErrorMessages[0]).toEqual( + 'asm.createCustomerForm.badRequestDuplicatedEmail emailAddress:' + + createdCustomerData.email + ); + }); + it('should close modal when create account successfully', () => { spyOn(asmCreateCustomerFacade, 'createCustomer').and.callThrough(); component.registerForm.patchValue(createdCustomerData); diff --git a/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.ts b/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.ts index a94d7d1fdbf..edba47086de 100644 --- a/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.ts +++ b/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.ts @@ -138,17 +138,13 @@ export class AsmCreateCustomerFormComponent { `asm.createCustomerForm.validationErrors.${errorDetail.subject}` ); break; - case 'AssistedServiceError': - if (errorDetail.message === 'Duplicate User id') { - this.addErrorMessage( - 'asm.createCustomerForm.badRequestDuplicatedEmail', - { - emailAddress: this.createdCustomer.email, - } - ); - } else { - this.addErrorMessage(unknownError); - } + case 'AssistedServiceDuplicatedUidError': + this.addErrorMessage( + 'asm.createCustomerForm.badRequestDuplicatedEmail', + { + emailAddress: this.createdCustomer.email, + } + ); break; default: this.addErrorMessage(unknownError); diff --git a/feature-libs/asm/components/asm-main-ui/asm-main-ui.component.html b/feature-libs/asm/components/asm-main-ui/asm-main-ui.component.html index dbe7bc2edf2..961baebe43f 100644 --- a/feature-libs/asm/components/asm-main-ui/asm-main-ui.component.html +++ b/feature-libs/asm/components/asm-main-ui/asm-main-ui.component.html @@ -79,6 +79,15 @@ > + + + + { spyOn(asmComponentService, 'getSearchParameter').and.returnValue( 'testuser' ); + spyOn(asmComponentService, 'getDeepLinkUrlParams').and.returnValue({ + customerId: 'testuser', + }); spyOn(featureConfig, 'isLevel').and.returnValue(true); @@ -489,6 +492,9 @@ describe('AsmMainUiComponent', () => { spyOn(asmComponentService, 'isEmulatedByDeepLink').and.returnValue( new BehaviorSubject(false) ); + spyOn(asmComponentService, 'getDeepLinkUrlParams').and.returnValue({ + customerId: 'newuser', + }); const oldUser = { customerId: 'olduser', name: 'Test old User' } as User; const newUser = { customerId: 'newuser', name: 'Test new User' } as User; @@ -513,6 +519,9 @@ describe('AsmMainUiComponent', () => { ); spyOn(authService, 'isUserLoggedIn').and.returnValue(of(false)); spyOn(asmComponentService, 'logoutCustomer').and.stub(); + spyOn(asmComponentService, 'getDeepLinkUrlParams').and.returnValue({ + customerId: testCustomerId, + }); spyOn(asmComponentService, 'getSearchParameter').and.returnValue( testCustomerId ); @@ -545,33 +554,35 @@ describe('AsmMainUiComponent', () => { }, 200); }); - it('should call naviate to home page when isEmulatedByDeepLink return true', () => { + it('should call navigate to home page when isEmulatedByDeepLink return true', () => { spyOn(routingService, 'go').and.stub(); dialogClose$.next({ selectedUser: {}, actionType: null, }); - spyOn(featureConfig, 'isLevel').and.returnValue(true); + spyOn(asmComponentService, 'isEmulateInURL').and.returnValue(true); + spyOn(featureConfig, 'isLevel').and.returnValue(true); spyOn(asmEnablerService, 'isEmulateInURL').and.returnValue(true); component.ngOnInit(); expect(routingService.go).toHaveBeenCalledWith('/'); }); - it('should not call naviate to home page when isEmulatedByDeepLink return false', () => { + it('should not call navigate to home page when isEmulatedByDeepLink return false', () => { spyOn(routingService, 'go').and.stub(); dialogClose$.next({ selectedUser: {}, actionType: null, }); - spyOn(featureConfig, 'isLevel').and.returnValue(true); + spyOn(asmComponentService, 'isEmulateInURL').and.returnValue(false); + spyOn(featureConfig, 'isLevel').and.returnValue(true); spyOn(asmEnablerService, 'isEmulateInURL').and.returnValue(false); component.ngOnInit(); expect(routingService.go).not.toHaveBeenCalledWith('/'); }); - it('should call naviate to order details when starting session with orderId in parameters', () => { + it('should call navigate to order details when starting session with orderId in parameters', () => { spyOn(routingService, 'go').and.stub(); component.startCustomerEmulationSession( @@ -585,7 +596,7 @@ describe('AsmMainUiComponent', () => { }); }); - it('should call naviate to order details when starting session with orderId and ticketId in parameters', () => { + it('should call navigate to order details when starting session with orderId and ticketId in parameters', () => { spyOn(routingService, 'go').and.stub(); component.startCustomerEmulationSession( @@ -599,7 +610,7 @@ describe('AsmMainUiComponent', () => { }); }); - it('should call naviate to support ticket details when starting session with ticketId in parameters', () => { + it('should call navigate to support ticket details when starting session with ticketId in parameters', () => { spyOn(routingService, 'go').and.stub(); component.startCustomerEmulationSession( @@ -613,7 +624,7 @@ describe('AsmMainUiComponent', () => { }); }); - it('should call naviate to saved cart when starting session with savedCartId in parameters', () => { + it('should call navigate to saved cart when starting session with savedCartId in parameters', () => { spyOn(routingService, 'go').and.stub(); component.startCustomerEmulationSession( @@ -624,7 +635,7 @@ describe('AsmMainUiComponent', () => { expect(routingService.go).toHaveBeenCalledWith('my-account/saved-cart/456'); }); - it('should call naviate to saved cart when starting session with savedCartId and ticketId in parameters', () => { + it('should call navigate to saved cart when starting session with savedCartId and ticketId in parameters', () => { spyOn(routingService, 'go').and.stub(); component.startCustomerEmulationSession( @@ -646,7 +657,7 @@ describe('AsmMainUiComponent', () => { expect(routingService.go).not.toHaveBeenCalled(); }); - it('should not call naviate when starting session with inactive cartId and ticketId in parameters', () => { + it('should not call navigate when starting session with inactive cartId and ticketId in parameters', () => { spyOn(routingService, 'go').and.stub(); component.startCustomerEmulationSession( @@ -664,4 +675,19 @@ describe('AsmMainUiComponent', () => { asmComponentService.setShowDeeplinkCartInfoAlert ).toHaveBeenCalledWith(false); }); + + it('should enable start customer emulation session meaasge and also can close the message', () => { + component.showCustomerEmulationInfoAlert = false; + + spyOn(csAgentAuthService, 'startCustomerEmulationSession').and.stub(); + const testCustomerId = 'customerid1234567890'; + component.startCustomerEmulationSession({ customerId: testCustomerId }); + expect( + csAgentAuthService.startCustomerEmulationSession + ).toHaveBeenCalledWith(testCustomerId); + + expect(component.showCustomerEmulationInfoAlert).toBeTruthy; + component.closeCustomerEmulationInfoAlert(); + expect(component.showCustomerEmulationInfoAlert).toBeFalsy; + }); }); diff --git a/feature-libs/asm/components/asm-main-ui/asm-main-ui.component.ts b/feature-libs/asm/components/asm-main-ui/asm-main-ui.component.ts index bdd26dac024..2d4d0b83384 100644 --- a/feature-libs/asm/components/asm-main-ui/asm-main-ui.component.ts +++ b/feature-libs/asm/components/asm-main-ui/asm-main-ui.component.ts @@ -31,11 +31,11 @@ import { } from '@spartacus/core'; import { ICON_TYPE, - LaunchDialogService, LAUNCH_CALLER, + LaunchDialogService, } from '@spartacus/storefront'; import { UserAccountFacade } from '@spartacus/user/account/root'; -import { combineLatest, Observable, of, Subscription } from 'rxjs'; +import { Observable, Subscription, combineLatest, of } from 'rxjs'; import { distinctUntilChanged, filter, @@ -70,11 +70,13 @@ export class AsmMainUiComponent implements OnInit, OnDestroy { deeplinkCartAlertKey: string = ''; showCreateCustomerSuccessfullyAlert = false; + globalMessageType = GlobalMessageType; @HostBinding('class.hidden') disabled = false; protected startingCustomerSession = false; + showCustomerEmulationInfoAlert = true; subscription: Subscription = new Subscription(); @@ -191,7 +193,8 @@ export class AsmMainUiComponent implements OnInit, OnDestroy { //Always route to home page to avoid 404 this.routingService.go('/'); } - const parameters = { + // TODO(CXSPA-3090): Use asmDeepLinkService only in 7.0. + const parameters = this.asmComponentService.getDeepLinkUrlParams() ?? { customerId: this.asmComponentService.getSearchParameter('customerId'), orderId: this.asmComponentService.getSearchParameter('orderId'), ticketId: this.asmComponentService.getSearchParameter('ticketId'), @@ -210,8 +213,12 @@ export class AsmMainUiComponent implements OnInit, OnDestroy { if (!isEmulatedByDeepLink && userLoggedin) { this.confirmSwitchCustomer(parameters.customerId); } else { - parameters.emulated = isEmulatedByDeepLink; - setTimeout(() => this.startSessionWithParameters(parameters)); + setTimeout(() => + this.startSessionWithParameters({ + ...parameters, + emulated: isEmulatedByDeepLink, + }) + ); } } }) @@ -298,8 +305,19 @@ export class AsmMainUiComponent implements OnInit, OnDestroy { if (customerId) { this.csAgentAuthService.startCustomerEmulationSession(customerId); this.startingCustomerSession = true; + this.showCustomerEmulationInfoAlert = true; + this.showCreateCustomerSuccessfullyAlert = false; if (parameters) { - this.handleDeepLinkParamsAfterStartSession(parameters); + // TODO(CXSPA-3090): Remove feature flag in 7.0 + if (this.featureConfig?.isLevel('6.3')) { + this.asmComponentService.handleDeepLinkNavigation({ + customerId, + ...parameters, + }); + } else { + // TODOi(CXSPA-3090): Remove this implementation in 7.0 + this.handleDeepLinkParamsAfterStartSession(parameters); + } } } else { this.globalMessageService.add( @@ -369,6 +387,10 @@ export class AsmMainUiComponent implements OnInit, OnDestroy { this.asmComponentService.setShowDeeplinkCartInfoAlert(false); } + closeCustomerEmulationInfoAlert(): void { + this.showCustomerEmulationInfoAlert = false; + } + ngOnDestroy() { this.subscription?.unsubscribe(); } diff --git a/feature-libs/asm/components/asm-save-cart-dialog/asm-save-cart-dialog.component.html b/feature-libs/asm/components/asm-save-cart-dialog/asm-save-cart-dialog.component.html index e6e9e602a7c..36969cc272c 100644 --- a/feature-libs/asm/components/asm-save-cart-dialog/asm-save-cart-dialog.component.html +++ b/feature-libs/asm/components/asm-save-cart-dialog/asm-save-cart-dialog.component.html @@ -38,31 +38,37 @@