@riosst100/pwa-marketplace 2.7.0 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/componentOverrideMapping.js +1 -0
- package/src/components/FilterListContent/filterListPage.js +1 -1
- package/src/components/ProductLabel/index.js +2 -0
- package/src/components/SellerProducts/productContent.js +1 -1
- package/src/components/SetsData/setsData.js +1 -1
- package/src/components/ShopBy/shopBy.js +1 -2
- package/src/overwrites/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js +33 -1
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js +5 -2
- package/src/overwrites/peregrine/lib/talons/SearchPage/searchPage.gql.js +126 -0
- package/src/overwrites/venia-ui/lib/components/Image/image.js +14 -13
package/package.json
CHANGED
|
@@ -15,6 +15,7 @@ module.exports = componentOverrideMapping = {
|
|
|
15
15
|
[`@magento/peregrine/lib/context/cart.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/context/cart.js',
|
|
16
16
|
[`@magento/peregrine/lib/talons/CheckoutPage/useCheckoutPage.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/CheckoutPage/useCheckoutPage.js',
|
|
17
17
|
[`@magento/peregrine/lib/talons/SignIn/signIn.gql.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/SignIn/signIn.gql.js',
|
|
18
|
+
[`@magento/peregrine/lib/talons/SearchPage/searchPage.gql.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/SearchPage/searchPage.gql.js',
|
|
18
19
|
[`@magento/peregrine/lib/talons/SignIn/useSignIn.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/SignIn/useSignIn.js',
|
|
19
20
|
[`@magento/peregrine/lib/talons/AccountMenu/useAccountMenuItems.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/AccountMenu/useAccountMenuItems.js',
|
|
20
21
|
[`@magento/peregrine/lib/talons/MegaMenu/megaMenu.gql.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/MegaMenu/megaMenu.gql.js',
|
|
@@ -245,7 +245,7 @@ const FilterListPage = props => {
|
|
|
245
245
|
if (label == "Singles") {
|
|
246
246
|
isSingles = true;
|
|
247
247
|
}
|
|
248
|
-
if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands"
|
|
248
|
+
if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands") {
|
|
249
249
|
activeFilters.push(
|
|
250
250
|
{
|
|
251
251
|
'label': label,
|
|
@@ -228,7 +228,7 @@ const ProductContent = props => {
|
|
|
228
228
|
if (label == "Singles") {
|
|
229
229
|
isSingles = true;
|
|
230
230
|
}
|
|
231
|
-
if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands"
|
|
231
|
+
if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands") {
|
|
232
232
|
activeFilters.push(
|
|
233
233
|
{
|
|
234
234
|
'label': label,
|
|
@@ -261,7 +261,7 @@ const SetsData = props => {
|
|
|
261
261
|
if (label == "Singles") {
|
|
262
262
|
isSingles = true;
|
|
263
263
|
}
|
|
264
|
-
if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands"
|
|
264
|
+
if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands") {
|
|
265
265
|
activeFilters.push(
|
|
266
266
|
{
|
|
267
267
|
'label': label,
|
|
@@ -83,7 +83,6 @@ const ShopBy = props => {
|
|
|
83
83
|
// totalPagesFromData,
|
|
84
84
|
// attributesBlock,
|
|
85
85
|
// category,
|
|
86
|
-
// virtualCategoryFilters
|
|
87
86
|
// } = talonProps;
|
|
88
87
|
|
|
89
88
|
const [active, setActive] = useState('all')
|
|
@@ -348,7 +347,7 @@ const ShopBy = props => {
|
|
|
348
347
|
if (label == "Singles") {
|
|
349
348
|
isSingles = true;
|
|
350
349
|
}
|
|
351
|
-
if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands"
|
|
350
|
+
if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands") {
|
|
352
351
|
activeFilters.push(
|
|
353
352
|
{
|
|
354
353
|
'label': label,
|
|
@@ -221,6 +221,33 @@ const getConfigPrice = (product, optionCodes, optionSelections) => {
|
|
|
221
221
|
return value;
|
|
222
222
|
};
|
|
223
223
|
|
|
224
|
+
const getConfigName = (product, optionCodes, optionSelections) => {
|
|
225
|
+
let value;
|
|
226
|
+
|
|
227
|
+
const { variants } = product;
|
|
228
|
+
const isConfigurable = isProductConfigurable(product);
|
|
229
|
+
|
|
230
|
+
const optionsSelected =
|
|
231
|
+
Array.from(optionSelections.values()).filter(value => !!value).length >
|
|
232
|
+
0;
|
|
233
|
+
|
|
234
|
+
if (!isConfigurable) {
|
|
235
|
+
value = product.name;
|
|
236
|
+
} else {
|
|
237
|
+
const item = findMatchingVariant({
|
|
238
|
+
optionCodes,
|
|
239
|
+
optionSelections,
|
|
240
|
+
variants
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
value = optionsSelected && item
|
|
244
|
+
? item.product.name
|
|
245
|
+
: product.name;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return value;
|
|
249
|
+
};
|
|
250
|
+
|
|
224
251
|
const attributeLabelCompare = (attribute1, attribute2) => {
|
|
225
252
|
const label1 = attribute1['attribute_metadata']['label'].toLowerCase();
|
|
226
253
|
const label2 = attribute2['attribute_metadata']['label'].toLowerCase();
|
|
@@ -418,6 +445,11 @@ export const useProductFullDetail = props => {
|
|
|
418
445
|
[product, optionCodes, optionSelections]
|
|
419
446
|
);
|
|
420
447
|
|
|
448
|
+
const productName = useMemo(
|
|
449
|
+
() => getConfigName(product, optionCodes, optionSelections),
|
|
450
|
+
[product, optionCodes, optionSelections]
|
|
451
|
+
);
|
|
452
|
+
|
|
421
453
|
// The map of ids to values (and their uids)
|
|
422
454
|
// For example:
|
|
423
455
|
// { "179" => [{ uid: "abc", value_index: 1 }, { uid: "def", value_index: 2 }]}
|
|
@@ -590,7 +622,7 @@ export const useProductFullDetail = props => {
|
|
|
590
622
|
const productDetails = {
|
|
591
623
|
description: product.description,
|
|
592
624
|
shortDescription: product.short_description,
|
|
593
|
-
name:
|
|
625
|
+
name: productName,
|
|
594
626
|
price: productPrice?.final_price,
|
|
595
627
|
price_range: product?.price_range,
|
|
596
628
|
sku: product.sku,
|
package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js
CHANGED
|
@@ -110,8 +110,10 @@ export const ProductDetailsFragment = gql`
|
|
|
110
110
|
}
|
|
111
111
|
preorder {
|
|
112
112
|
is_preorder
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
pre_order_payment_type
|
|
114
|
+
pre_order_deposit
|
|
115
|
+
pre_order_notes
|
|
116
|
+
pre_order_date
|
|
115
117
|
}
|
|
116
118
|
term_and_conditions
|
|
117
119
|
shipping_policy
|
|
@@ -191,6 +193,7 @@ export const ProductDetailsFragment = gql`
|
|
|
191
193
|
label
|
|
192
194
|
position
|
|
193
195
|
}
|
|
196
|
+
name
|
|
194
197
|
sku
|
|
195
198
|
stock_status
|
|
196
199
|
price {
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
|
|
3
|
+
export const GET_PAGE_SIZE = gql`
|
|
4
|
+
query getPageSize {
|
|
5
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
6
|
+
storeConfig {
|
|
7
|
+
store_code
|
|
8
|
+
grid_per_page
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const GET_PRODUCT_FILTERS_BY_SEARCH = gql`
|
|
14
|
+
query getProductFiltersBySearch($search: String!) {
|
|
15
|
+
products(search: $search) {
|
|
16
|
+
aggregations {
|
|
17
|
+
label
|
|
18
|
+
count
|
|
19
|
+
attribute_code
|
|
20
|
+
options {
|
|
21
|
+
label
|
|
22
|
+
value
|
|
23
|
+
}
|
|
24
|
+
position
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
export const GET_SEARCH_TERM_DATA = gql`
|
|
31
|
+
query getSearchTermData($search: String) {
|
|
32
|
+
searchTerm(Search: $search) {
|
|
33
|
+
query_text
|
|
34
|
+
redirect
|
|
35
|
+
popularity
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
export const PRODUCT_SEARCH = gql`
|
|
41
|
+
query ProductSearch(
|
|
42
|
+
$currentPage: Int = 1
|
|
43
|
+
$inputText: String!
|
|
44
|
+
$pageSize: Int = 6
|
|
45
|
+
$filters: ProductAttributeFilterInput!
|
|
46
|
+
$sort: ProductAttributeSortInput
|
|
47
|
+
) {
|
|
48
|
+
products(
|
|
49
|
+
currentPage: $currentPage
|
|
50
|
+
pageSize: $pageSize
|
|
51
|
+
search: $inputText
|
|
52
|
+
filter: $filters
|
|
53
|
+
sort: $sort
|
|
54
|
+
) {
|
|
55
|
+
items {
|
|
56
|
+
id
|
|
57
|
+
uid
|
|
58
|
+
name
|
|
59
|
+
price_range {
|
|
60
|
+
maximum_price {
|
|
61
|
+
final_price {
|
|
62
|
+
currency
|
|
63
|
+
value
|
|
64
|
+
}
|
|
65
|
+
regular_price {
|
|
66
|
+
currency
|
|
67
|
+
value
|
|
68
|
+
}
|
|
69
|
+
discount {
|
|
70
|
+
amount_off
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
sku
|
|
75
|
+
preorder {
|
|
76
|
+
is_preorder
|
|
77
|
+
}
|
|
78
|
+
small_image {
|
|
79
|
+
url
|
|
80
|
+
}
|
|
81
|
+
stock_status
|
|
82
|
+
__typename
|
|
83
|
+
url_key
|
|
84
|
+
}
|
|
85
|
+
page_info {
|
|
86
|
+
total_pages
|
|
87
|
+
}
|
|
88
|
+
total_count
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
export const GET_FILTER_INPUTS = gql`
|
|
94
|
+
query GetFilterInputsForSearch {
|
|
95
|
+
__type(name: "ProductAttributeFilterInput") {
|
|
96
|
+
inputFields {
|
|
97
|
+
name
|
|
98
|
+
type {
|
|
99
|
+
name
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
|
|
106
|
+
export const GET_SEARCH_AVAILABLE_SORT_METHODS = gql`
|
|
107
|
+
query getSearchAvailableSortMethods($search: String!) {
|
|
108
|
+
products(search: $search) {
|
|
109
|
+
sort_fields {
|
|
110
|
+
options {
|
|
111
|
+
label
|
|
112
|
+
value
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`;
|
|
118
|
+
|
|
119
|
+
export default {
|
|
120
|
+
getFilterInputsQuery: GET_FILTER_INPUTS,
|
|
121
|
+
getPageSize: GET_PAGE_SIZE,
|
|
122
|
+
getSearchTermData: GET_SEARCH_TERM_DATA,
|
|
123
|
+
getProductFiltersBySearchQuery: GET_PRODUCT_FILTERS_BY_SEARCH,
|
|
124
|
+
getSearchAvailableSortMethods: GET_SEARCH_AVAILABLE_SORT_METHODS,
|
|
125
|
+
productSearchQuery: PRODUCT_SEARCH
|
|
126
|
+
};
|
|
@@ -87,19 +87,20 @@ const Image = props => {
|
|
|
87
87
|
{...rest}
|
|
88
88
|
/>
|
|
89
89
|
) : (
|
|
90
|
-
<ResourceImage
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/>
|
|
90
|
+
// <ResourceImage
|
|
91
|
+
// alt={alt}
|
|
92
|
+
// className={imageClass}
|
|
93
|
+
// handleError={handleError}
|
|
94
|
+
// handleLoad={handleImageLoad}
|
|
95
|
+
// height={talonResourceHeight}
|
|
96
|
+
// resource={resource}
|
|
97
|
+
// type={type}
|
|
98
|
+
// width={talonResourceWidth}
|
|
99
|
+
// widths={widths}
|
|
100
|
+
// ratio={ratio}
|
|
101
|
+
// {...rest}
|
|
102
|
+
// />
|
|
103
|
+
<></>
|
|
103
104
|
);
|
|
104
105
|
|
|
105
106
|
return (
|