@everymatrix/casino-filter-page 1.5.4 → 1.5.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-filter-page",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "main": "dist/casino-filter-page.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "0515078fefc5290a183afcfb2608cf265f2322c7"
39
+ "gitHead": "18b817f66a008871bf85a5a004a749dca5111add"
40
40
  }
@@ -34,7 +34,7 @@
34
34
  [currentCategoryId]: []
35
35
  }
36
36
  }
37
-
37
+
38
38
  let previousFilterSelection:any = [];
39
39
 
40
40
  setupI18n({ withLocale: 'en', translations: {}});
@@ -84,7 +84,21 @@
84
84
  }
85
85
  }
86
86
 
87
- getVendors(`${endpoint}/casino/vendors?filter=games(groups=${currentCategoryId})&datasource=${datasource}&platform=${getDevice(userAgent)}`);
87
+ const url:any = new URL(`${endpoint}/casino/vendors`);
88
+
89
+ url.searchParams.append("fields" , "id,name,subVendors" );
90
+
91
+ url.searchParams.append("language" , lang);
92
+ url.searchParams.append("datasource" , datasource);
93
+ url.searchParams.append("platform", getDevice(userAgent));
94
+ if((currentCategoryId.match(/\$/g) || []).length > 1) {
95
+ url.searchParams.append("filter" , `games(subGroups=${currentCategoryId})`);
96
+ url.searchParams.append("subVendors" , `games(subGroups=${currentCategoryId})`);
97
+ } else {
98
+ url.searchParams.append("filter" , `games(groups=${currentCategoryId})`);
99
+ }
100
+
101
+ getVendors(url);
88
102
 
89
103
  let selectedVendorsArray = provisionalVendorArray;
90
104
 
@@ -135,7 +149,6 @@
135
149
 
136
150
  case 'CategoryVendors':
137
151
  currentCategoryId = e.data.categoryid;
138
-
139
152
  if (categoryVendorFiltersCollection) {
140
153
  if (currentCategoryId) {
141
154
  provisionalVendorArray = categoryVendorFiltersCollection[currentCategoryId];
@@ -166,13 +179,11 @@
166
179
 
167
180
  response.forEach((ven:any) => {
168
181
  let vendors = JSON.parse(sessionStorage.getItem('vendorFiltersByCategory'));
169
-
170
182
  if (!vendors) {
171
183
  vendors = {
172
184
  currentCategoryId: []
173
185
  }
174
186
  }
175
-
176
187
  if (currentCategoryId) {
177
188
  if (vendors[currentCategoryId]) {
178
189
  ven.isFilterSelected = (vendors[currentCategoryId].indexOf(ven.id) >= 0) ? true : false;
@@ -317,15 +328,17 @@
317
328
  </section>
318
329
  <section class="FilterContentSection" part="FilterContentSection">
319
330
  {#if vendorsArray}
320
- {#each vendorsArray as vendor}
321
- <div class="VendorBox {vendor.isFilterSelected ? 'VendorBoxSelected' : ''}" part="VendorBox {vendor.isFilterSelected ? 'VendorBoxSelected' : ''}" on:click="{() => toggleVendorFilter(vendor)}">
322
- <img class="VendorImage" part="VendorImage" src="{vendor.image}" alt="{vendor.name}" />
323
- {#if vendor.isFilterSelected}
324
- <div class="FilterIconContainer" part="FilterIconContainer">
325
- <div class="CheckMark" part="CheckMark"></div>
326
- </div>
327
- {/if}
328
- </div>
331
+ {#each vendorsArray as vendors}
332
+ {#each vendors.subVendors as vendor}
333
+ <div class="VendorBox {vendor.isFilterSelected ? 'VendorBoxSelected' : ''} {vendor.logo ? '' : 'VendorBoxMissing'}" part="VendorBox {vendor.isFilterSelected ? 'VendorBoxSelected' : ''}" on:click="{() => toggleVendorFilter(vendor)}">
334
+ <img class="VendorImage" part="VendorImage" src="{vendor.logo}" alt="{vendor.name}" />
335
+ {#if vendor.isFilterSelected}
336
+ <div class="FilterIconContainer" part="FilterIconContainer">
337
+ <div class="CheckMark" part="CheckMark"></div>
338
+ </div>
339
+ {/if}
340
+ </div>
341
+ {/each}
329
342
  {/each}
330
343
  {/if}
331
344
  </section>
@@ -399,6 +412,11 @@
399
412
  border: 1px solid var(--emfe-w-color-gray-100, #E6E6E6);
400
413
  border-radius: 5px;
401
414
  position: relative;
415
+ &.VendorBoxMissing {
416
+ background: url('https://breakthrough.org/wp-content/uploads/2018/10/default-placeholder-image.png');
417
+ background-size: cover;
418
+ background-position: center;
419
+ }
402
420
  &.VendorBoxSelected {
403
421
  border: 1px solid var(--emfe-w-color-primary, #D0046C);
404
422
  }