Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 7de2877

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into HEAD
2 parents 8477489 + fcdb8b0 commit 7de2877

File tree

82 files changed

+8176
-6387
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+8176
-6387
lines changed

.github/workflows/nodejs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Node CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [10.x, 12.x]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- name: yarn lint
21+
run: |
22+
yarn
23+
yarn lint
24+
env:
25+
CI: true
26+
- name: yarn build
27+
run: |
28+
yarn build
29+
env:
30+
CI: true
31+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ var/magento2-sample-data/
1414
*.iml
1515
/docker/elasticsearch/data/
1616
!/docker/elasticsearch/data/.gitkeep
17+
/docker/elasticsearch7/data/
18+
!/docker/elasticsearch7/data/.gitkeep

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [1.11.0-rc.1] - UNRELEASED
7+
## [1.11.0] - unreleased
8+
9+
### Fixed
10+
11+
- Fixed some smaller issues with graphql so that it is now working again with the fronted - #350
12+
13+
14+
## [1.11.0-rc.1] - 2019.10.03
815

916
### Added
17+
- Experimental Elastic 7 support - @pkarw (#342)
1018
- Output cache support with tagging and cache invalidate requests forwarding - @pkarw @resubaka (https://github.com/DivanteLtd/vue-storefront/issues/3367, #333)
1119
- Constant for Mailchimp subscription status - @KonstantinSoelch (#294)
1220
- mage2vs import now has optional `--generate-unique-url-keys` parameter which defaults to `false` to enable/disable the url key generation with name and id for categories - @rain2o (#232)
@@ -15,8 +23,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1523
- Added jest support - @resubaka (#321)
1624
- Added caching factory and action factory for the image endpoint. This gives the possibility to use other services for caching or image processing - @resubaka (#317, #315)
1725
- Added support for tax calculation where the values from customer_tax_class_ids is used - @resubaka (#307)
26+
- The `db` context object - passed to every api endpoint now has two usefull methods: `getElasticClient` and `getRedisClient` for accesing the data stores - @pkarw (#328)
27+
- The `lib/utils` got two new methods `getStoreCode(req: Express.Request)` and `getStoreView(code: string)` for getting the current multistore context from `vue-storefront` frontend requests - @pkarw
28+
29+
### Removed
30+
- The `scripts/seo.js` tool has been removed, the legacy `migrations` scripts have been removed, the unused legacy extensions (`gls-parcelshop-dk`, `postnord-parcelshop-dk`) - @pkarw (#342)
1831

1932
### Fixed
33+
- The way Elastic and Redis clients have been fixed and code duplication removed across the app - @pkarw (#327)
2034
- The `product.price_*` fields have been normalized with the backward compatibility support (see `config.tax.deprecatedPriceFieldsSupport` which is by default true) - @pkarw (#289)
2135
- The `product.final_price` field is now being taken into product price calcualtion. Moreover, we've added the `config.tax.finalPriceIncludesTax` - which is set to `true` by default. All the `price`, `original_price` and `special_price` fields are calculated accordingly. It was required as Magento2 uses `final_price` to set the catalog pricing rules after-prices - @pkarw (#289)
2236
- Force ES connections to use protocol config option - @cewald (#303, #304)
@@ -25,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2539
### Changed
2640
- Error responses for mailchimp - @andrzejewsky (#3337)
2741
- Replaced function arguments to object destructuring in `calculateProductTax` - @andrzejewsky (#3337)
42+
- Refactor `taxcalc.js` similar to frontend - @gibkigonzo (#356)
2843

2944
## [1.10.0] - 2019.08.12
3045

@@ -42,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4257

4358
### Changed
4459
- Sharp dependency has been updated. *It might require reinstalling yarn dependencies* - @lukeromanowicz
60+
- Replaced index property value `not_analyzed` with `true` for `options` field in attribute schema - @adityasharma7 (#334)
4561

4662
### Fixed
4763
- Missing `res` and `req` parameters are now passed to ProductProcessor - @jahvi (#218)

README.md

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Besides a big improvement for the shopping experience, we also want to create a
1919
- Docker and Docker Compose
2020

2121
Already included in `vue-storefront-api` Docker image (required locally, if you do not use containerization):
22-
- Node.js 8.x or higher
22+
- Node.js 10.x or higher
2323
- Yarn
2424

2525
## Installation
@@ -65,6 +65,68 @@ A [Kibana](https://www.elastic.co/products/kibana) service is available to explo
6565

6666
At first access it will ask to specify an index pattern, insert `vue_storefront*`
6767

68+
**Note:** Kibana is not provided with the Elastic 7 docker file. Please install it on your own when needed or check the [`es-head`](https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm) Chrome plugin.
69+
70+
## Elastic 7 support
71+
72+
By default, Vue Storefront API docker files and config are based on Elastic 5.6. We plan to change the default Elastic version to 7 with the 1.11 stable release. As for now, the [Elastic 7 support](https://github.com/DivanteLtd/vue-storefront-api/pull/342) is marked as **experimental**.
73+
74+
**How to use it?**
75+
76+
In order to use the new Elastic 7 please make sure your `vue-storefront-api` has been checked out from the [PR#342](https://github.com/DivanteLtd/vue-storefront-api/pull/342) branch.
77+
To start the Elastic 7 docker service please use the `docker-compose.elastic7.yml` file provided:
78+
79+
```bash
80+
docker-compose -f docker-compose.elastic7.yml up
81+
```
82+
83+
Then, please do change the `config/local.json` to start using the new Elastic API. Key properties in the `elasticsearch` section are: `indexTypes` and `apiVersion` (to be set to 7.1). If you're using the multistore configuration please make sure you adjusted the `storeViews.*.elasticsearch` section as well - per each separate store.
84+
85+
```json
86+
"elasticsearch": {
87+
"host": "localhost",
88+
"port": 9200,
89+
"protocol": "http",
90+
"min_score": 0.01,
91+
"indices": [
92+
"vue_storefront_catalog",
93+
"vue_storefront_catalog_de",
94+
"vue_storefront_catalog_it"
95+
],
96+
"indexTypes": [
97+
"product",
98+
"category",
99+
"cms_block",
100+
"cms_page",
101+
"attribute",
102+
"taxrule",
103+
"review"
104+
],
105+
"apiVersion": "7.1"
106+
}
107+
```
108+
109+
Starting from [Elasitc 6 and 7](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html) we can have **just single** document type per single index. Vue Storefront used to have `product`, `category` ... types defined in the `vue_storefront_catalog`.
110+
111+
From now on, we're using the separate indexes per each entity type. The convention is: `${indexName}_${entityType}`. If your' **logical index name** is `vue_storefront_catalog` then it will be mapped to the **physical indexes** of: `vue_storefront_catalog_product`, `vue_storefront_catalog_category` ...
112+
113+
To take the advantage of this new logical->physical index distinction we've provided new Elastic tools: `db7`, `migrate7`, `dump7`, `restore7` tools. They can be used exactly the same way [like the old tools](https://docs.vuestorefront.io/guide/data/database-tool.html) were. The only distinction is that they work on separate indexes.
114+
115+
**Create new index**
116+
117+
Before restoreing or importing data you might want to create a new Elastic index with the proper data types/schema applied. You can run just the `yarn db7 new` command in order to do that.
118+
119+
**Restore the data**
120+
121+
After you ran the docker file and have Elastic7 up and running you might want to:
122+
123+
a) restore the demo data by running `yarn restore7` and `yarn restore7_it; yarn restore7_de` for default multistores. The data is restored from `var/catalog_product.json`, `var/catalog_category.json` and so on...
124+
125+
b) import the data from Magento to proper physical indexes. To do so, currently you can do this only with [mage2vuestorefront](https://github.com/DivanteLtd/mage2vuestorefront/pull/96).
126+
127+
**Note:** After 1.11 stable release (around November, 2019) we'll **replace** the standard tools: `db`, `migrate`, `dump`, `restore` with the Elastic 7 equivalents and it will become the default.
128+
129+
68130
## API access
69131
Catalog API calls are compliant with ElasticSearch (it works like a filtering proxy to ES). More on ES queries: [ElasticSearch queries tutorial](http://okfnlabs.org/blog/2013/07/01/elasticsearch-query-tutorial.html)
70132

@@ -82,7 +144,7 @@ This backend is using ElasticSearch data formats popularized by [ElasticSuite fo
82144
Please use data migration mechanism provided to manipulate Redis, ElasticSearch or kue. Details: https://github.com/DivanteLtd/vue-storefront-api/tree/master/doc
83145

84146
## Adding custom modules with own dependencies (Yarn only)
85-
When adding custom [Extensions to the API](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Extending%20vue-storefront-api.md) you might want to define some dependencies inside them. Thanks to [Yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) dependecies defined inside your custom module will be intaled when you execute `yarn` at project root level, so it's way esier and faster than installing all modules dependcies separetly.
147+
When adding custom [Extensions to the API](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Extending%20vue-storefront-api.md) you might want to define some dependencies inside them. Thanks to [Yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) dependencies defined inside your custom module will be installed when you execute `yarn` at project root level, so it's way easier and faster than installing all modules dependencies separately.
86148

87149
To do this, define the `package.json` with your dependencies in your custom module:
88150
- `src/api/extensions/{your-custom-extension}/package.json`

config/default.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
"host": "localhost",
2222
"port": 9200,
2323
"protocol": "http",
24-
"user": "elastic",
25-
"password": "changeme",
2624
"min_score": 0.01,
2725
"indices": [
2826
"vue_storefront_catalog",
@@ -32,7 +30,8 @@
3230
"indexTypes": [
3331
"product",
3432
"category",
35-
"cms",
33+
"cms_block",
34+
"cms_page",
3635
"attribute",
3736
"taxrule",
3837
"review"
@@ -64,6 +63,7 @@
6463
"storeCode": "de",
6564
"disabled": false,
6665
"storeId": 3,
66+
"websiteId": 1,
6767
"name": "German Store",
6868
"url": "/de",
6969
"elasticsearch": {
@@ -98,6 +98,7 @@
9898
"storeCode": "it",
9999
"disabled": false,
100100
"storeId": 4,
101+
"websiteId": 1,
101102
"name": "Italian Store",
102103
"url": "/it",
103104
"elasticsearch": {

config/elastic.schema.attribute.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
"options": {
1010
"properties": {
1111
"value": {
12-
"type": "text",
13-
"index": "not_analyzed"
12+
"type": "text"
1413
}
1514
}
1615
}
1716
}
18-
}
17+
}

config/elastic.schema.block.extension.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

config/elastic.schema.category.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
"is_active": {"type": "boolean"},
77
"product_count": {"type": "integer"},
88
"parent_id": {"type": "integer"},
9-
"created_at": {
10-
"type": "date",
9+
"position": {"type": "integer"},
10+
"created_at": {
11+
"type": "date",
1112
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
1213
},
13-
"updated_at": {
14-
"type": "date",
14+
"updated_at": {
15+
"type": "date",
1516
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
1617
}
1718
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)