« get me outta code hell

divide referenced-by lists by configurable groups - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-05-22 12:00:01 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-05-22 12:00:23 -0300
commitf6bd91ea9beef64e0ff0865560219a64a367bb5b (patch)
tree053700f2bc57d395148d90b77daa6e4e3cb4a849 /src/data
parent3b542d286f66e54cb10507fb196a61b7b2f1ee94 (diff)
divide referenced-by lists by configurable groups
...instead of hard-coding 'em
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things.js11
-rw-r--r--src/data/yaml.js3
2 files changed, 13 insertions, 1 deletions
diff --git a/src/data/things.js b/src/data/things.js
index 8f460e49..18efac47 100644
--- a/src/data/things.js
+++ b/src/data/things.js
@@ -1388,13 +1388,22 @@ WikiInfo.propertyDescriptors = {
         update: {validate: isURL}
     },
 
-    // Feature toggles
+    divideTrackListsByGroupsByRef: Thing.common.referenceList(Group),
 
+    // Feature toggles
     enableFlashesAndGames: Thing.common.flag(false),
     enableListings: Thing.common.flag(false),
     enableNews: Thing.common.flag(false),
     enableArtTagUI: Thing.common.flag(false),
     enableGroupUI: Thing.common.flag(false),
+
+    // Update only
+
+    groupData: Thing.common.wikiData(Group),
+
+    // Expose only
+
+    divideTrackListsByGroups: Thing.common.dynamicThingsFromReferenceList('divideTrackListsByGroupsByRef', 'groupData', find.group),
 };
 
 // -> Language
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 072aca67..fa967561 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -402,6 +402,7 @@ export const processWikiInfoDocument = makeProcessDocument(WikiInfo, {
         footerContent: 'Footer Content',
         defaultLanguage: 'Default Language',
         canonicalBase: 'Canonical Base',
+        divideTrackListsByGroupsByRef: 'Divide Track Lists By Groups',
         enableFlashesAndGames: 'Enable Flashes & Games',
         enableListings: 'Enable Listings',
         enableNews: 'Enable News',
@@ -1090,6 +1091,8 @@ export function linkWikiDataArrays(wikiData) {
 
     const WD = wikiData;
 
+    assignWikiData([WD.wikiInfo], 'groupData');
+
     assignWikiData(WD.albumData, 'artistData', 'artTagData', 'groupData', 'trackData');
     WD.albumData.forEach(album => assignWikiData(album.trackGroups, 'trackData'));