Skip to content

Commit

Permalink
Merge release/1.0.0-beta-4.1 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 7, 2021
2 parents 0143ff4 + 5be2a7d commit 71521a7
Show file tree
Hide file tree
Showing 10 changed files with 648 additions and 31 deletions.
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/magento-api",
"version": "1.0.0-beta.4",
"version": "1.0.0-beta.4.1",
"sideEffects": false,
"license": "MIT",
"server": "server/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,60 @@
#import "../../fragments/productFragment.graphql"

query relatedProduct($search: String = "", $filter: ProductAttributeFilterInput, $pageSize: Int = 20, $currentPage: Int = 1, $sort: ProductAttributeSortInput) {
products(search: $search, filter: $filter, sort: $sort, pageSize: $pageSize, currentPage: $currentPage) {
query relatedProduct(
$search: String = ""
$filter: ProductAttributeFilterInput
$pageSize: Int = 20
$currentPage: Int = 1
$sort: ProductAttributeSortInput
) {
products(
search: $search
filter: $filter
sort: $sort
pageSize: $pageSize
currentPage: $currentPage
) {
items {
related_products {
...ProductData
uid
__typename
sku
name
new
stock_status
only_x_left_in_stock
rating_summary
sale
thumbnail {
url
position
disabled
label
}
price_range {
minimum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
}
url_key
url_rewrites {
url
}
categories {
uid
name
url_suffix
url_path
breadcrumbs {
category_name
category_url_path
}
}
}
uid
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,60 @@
#import "../../fragments/productFragment.graphql"

query upsellProducts($search: String = "", $filter: ProductAttributeFilterInput, $pageSize: Int = 20, $currentPage: Int = 1, $sort: ProductAttributeSortInput) {
products(search: $search, filter: $filter, sort: $sort, pageSize: $pageSize, currentPage: $currentPage) {
query upsellProducts(
$search: String = ""
$filter: ProductAttributeFilterInput
$pageSize: Int = 20
$currentPage: Int = 1
$sort: ProductAttributeSortInput
) {
products(
search: $search
filter: $filter
sort: $sort
pageSize: $pageSize
currentPage: $currentPage
){
items {
upsell_products {
...ProductData
uid
__typename
sku
name
new
stock_status
only_x_left_in_stock
rating_summary
sale
thumbnail {
url
position
disabled
label
}
price_range {
minimum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
}
url_key
url_rewrites {
url
}
categories {
uid
name
url_suffix
url_path
breadcrumbs {
category_name
category_url_path
}
}
}
uid
}
Expand Down
532 changes: 518 additions & 14 deletions packages/api-client/src/types/GraphQL.ts

Large diffs are not rendered by default.

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/magento",
"version": "1.0.0-beta.4",
"version": "1.0.0-beta.4.1",
"license": "MIT",
"sideEffects": false,
"main": "lib/index.cjs.js",
Expand All @@ -24,7 +24,7 @@
"access": "public"
},
"dependencies": {
"@vue-storefront/magento-api": "^1.0.0-beta.4",
"@vue-storefront/magento-api": "^1.0.0-beta.4.1",
"@vue-storefront/core": "^2.3.1",
"vue": "^2.6.x"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { CategoryGetters, AgnosticCategoryTree, AgnosticBreadcrumb } from '@vue-storefront/core';
import { Category } from '@vue-storefront/magento-api';
import { htmlDecode } from '../../helpers/htmlDecoder';

const buildTree = (rootCategory: Category, currentCategory: string, withProducts = false): AgnosticCategoryTree => ({
label: rootCategory.name,
label: htmlDecode(rootCategory.name),
slug: `/${rootCategory.url_path}${rootCategory.url_suffix || ''}`,
items: Array.isArray(rootCategory.children) && rootCategory.children.length ? rootCategory
.children
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from '@vue-storefront/magento-api';

import categoryGetters from './categoryGetters';
import { htmlDecode } from '../../helpers/htmlDecoder';

type ProductVariantFilters = any;

Expand All @@ -19,7 +20,7 @@ export const getProductName = (product: Product): string => {
return '';
}

return product.name;
return htmlDecode(product.name);
};

export const getProductSlug = (product: Product, category?: Category): string => {
Expand Down
9 changes: 9 additions & 0 deletions packages/composables/src/helpers/htmlDecoder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export function htmlDecode(input) {
try {
const domParser = new DOMParser();
const doc = domParser.parseFromString(input, 'text/html');
return doc.documentElement.textContent;
} catch {
return input;
}
}
2 changes: 2 additions & 0 deletions packages/theme/components/MyAccount/ProfileUpdateForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
:title="$t('Attention!')"
cross
persistent
@close="requirePassword = false"
>
{{ $t('Please type your current password to change your email address.') }}
<SfInput
Expand All @@ -63,6 +64,7 @@
label="Current Password"
required
class="form__element"
style="margin-top: 10px"
@keypress.enter="handleSubmit(submitForm(reset))"
/>
<SfButton
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/magento-theme",
"version": "1.0.0-beta.4",
"version": "1.0.0-beta.4.1",
"private": true,
"license": "MIT",
"scripts": {
Expand All @@ -24,7 +24,7 @@
"@nuxtjs/style-resources": "^1.0.0",
"@storefront-ui/vue": "^0.10.5",
"@vue-storefront/core": "^2.3.1",
"@vue-storefront/magento": "^1.0.0-beta.4",
"@vue-storefront/magento": "^1.0.0-beta.4.1",
"@vue-storefront/middleware": "^2.3.1",
"@vue-storefront/nuxt": "^2.3.1",
"@vue-storefront/nuxt-theme": "^2.3.1",
Expand Down

0 comments on commit 71521a7

Please sign in to comment.