« get me outta code hell

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:
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/homepage-layout.js6
-rw-r--r--src/data/things/static-page.js1
-rw-r--r--src/data/yaml.js5
3 files changed, 9 insertions, 3 deletions
diff --git a/src/data/things/homepage-layout.js b/src/data/things/homepage-layout.js
index 344716cb..c18e8110 100644
--- a/src/data/things/homepage-layout.js
+++ b/src/data/things/homepage-layout.js
@@ -7,6 +7,7 @@ export class HomepageLayout extends Thing {
     HomepageLayoutRow,
 
     validators: {
+      isStringNonEmpty,
       validateArrayItems,
       validateInstanceOf,
     },
@@ -15,6 +16,11 @@ export class HomepageLayout extends Thing {
 
     sidebarContent: Thing.common.simpleString(),
 
+    navbarLinks: {
+      flags: {update: true, expose: true},
+      update: {validate: validateArrayItems(isStringNonEmpty)},
+    },
+
     rows: {
       flags: {update: true, expose: true},
 
diff --git a/src/data/things/static-page.js b/src/data/things/static-page.js
index 226e0b61..3d8d474c 100644
--- a/src/data/things/static-page.js
+++ b/src/data/things/static-page.js
@@ -25,6 +25,5 @@ export class StaticPage extends Thing {
     directory: Thing.common.directory(),
     content: Thing.common.simpleString(),
     stylesheet: Thing.common.simpleString(),
-    showInNavigationBar: Thing.common.flag(true),
   });
 }
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 6ddd3a13..02e56d64 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -377,8 +377,6 @@ export const processStaticPageDocument = makeProcessDocument(T.StaticPage, {
 
     content: 'Content',
     stylesheet: 'Style',
-
-    showInNavigationBar: 'Show in Navigation Bar',
   },
 });
 
@@ -403,6 +401,7 @@ export const processWikiInfoDocument = makeProcessDocument(T.WikiInfo, {
 export const processHomepageLayoutDocument = makeProcessDocument(T.HomepageLayout, {
   propertyFieldMapping: {
     sidebarContent: 'Sidebar Content',
+    navbarLinks: 'Navbar Links',
   },
 
   ignoredFields: ['Homepage'],
@@ -896,6 +895,8 @@ export const dataSteps = [
     processDocument: processStaticPageDocument,
 
     save(staticPageData) {
+      sortAlphabetically(staticPageData);
+
       return {staticPageData};
     },
   },