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
131
Issues
131
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
gargantext
purescript-gargantext
Commits
d75a1f93
Verified
Commit
d75a1f93
authored
Feb 25, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 362-dev-sqlite
parents
cf9f8322
4ec9e0db
Pipeline
#7366
passed with stages
in 21 minutes and 45 seconds
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
183 deletions
+102
-183
Frame.purs
...text/Components/Forest/Tree/Node/Action/Search/Frame.purs
+1
-1
SearchField.purs
...omponents/Forest/Tree/Node/Action/Search/SearchField.purs
+69
-145
Types.purs
...text/Components/Forest/Tree/Node/Action/Search/Types.purs
+31
-35
Progress.purs
src/Gargantext/Context/Progress.purs
+1
-2
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Search/Frame.purs
View file @
d75a1f93
...
...
@@ -55,7 +55,7 @@ searchIframesCpt = here.component "searchIframes" cpt
pure $
if isIsTex_Advanced search'.datafield then divIframe { frameSource: Istex, iframeRef, search } []
else if
Just
Web == search'.datafield then divIframe { frameSource: Searx, iframeRef, search } []
else if Web == search'.datafield then divIframe { frameSource: Searx, iframeRef, search } []
else H.div {} []
type IFrameProps =
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchField.purs
View file @
d75a1f93
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest/Tree/Node/Action/Search/Types.purs
View file @
d75a1f93
...
...
@@ -2,6 +2,7 @@ module Gargantext.Components.Forest.Tree.Node.Action.Search.Types where
import Gargantext.Prelude
import Data.Array as A
-- import Data.Bounded (class Bounded)
import Data.Either (Either)
-- import Data.Enum (class Enum, class BoundedEnum)
...
...
@@ -26,23 +27,16 @@ import URI.Extra.QueryPairs as QP
import URI.Query as Q
type Search =
{ databases :: Database
, datafield :: Maybe DataField
{ datafield :: DataField
, url :: String
, lang :: Maybe Lang
, node_id :: Maybe Int
, epoApiUser :: Maybe String
, epoApiToken :: Maybe String
, pubmedApiKey :: Maybe String
, term :: String
, years :: Array String
}
isIsTex_Advanced :: Maybe DataField -> Boolean
isIsTex_Advanced
( Just
(External (IsTex_Advanced))
) = true
isIsTex_Advanced :: DataField -> Boolean
isIsTex_Advanced (External (IsTex_Advanced)) = true
isIsTex_Advanced _ = false
------------------------------------------------------------------------
...
...
@@ -81,7 +75,7 @@ instance Doc DataField where
derive instance Eq DataField
instance JSON.WriteForeign DataField where
writeImpl (External db) = JSON.writeImpl { "External":
JSON.writeImpl $ show
db }
writeImpl (External db) = JSON.writeImpl { "External": db }
writeImpl Gargantext = JSON.writeImpl "Gargantext"
writeImpl Web = JSON.writeImpl "Web"
writeImpl Files = JSON.writeImpl "Files"
...
...
@@ -116,13 +110,13 @@ data Database
= All_Databases
| Empty
| OpenAlex
| PubMed
| PubMed
(Maybe String)
| Arxiv
| HAL (Maybe Org)
| IsTex
| IsTex_Advanced
| Isidore
| EPO
| EPO
(Maybe String) (Maybe String)
-- | News
-- | SocialNetworks
...
...
@@ -133,13 +127,13 @@ derive instance Generic Database _
instance Show Database where
show All_Databases = "All Databases"
show OpenAlex = "OpenAlex"
show
PubMed
= "PubMed"
show
(PubMed _)
= "PubMed"
show Arxiv = "Arxiv"
show (HAL _) = "HAL"
show IsTex = "IsTex"
show IsTex_Advanced = "IsTex_Advanced"
show Isidore = "Isidore"
show
EPO
= "EPO"
show
(EPO _ _)
= "EPO"
show Empty = "Empty"
-- show News = "News"
...
...
@@ -148,13 +142,13 @@ instance Show Database where
instance Doc Database where
doc All_Databases = "All databases"
doc OpenAlex = "OpenAlex db"
doc
PubMed
= "All Medical publications"
doc
(PubMed _)
= "All Medical publications"
doc Arxiv = "Arxiv"
doc (HAL _) = "All open science (archives ouvertes)"
doc IsTex = "All Elsevier enriched by CNRS/INIST"
doc IsTex_Advanced = "IsTex advanced search"
doc Isidore = "All (French) Social Sciences"
doc
EPO
= "European Patent Office"
doc
(EPO _ _)
= "European Patent Office"
doc Empty = "Empty"
-- doc News = "Web filtered by News"
...
...
@@ -176,17 +170,24 @@ instance Doc Database where
derive instance Eq Database
instance JSON.WriteForeign Database where
writeImpl f = JSON.writeImpl $ show f
writeImpl (PubMed mAPIKey) = JSON.writeImpl { "db": "PubMed", "api_key": mAPIKey }
writeImpl (EPO mAPIUser mAPIToken) = JSON.writeImpl
{ "db": "PubMed"
, "api_user": mAPIUser
, "api_token": mAPIToken
}
writeImpl (HAL mOrg) = JSON.writeImpl { "db": "HAL", "org": mOrg }
writeImpl d = JSON.writeImpl { "db": show d }
allDatabases :: Array Database
allDatabases =
[ Empty
, PubMed
, PubMed
Nothing
, HAL Nothing
, Arxiv
, OpenAlex
, IsTex
-- , EPO
-- , EPO
Nothing Nothing
--, IsTex_Advanced
--, Isidore
--, Web
...
...
@@ -197,25 +198,25 @@ allDatabases =
dbToInputValue :: Database -> String
dbToInputValue All_Databases = "all_databases"
dbToInputValue OpenAlex = "openalex"
dbToInputValue
PubMed
= "pubmed"
dbToInputValue
(PubMed _)
= "pubmed"
dbToInputValue Arxiv = "arxiv"
dbToInputValue (HAL _) = "hal"
dbToInputValue IsTex = "istex"
dbToInputValue IsTex_Advanced = "istex_advanced"
dbToInputValue Isidore = "isidore"
dbToInputValue
EPO
= "epo"
dbToInputValue
(EPO _ _)
= "epo"
dbToInputValue Empty = "empty"
dbFromInputValue :: String -> Maybe Database
dbFromInputValue "all_databases" = Just All_Databases
dbFromInputValue "openalex" = Just OpenAlex
dbFromInputValue "pubmed" = Just
PubMed
dbFromInputValue "pubmed" = Just
(PubMed Nothing)
dbFromInputValue "arxiv" = Just Arxiv
dbFromInputValue "hal" = Just (HAL Nothing)
dbFromInputValue "istex" = Just IsTex
dbFromInputValue "istex_advanced" = Just IsTex_Advanced
dbFromInputValue "isidore" = Just Isidore
dbFromInputValue "epo" = Just
EPO
dbFromInputValue "epo" = Just
(EPO Nothing Nothing)
dbFromInputValue "empty" = Just Empty
dbFromInputValue _ = Nothing
...
...
@@ -252,6 +253,9 @@ instance Read Org where
read _ = Nothing
derive instance Eq Org
-- | NOTE: IMT_org list isn't really used here in JSON
-- | encoding. Instead, for HAL, a special query is constructed in
-- | SearchField (queryHAL function).
instance JSON.WriteForeign Org where
writeImpl = JSON.writeImpl <<< show
...
...
@@ -294,8 +298,7 @@ instance Show SearchOrder where
newtype SearchQuery = SearchQuery
{ query :: String
, databases :: Database
, datafield :: Maybe DataField
, datafield :: DataField
, files_id :: Array String
, lang :: Maybe Lang
, limit :: Maybe Int
...
...
@@ -304,7 +307,6 @@ newtype SearchQuery = SearchQuery
, order :: Maybe SearchOrder
, epoAPIUser :: Maybe String
, epoAPIToken :: Maybe String
, pubmedAPIKey :: Maybe String
, selection :: ListSelection.Selection
}
...
...
@@ -329,34 +331,29 @@ instance GT.ToQuery SearchQuery where
instance JSON.WriteForeign SearchQuery where
writeImpl
( SearchQuery
{ databases
, datafield
{ datafield
, lang
, node_id
, epoAPIUser
, epoAPIToken
, pubmedAPIKey
, query
, selection
}
) =
JSON.writeImpl
{ query: query -- String.replace (String.Pattern "\"") (String.Replacement "\\\"") query
, databases
, datafield
, lang: maybe "EN" show lang
, node_id: fromMaybe 0 node_id
, flowListWith: selection
, epoAPIUser
, epoAPIToken
, pubmedAPIKey
}
defaultSearchQuery :: SearchQuery
defaultSearchQuery = SearchQuery
{ query: ""
, databases: Empty
, datafield: Nothing
, datafield: External Empty
, files_id: []
, lang: Nothing
, limit: Nothing
...
...
@@ -365,7 +362,6 @@ defaultSearchQuery = SearchQuery
, order: Nothing
, epoAPIUser: Nothing
, epoAPIToken: Nothing
, pubmedAPIKey: Nothing
, selection: ListSelection.NoList -- MyListsFirst
}
...
...
src/Gargantext/Context/Progress.purs
View file @
d75a1f93
...
...
@@ -68,8 +68,7 @@ asyncProgressCpt = R2.hereComponent here "asyncProgress" hCpt
here.log "[onProgress] TODO: Implement status killed"
if
GT.asyncTaskLogIsFinished atl ||
GT.asyncTaskLogIsError atl then do
GT.asyncTaskLogIsFinished atl then do
handleErrorInAsyncTaskLog errors atl
-- resetInterval intervalIdRef Nothing (pure unit)
onFinish unit
...
...
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