Commit cfa0c382 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FEAT][Search] IsTex basic and IsTex Advanced.

parent ed4f4b47
...@@ -23,7 +23,7 @@ import Gargantext.Components.Forest.Tree.Node.ProgressBar (asyncProgressBar, Bar ...@@ -23,7 +23,7 @@ import Gargantext.Components.Forest.Tree.Node.ProgressBar (asyncProgressBar, Bar
import Gargantext.Components.GraphExplorer.API as GraphAPI import Gargantext.Components.GraphExplorer.API as GraphAPI
import Gargantext.Components.Lang (allLangs, Lang(EN)) import Gargantext.Components.Lang (allLangs, Lang(EN))
import Gargantext.Components.Search.SearchBar (searchBar) import Gargantext.Components.Search.SearchBar (searchBar)
import Gargantext.Components.Search.SearchField (Search, defaultSearch, isIsTex) import Gargantext.Components.Search.SearchField (Search, defaultSearch, isIsTex_Advanced)
import Gargantext.Ends (Frontends, url) import Gargantext.Ends (Frontends, url)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes (AppRoute) import Gargantext.Routes (AppRoute)
...@@ -299,9 +299,9 @@ mAppRouteId _ = Nothing ...@@ -299,9 +299,9 @@ mAppRouteId _ = Nothing
-- | START Popup View -- | START Popup View
type NodePopupProps = type NodePopupProps =
( id :: ID ( id :: ID
, name :: Name , name :: Name
, nodeType :: GT.NodeType , nodeType :: GT.NodeType
, onPopoverClose :: DOM.Element -> Effect Unit , onPopoverClose :: DOM.Element -> Effect Unit
| CommonProps | CommonProps
) )
...@@ -427,7 +427,7 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt ...@@ -427,7 +427,7 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
} }
searchIsTexIframe {nodeType} search@(search' /\ _) iframeRef = searchIsTexIframe {nodeType} search@(search' /\ _) iframeRef =
if isIsTex search'.datafield then if isIsTex_Advanced search'.datafield then
H.div { className: "istex-search panel panel-default" } H.div { className: "istex-search panel panel-default" }
[ [
H.h3 { className: GT.fldr nodeType true} [] H.h3 { className: GT.fldr nodeType true} []
...@@ -480,7 +480,6 @@ type ButtonClickProps = ...@@ -480,7 +480,6 @@ type ButtonClickProps =
, state :: R.State (Record ActionState) , state :: R.State (Record ActionState)
) )
buttonClick :: Record ButtonClickProps -> R.Element buttonClick :: Record ButtonClickProps -> R.Element
buttonClick p = R.createElement buttonClickCpt p [] buttonClick p = R.createElement buttonClickCpt p []
...@@ -505,9 +504,7 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt ...@@ -505,9 +504,7 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt
then Nothing then Nothing
else (Just todo) else (Just todo)
-- END Popup View -- END Popup View
type NodeProps = type NodeProps =
( id :: ID ( id :: ID
, name :: Name , name :: Name
...@@ -586,7 +583,12 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt ...@@ -586,7 +583,12 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
actionDelete :: NodeType -> Dispatch -> R.Hooks R.Element actionDelete :: NodeType -> Dispatch -> R.Hooks R.Element
actionDelete NodeUser _ = do actionDelete NodeUser _ = do
pure $ R.fragment [ pure $ R.fragment [
H.div {style: {margin: "10px"}} [H.text "Yes, we are RGPD compliant! But you can not delete User Node yet (we are still on development). Thanks for your comprehensin."] H.div {style: {margin: "10px"}}
[H.text $ "Yes, we are RGPD compliant!"
<> " But you can not delete User Node yet."
<> " We are still on development."
<> " Thanks for your comprehensin."
]
] ]
actionDelete _ dispatch = do actionDelete _ dispatch = do
......
module Gargantext.Components.Search.SearchField module Gargantext.Components.Search.SearchField
( Search, Props, defaultSearch, searchField, searchFieldComponent, isIsTex) where ( Search, Props, defaultSearch, searchField, searchFieldComponent, isIsTex, isIsTex_Advanced) where
import Data.Maybe (Maybe(..), maybe, fromMaybe, isJust) import Data.Maybe (Maybe(..), maybe, fromMaybe, isJust)
import Data.Newtype (over) import Data.Newtype (over)
...@@ -165,6 +165,17 @@ isIsTex ( Just ...@@ -165,6 +165,17 @@ isIsTex ( Just
) = true ) = true
isIsTex _ = false isIsTex _ = false
isIsTex_Advanced :: Maybe DataField -> Boolean
isIsTex_Advanced ( Just
( External
( Just ( IsTex_Advanced)
)
)
) = true
isIsTex_Advanced _ = false
isIMT :: Maybe DataField -> Boolean isIMT :: Maybe DataField -> Boolean
isIMT ( Just isIMT ( Just
( External ( External
......
...@@ -91,6 +91,7 @@ allDatabases = [ Empty ...@@ -91,6 +91,7 @@ allDatabases = [ Empty
, PubMed , PubMed
, HAL Nothing , HAL Nothing
, IsTex , IsTex
, IsTex_Advanced
, Isidore , Isidore
--, Web --, Web
--, News --, News
...@@ -102,6 +103,7 @@ data Database = All_Databases ...@@ -102,6 +103,7 @@ data Database = All_Databases
| PubMed | PubMed
| HAL (Maybe Org) | HAL (Maybe Org)
| IsTex | IsTex
| IsTex_Advanced
| Isidore | Isidore
-- | News -- | News
-- | SocialNetworks -- | SocialNetworks
...@@ -111,6 +113,7 @@ instance showDatabase :: Show Database where ...@@ -111,6 +113,7 @@ instance showDatabase :: Show Database where
show PubMed = "PubMed" show PubMed = "PubMed"
show (HAL _)= "HAL" show (HAL _)= "HAL"
show IsTex = "IsTex" show IsTex = "IsTex"
show IsTex_Advanced = "IsTex_Advanced"
show Isidore= "Isidore" show Isidore= "Isidore"
show Empty = "Empty" show Empty = "Empty"
-- show News = "News" -- show News = "News"
...@@ -121,6 +124,7 @@ instance docDatabase :: Doc Database where ...@@ -121,6 +124,7 @@ instance docDatabase :: Doc Database where
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 IsTex_Advanced = "IsTex advanced search"
doc Isidore = "All (French) Social Sciences" doc Isidore = "All (French) Social Sciences"
doc Empty = "Empty" doc Empty = "Empty"
-- doc News = "Web filtered by News" -- doc News = "Web filtered by News"
...@@ -130,8 +134,9 @@ readDatabase :: String -> Maybe Database ...@@ -130,8 +134,9 @@ readDatabase :: String -> Maybe Database
readDatabase "All Databases" = Just All_Databases readDatabase "All Databases" = Just All_Databases
readDatabase "PubMed" = Just PubMed readDatabase "PubMed" = Just PubMed
readDatabase "HAL" = Just $ HAL Nothing readDatabase "HAL" = Just $ HAL Nothing
readDatabase "IsTex" = Just IsTex
readDatabase "Isidore"= Just Isidore readDatabase "Isidore"= Just Isidore
readDatabase "IsTex" = Just IsTex
readDatabase "IsTex_Advanced" = Just IsTex_Advanced
-- 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
......
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