@riosst100/pwa-marketplace 2.5.5 → 2.5.7
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/components/FilterTop/CustomFilters/customFilters.js +1 -1
- package/src/components/FilterTopBackup/CustomFilters/customFilters.js +1 -1
- package/src/components/SetsData/setsData.js +0 -2
- package/src/components/ShopBy/shopBy.js +8 -8
- package/src/overwrites/peregrine/lib/talons/FilterSidebar/useFilterSidebar.js +41 -30
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryFragments.gql.js +32 -0
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +3 -3
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterItemRadioGroup.js +16 -15
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +32 -31
- package/src/overwrites/venia-ui/lib/components/Header/cartTrigger.js +0 -10
- package/src/talons/CustomFilters/customFilters.gql.js +9 -6
- package/src/talons/FilterTop/customFilters.gql.js +9 -6
- package/src/talons/FilterTop/filterTop.gql.js +9 -6
- package/src/talons/FilterTop/useFilterTop.js +2 -2
- package/src/talons/ShopBy/shopBy.gql.js +1 -0
- package/src/talons/ShopBy/useShopBy.js +20 -15
package/package.json
CHANGED
|
@@ -56,7 +56,7 @@ const CustomFilters = props => {
|
|
|
56
56
|
// create elements and params at the same time for efficiency
|
|
57
57
|
const filterElements = useMemo(() => {
|
|
58
58
|
const elements = [];
|
|
59
|
-
customFiltersData && customFiltersData.map((filter, index) => {
|
|
59
|
+
customFiltersData && customFiltersData.filters && customFiltersData.filters.map((filter, index) => {
|
|
60
60
|
const { label, attribute_code, options } = filter || {};
|
|
61
61
|
|
|
62
62
|
const group = attribute_code;
|
|
@@ -59,7 +59,7 @@ const CustomFilters = props => {
|
|
|
59
59
|
// create elements and params at the same time for efficiency
|
|
60
60
|
const filterElements = useMemo(() => {
|
|
61
61
|
const elements = [];
|
|
62
|
-
customFiltersData && customFiltersData.map((filter, index) => {
|
|
62
|
+
customFiltersData && customFiltersData.filters && customFiltersData.filters.map((filter, index) => {
|
|
63
63
|
const { label, attribute_code, options } = filter || {};
|
|
64
64
|
|
|
65
65
|
const group = attribute_code;
|
|
@@ -130,8 +130,6 @@ const SetsData = props => {
|
|
|
130
130
|
sets.map((set, index) => {
|
|
131
131
|
const { products_count, set_name, option_id, release_year } = set;
|
|
132
132
|
|
|
133
|
-
console.log(products_count)
|
|
134
|
-
|
|
135
133
|
const categoryUrl = resourceUrl(
|
|
136
134
|
`/${category?.url_path}${categoryUrlSuffix || ''}${filterSearch || ''}&${attributeCode}[filter]=${set_name},${option_id}`
|
|
137
135
|
);
|
|
@@ -62,7 +62,7 @@ const ShopBy = props => {
|
|
|
62
62
|
// pageControl,
|
|
63
63
|
// sortProps,
|
|
64
64
|
// pageSize
|
|
65
|
-
} = props;
|
|
65
|
+
} = props || {};
|
|
66
66
|
// const [currentSort] = sortProps;
|
|
67
67
|
|
|
68
68
|
// const talonProps = useCategoryContent({
|
|
@@ -153,18 +153,18 @@ const ShopBy = props => {
|
|
|
153
153
|
|
|
154
154
|
if (active === 'all' || active === group) {
|
|
155
155
|
dataResult[group] && dataResult[group].length && dataResult[group].map((option, index) => {
|
|
156
|
-
const { label, value } = option;
|
|
156
|
+
const { products_count, label, value } = option;
|
|
157
157
|
|
|
158
158
|
const filter = attributeData.attribute_code + '[filter]=' + label + ',' + value;
|
|
159
159
|
const params = filterSearch ? filterSearch + '&' + filter + additionalFilter : '?' + filter + additionalFilter;
|
|
160
160
|
|
|
161
161
|
const categoryUrl = resourceUrl(
|
|
162
|
-
`/${category
|
|
162
|
+
`/${category?.url_path}${categoryUrlSuffix || ''}${params}`
|
|
163
163
|
);
|
|
164
164
|
|
|
165
|
-
optionsResult.push(<li className='list-none'>
|
|
166
|
-
<Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-
|
|
167
|
-
{label}
|
|
165
|
+
optionsResult.push(<li key={index} className='list-none'>
|
|
166
|
+
<Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-0">
|
|
167
|
+
{label} <span className='text-[12px]'>({products_count})</span>
|
|
168
168
|
</Link>
|
|
169
169
|
</li>)
|
|
170
170
|
});
|
|
@@ -286,7 +286,7 @@ const ShopBy = props => {
|
|
|
286
286
|
// console.log(category)
|
|
287
287
|
|
|
288
288
|
if (shopby == "brands" || shopby == "product_line") {
|
|
289
|
-
if (category && category
|
|
289
|
+
if (category && category?.url_path.includes('anime-figures')) {
|
|
290
290
|
availableFilterOption = [
|
|
291
291
|
{
|
|
292
292
|
'code': 'anime_figures',
|
|
@@ -346,7 +346,7 @@ const ShopBy = props => {
|
|
|
346
346
|
<Fragment>
|
|
347
347
|
<StoreTitle>{title}</StoreTitle>
|
|
348
348
|
<Breadcrumbs categoryId={categoryId} customPage={title} currentFilter={activeFilters} />
|
|
349
|
-
{category
|
|
349
|
+
{category?.url_path.includes('model-railway') && <FilterTop shopby={shopby} filters={[]} category={category} children={[]} allowedFilters={category ? category.allowed_filters : []} />}
|
|
350
350
|
{/* <ShopByFilters handleActiveFilter={handleActiveFilter} activeFilter={activeFilter} category={category} /> */}
|
|
351
351
|
{availableFilterOption.length ?
|
|
352
352
|
<ul className={classes.nav}>
|
|
@@ -36,17 +36,28 @@ export const useFilterSidebar = props => {
|
|
|
36
36
|
|
|
37
37
|
const { data: introspectionData } = useQuery(getFilterInputsQuery);
|
|
38
38
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
const {
|
|
40
|
+
called: subFilterItemsCalled,
|
|
41
|
+
data: subFilterItems,
|
|
42
|
+
loading: subFilterItemsLoading,
|
|
43
|
+
error: subFilterItemsError
|
|
44
|
+
} = useQuery(getSubFiltersQuery,
|
|
45
|
+
{
|
|
46
|
+
fetchPolicy: 'cache-and-network',
|
|
47
|
+
nextFetchPolicy: 'cache-first'
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
console.log('subFilterItemsCalled')
|
|
51
|
+
console.log(subFilterItemsCalled)
|
|
52
|
+
|
|
53
|
+
console.log('subFilterItemsLoading')
|
|
54
|
+
console.log(subFilterItemsLoading)
|
|
55
|
+
|
|
56
|
+
console.log('subFilterItemsError')
|
|
57
|
+
console.log(subFilterItemsError)
|
|
58
|
+
|
|
59
|
+
console.log('subFilterItems')
|
|
60
|
+
console.log(subFilterItems)
|
|
50
61
|
|
|
51
62
|
const attributeCodes = useMemo(
|
|
52
63
|
() => filters.map(({ attribute_code }) => attribute_code),
|
|
@@ -255,25 +266,25 @@ export const useFilterSidebar = props => {
|
|
|
255
266
|
const item = args[1];
|
|
256
267
|
|
|
257
268
|
// REMOVE ACTIVE FILTER
|
|
258
|
-
if (group.includes('card_release')) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
if (group.includes('sc_release')) {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
if (group.includes('sc_set_name')) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
if (group.includes('card_set')) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
269
|
+
// if (group.includes('card_release')) {
|
|
270
|
+
// const subFilter = group.replace("card_release", "card_set");
|
|
271
|
+
// filterApi.removeGroup({ group: subFilter });
|
|
272
|
+
// }
|
|
273
|
+
|
|
274
|
+
// if (group.includes('sc_release')) {
|
|
275
|
+
// const subFilter = group.replace("sc_release", "sc_set_name");
|
|
276
|
+
// filterApi.removeGroup({ group: subFilter });
|
|
277
|
+
// }
|
|
278
|
+
|
|
279
|
+
// if (group.includes('sc_set_name')) {
|
|
280
|
+
// const subFilter = group.replace("sc_set_name", "sc_release");
|
|
281
|
+
// filterApi.removeGroup({ group: subFilter });
|
|
282
|
+
// }
|
|
283
|
+
|
|
284
|
+
// if (group.includes('card_set')) {
|
|
285
|
+
// const subFilter = group.replace("card_set", "card_release");
|
|
286
|
+
// filterApi.removeGroup({ group: subFilter });
|
|
287
|
+
// }
|
|
277
288
|
|
|
278
289
|
setIsApplying(true);
|
|
279
290
|
handleClose();
|
package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryFragments.gql.js
CHANGED
|
@@ -19,6 +19,37 @@ export const ProductsFragment = gql`
|
|
|
19
19
|
seller {
|
|
20
20
|
name
|
|
21
21
|
}
|
|
22
|
+
custom_attributes {
|
|
23
|
+
selected_attribute_options {
|
|
24
|
+
attribute_option {
|
|
25
|
+
uid
|
|
26
|
+
label
|
|
27
|
+
is_default
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
entered_attribute_value {
|
|
31
|
+
value
|
|
32
|
+
}
|
|
33
|
+
attribute_metadata {
|
|
34
|
+
uid
|
|
35
|
+
code
|
|
36
|
+
label
|
|
37
|
+
attribute_labels {
|
|
38
|
+
store_code
|
|
39
|
+
label
|
|
40
|
+
}
|
|
41
|
+
data_type
|
|
42
|
+
is_system
|
|
43
|
+
entity_type
|
|
44
|
+
ui_input {
|
|
45
|
+
ui_input_type
|
|
46
|
+
is_html_allowed
|
|
47
|
+
}
|
|
48
|
+
... on ProductAttributeMetadata {
|
|
49
|
+
used_in_components
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
22
53
|
price_range {
|
|
23
54
|
maximum_price {
|
|
24
55
|
final_price {
|
|
@@ -51,6 +82,7 @@ export const ProductsFragment = gql`
|
|
|
51
82
|
small_image {
|
|
52
83
|
url
|
|
53
84
|
}
|
|
85
|
+
stock_status
|
|
54
86
|
__typename
|
|
55
87
|
url_key
|
|
56
88
|
}
|
|
@@ -134,10 +134,10 @@ const Breadcrumbs = props => {
|
|
|
134
134
|
)
|
|
135
135
|
) : filterBreadcrumbsElement.push(
|
|
136
136
|
index == lastIndex ?
|
|
137
|
-
|
|
137
|
+
<>
|
|
138
138
|
<span className={classes.divider}>{DELIMITER}</span>
|
|
139
|
-
<span className={cn(classes.currentCategory, 'text-blue-700 font-medium')}>{filter.label}</span>
|
|
140
|
-
|
|
139
|
+
<span key={index} className={cn(classes.currentCategory, 'text-blue-700 font-medium')}>{filter.label}</span>
|
|
140
|
+
</> : <>
|
|
141
141
|
<span className={classes.divider}>{DELIMITER}</span>
|
|
142
142
|
<Link
|
|
143
143
|
key={index}
|
package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterItemRadioGroup.js
CHANGED
|
@@ -25,23 +25,24 @@ const FilterItemRadioGroup = props => {
|
|
|
25
25
|
|
|
26
26
|
const code = `item-${group}-${item.value}`;
|
|
27
27
|
|
|
28
|
-
if (allowedSubFilters.length && !allowedSubFilters.includes(item.title)) {
|
|
29
|
-
|
|
30
|
-
}
|
|
28
|
+
// if (allowedSubFilters.length && !allowedSubFilters.includes(item.title)) {
|
|
29
|
+
// return '';
|
|
30
|
+
// }
|
|
31
31
|
|
|
32
|
-
let newAllowedSubFilters = [];
|
|
32
|
+
// let newAllowedSubFilters = [];
|
|
33
33
|
|
|
34
|
-
if (subFilter && subFilterItems) {
|
|
35
|
-
|
|
34
|
+
// if (subFilter && subFilterItems) {
|
|
35
|
+
// const result = subFilterItems.find(item => item.attribute_code === "card_release" || item.attribute_code === "sc_release");
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
// // Ambil options jika ditemukan
|
|
38
|
+
// const options = result ? result.options : [];
|
|
39
|
+
// const option = options ? options.find(option => option.option_label === item.title) : [];
|
|
40
|
+
// if (option) {
|
|
41
|
+
// newAllowedSubFilters = option.sub_option_labels;
|
|
42
|
+
// }
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
// // console.log(newAllowedSubFilters)
|
|
45
|
+
// }
|
|
45
46
|
|
|
46
47
|
return (
|
|
47
48
|
<>
|
|
@@ -54,7 +55,7 @@ const FilterItemRadioGroup = props => {
|
|
|
54
55
|
onApply={onApply}
|
|
55
56
|
labels={labels}
|
|
56
57
|
/>
|
|
57
|
-
{subFilter && <FilterBlock
|
|
58
|
+
{/* {subFilter && <FilterBlock
|
|
58
59
|
key={subFilter.key}
|
|
59
60
|
filterApi={subFilter.filterApi}
|
|
60
61
|
filterState={subFilter.filterState}
|
|
@@ -67,7 +68,7 @@ const FilterItemRadioGroup = props => {
|
|
|
67
68
|
name={''}
|
|
68
69
|
onApply={subFilter.onApply}
|
|
69
70
|
initialOpen={true}
|
|
70
|
-
/>}
|
|
71
|
+
/>} */}
|
|
71
72
|
{/* {subFilterBlock} */}
|
|
72
73
|
</>
|
|
73
74
|
);
|
|
@@ -34,8 +34,8 @@ const FilterSidebar = props => {
|
|
|
34
34
|
handleReset
|
|
35
35
|
} = talonProps;
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
console.log('subFilterItems')
|
|
38
|
+
console.log(subFilterItems)
|
|
39
39
|
// console.log(filters)
|
|
40
40
|
// console.log('filterCountToOpen'+filterCountToOpen)
|
|
41
41
|
// console.log('hideFilters'+hideFilters)
|
|
@@ -100,38 +100,39 @@ const FilterSidebar = props => {
|
|
|
100
100
|
|
|
101
101
|
const hideFilters = ['card_game','bricks_categories','sc_sports_categories','trains','trains_locomotives','trains_supplies_type','lof_preorder','auction','special_price','sc_baseball_inserts','sc_baseball_parallel','sale','sc_set_type','sc_brands'];
|
|
102
102
|
if (!allowedFiltersArr?.length || filterState.size && allowedFiltersArr.length || !filterState.size && allowedFiltersArr.length && allowedFiltersArr.includes(group)) {
|
|
103
|
-
|
|
103
|
+
console.log(group)
|
|
104
|
+
if (!hideFilters.includes(group) && groupName && !group.includes('card_release') && !group.includes('card_set') && !group.includes('sc_set_name')) {
|
|
104
105
|
|
|
105
106
|
// if (!allowedFiltersArr?.length && group != "category_uid" || allowedFiltersArr?.length && allowedFiltersArr.includes(group)) {
|
|
106
107
|
let subFilter = null;
|
|
107
|
-
if (group.includes('sc_release') || group.includes('card_release')) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
108
|
+
// if (group.includes('sc_release') || group.includes('card_release')) {
|
|
109
|
+
// let subGroup = '';
|
|
110
|
+
// if (group.includes('card_release')) {
|
|
111
|
+
// subGroup = group.replace('card_release', 'card_set');
|
|
112
|
+
// }
|
|
113
|
+
|
|
114
|
+
// if (group.includes('sc_release')) {
|
|
115
|
+
// subGroup = group.replace('sc_release', 'sc_set_name');
|
|
116
|
+
// }
|
|
117
|
+
|
|
118
|
+
// const subBlockState = filterState.get(subGroup);
|
|
119
|
+
// const subFrontendInput = filterFrontendInput.get(subGroup);
|
|
120
|
+
// const subFilterItems = filterItems.get(subGroup);
|
|
121
|
+
|
|
122
|
+
// subFilter = {
|
|
123
|
+
// key: subGroup,
|
|
124
|
+
// filterApi: filterApi,
|
|
125
|
+
// filterState: subBlockState,
|
|
126
|
+
// filterFrontendInput: subFrontendInput,
|
|
127
|
+
// group: subGroup,
|
|
128
|
+
// isSubFilter: true,
|
|
129
|
+
// items: subFilterItems,
|
|
130
|
+
// name: '',
|
|
131
|
+
// onApply: handleApplyFilter,
|
|
132
|
+
// initialOpen: true
|
|
133
|
+
// };
|
|
134
|
+
|
|
135
|
+
// }
|
|
135
136
|
|
|
136
137
|
return (
|
|
137
138
|
<FilterBlock
|
|
@@ -13,9 +13,6 @@ import cn from 'classnames';
|
|
|
13
13
|
import { ShoppingCart } from 'iconsax-react';
|
|
14
14
|
import { darkBlue } from '@riosst100/pwa-marketplace/src/theme/vars';
|
|
15
15
|
import { Link } from 'react-router-dom';
|
|
16
|
-
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
17
|
-
|
|
18
|
-
const MiniCart = React.lazy(() => import('@magento/venia-ui/lib/components/MiniCart'));
|
|
19
16
|
|
|
20
17
|
const CartTrigger = props => {
|
|
21
18
|
const {
|
|
@@ -90,13 +87,6 @@ const CartTrigger = props => {
|
|
|
90
87
|
<Icon src={ShoppingCartIcon} />
|
|
91
88
|
{maybeItemCounter}
|
|
92
89
|
</button>
|
|
93
|
-
<Suspense fallback={null}>
|
|
94
|
-
<MiniCart
|
|
95
|
-
isOpen={miniCartIsOpen}
|
|
96
|
-
setIsOpen={setMiniCartIsOpen}
|
|
97
|
-
ref={miniCartRef}
|
|
98
|
-
/>
|
|
99
|
-
</Suspense>
|
|
100
90
|
</Fragment>
|
|
101
91
|
);
|
|
102
92
|
|
|
@@ -3,14 +3,17 @@ import { gql } from '@apollo/client';
|
|
|
3
3
|
export const GET_CUSTOM_FILTERS = gql`
|
|
4
4
|
query GetCustomFilters($filters: ProductAttributeFilterInput!) {
|
|
5
5
|
customSubFilters(filters: $filters) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attribute_code
|
|
9
|
-
options {
|
|
6
|
+
filter_id
|
|
7
|
+
filters {
|
|
10
8
|
label
|
|
11
|
-
|
|
9
|
+
count
|
|
10
|
+
attribute_code
|
|
11
|
+
options {
|
|
12
|
+
label
|
|
13
|
+
value
|
|
14
|
+
}
|
|
15
|
+
position
|
|
12
16
|
}
|
|
13
|
-
position
|
|
14
17
|
}
|
|
15
18
|
}
|
|
16
19
|
`;
|
|
@@ -3,14 +3,17 @@ import { gql } from '@apollo/client';
|
|
|
3
3
|
export const GET_CUSTOM_FILTERS = gql`
|
|
4
4
|
query GetCustomFilters($filters: ProductAttributeFilterInput!) {
|
|
5
5
|
customSubFilters(filters: $filters) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attribute_code
|
|
9
|
-
options {
|
|
6
|
+
filter_id
|
|
7
|
+
filters {
|
|
10
8
|
label
|
|
11
|
-
|
|
9
|
+
count
|
|
10
|
+
attribute_code
|
|
11
|
+
options {
|
|
12
|
+
label
|
|
13
|
+
value
|
|
14
|
+
}
|
|
15
|
+
position
|
|
12
16
|
}
|
|
13
|
-
position
|
|
14
17
|
}
|
|
15
18
|
}
|
|
16
19
|
`;
|
|
@@ -3,14 +3,17 @@ import { gql } from '@apollo/client';
|
|
|
3
3
|
export const GET_CUSTOM_FILTERS = gql`
|
|
4
4
|
query GetCustomFilters($search: String, $filterBy: String, $shopby: String, $category: String!, $filters: ProductAttributeFilterInput!) {
|
|
5
5
|
customSubFilters(search: $search, filterBy: $filterBy, shopby: $shopby, category: $category, filters: $filters) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attribute_code
|
|
9
|
-
options {
|
|
6
|
+
filter_id
|
|
7
|
+
filters {
|
|
10
8
|
label
|
|
11
|
-
|
|
9
|
+
count
|
|
10
|
+
attribute_code
|
|
11
|
+
options {
|
|
12
|
+
label
|
|
13
|
+
value
|
|
14
|
+
}
|
|
15
|
+
position
|
|
12
16
|
}
|
|
13
|
-
position
|
|
14
17
|
}
|
|
15
18
|
}
|
|
16
19
|
`;
|
|
@@ -184,8 +184,8 @@ export const useFilterTop = props => {
|
|
|
184
184
|
const itemsByGroup = new Map();
|
|
185
185
|
const customFiltersMap = [];
|
|
186
186
|
|
|
187
|
-
if (customFiltersData) {
|
|
188
|
-
customFiltersData.map(({ attribute_code, options }, index) => {
|
|
187
|
+
if (customFiltersData && customFiltersData.filters) {
|
|
188
|
+
customFiltersData.filters.map(({ attribute_code, options }, index) => {
|
|
189
189
|
|
|
190
190
|
customFiltersMap.push(attribute_code)
|
|
191
191
|
|
|
@@ -58,24 +58,29 @@ export const useShopBy = props => {
|
|
|
58
58
|
|
|
59
59
|
const filters = getFiltersFromSearch(search);
|
|
60
60
|
|
|
61
|
+
console.log('filtersfilters')
|
|
62
|
+
console.log(filterTypeMap)
|
|
63
|
+
|
|
61
64
|
// Construct the filter arg object.
|
|
62
65
|
const newFilters = {};
|
|
63
66
|
filters.forEach((values, key) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
if (filterTypeMap.get(key)) {
|
|
68
|
+
newFilters[key] = getFilterInput(values, filterTypeMap.get(key));
|
|
69
|
+
|
|
70
|
+
if (key == "sc_baseball_release") {
|
|
71
|
+
for(let item of values) {
|
|
72
|
+
if(item) {
|
|
73
|
+
// console.log(item.split(',')[0])
|
|
74
|
+
const data = search.split('&');
|
|
75
|
+
data.pop();
|
|
76
|
+
activeFilters.push(
|
|
77
|
+
{
|
|
78
|
+
'label': item.split(',')[0],
|
|
79
|
+
'path': data
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
});
|