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
52db2f1e
Commit
52db2f1e
authored
Nov 08, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SEARCH FORM] Fix In Gargantext as default database.
parent
ef4c4674
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
SearchField.purs
src/Gargantext/Components/Search/SearchField.purs
+2
-2
Types.purs
src/Gargantext/Components/Search/Types.purs
+5
-2
No files found.
src/Gargantext/Components/Search/SearchField.purs
View file @
52db2f1e
...
...
@@ -28,7 +28,7 @@ type Search = { database :: Maybe Database
}
defaultSearch :: Search
defaultSearch = { database:
Nothing
defaultSearch = { database:
Just InGargantext
, term: ""
, lang: Nothing
, org : Nothing
...
...
@@ -54,7 +54,7 @@ searchFieldComponent = R.memo (R.hooksComponent "SearchField" cpt) hasChanged
cpt props@{node_id} _ = do
let search = maybe defaultSearch identity (fst props.search)
term <- R.useState' search.term
db@(curDb /\ setDb) <- R.useState' (
Nothing
:: Maybe Database)
db@(curDb /\ setDb) <- R.useState' (
Just InGargantext
:: Maybe Database)
lang <- R.useState' (Nothing :: Maybe Lang)
org@(curOrg /\ setOrg) <- R.useState' (Nothing :: Maybe Org)
filters@(curFilters /\ setFilters) <- R.useState' (Nothing :: Maybe HAL_Filters)
...
...
src/Gargantext/Components/Search/Types.purs
View file @
52db2f1e
...
...
@@ -54,7 +54,7 @@ instance encodeJsonLang :: EncodeJson Lang where
------------------------------------------------------------------------
-- | Database search specifications
allDatabases :: Array Database
allDatabases = [
All
allDatabases = [
InGargantext
, PubMed
, HAL
, IsTex
...
...
@@ -62,6 +62,7 @@ allDatabases = [ All
]
data Database = All
| InGargantext
| PubMed
| HAL
| IsTex
...
...
@@ -69,7 +70,8 @@ data Database = All
instance showDatabase :: Show Database where
show All = "In Gargantext"
show All = "All"
show InGargantext = "In Gargantext"
show PubMed = "PubMed"
show HAL = "HAL"
show IsTex = "IsTex"
...
...
@@ -77,6 +79,7 @@ instance showDatabase :: Show Database where
readDatabase :: String -> Maybe Database
readDatabase "All" = Just All
readDatabase "In Gargantext" = Just InGargantext
readDatabase "PubMed" = Just PubMed
readDatabase "HAL" = Just HAL
readDatabase "IsTex" = Just IsTex
...
...
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