« get me outta code hell

HomepageLayoutActionsRow.js « homepage-layout « things « data « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/homepage-layout/HomepageLayoutActionsRow.js
blob: b6d19793b8d8565e6252a153ab4ace01364a0915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import {V} from '#composite';
import Thing from '#thing';
import {validateArrayItems, isString} from '#validators';

import {exposeConstant} from '#composite/control-flow';

import {HomepageLayoutRow} from './HomepageLayoutRow.js';

export class HomepageLayoutActionsRow extends HomepageLayoutRow {
  static [Thing.friendlyName] = `Homepage Actions Row`;

  static [Thing.getPropertyDescriptors] = () => ({
    // Update & expose

    actionLinks: {
      flags: {update: true, expose: true},
      update: {validate: validateArrayItems(isString)},
    },

    // Expose only

    isHomepageLayoutActionsRow: exposeConstant(V(true)),
    type: exposeConstant(V('actions')),
  });

  static [Thing.yamlDocumentSpec] = {
    fields: {
      'Actions': {property: 'actionLinks'},
    },
  };
}