« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/data/things/art-tag.js10
-rw-r--r--src/data/yaml.js2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/data/things/art-tag.js b/src/data/things/art-tag.js
index 9a8a75c5..75fb0f7b 100644
--- a/src/data/things/art-tag.js
+++ b/src/data/things/art-tag.js
@@ -18,6 +18,16 @@ export class ArtTag extends Thing {
     color: Thing.common.color(),
     isContentWarning: Thing.common.flag(false),
 
+    nameShort: {
+      flags: {update: true, expose: true},
+
+      expose: {
+        dependencies: ['name'],
+        transform: (value, {name}) =>
+          value ?? name.replace(/ \(.*?\)$/, ''),
+      },
+    },
+
     // Update only
 
     albumData: Thing.common.wikiData(Album),
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 73450f17..37b1f86c 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -343,7 +343,9 @@ export const processNewsEntryDocument = makeProcessDocument(T.NewsEntry, {
 export const processArtTagDocument = makeProcessDocument(T.ArtTag, {
   propertyFieldMapping: {
     name: 'Tag',
+    nameShort: 'Short Name',
     directory: 'Directory',
+
     color: 'Color',
     isContentWarning: 'Is CW',
   },