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
c297207e
Commit
c297207e
authored
Nov 08, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SEARCH FORM][WIP] Advanced option tree.
parent
c45116fb
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
70 deletions
+135
-70
SearchField.purs
src/Gargantext/Components/Search/SearchField.purs
+91
-49
Types.purs
src/Gargantext/Components/Search/Types.purs
+44
-21
No files found.
src/Gargantext/Components/Search/SearchField.purs
View file @
c297207e
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Search/Types.purs
View file @
c297207e
...
@@ -22,6 +22,10 @@ import Gargantext.Utils (id)
...
@@ -22,6 +22,10 @@ import Gargantext.Utils (id)
import URI.Extra.QueryPairs as QP
import URI.Extra.QueryPairs as QP
import URI.Query as Q
import URI.Query as Q
------------------------------------------------------------------------
class Doc a where
doc :: a -> String
------------------------------------------------------------------------
------------------------------------------------------------------------
-- | Lang search specifications
-- | Lang search specifications
allLangs :: Array Lang
allLangs :: Array Lang
...
@@ -51,11 +55,40 @@ readLang _ = Nothing
...
@@ -51,11 +55,40 @@ readLang _ = Nothing
instance encodeJsonLang :: EncodeJson Lang where
instance encodeJsonLang :: EncodeJson Lang where
encodeJson a = encodeJson (show a)
encodeJson a = encodeJson (show a)
------------------------------------------------------------------------
-- | DataField search specifications
dataFields :: Array DataField
dataFields = [ Gargantext
, External Nothing
, Web
]
data DataField = Gargantext
| External (Maybe Database)
| Web
instance showDataField :: Show DataField where
show Gargantext = "In Gargantext"
show (External _) = "Ext.Database"
show Web = "Web"
instance docDataField :: Doc DataField where
doc Gargantext = "All Gargantext Database"
doc (External _) = "External (scientific) databases"
doc Web = "All the web crawled with meta-search-engine SearX"
instance eqDataField :: Eq DataField where
eq Gargantext Gargantext = true
eq (External _) (External _) = true
eq Web Web = true
eq _ _ = false
------------------------------------------------------------------------
------------------------------------------------------------------------
-- | Database search specifications
-- | Database search specifications
allDatabases :: Array Database
allDatabases :: Array Database
allDatabases = [ Gargantext
allDatabases = [ PubMed
, PubMed
, HAL
, HAL
, IsTex
, IsTex
, Isidore
, Isidore
...
@@ -65,50 +98,40 @@ allDatabases = [ Gargantext
...
@@ -65,50 +98,40 @@ allDatabases = [ Gargantext
]
]
data Database = All_Databases
data Database = All_Databases
| Gargantext
| PubMed
| PubMed
| HAL
| HAL
| IsTex
| IsTex
| Isidore
| Isidore
| Web
-- | News
| News
-- | SocialNetworks
| SocialNetworks
instance showDatabase :: Show Database where
instance showDatabase :: Show Database where
show All_Databases= "All Databases"
show All_Databases= "All Databases"
show Gargantext = "In Gargantext"
show PubMed = "PubMed"
show PubMed = "PubMed"
show HAL = "HAL"
show HAL = "HAL"
show IsTex = "IsTex"
show IsTex = "IsTex"
show Isidore= "Isidore"
show Isidore= "Isidore"
show Web = "Web"
-- show News = "News"
show News = "News"
-- show SocialNetworks = "Social Networks"
show SocialNetworks = "Social Networks"
class Doc a where
doc :: a -> String
instance docDatabase :: Doc Database where
instance docDatabase :: Doc Database where
doc All_Databases = "All databases"
doc All_Databases = "All databases"
doc Gargantext = "All Gargantext Database"
doc PubMed = "All Medical publications"
doc PubMed = "All Medical publications"
doc HAL = "All open science (archives ouvertes)"
doc HAL = "All open science (archives ouvertes)"
doc IsTex = "All Elsevier enriched by CNRS/INIST"
doc IsTex = "All Elsevier enriched by CNRS/INIST"
doc Isidore = "All (French) Social Sciences"
doc Isidore = "All (French) Social Sciences"
doc Web = "All the web crawled with meta-search-engine SearX"
-- doc News = "Web filtered by News"
doc News = "Web filtered by News"
-- doc SocialNetworks = "Web filtered by MicroBlogs"
doc SocialNetworks = "Web filtered by MicroBlogs"
readDatabase :: String -> Maybe Database
readDatabase :: String -> Maybe Database
readDatabase "All Databases" = Just All_Databases
readDatabase "All Databases" = Just All_Databases
readDatabase "Gargantext" = Just Gargantext
readDatabase "PubMed" = Just PubMed
readDatabase "PubMed" = Just PubMed
readDatabase "HAL" = Just HAL
readDatabase "HAL" = Just HAL
readDatabase "IsTex" = Just IsTex
readDatabase "IsTex" = Just IsTex
readDatabase "Isidore"= Just Isidore
readDatabase "Isidore"= Just Isidore
readDatabase "Web" = Just Web
--
readDatabase "Web" = Just Web
readDatabase "News" = Just News
--
readDatabase "News" = Just News
readDatabase "Social Networks" = Just SocialNetworks
--
readDatabase "Social Networks" = Just SocialNetworks
readDatabase _ = Nothing
readDatabase _ = Nothing
derive instance eqDatabase :: Eq Database
derive instance eqDatabase :: Eq Database
...
...
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