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 ...@@ -28,7 +28,7 @@ type Search = { database :: Maybe Database
} }
defaultSearch :: Search defaultSearch :: Search
defaultSearch = { database: Nothing defaultSearch = { database: Just InGargantext
, term: "" , term: ""
, lang: Nothing , lang: Nothing
, org : Nothing , org : Nothing
...@@ -54,7 +54,7 @@ searchFieldComponent = R.memo (R.hooksComponent "SearchField" cpt) hasChanged ...@@ -54,7 +54,7 @@ searchFieldComponent = R.memo (R.hooksComponent "SearchField" cpt) hasChanged
cpt props@{node_id} _ = do cpt props@{node_id} _ = do
let search = maybe defaultSearch identity (fst props.search) let search = maybe defaultSearch identity (fst props.search)
term <- R.useState' search.term 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) lang <- R.useState' (Nothing :: Maybe Lang)
org@(curOrg /\ setOrg) <- R.useState' (Nothing :: Maybe Org) org@(curOrg /\ setOrg) <- R.useState' (Nothing :: Maybe Org)
filters@(curFilters /\ setFilters) <- R.useState' (Nothing :: Maybe HAL_Filters) filters@(curFilters /\ setFilters) <- R.useState' (Nothing :: Maybe HAL_Filters)
......
...@@ -54,7 +54,7 @@ instance encodeJsonLang :: EncodeJson Lang where ...@@ -54,7 +54,7 @@ instance encodeJsonLang :: EncodeJson Lang where
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- | Database search specifications -- | Database search specifications
allDatabases :: Array Database allDatabases :: Array Database
allDatabases = [ All allDatabases = [ InGargantext
, PubMed , PubMed
, HAL , HAL
, IsTex , IsTex
...@@ -62,6 +62,7 @@ allDatabases = [ All ...@@ -62,6 +62,7 @@ allDatabases = [ All
] ]
data Database = All data Database = All
| InGargantext
| PubMed | PubMed
| HAL | HAL
| IsTex | IsTex
...@@ -69,7 +70,8 @@ data Database = All ...@@ -69,7 +70,8 @@ data Database = All
instance showDatabase :: Show Database where instance showDatabase :: Show Database where
show All = "In Gargantext" show All = "All"
show InGargantext = "In Gargantext"
show PubMed = "PubMed" show PubMed = "PubMed"
show HAL = "HAL" show HAL = "HAL"
show IsTex = "IsTex" show IsTex = "IsTex"
...@@ -77,6 +79,7 @@ instance showDatabase :: Show Database where ...@@ -77,6 +79,7 @@ instance showDatabase :: Show Database where
readDatabase :: String -> Maybe Database readDatabase :: String -> Maybe Database
readDatabase "All" = Just All readDatabase "All" = Just All
readDatabase "In Gargantext" = Just InGargantext
readDatabase "PubMed" = Just PubMed readDatabase "PubMed" = Just PubMed
readDatabase "HAL" = Just HAL readDatabase "HAL" = Just HAL
readDatabase "IsTex" = Just IsTex 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