From aa0404a0075acbcd4c6f94984acdbb4d68f08d0a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 4 Dec 2020 16:36:55 +0100 Subject: [PATCH] fix(workflows): properly offer previous payload files --- src/Handler/Utils/Workflow/EdgeForm.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Handler/Utils/Workflow/EdgeForm.hs b/src/Handler/Utils/Workflow/EdgeForm.hs index abb672e4b..e0750743d 100644 --- a/src/Handler/Utils/Workflow/EdgeForm.hs +++ b/src/Handler/Utils/Workflow/EdgeForm.hs @@ -351,9 +351,13 @@ workflowEdgePayloadFields specs = evalRWST (forM specs $ runExceptT . renderSpec | otherwise -> \case Nothing -> Just $ Set.singleton p Just _ -> Nothing + let wpffConfig' = wpffConfig & _fieldAdditionalFiles %~ (fRefs' <>) + where fRefs' = review _FileReferenceFileReferenceTitleMap . Map.fromList $ do + FileReference{..} <- Set.toList =<< hoistMaybe fRefs + return (fileReferenceTitle, (fileReferenceContent, fileReferenceModified, FileFieldUserOption False True)) wSetTooltip' (fmap slI18n wpffTooltip) $ f' (nonEmpty . Set.toList) wpffOptional - (convertFieldM (\p -> runConduit $ transPipe liftHandler p .| C.foldMap Set.singleton) yieldMany . genericFileField $ return wpffConfig) + (convertFieldM (\p -> runConduit $ transPipe liftHandler p .| C.foldMap Set.singleton) yieldMany . genericFileField $ return wpffConfig') ( fsl (slI18n wpffLabel) & maybe id (addName . ($ "file")) mNudge )