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 ...@@ -417,8 +417,7 @@ pubmedInputCpt = here.component "pubmedInput" cpt where
let mVal = case val of let mVal = case val of
"" -> Nothing "" -> Nothing
s -> Just s s -> Just s
T.modify_ (\s -> T.modify_ (_ { datafield = Just (External (PubMed p { api_key = mVal })) }) search
s { datafield = Just (External (PubMed p { api_key = mVal })) }) search
type OrgInputProps = type OrgInputProps =
...@@ -582,14 +581,14 @@ submitButtonComponent = here.component "submitButton" cpt ...@@ -582,14 +581,14 @@ submitButtonComponent = here.component "submitButton" cpt
pure $ pure $
H.button { className: "btn btn-primary" H.button { className: "btn btn-primary"
, "type" : "submit" , "type" : "button"
, on : { click: doSearch onSearch errors session selection' search' } , on : { click: doSearch onSearch errors session selection' search' }
, style : { width: "100%" } , style : { width: "100%" }
} }
[ H.text "Launch Search" ] [ H.text "Launch Search" ]
doSearch onSearch errors session selection search = \_ -> do doSearch onSearch errors session selection search = \_ -> do
log2 "[submitButton] searching" search -- log2 "[submitButton] searching" search
triggerSearch { onSearch, errors, session, selection, search } triggerSearch { onSearch, errors, session, selection, search }
--case search.term of --case search.term of
-- "" -> setSearch $ const defaultSearch -- "" -> setSearch $ const defaultSearch
...@@ -611,20 +610,20 @@ triggerSearch :: { onSearch :: (GT.AsyncTaskWithType -> Effect Unit) ...@@ -611,20 +610,20 @@ triggerSearch :: { onSearch :: (GT.AsyncTaskWithType -> Effect Unit)
-> Effect Unit -> Effect Unit
triggerSearch { onSearch, errors, session, selection, search } = triggerSearch { onSearch, errors, session, selection, search } =
launchAff_ $ do launchAff_ $ do
liftEffect $ do -- liftEffect $ do
let here' = "[triggerSearch] Searching " -- let here' = "[triggerSearch] Searching "
here.log2 (here' <> "databases: ") (show search.databases) -- here.log2 (here' <> "databases: ") (show search.databases)
here.log2 (here' <> "datafield: ") (show search.datafield) -- here.log2 (here' <> "datafield: ") (show search.datafield)
here.log2 (here' <> "term: ") search.term -- here.log2 (here' <> "term: ") search.term
here.log2 (here' <> "lang: ") (show search.lang) -- here.log2 (here' <> "lang: ") (show search.lang)
case search.node_id of case search.node_id of
Nothing -> liftEffect $ here.log "[triggerSearch] node_id is Nothing, don't know what to do" Nothing -> liftEffect $ here.log "[triggerSearch] node_id is Nothing, don't know what to do"
Just id -> 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 eTask <- performSearch session id $ searchQuery selection search
handleRESTError here errors eTask $ \task -> liftEffect $ do handleRESTError here errors eTask $ \task -> liftEffect $ do
here.log2 "[triggerSearch] task" task -- here.log2 "[triggerSearch] task" task
onSearch task onSearch task
--liftEffect $ do --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