-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Saved Carts is a generic save-a-cart-for-later mechanism. It's similar to the favorites wishlist. It allows us to save an active cart, see all saved carts on the list and make the saved cart active. It's especially important to the Import CSV feature Closes #11062
- Loading branch information
1 parent
25bf118
commit 7c14d9a
Showing
176 changed files
with
9,406 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "../../.eslintrc.json", | ||
"ignorePatterns": ["schematics/**/*.d.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>/', | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}; | ||
}, | ||
}); | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* | ||
* Public API Surface of cart | ||
*/ | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import './styles/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './translations/translations'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { savedCart } from './saved-cart.i18n'; | ||
|
||
export const en = { | ||
savedCart, | ||
}; |
Oops, something went wrong.