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
264dd152
Commit
264dd152
authored
May 18, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SearchBar] fix api backend.
parent
b8c1e90b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
Ajax.purs
src/Gargantext/Components/Search/Ajax.purs
+1
-1
SearchField.purs
src/Gargantext/Components/Search/SearchField.purs
+1
-1
Types.purs
src/Gargantext/Components/Search/Types.purs
+2
-2
SearchBar.purs
src/Gargantext/Pages/Layout/Specs/SearchBar.purs
+1
-1
No files found.
src/Gargantext/Components/Search/Ajax.purs
View file @
264dd152
...
...
@@ -12,7 +12,7 @@ import Gargantext.Config (urlPlease, End(Back))
import URI.Query as Q
searchUrl :: SearchQuery -> String
searchUrl q = urlPlease Back $ "
search
" <> Q.print (toQuery q)
searchUrl q = urlPlease Back $ "
new
" <> Q.print (toQuery q)
search :: forall a. DecodeJson a => SearchQuery -> Aff a
search q = do
...
...
src/Gargantext/Components/Search/SearchField.purs
View file @
264dd152
...
...
@@ -47,7 +47,7 @@ searchFieldComponent = R.memo (R.hooksComponent "SearchField" cpt) hasChanged
cpt props _ = do
let search = maybe defaultSearch identity (fst props.search)
term <- R.useState $ \_ -> pure search.term
db <- R.useState $ \_ -> pure Nothing
db
<- R.useState $ \_ -> pure Nothing
pure $
div { className: "search-field" }
[ databaseInput db props.databases
...
...
src/Gargantext/Components/Search/Types.purs
View file @
264dd152
...
...
@@ -52,7 +52,7 @@ instance showSearchOrder :: Show SearchOrder where
show ScoreDesc = "ScoreDesc"
newtype SearchQuery = SearchQuery
{ query ::
Array
String
{ query :: String
, databases :: Array Database
, corpus_id :: Maybe Int
, offset :: Maybe Int
...
...
@@ -63,7 +63,7 @@ derive instance newtypeSearchQuery :: Newtype SearchQuery _
defaultSearchQuery :: SearchQuery
defaultSearchQuery = SearchQuery
{ query:
[]
{ query:
""
, databases: allDatabases
, corpus_id: Nothing
, offset: Nothing
...
...
src/Gargantext/Pages/Layout/Specs/SearchBar.purs
View file @
264dd152
...
...
@@ -57,7 +57,7 @@ onSearchChange (search /\ setSearch) =
(r :: Unit) <- Ajax.search (searchQuery q)
liftEffect $ log2 "Return:" r
liftEffect $ modalShow "addCorpus"
searchQuery {term} = over SearchQuery (_ {query=
[term]
}) defaultSearchQuery
searchQuery {term} = over SearchQuery (_ {query=
term
}) defaultSearchQuery
toggleButton :: R.State Boolean -> R.Element
toggleButton open =
...
...
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