Skip to content

Commit

Permalink
Merge pull request #12 from vuestorefront-community/dev
Browse files Browse the repository at this point in the history
chore: release version 1.0.0-rc.5
  • Loading branch information
odranoelBR authored Jan 6, 2022
2 parents 34fb85a + 6c53cbb commit e6f3f9a
Show file tree
Hide file tree
Showing 8 changed files with 6,816 additions and 8,830 deletions.
15,590 changes: 6,765 additions & 8,825 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/odoo-api",
"version": "1.0.0-rc.4",
"version": "1.0.0-rc.5",
"private": false,
"sideEffects": false,
"server": "server/index.js",
Expand Down
13 changes: 13 additions & 0 deletions packages/api-client/src/fragments/orderFragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ order {
dateOrder
orderUrl
stage
websiteOrderLine {
id
name
product {
id
name
image
image
displayName
}
quantity
priceTotal
}
orderLines {
id
name
Expand Down
1 change: 1 addition & 0 deletions packages/api-client/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ export type Order = {
amountDelivery: number;
currency: Currency;
orderLines?: OrderLine[];
websiteOrderLine?: OrderLine[];
stage: OrderStage;
orderUrl: string;
transactions: PaymentTransaction[];
Expand Down
4 changes: 2 additions & 2 deletions packages/composables/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/odoo",
"version": "1.0.0-rc.4",
"version": "1.0.0-rc.5",
"private": false,
"sideEffects": false,
"main": "lib/index.cjs.js",
Expand All @@ -18,7 +18,7 @@
},
"dependencies": {
"@vue-storefront/core": "2.4.0",
"@vue-storefront/odoo-api": "1.0.0-rc.4"
"@vue-storefront/odoo-api": "1.0.0-rc.5"
},
"peerDependencies": {
"@vue/composition-api": "1.0.0-beta.21"
Expand Down
4 changes: 4 additions & 0 deletions packages/theme/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export default {
},
loading: { color: '#fff' },
plugins: [],
serverMiddleware: [
// Server-side redirects
'~/serverMiddleware/redirects',
],
buildModules: [
// to core
'@nuxtjs/pwa',
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/odoo-theme",
"version": "1.0.0-rc.4",
"version": "1.0.0-rc.5",
"private": true,
"scripts": {
"build": "nuxt build -m --dotenv .env_production",
Expand All @@ -24,7 +24,7 @@
"@vue-storefront/middleware": "2.4.0",
"@vue-storefront/nuxt": "2.4.0",
"@vue-storefront/nuxt-theme": "2.4.0",
"@vue-storefront/odoo": "1.0.0-rc.4",
"@vue-storefront/odoo": "1.0.0-rc.5",
"cookie-universal-nuxt": "^2.1.3",
"core-js": "^2.6.5",
"nuxt": "2.15.6",
Expand Down
28 changes: 28 additions & 0 deletions packages/theme/serverMiddleware/redirects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
redirects = [
{ from: '/test', to: '/test-new' },
{ from: '/test2', to: '/test2-new' }
]

module.exports = function (req, res, next) {
var url = req.url.split('?')[0];
var urlParams = null;
if (req.url.includes("?")) {
urlParams = '?' + req.url.split('?')[1]
}

const redirect = redirects.find(r => r.from === url)
if (redirect) {
var newLocation;
if (urlParams) {
newLocation = redirect.to + urlParams;
} else {
newLocation = redirect.to;
}
res.writeHead(301, {
Location: newLocation
});
res.end()
} else {
next()
}
}

0 comments on commit e6f3f9a

Please sign in to comment.