« 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/composite/wiki-data/withResolvedContribs.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/composite/wiki-data/withResolvedContribs.js')
-rw-r--r--src/data/composite/wiki-data/withResolvedContribs.js31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/data/composite/wiki-data/withResolvedContribs.js b/src/data/composite/wiki-data/withResolvedContribs.js
index 764d7770..b4119604 100644
--- a/src/data/composite/wiki-data/withResolvedContribs.js
+++ b/src/data/composite/wiki-data/withResolvedContribs.js
@@ -5,15 +5,16 @@
 // any artist.
 
 import {input, templateCompositeFrom} from '#composite';
-import find from '#find';
 import {filterMultipleArrays, stitchArrays} from '#sugar';
 import thingConstructors from '#things';
 import {isContributionList, isDate, isStringNonEmpty} from '#validators';
 
-import {raiseOutputWithoutDependency} from '#composite/control-flow';
-import {withPropertiesFromList} from '#composite/data';
+import {raiseOutputWithoutDependency, withAvailabilityFilter}
+  from '#composite/control-flow';
+import {withPropertyFromList, withPropertiesFromList} from '#composite/data';
 
 import inputNotFoundMode from './inputNotFoundMode.js';
+import raiseResolvedReferenceList from './raiseResolvedReferenceList.js';
 
 export default templateCompositeFrom({
   annotation: `withResolvedContribs`,
@@ -133,16 +134,20 @@ export default templateCompositeFrom({
       }),
     },
 
-    {
-      dependencies: ['#contributions'],
+    withPropertyFromList({
+      list: '#contributions',
+      property: input.value('thing'),
+    }),
 
-      compute: (continuation, {
-        ['#contributions']: contributions,
-      }) => continuation({
-        ['#resolvedContribs']:
-          contributions
-            .filter(contrib => contrib.artist),
-      }),
-    },
+    withAvailabilityFilter({
+      from: '#contributions.thing',
+    }),
+
+    raiseResolvedReferenceList({
+      notFoundMode: input('notFoundMode'),
+      results: '#contributions',
+      filter: '#availabilityFilter',
+      outputs: input.value('#resolvedContribs'),
+    }),
   ],
 });