« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/data/composite/things/artwork/index.js1
-rw-r--r--src/data/composite/things/artwork/withDate.js41
-rw-r--r--src/data/things/artwork.js7
3 files changed, 2 insertions, 47 deletions
diff --git a/src/data/composite/things/artwork/index.js b/src/data/composite/things/artwork/index.js
index e2661b50..2cd3c388 100644
--- a/src/data/composite/things/artwork/index.js
+++ b/src/data/composite/things/artwork/index.js
@@ -1,2 +1 @@
 export {default as withContainingArtworkList} from './withContainingArtworkList.js';
-export {default as withDate} from './withDate.js';
diff --git a/src/data/composite/things/artwork/withDate.js b/src/data/composite/things/artwork/withDate.js
deleted file mode 100644
index 4666ff1b..00000000
--- a/src/data/composite/things/artwork/withDate.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import {input, templateCompositeFrom} from '#composite';
-
-import {raiseOutputWithoutDependency} from '#composite/control-flow';
-import {withPropertyFromObject} from '#composite/data';
-
-export default templateCompositeFrom({
-  annotation: `withDate`,
-
-  inputs: {
-    from: input({
-      defaultDependency: '_date',
-      acceptsNull: true,
-    }),
-  },
-
-  outputs: ['#date'],
-
-  steps: () => [
-    {
-      dependencies: [input('from')],
-      compute: (continuation, {
-        [input('from')]: date,
-      }) =>
-        (date
-          ? continuation.raiseOutput({'#date': date})
-          : continuation()),
-    },
-
-    raiseOutputWithoutDependency({
-      dependency: 'dateFromThingProperty',
-      output: input.value({'#date': null}),
-    }),
-
-    withPropertyFromObject({
-      object: 'thing',
-      property: 'dateFromThingProperty',
-    }).outputs({
-      ['#value']: '#date',
-    }),
-  ],
-})
diff --git a/src/data/things/artwork.js b/src/data/things/artwork.js
index 688cccb3..6ec524c2 100644
--- a/src/data/things/artwork.js
+++ b/src/data/things/artwork.js
@@ -62,8 +62,7 @@ import {
   wikiData,
 } from '#composite/wiki-properties';
 
-import {withContainingArtworkList, withDate}
-  from '#composite/things/artwork';
+import {withContainingArtworkList} from '#composite/things/artwork';
 
 export class Artwork extends Thing {
   static [Thing.referenceType] = 'artwork';
@@ -135,11 +134,9 @@ export class Artwork extends Thing {
     artistContribsArtistProperty: simpleString(),
 
     artistContribs: [
-      withDate(),
-
       withResolvedContribs({
         from: input.updateValue({validate: isContributionList}),
-        date: '#date',
+        date: 'date',
         thingProperty: input.thisProperty(),
         artistProperty: 'artistContribsArtistProperty',
       }),