Commit 52db2f1e authored by Alexandre Delanoë's avatar Alexandre Delanoë

[SEARCH FORM] Fix In Gargantext as default database.

parent ef4c4674
......@@ -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)
......
......@@ -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
......
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