From 27e67da7b6f31b6d6da52a7ad09a0da1acc06e03 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 3 Apr 2024 14:05:23 -0300 Subject: data: flash-act: inherit list terminology from side --- src/data/things/flash.js | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'src/data/things/flash.js') diff --git a/src/data/things/flash.js b/src/data/things/flash.js index 5500707d..dc6a32df 100644 --- a/src/data/things/flash.js +++ b/src/data/things/flash.js @@ -4,13 +4,19 @@ import {input} from '#composite'; import find from '#find'; import {sortFlashesChronologically} from '#sort'; import Thing from '#thing'; -import {anyOf, isColor, isDirectory, isNumber, isString} from '#validators'; +import {anyOf, isColor, isContentString, isDirectory, isNumber, isString} + from '#validators'; import {parseDate, parseContributors} from '#yaml'; -import {exposeDependency, exposeUpdateValueOrContinue} - from '#composite/control-flow'; import {withPropertyFromObject} from '#composite/data'; +import { + exposeConstant, + exposeDependency, + exposeDependencyOrContinue, + exposeUpdateValueOrContinue, +} from '#composite/control-flow'; + import { color, contentString, @@ -179,7 +185,27 @@ export class FlashAct extends Thing { name: name('Unnamed Flash Act'), directory: directory(), color: color(), - listTerminology: contentString(), + + listTerminology: [ + exposeUpdateValueOrContinue({ + validate: input.value(isContentString), + }), + + withFlashSide(), + + withPropertyFromObject({ + object: '#flashSide', + property: input.value('listTerminology'), + }), + + exposeDependencyOrContinue({ + dependency: '#flashSide.listTerminology', + }), + + exposeConstant({ + value: input.value(null), + }), + ], flashes: referenceList({ class: input.value(Flash), @@ -235,6 +261,7 @@ export class FlashSide extends Thing { name: name('Unnamed Flash Side'), directory: directory(), color: color(), + listTerminology: contentString(), acts: referenceList({ class: input.value(FlashAct), @@ -254,6 +281,7 @@ export class FlashSide extends Thing { 'Side': {property: 'name'}, 'Directory': {property: 'directory'}, 'Color': {property: 'color'}, + 'List Terminology': {property: 'listTerminology'}, }, }; -- cgit 1.3.0-6-gf8a5