« get me outta code hell

bam (Thing subclasses: several steps, one file) - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/thing/homepage-layout.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-02-12 17:38:27 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-02-12 17:40:01 -0400
commit95bd943d62473e53de11cd6368e540cd48e4231a (patch)
treea6e1f0a21222eaeb01a270d8202a31616903649b /src/thing/homepage-layout.js
parentcfa02cb03a363c46408db7f0ec54bd3a7e4ad018 (diff)
bam (Thing subclasses: several steps, one file)
Diffstat (limited to 'src/thing/homepage-layout.js')
-rw-r--r--src/thing/homepage-layout.js99
1 files changed, 0 insertions, 99 deletions
diff --git a/src/thing/homepage-layout.js b/src/thing/homepage-layout.js
deleted file mode 100644
index 4717391..0000000
--- a/src/thing/homepage-layout.js
+++ /dev/null
@@ -1,99 +0,0 @@
-import CacheableObject from './cacheable-object.js';
-
-import {
-    isColor,
-    isCountingNumber,
-    isName,
-    isString,
-    oneOf,
-    validateArrayItems,
-    validateInstanceOf,
-    validateReference,
-    validateReferenceList,
-} from './validators.js';
-
-export class HomepageLayoutRow extends CacheableObject {
-    static propertyDescriptors = {
-        // Update & expose
-
-        name: {
-            flags: {update: true, expose: true},
-            update: {validate: isName}
-        },
-
-        type: {
-            flags: {update: true, expose: true},
-
-            update: {
-                validate(value) {
-                    throw new Error(`'type' property validator must be overridden`);
-                }
-            }
-        },
-
-        color: {
-            flags: {update: true, expose: true},
-            update: {validate: isColor}
-        },
-    };
-}
-
-export class HomepageLayoutAlbumsRow extends HomepageLayoutRow {
-    static propertyDescriptors = {
-        ...HomepageLayoutRow.propertyDescriptors,
-
-        // Update & expose
-
-        type: {
-            flags: {update: true, expose: true},
-            update: {
-                validate(value) {
-                    if (value !== 'albums') {
-                        throw new TypeError(`Expected 'albums'`);
-                    }
-
-                    return true;
-                }
-            }
-        },
-
-        sourceGroupByRef: {
-            flags: {update: true, expose: true},
-            update: {validate: validateReference('group')}
-        },
-
-        sourceAlbumsByRef: {
-            flags: {update: true, expose: true},
-            update: {validate: validateReferenceList('album')}
-        },
-
-        countAlbumsFromGroup: {
-            flags: {update: true, expose: true},
-            update: {validate: isCountingNumber}
-        },
-
-        actionLinks: {
-            flags: {update: true, expose: true},
-            update: {validate: validateArrayItems(isString)}
-        },
-    }
-}
-
-export default class HomepageLayout extends CacheableObject {
-    static propertyDescriptors = {
-        // Update & expose
-
-        sidebarContent: {
-            flags: {update: true, expose: true},
-            update: {validate: isString}
-        },
-
-        rows: {
-            flags: {update: true, expose: true},
-
-            update: {
-                validate: validateArrayItems(validateInstanceOf(HomepageLayoutRow))
-            }
-        },
-    };
-}