Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
68565a44
Commit
68565a44
authored
Jun 21, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/571-dev-search-field-fixes' into dev
parents
af6069dd
39c4db00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
SearchField.purs
...omponents/Forest/Tree/Node/Action/Search/SearchField.purs
+12
-13
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchField.purs
View file @
68565a44
...
@@ -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 =
...
@@ -540,7 +539,7 @@ searchInputCpt = here.component "searchInput" cpt
...
@@ -540,7 +539,7 @@ searchInputCpt = here.component "searchInput" cpt
, className: "form-control"
, className: "form-control"
, defaultValue: R.readRef valueRef
, defaultValue: R.readRef valueRef
, placeholder: "Your query here"
, placeholder: "Your query here"
, type: "text"
, type: "text"
, required: true }
, required: true }
]
]
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment