gatsby-core-theme 9.0.1 → 9.0.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/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [9.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v9.0.1...v9.0.2) (2022-08-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add author name and link to the toplist module ([9baa500](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9baa500eec68512f76aacfb33554902a7dfa2a7a))
7
+ * modules test ([967fb13](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/967fb13555326b691303685b575e265ef6a8c661))
8
+
9
+
10
+ * Merge branch 'tm-2971-adding-expert-rating-to-toplist' into 'master' ([bffd32c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bffd32cac4fa8837c08052d9b5b2efa319d03099))
11
+
1
12
  ## [9.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v9.0.0...v9.0.1) (2022-08-01)
2
13
 
3
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "9.0.1",
3
+ "version": "9.0.2",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -238,10 +238,18 @@ export function processArchiveModule(module, pages) {
238
238
  module.numOfPages = 1;
239
239
  }
240
240
 
241
- export function processTopListModule(module, relations) {
241
+ export function processTopListModule(module, relations, pages) {
242
242
  module.items = module.items.map((listItem) => {
243
243
  listItem.items = listItem.items.map((item) => {
244
244
  const clone = pick(cloneDeep(relations.operator[item.operator_id]), topListPickKeys);
245
+ const operatorPage = pages
246
+ ? pages.operator.filter((page) => page.relation_id === item.operator_id)
247
+ : [];
248
+
249
+ if (operatorPage.length >= 1) {
250
+ clone.authorName = operatorPage[0].author.name;
251
+ clone.authorPath = operatorPage[0].author.profile_page_path;
252
+ }
245
253
  delete clone.software;
246
254
  delete clone.bonus.deposit_methods;
247
255
  return Object.assign(clone, item);
@@ -283,7 +291,7 @@ export function processModule(
283
291
  } else if (module.name === 'archive' && previewMode) {
284
292
  processArchiveModule(module, pages);
285
293
  } else if (module.name === 'top_list') {
286
- processTopListModule(module, relations);
294
+ processTopListModule(module, relations, pages);
287
295
  } else if (module.name === 'menu' && menus && menus[module.menu_id]) {
288
296
  module = Object.assign(module, menus[module.menu_id]);
289
297
  }