Commit 68565a44 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/571-dev-search-field-fixes' into dev

parents af6069dd 39c4db00
......@@ -417,8 +417,7 @@ pubmedInputCpt = here.component "pubmedInput" cpt where
let mVal = case val of
"" -> Nothing
s -> Just s
T.modify_ (\s ->
s { datafield = Just (External (PubMed p { api_key = mVal })) }) search
T.modify_ (_ { datafield = Just (External (PubMed p { api_key = mVal })) }) search
type OrgInputProps =
......@@ -582,14 +581,14 @@ submitButtonComponent = here.component "submitButton" cpt
pure $
H.button { className: "btn btn-primary"
, "type" : "submit"
, "type" : "button"
, on : { click: doSearch onSearch errors session selection' search' }
, style : { width: "100%" }
}
[ H.text "Launch Search" ]
doSearch onSearch errors session selection search = \_ -> do
log2 "[submitButton] searching" search
-- log2 "[submitButton] searching" search
triggerSearch { onSearch, errors, session, selection, search }
--case search.term of
-- "" -> setSearch $ const defaultSearch
......@@ -611,20 +610,20 @@ triggerSearch :: { onSearch :: (GT.AsyncTaskWithType -> Effect Unit)
-> Effect Unit
triggerSearch { onSearch, errors, session, selection, search } =
launchAff_ $ do
liftEffect $ do
let here' = "[triggerSearch] Searching "
here.log2 (here' <> "databases: ") (show search.databases)
here.log2 (here' <> "datafield: ") (show search.datafield)
here.log2 (here' <> "term: ") search.term
here.log2 (here' <> "lang: ") (show search.lang)
-- liftEffect $ do
-- let here' = "[triggerSearch] Searching "
-- here.log2 (here' <> "databases: ") (show search.databases)
-- here.log2 (here' <> "datafield: ") (show search.datafield)
-- here.log2 (here' <> "term: ") search.term
-- here.log2 (here' <> "lang: ") (show search.lang)
case search.node_id of
Nothing -> liftEffect $ here.log "[triggerSearch] node_id is Nothing, don't know what to do"
Just id -> do
liftEffect $ here.log2 "[triggerSearch] searchQuery" $ searchQuery selection search
-- liftEffect $ here.log2 "[triggerSearch] searchQuery" $ searchQuery selection search
eTask <- performSearch session id $ searchQuery selection search
handleRESTError here errors eTask $ \task -> liftEffect $ do
here.log2 "[triggerSearch] task" task
-- here.log2 "[triggerSearch] task" task
onSearch task
--liftEffect $ do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment