8000 feat: Epic/saved carts by bgambocjaviniar · Pull Request #11358 · SAP/spartacus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Epic/saved carts #11358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 75 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
4f1c966
Create base feature-lib for cart (GH-11061) (#11096)
bgambocjaviniar Feb 21, 2021
6fe081f
Merge remote-tracking branch 'origin/develop' into epic/saved-carts
dydome Feb 24, 2021
046c4c4
feat: Saved carts list page UI #9194
bgambocjaviniar Feb 25, 2021
91d8cb7
feat: Save cart UI #9191 (#11267)
dydome Feb 26, 2021
3ef5b94
Merge remote-tracking branch 'origin/develop' into epic/saved-carts
dydome Feb 26, 2021
5b27cd7
Merge branch 'develop' into epic/saved-carts
bgambocjaviniar Mar 1, 2021
3f75d1d
added missing tsconfig.json from hs-deploy-action from previous merge
bgambocjaviniar Mar 1, 2021
e30fa9c
feat: Core functionality for Saved Cart List (GH-9193) (#11230)
bgambocjaviniar Mar 2, 2021
4776a0b
feat: Core functionality for Saved Cart Details (GH-11155) (#11326)
bgambocjaviniar Mar 2, 2021
6c24c8c
Merge remote-tracking branch 'origin/develop' into epic/saved-carts
dydome Mar 3, 2021
d9ca21f
feat: Saved cart details page UI (GH-9196) (#11343)
bgambocjaviniar Mar 3, 2021
466a6ba
fixed conflict that was merged in, change backk .envrc, and update en…
bgambocjaviniar Mar 3, 2021
9a23ca2
as discussed, commit to view unit tests withthout a blocker
bgambocjaviniar Mar 3, 2021
b557a2d
feat: Update the AccountSavedCartDetailsActionsComponent UI #9197 (#1…
bgambocjaviniar Mar 4, 2021
70d8702
feat: Update the AccountSavedCartDetailsOverviewComponent #9198 (#11365)
bgambocjaviniar Mar 4, 2021
1b479b8
feat: Save cart functionality (GH-9190)
bgambocjaviniar Mar 5, 2021
ff55c26
feat: all of Saved Carts core/occ unit tests (#11409)
bgambocjaviniar Mar 8, 2021
39023fb
Some unit test on save cart functionality and added providers/imports…
dydome Mar 8, 2021
2888b11
Unit tests for details page + exposing components/services
bgambocjaviniar Mar 9, 2021
f9568b9
Revert "Unit tests for details page + exposing components/services"
bgambocjaviniar Mar 9, 2021
b78b01d
chore: support events by updating saved cart actions (#11444)
bgambocjaviniar Mar 10, 2021
81fa025
fixed conflicts
bgambocjaviniar Mar 10, 2021
4eeb8f4
Unit tests for details page + exposing components/services + change t…
bgambocjaviniar Mar 10, 2021
ba4d468
schematics update and added missing file for cart lib
bgambocjaviniar Mar 10, 2021
94d82f0
feat: truncate text with button for popover element (#11475)
dydome Mar 12, 2021
5bc136f
feat: popover element on the saved carts list with truncate (GH-11483)
dydome Mar 15, 2021
354d593
chore: Added more unit tests for saving cart (#11331)
dydome Mar 15, 2021
4fcf2d6
Merge remote-tracking branch 'origin/develop' into epic/saved-carts
dydome Mar 16, 2021
5b52558
fix merged conflict, fix build error (imports), remove truncate for s…
bgambocjaviniar Mar 16, 2021
7693feb
added proper value from removal of truncate component
bgambocjaviniar Mar 16, 2021
cb62b22
fix global package script..
bgambocjaviniar Mar 16, 2021
81881f8
feat: saved carts events (#11497)
Mar 16, 2021
49a1c17
Merge remote-tracking branch 'origin/develop' into epic/saved-carts
dydome Mar 18, 2021
3bc24b9
Fix: Saved Cart UI styling (#11504)
morganm58 Mar 18, 2021
6aac84f
prettified files
bgambocjaviniar Mar 18, 2021
26929df
Merge branch 'develop' into epic/saved-carts
bgambocjaviniar Mar 19, 2021
55b6bf9
remove that extra line for .env-cmdrv
bgambocjaviniar Mar 19, 2021
e7843da
Create the SavedCartDetailsItemsComponent (#11542)
bgambocjaviniar Mar 19, 2021
1b2244b
chore: added spinner for saved cart list on loading state (#9194)
dydome Mar 19, 2021
c167386
chore: changes for truncate text popover, saved carts list and (#11559)
dydome Mar 19, 2021
977112f
fix: saved carts pipelines fix (#11589)
dydome Mar 19, 2021
ffcd892
Feature/gh 11325 (#11440)
ren-tham Mar 22, 2021
519c7d7
chore: refactoring parts of saved cart
bgambocjaviniar Mar 22, 2021
d40b5c5
Merge branch 'develop' into epic/saved-carts
bgambocjaviniar Mar 22, 2021
6ed2115
Update feature-libs/cart/.release-it.json
dydome Mar 23, 2021
f02cdda
Update feature-libs/cart/.release-it.json
dydome Mar 23, 2021
22efc13
chore: refactoring saved carts lib after code review (#11625)
dydome Mar 23, 2021
d76bebd
chore: close dialog when component gets destroyed if ever
bgambocjaviniar Mar 23, 2021
d6d1016
test: Saved carts accessibility e2e and happy path (#11618)
bgambocjaviniar Mar 23, 2021
6cd7bbf
chore: epic review changes (#11638)
bgambocjaviniar Mar 24, 2021
e9d641a
Update projects/storefrontlib/src/shared/components/truncate-text-pop…
dydome Mar 24, 2021
f9428da
Update feature-libs/cart/saved-cart/occ/model/occ-saved-cart-endpoint…
dydome Mar 24, 2021
1fe70ce
Update feature-libs/cart/saved-cart/root/saved-cart-root.module.ts
dydome Mar 24, 2021
f6bfbac
Feature/saved carts hide configuration button (#11649)
ren-tham Mar 24, 2021
51f388b
chore: refactor component with user id service (#11642)
dydome Mar 25, 2021
4e67e2a
chore: final review for saved cart epic (#11648)
bgambocjaviniar Mar 25, 2021
3205e9a
chore: adapt saved cart lib to strict mode (#11643)
dydome Mar 25, 2021
4961683
Merge remote-tracking branch 'origin/develop' into epic/saved-carts
dydome Mar 25, 2021
f9605b5
Update projects/storefrontlib/src/cms-components/cart/cart-shared/car…
dydome Mar 25, 2021
d66081c
Update projects/storefrontlib/src/cms-components/cart/cart-shared/car…
dydome Mar 25, 2021
6705e7b
Update feature-libs/cart/saved-cart/core/services/saved-cart.service.ts
dydome Mar 25, 2021
9c6f506
Update feature-libs/cart/saved-cart/core/store/actions/saved-cart.act…
dydome Mar 25, 2021
79ae3de
Update feature-libs/cart/saved-cart/core/services/saved-cart.service.ts
dydome Mar 25, 2021
b80cdbe
Update feature-libs/cart/saved-cart/core/store/actions/saved-cart.act…
dydome Mar 25, 2021
9f8890b
Update feature-libs/cart/saved-cart/occ/adapters/occ-saved-cart.adapt…
dydome Mar 25, 2021
4ef635f
Update feature-libs/cart/saved-cart/occ/adapters/occ-saved-cart.adapt…
dydome Mar 25, 2021
43608da
Update feature-libs/cart/tsconfig.lib.json
dydome Mar 25, 2021
8d56237
Update projects/core/src/cart/store/actions/cart.action.ts
dydome Mar 25, 2021
adc6e9c
Update feature-libs/cart/saved-cart/occ/adapters/occ-saved-cart.adapt…
dydome Mar 25, 2021
51bf830
chore: revert env settings
dydome Mar 25, 2021
3fd83bb
Merge branch 'epic/saved-carts' of github.com:SAP/spartacus into epic…
dydome Mar 25, 2021
02d0dd6
Merge branch 'develop' into epic/saved-carts
marlass Mar 26, 2021
63eea2d
chore: skip e2e tests for saved cart
dydome Mar 26, 2021
8084731
Merge branch 'epic/saved-carts' of github.com:SAP/spartacus into epic…
dydome Mar 26, 2021
cd7dd95
Trigger pipeline
dydome Mar 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
{
"input": "projects/storefrontapp/src/styles/lib-qualtrics.scss",
"bundleName": "qualtrics"
},
{
"input": "projects/storefrontapp/src/styles/lib-cart.scss",
"bundleName": "cart"
}
],
"stylePreprocessorOptions": {
Expand Down Expand Up @@ -764,6 +768,43 @@
}
}
}
},
"cart": {
"projectType": "library",
"root": "feature-libs/cart",
"sourceRoot": "feature-libs/cart",
"prefix": "cx",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "feature-libs/cart/tsconfig.lib.json",
"project": "feature-libs/cart/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "feature-libs/cart/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "feature-libs/cart/test.ts",
"tsConfig": "feature-libs/cart/tsconfig.spec.json",
"karmaConfig": "feature-libs/cart/karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"feature-libs/cart/**/*.ts",
"feature-libs/cart/**/*.html"
]
}
}
}
}
},
"defaultProject": "storefrontapp"
Expand Down
12 changes: 12 additions & 0 deletions ci-scripts/unit-tests-sonar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ echo "Running schematics unit tests and code coverage for asm library"
exec 5>&1
output=$(yarn --cwd feature-libs/asm run test:schematics --coverage=true | tee /dev/fd/5)

echo "Running unit tests and code coverage for cart library"
exec 5>&1
output=$(ng test cart --sourceMap --watch=false --code-coverage --browsers=ChromeHeadless | tee /dev/fd/5)
coverage=$(echo $output | grep -i "does not meet global threshold" || true)
if [[ -n "$coverage" ]]; then
echo "Error: Tests did not meet coverage expectations"
exit 1
fi
echo "Running schematics unit tests and code coverage for cart library"
exec 5>&1
output=$(yarn --cwd feature-libs/cart run test:schematics --coverage=true | tee /dev/fd/5)

echo "Running unit tests and code coverage for setup"
exec 5>&1
output=$(ng test setup --sourceMap --watch=false --code-coverage --browsers=ChromeHeadless | tee /dev/fd/5)
Expand Down
20 changes: 10 additions & 10 deletions feature-libs/asm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@
"name": "@spartacus/asm",
"version": "3.2.0-next.2",
"description": "ASM feature library for Spartacus",
"homepage": "https://github.com/SAP/spartacus",
"keywords": [
"spartacus",
"framework",
"storefront",
"asm"
],
"homepage": "https://github.com/SAP/spartacus",
"repository": "https://github.com/SAP/spartacus/tree/develop/feature-libs/asm",
"license": "Apache-2.0",
"scripts": {
"clean:schematics": "../../node_modules/.bin/rimraf \"schematics/**/*.js\" \"schematics/**/*.js.map\" \"schematics/**/*.d.ts\"",
"build:schematics": "yarn clean:schematics && ../../node_modules/.bin/tsc -p ./tsconfig.schematics.json",
"test:schematics": "yarn --cwd ../../projects/schematics/ run clean && yarn clean:schematics && ../../node_modules/.bin/jest --config ./jest.schematics.config.js"
},
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
"dependencies": {
"tslib": "^2.0.0"
},
"repository": "https://github.com/SAP/spartacus/tree/develop/feature-libs/asm",
"peerDependencies": {
"@angular-devkit/schematics": "^10.2.1",
"@angular/common": "^10.2.4",
"@angular/core": "^10.2.4",
"@angular/forms": "^10.2.4",
"@angular-devkit/schematics": "^10.2.1",
"rxjs": "^6.6.0",
"@ngrx/effects": "^10.0.0",
"@ngrx/store": "^10.0.0",
"@schematics/angular": "10.2.1",
"@spartacus/core": "3.2.0-next.2",
"@spartacus/schematics": "3.2.0-next.2",
"@spartacus/storefront": "3.2.0-next.2",
"@spartacus/schematics": "3.2.0-next.2"
"rxjs": "^6.6.0"
},
"dependencies": {
"tslib": "^2.0.0"
"publishConfig": {
"access": "public"
}
}
4 changes: 4 additions & 0 deletions feature-libs/cart/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../.eslintrc.json",
"ignorePatterns": ["schematics/**/*.d.ts"]
}
36 changes: 36 additions & 0 deletions feature-libs/cart/.release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"git": {
"requireCleanWorkingDir": true,
"requireUpstream": false,
"tagName": "cart-${version}",
"commitMessage": "Bumping cart version to ${version}",
"tagAnnotation": "Bumping cart version to ${version}"
},
"npm": {
"publishPath": "./../../dist/cart"
},
"hooks": {
"after:version:bump": "cd ../.. && yarn build:cart"
},
"github": {
"release": true,
"assets": ["../../docs.tar.gz", "../../docs.zip"],
"releaseName": "@spartacus/cart@${version}",
"releaseNotes": "ts-node ../../scripts/changelog.ts --verbose --lib cart --to cart-${version}"
},
"plugins": {
"../../scripts/release-it/bumper.js": {
"out": [
{
"file": "package.json",
"path": [
"peerDependencies.@spartacus/core",
"peerDependencies.@spartacus/storefront",
"peerDependencies.@spartacus/schematics",
"peerDependencies.@spartacus/styles"
]
}
]
}
}
}
11 changes: 11 additions & 0 deletions feature-libs/cart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Spartacus Cart

`@spartacus/cart` is a package that you can include in your application, which allows you to use various cart features.

Cart can be added to the existing Spartacus application by running `ng add @spartacus/cart`. For more information about Spartacus schematics, visit the [official Spartacus schematics documentation page](https://sap.github.io/spartacus-docs/schematics/).

The Spartacus Cart library contains the following packages:

- `@spartacus/cart/saved-cart` is a package that adds the saved cart feature.

For more information about Spartacus, see [Spartacus](https://github.com/SAP/spartacus).
7 changes: 7 additions & 0 deletions feature-libs/cart/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import '~@spartacus/styles';

@import '~bootstrap/scss/functions';
@import '~bootstrap/scss/variables';
@import '~bootstrap/scss/_mixins';

@import './saved-cart/index';
29 changes: 29 additions & 0 deletions feature-libs/cart/jest.schematics.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { compilerOptions } = require('./tsconfig.schematics');

module.exports = {
setupFilesAfterEnv: ['<rootDir>/jest.ts'],
transform: {
'^.+\\.ts?$': 'ts-jest',
},

collectCoverage: false,
coverageReporters: ['json', 'lcov', 'text', 'clover'],
coverageDirectory: '<rootDir>/../../coverage/cart/schematics',
coverageThreshold: {
global: {
branches: 70,
functions: 80,
lines: 80,
statements: 80,
},
},

roots: ['<rootDir>/schematics'],
modulePaths: ['<rootDir>/../../projects/schematics'],
testMatch: ['**/+(*_)+(spec).+(ts)'],
moduleFileExtensions: ['js', 'ts', 'json'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths || {}, {
prefix: '<rootDir>/',
}),
};
24 changes: 24 additions & 0 deletions feature-libs/cart/jest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// uncomment when we switch the whole lib to jest
/*
Object.defineProperty(window, 'CSS', { value: null });
Object.defineProperty(window, 'getComputedStyle', {
value: () => {
return {
display: 'none',
appearance: ['-webkit-appearance'],
};
},
});

Object.defineProperty(document, 'doctype', {
value: '<!DOCTYPE html>',
});
Object.defineProperty(document.body.style, 'transform', {
value: () => {
return {
enumerable: true,
configurable: true,
};
},
});
*/
40 changes: 40 additions & 0 deletions feature-libs/cart/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-coverage'),
require('karma-junit-reporter'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
reporters: ['progress', 'kjhtml', 'coverage-istanbul', 'dots'],
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage/cart'),
reports: ['lcov', 'cobertura', 'text-summary'],
fixWebpackSourcePaths: true,
thresholds: {
statements: 80,
lines: 80,
branches: 70,
functions: 80,
},
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
});
};
13 changes: 13 additions & 0 deletions feature-libs/cart/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/cart",
"lib": {
"entryFile": "./public_api.ts",
"umdModuleIds": {
"@spartacus/core": "core",
"@spartacus/storefront": "storefront",
"rxjs": "rxjs"
}
},
"assets": ["**/*.scss", "schematics/**/*.json", "schematics/**/*.js"]
}
46 changes: 46 additions & 0 deletions feature-libs/cart/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "@spartacus/cart",
"version": "3.2.0-next.2",
"description": "",
"keywords": [
"spartacus",
"framework",
"storefront",
"cart",
"shopping",
"shop",
"saved cart"
],
"homepage": "https://github.com/SAP/spartacus",
"repository": "https://github.com/SAP/spartacus/tree/develop/feature-libs/cart",
"license": "Apache-2.0",
"scripts": {
"build:schematics": "yarn clean:schematics && ../../node_modules/.bin/tsc -p ./tsconfig.schematics.json",
"clean:schematics": "../../node_modules/.bin/rimraf \"schematics/**/*.js\" \"schematics/**/*.js.map\" \"schematics/**/*.d.ts\"",
"test:schematics": "yarn --cwd ../../projects/schematics/ run clean && yarn clean:schematics && ../../node_modules/.bin/jest --config ./jest.schematics.config.js"
},
"dependencies": {
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular-devkit/schematics": "^10.1.0",
"@angular/common": "^10.1.0",
"@angular/core": "^10.1.0",
"@angular/forms": "^10.1.0",
"@angular/router": "^10.1.0",
"@ngrx/effects": "^10.0.0",
"@ngrx/store": "^10.0.0",
"@schematics/angular": "^10.1.0",
"@spartacus/core": "3.2.0-next.2",
"@spartacus/schematics": "3.2.0-next.2",
"@spartacus/storefront": "3.2.0-next.2",
"@spartacus/styles": "3.2.0-next.2",
"bootstrap": "^4.0",
"rxjs": "^6.6.0",
"typescript": "~4.0.2"
},
"publishConfig": {
"access": "public"
},
"schematics": "./schematics/collection.json"
}
5 changes: 5 additions & 0 deletions feature-libs/cart/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* Public API Surface of cart
*/

export {};
1 change: 1 addition & 0 deletions feature-libs/cart/saved-cart/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import './styles/index';
6 changes: 6 additions & 0 deletions feature-libs/cart/saved-cart/assets/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json",
"lib": {
"entryFile": "./public_api.ts"
}
}
1 change: 1 addition & 0 deletions feature-libs/cart/saved-cart/assets/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './translations/translations';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { savedCart } from './saved-cart.i18n';

export const en = {
savedCart,
};
Loading
0