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
6e3f3063
Commit
6e3f3063
authored
Jun 01, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-async-tasks-local-storage
parents
58c34940
914fc19b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
145 additions
and
120 deletions
+145
-120
App.purs
src/Gargantext/Components/App.purs
+37
-41
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+78
-78
Home.purs
src/Gargantext/Components/Nodes/Home.purs
+4
-1
License.purs
src/Gargantext/License.purs
+26
-0
No files found.
src/Gargantext/Components/App.purs
View file @
6e3f3063
...
@@ -12,6 +12,7 @@ import Effect.Class (liftEffect)
...
@@ -12,6 +12,7 @@ import Effect.Class (liftEffect)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Gargantext.License (license)
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Forest (forest)
import Gargantext.Components.Forest (forest)
import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.GraphExplorer (explorerLayout)
...
@@ -60,7 +61,7 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
...
@@ -60,7 +61,7 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
, showLogin: snd showLogin }
, showLogin: snd showLogin }
let mCurrentRoute = fst route
let mCurrentRoute = fst route
let backends = fromFoldable defaultBackends
let backends = fromFoldable defaultBackends
let ff f session = R.fragment [ f session,
version { session }
]
let ff f session = R.fragment [ f session,
footer { session }
]
let withSession sid f =
let withSession sid f =
maybe' (const $ forested $ homeLayout LL_EN) (ff f) $ Sessions.lookup sid (fst sessions)
maybe' (const $ forested $ homeLayout LL_EN) (ff f) $ Sessions.lookup sid (fst sessions)
...
@@ -112,7 +113,7 @@ type ForestLayoutProps =
...
@@ -112,7 +113,7 @@ type ForestLayoutProps =
forestLayout :: Record ForestLayoutProps -> R.Element
forestLayout :: Record ForestLayoutProps -> R.Element
forestLayout { child, frontends, reload, route, sessions, showLogin } = do
forestLayout { child, frontends, reload, route, sessions, showLogin } = do
R.fragment [ topBar {}, R2.row [main]
, footer { }
]
R.fragment [ topBar {}, R2.row [main] ]
where
where
main =
main =
R.fragment
R.fragment
...
@@ -123,7 +124,7 @@ forestLayout { child, frontends, reload, route, sessions, showLogin } = do
...
@@ -123,7 +124,7 @@ forestLayout { child, frontends, reload, route, sessions, showLogin } = do
-- Simple layout does not accommodate the tree
-- Simple layout does not accommodate the tree
simpleLayout :: R.Element -> R.Element
simpleLayout :: R.Element -> R.Element
simpleLayout child = R.fragment [ topBar {}, child,
footer {}
]
simpleLayout child = R.fragment [ topBar {}, child,
license
]
mainPage :: R.Element -> R.Element
mainPage :: R.Element -> R.Element
mainPage child =
mainPage child =
...
@@ -248,6 +249,9 @@ liNav (LiNav { title : title'
...
@@ -248,6 +249,9 @@ liNav (LiNav { title : title'
]
]
]
]
---------------------------------------------------------------------------
-- | TODO put Version in the Tree/Root node
type VersionProps =
type VersionProps =
(
(
session :: Sessions.Session
session :: Sessions.Session
...
@@ -267,46 +271,38 @@ versionCpt = R.hooksComponent "G.C.A.version" cpt
...
@@ -267,46 +271,38 @@ versionCpt = R.hooksComponent "G.C.A.version" cpt
v <- GV.getBackendVersion session
v <- GV.getBackendVersion session
liftEffect $ setVer $ const v
liftEffect $ setVer $ const v
pure $ H.div { className: "container" } [
pure $ H.div { className: "row" }
H.footer {}
[ H.div { className: versionCheck GV.version ver}
[
[ H.h4 {} [H.text $ versionMessage GV.version ver]
H.span {} [ H.text $ "Frontend version: " <> GV.version <> ", " ]
, H.div { className: "container" } [showVersions GV.version ver]
, H.span {} [ H.text $ "backend version: " <> ver ]
]
, warning ver GV.version
]
]
where
]
versionCheck v1 v2 = case v1 == v2 of
warning backendVer frontendVer =
false -> "col alert alert-danger"
if backendVer == frontendVer then
true -> "col alert alert-success"
H.div {} []
versionMessage v1 v2 = case v1 == v2 of
else
false -> "Versions do not match"
H.div { className: "text-danger" } [ H.text "Versions do not match" ]
true -> "Versions are up to date"
footer :: {} -> R.Element
showVersions frontendVer backendVer =
H.div { className: "row" }
[ H.h5 {} [ H.text $ "Frontend version: " <> frontendVer ]
, H.h5 {} [ H.text $ "backend version: " <> backendVer ]
]
footer :: Record VersionProps -> R.Element
footer props = R.createElement footerCpt props []
footer props = R.createElement footerCpt props []
footerCpt :: R.Component
()
footerCpt :: R.Component
VersionProps
footerCpt = R.hooksComponent "G.C.A.footer" cpt
footerCpt = R.hooksComponent "G.C.A.footer" cpt
where
where
cpt _ _ = do
cpt { session } _ = do
pure $ H.div { className: "container" }
pure $ H.div
[ H.hr {}
{ className: "container" }
, H.footer {}
[ H.hr {}
[ H.p {}
, H.footer {} [ version { session }
[ H.text "Gargantext "
, license
, H.span {className: "glyphicon glyphicon-registration-mark"} []
]
, H.a { href: "http://www.cnrs.fr"
, target: "blank"
, title: "Project hosted by CNRS."
}
[ H.text ", Copyrights "
, H.span { className: "glyphicon glyphicon-copyright-mark" } []
, H.text " CNRS 2017-Present"
]
]
, H.a { href: "http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE"
, target: "blank"
, title: "Legal instructions of the project."
}
[ H.text ", Licences aGPLV3 and CECILL variant Affero compliant" ]
, H.text "."
]]
]
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
6e3f3063
...
@@ -3,38 +3,38 @@ module Gargantext.Components.Forest.Tree.Node.Box where
...
@@ -3,38 +3,38 @@ module Gargantext.Components.Forest.Tree.Node.Box where
import Gargantext.Prelude
import Gargantext.Prelude
import DOM.Simple as DOM
import DOM.Simple as DOM
import DOM.Simple.Event
import DOM.Simple.EventListener
import DOM.Simple.Types
import DOM.Simple.Window
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Nullable (null)
import Data.Nullable (
Nullable,
null)
import Data.Tuple (fst, Tuple(..))
import Data.Tuple (fst, Tuple(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Data.Nullable (Nullable, null)
import DOM.Simple as DOM
import Effect (Effect)
import Effect (Effect)
import Effect.Aff (Aff, launchAff, launchAff_)
import Effect.Aff (Aff, launchAff, launchAff_)
import Effect.Class (liftEffect)
import Effect.Class (liftEffect)
import Effect.Console
import Effect.Uncurried (mkEffectFn1)
import Effect.Uncurried (mkEffectFn1)
import Gargantext.Components.Forest.Tree.Node (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
import Gargantext.Components.Forest.Tree.Node (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..), DroppedFile(..), FileType(..), ID, Name, UploadFileContents(..))
import Gargantext.Components.Forest.Tree.Node.Action (Action(..), DroppedFile(..), FileType(..), ID, Name, UploadFileContents(..))
import Gargantext.Components.Forest.Tree.Node.Action.Add (NodePopup(..), createNodeView)
import Gargantext.Components.Forest.Tree.Node.Action.Add (NodePopup(..), createNodeView)
import Gargantext.Components.Forest.Tree.Node.Action.Rename (renameBox)
import Gargantext.Components.Forest.Tree.Node.Action.Rename (renameBox)
import Gargantext.Components.Forest.Tree.Node.Action.Upload (uploadFileView, fileTypeView, uploadTermListView, copyFromCorpusView)
import Gargantext.Components.Forest.Tree.Node.Action.Upload (uploadFileView, fileTypeView, uploadTermListView, copyFromCorpusView)
import Gargantext.Components.Forest.Tree.Node.ProgressBar (asyncProgressBar, BarType(..))
import Gargantext.Components.Forest.Tree.Node.ProgressBar (asyncProgressBar, BarType(..))
import Gargantext.Components.GraphExplorer.API as GraphAPI
import Gargantext.Components.GraphExplorer.API as GraphAPI
import Gargantext.Components.Lang (allLangs, Lang(EN))
import Gargantext.Components.NgramsTable.API as NTAPI
import Gargantext.Components.NgramsTable.API as NTAPI
import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild)
import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild)
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_Advanced)
import Gargantext.Components.Search.SearchField (Search, defaultSearch, isIsTex_Advanced)
import Gargantext.Components.Search.Types (DataField(..))
import Gargantext.Components.Search.Types (DataField(..))
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 as Routes
import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, sessionId, post)
import Gargantext.Sessions (Session, sessionId, post)
import Gargantext.Types (NodeType(..))
import Gargantext.Types (NodeType(..))
import Gargantext.Types as GT
import Gargantext.Types as GT
import Gargantext.Routes as GR
import Gargantext.Utils (glyphicon, glyphiconActive)
import Gargantext.Utils (glyphicon, glyphiconActive)
import Gargantext.Utils.Popover as Popover
import Gargantext.Utils.Popover as Popover
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
...
@@ -45,12 +45,6 @@ import URI.Extra.QueryPairs as NQP
...
@@ -45,12 +45,6 @@ import URI.Extra.QueryPairs as NQP
import URI.Query as Query
import URI.Query as Query
import Web.File.FileReader.Aff (readAsText)
import Web.File.FileReader.Aff (readAsText)
import DOM.Simple.Types
import DOM.Simple.Window
import DOM.Simple.EventListener
import DOM.Simple.Event
import Effect.Console
type Dispatch = Action -> Aff Unit
type Dispatch = Action -> Aff Unit
type CommonProps =
type CommonProps =
...
@@ -58,14 +52,13 @@ type CommonProps =
...
@@ -58,14 +52,13 @@ type CommonProps =
, session :: Session
, session :: Session
)
)
-- Main Node
-- Main Node
type NodeMainSpanProps =
type NodeMainSpanProps =
( id :: ID
( id :: ID
, asyncTasks :: Array GT.AsyncTaskWithType
, asyncTasks :: Array GT.AsyncTaskWithType
, folderOpen :: R.State Boolean
, folderOpen :: R.State Boolean
, frontends :: Frontends
, frontends :: Frontends
, mCurrentRoute :: Maybe AppRoute
, mCurrentRoute :: Maybe
Routes.
AppRoute
, name :: Name
, name :: Name
, nodeType :: GT.NodeType
, nodeType :: GT.NodeType
, onAsyncTaskFinish :: GT.AsyncTaskWithType -> Effect Unit
, onAsyncTaskFinish :: GT.AsyncTaskWithType -> Effect Unit
...
@@ -82,7 +75,7 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
...
@@ -82,7 +75,7 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
droppedFile <- R.useState' (Nothing :: Maybe DroppedFile)
droppedFile <- R.useState' (Nothing :: Maybe DroppedFile)
isDragOver <- R.useState' false
isDragOver <- R.useState' false
popoverRef <- R.useRef null
popoverRef
<- R.useRef null
pure $ H.span (dropProps droppedFile isDragOver) $
pure $ H.span (dropProps droppedFile isDragOver) $
[ folderIcon nodeType folderOpen
[ folderIcon nodeType folderOpen
...
@@ -305,8 +298,7 @@ nodeActionsNodeListCpt = R.hooksComponent "G.C.F.T.N.B.nodeActionsNodeList" cpt
...
@@ -305,8 +298,7 @@ nodeActionsNodeListCpt = R.hooksComponent "G.C.F.T.N.B.nodeActionsNodeList" cpt
]
]
type NodeListUpdateButtonProps =
type NodeListUpdateButtonProps =
(
( listId :: GT.ListId
listId :: GT.ListId
, nodeId :: ID
, nodeId :: ID
, nodeType :: GT.TabSubType GT.CTabNgramType
, nodeType :: GT.TabSubType GT.CTabNgramType
, session :: Session
, session :: Session
...
@@ -322,10 +314,11 @@ nodeListUpdateButtonCpt = R.hooksComponent "G.C.F.T.N.B.nodeListUpdateButton" cp
...
@@ -322,10 +314,11 @@ nodeListUpdateButtonCpt = R.hooksComponent "G.C.F.T.N.B.nodeListUpdateButton" cp
cpt { listId, nodeId, nodeType, session, triggerRefresh } _ = do
cpt { listId, nodeId, nodeType, session, triggerRefresh } _ = do
enabled <- R.useState' true
enabled <- R.useState' true
pure $ H.div { className: "update-button " <> if (fst enabled) then "enabled" else "disabled text-muted" } [
pure $ H.div { className: "update-button "
H.span { className: "fa fa-refresh"
<> if (fst enabled) then "enabled" else "disabled text-muted"
, on: { click: onClick enabled } } []
} [ H.span { className: "fa fa-refresh"
]
, on: { click: onClick enabled } } []
]
where
where
onClick (false /\ _) _ = pure unit
onClick (false /\ _) _ = pure unit
onClick (true /\ setEnabled) _ = do
onClick (true /\ setEnabled) _ = do
...
@@ -338,7 +331,7 @@ nodeListUpdateButtonCpt = R.hooksComponent "G.C.F.T.N.B.nodeListUpdateButton" cp
...
@@ -338,7 +331,7 @@ nodeListUpdateButtonCpt = R.hooksComponent "G.C.F.T.N.B.nodeListUpdateButton" cp
-- END nodeActions
-- END nodeActions
mAppRouteId :: Maybe AppRoute -> Maybe Int
mAppRouteId :: Maybe
Routes.
AppRoute -> Maybe Int
mAppRouteId (Just (Routes.Folder _ id)) = Just id
mAppRouteId (Just (Routes.Folder _ id)) = Just id
mAppRouteId (Just (Routes.FolderPrivate _ id)) = Just id
mAppRouteId (Just (Routes.FolderPrivate _ id)) = Just id
mAppRouteId (Just (Routes.FolderPublic _ id)) = Just id
mAppRouteId (Just (Routes.FolderPublic _ id)) = Just id
...
@@ -351,8 +344,8 @@ mAppRouteId (Just (Routes.Texts _ id)) = Just id
...
@@ -351,8 +344,8 @@ mAppRouteId (Just (Routes.Texts _ id)) = Just id
mAppRouteId (Just (Routes.Lists _ id)) = Just id
mAppRouteId (Just (Routes.Lists _ id)) = Just id
mAppRouteId (Just (Routes.Annuaire _ id)) = Just id
mAppRouteId (Just (Routes.Annuaire _ id)) = Just id
mAppRouteId (Just (Routes.UserPage _ id)) = Just id
mAppRouteId (Just (Routes.UserPage _ id)) = Just id
mAppRouteId (Just (Routes.Document _ id _ )) = Just id
mAppRouteId (Just (Routes.Document _ id _
)) = Just id
mAppRouteId (Just (Routes.ContactPage _ id _ )) = Just id
mAppRouteId (Just (Routes.ContactPage _ id _
)) = Just id
mAppRouteId (Just (Routes.CorpusDocument _ id _ _)) = Just id
mAppRouteId (Just (Routes.CorpusDocument _ id _ _)) = Just id
mAppRouteId _ = Nothing
mAppRouteId _ = Nothing
...
@@ -367,11 +360,10 @@ type NodePopupProps =
...
@@ -367,11 +360,10 @@ type NodePopupProps =
)
)
type NodePopupS =
type NodePopupS =
(
( action :: Maybe NodeAction
action :: Maybe NodeAction
, id :: ID
, id :: ID
, name :: Name
, name :: Name
, nodeType :: GT.NodeType
, nodeType :: GT.NodeType
)
)
iconAStyle :: { color :: String
iconAStyle :: { color :: String
...
@@ -483,7 +475,6 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
...
@@ -483,7 +475,6 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
, session : p.session
, session : p.session
}
}
type ActionState =
type ActionState =
( action :: Maybe NodeAction
( action :: Maybe NodeAction
, id :: ID
, id :: ID
...
@@ -491,7 +482,6 @@ type ActionState =
...
@@ -491,7 +482,6 @@ type ActionState =
, nodeType :: GT.NodeType
, nodeType :: GT.NodeType
)
)
type ButtonClickProps =
type ButtonClickProps =
( action :: NodeAction
( action :: NodeAction
, state :: R.State (Record ActionState)
, state :: R.State (Record ActionState)
...
@@ -547,10 +537,10 @@ panelAction p = R.createElement panelActionCpt p []
...
@@ -547,10 +537,10 @@ panelAction p = R.createElement panelActionCpt p []
panelActionCpt :: R.Component PanelActionProps
panelActionCpt :: R.Component PanelActionProps
panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
where
where
cpt {action: Documentation nodeType} _ = actionDoc nodeType
cpt {action: Documentation nodeType}
_ = actionDoc nodeType
cpt {action: Download, id, nodeType, session} _ = actionDownload nodeType id session
cpt {action: Download, id, nodeType, session}
_ = actionDownload nodeType id session
cpt {action: Upload, dispatch, id, nodeType, session} _ = actionUpload nodeType id session dispatch
cpt {action: Upload, dispatch, id, nodeType, session} _ = actionUpload
nodeType id session dispatch
cpt {action: Delete, nodeType, dispatch}
_ = actionDelete
nodeType dispatch
cpt {action: Delete, nodeType, dispatch}
_ = actionDelete
nodeType dispatch
cpt {action: Add xs, dispatch, id, name, nodePopup: p, nodeType} _ = do
cpt {action: Add xs, dispatch, id, name, nodePopup: p, nodeType} _ = do
pure $ createNodeView {dispatch, id, name, nodeType, nodeTypes: xs}
pure $ createNodeView {dispatch, id, name, nodeType, nodeTypes: xs}
...
@@ -558,46 +548,43 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
...
@@ -558,46 +548,43 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
cpt {action: CopyFromCorpus, dispatch, id, nodeType, session} _ = do
cpt {action: CopyFromCorpus, dispatch, id, nodeType, session} _ = do
pure $ copyFromCorpusView {dispatch, id, nodeType, session}
pure $ copyFromCorpusView {dispatch, id, nodeType, session}
cpt {action: Link _} _ = pure $ fragmentPT "Soon, you will be able to link the corpus with your Annuaire (and reciprocally)."
cpt {action: Link _} _ = pure $ fragmentPT $ "Soon, you will be able "
<> "to link the corpus with your Annuaire"
<> " (and reciprocally)."
cpt props@{action: SearchBox, search, session} _ = do
pure $ R.fragment [ H.p {"style": {"margin" :"10px"}}
[ H.text $ "Search and create a private corpus with the search query as corpus name." ]
, searchBar {langs: allLangs, onSearch: searchOn props, search, session}
]
where
searchOn :: Record PanelActionProps -> GT.AsyncTaskWithType -> Effect Unit
searchOn {dispatch, nodePopup: p} task = do
_ <- launchAff $ dispatch (SearchQuery task)
-- close popup
-- TODO
--snd p $ const Nothing
pure unit
{-
cpt props@{action: SearchBox, search, session, dispatch, nodePopup} _ =
cpt {action: Refresh, nodeType: GT.Graph, id, session} _ = do
actionSearch search session dispatch nodePopup
pure $ H.div {className: "panel-footer"}
[ H.a { type: "button"
, className: "btn glyphicon glyphicon-trash"
, id: "delete"
, title: "Delete"
, on: {click: \_ -> post session (GR.GraphAPI id $ GT.asyncTaskTypePath GT.GraphT) {}
-- TODO pure $ GT.AsyncTaskWithType { task, typ: GT.GraphT }
}
}
[H.text " Yes, delete!"]
]
--}
cpt _ _ = do
cpt _ _ = do
pure $ H.div {} []
pure $ H.div {} []
-- | Action : Search
actionSearch :: R.State Search
-> Session
-> (Action -> Aff Unit)
-> Maybe NodePopup
-> R.Hooks R.Element
actionSearch search session dispatch nodePopup =
pure $ R.fragment [ H.p {"style": {"margin" :"10px"}}
[ H.text $ "Search and create a private "
<> "corpus with the search query as corpus name." ]
, searchBar {langs: allLangs, onSearch: searchOn dispatch nodePopup, search, session}
]
where
searchOn :: (Action -> Aff Unit)
-> Maybe NodePopup
-> GT.AsyncTaskWithType
-> Effect Unit
searchOn dispatch p task = do
_ <- launchAff $ dispatch (SearchQuery task)
-- close popup
-- TODO
--snd p $ const Nothing
pure unit
-- | Action : Delete
-- | Action : Delete
actionDelete :: NodeType ->
Dispatch
-> R.Hooks R.Element
actionDelete :: NodeType ->
(Action -> Aff Unit)
-> R.Hooks R.Element
actionDelete NodeUser _ = do
actionDelete NodeUser _ = do
pure $ R.fragment [
pure $ R.fragment [
H.div {style: {margin: "10px"}}
H.div {style: {margin: "10px"}}
...
@@ -610,7 +597,12 @@ actionDelete NodeUser _ = do
...
@@ -610,7 +597,12 @@ actionDelete NodeUser _ = do
actionDelete _ dispatch = do
actionDelete _ dispatch = do
pure $ R.fragment [
pure $ R.fragment [
H.div {style: {margin: "10px"}} (map (\t -> H.p {} [H.text t]) ["Are your sure you want to delete it ?", "If yes, click again below."])
H.div {style: {margin: "10px"}}
(map (\t -> H.p {} [H.text t])
[ "Are your sure you want to delete it ?"
, "If yes, click again below."
]
)
, reallyDelete dispatch
, reallyDelete dispatch
]
]
where
where
...
@@ -717,11 +709,15 @@ docOf GT.FolderShared = ["Soon, you will be able to build teams folders to shar
...
@@ -717,11 +709,15 @@ docOf GT.FolderShared = ["Soon, you will be able to build teams folders to shar
docOf nodeType = ["More information on " <> show nodeType]
docOf nodeType = ["More information on " <> show nodeType]
fragmentPT :: String -> R.Element
fragmentPT text = H.div {style: {margin: "10px"}} [H.text text]
fragmentPT text = H.div {style: {margin: "10px"}} [H.text text]
--------------------
--------------------
-- | Iframes
-- | Iframes
searchIframes :: Record NodePopupProps
-> R.State Search
-> R.Ref (Nullable DOM.Element)
-> R.Element
searchIframes {nodeType} search@(search' /\ _) iframeRef =
searchIframes {nodeType} search@(search' /\ _) iframeRef =
if isIsTex_Advanced 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" }
...
@@ -737,6 +733,10 @@ searchIframes {nodeType} search@(search' /\ _) iframeRef =
...
@@ -737,6 +733,10 @@ searchIframes {nodeType} search@(search' /\ _) iframeRef =
else
else
H.div {} []
H.div {} []
iframeWith :: String
-> R.State Search
-> R.Ref (Nullable DOM.Element)
-> R.Element
iframeWith url (search /\ setSearch) iframeRef =
iframeWith url (search /\ setSearch) iframeRef =
H.iframe { src: isTexTermUrl search.term
H.iframe { src: isTexTermUrl search.term
,width: "100%"
,width: "100%"
...
@@ -750,12 +750,13 @@ iframeWith url (search /\ setSearch) iframeRef =
...
@@ -750,12 +750,13 @@ iframeWith url (search /\ setSearch) iframeRef =
} []
} []
where
where
changeSearchOnMessage :: String -> Callback MessageEvent
changeSearchOnMessage :: String -> Callback MessageEvent
changeSearchOnMessage url = callback $ \m -> if R2.getMessageOrigin m == url
changeSearchOnMessage url =
then do
callback $ \m -> if R2.getMessageOrigin m == url
let {url, term} = R2.getMessageData m
then do
setSearch $ _ {url = url, term = term}
let {url, term} = R2.getMessageData m
else
setSearch $ _ {url = url, term = term}
pure unit
else
pure unit
isTexTermUrl term = url <> query
isTexTermUrl term = url <> query
where
where
query = Query.print $ NQP.print identity identity qp
query = Query.print $ NQP.print identity identity qp
...
@@ -764,4 +765,3 @@ iframeWith url (search /\ setSearch) iframeRef =
...
@@ -764,4 +765,3 @@ iframeWith url (search /\ setSearch) iframeRef =
Tuple (NQP.keyFromString "query") (Just (NQP.valueFromString term))
Tuple (NQP.keyFromString "query") (Just (NQP.valueFromString term))
]
]
src/Gargantext/Components/Nodes/Home.purs
View file @
6e3f3063
...
@@ -6,6 +6,7 @@ import Effect (Effect)
...
@@ -6,6 +6,7 @@ import Effect (Effect)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Routing.Hash (setHash)
import Routing.Hash (setHash)
import Gargantext.License (license)
import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Components.Data.Landing
import Gargantext.Components.Data.Landing
...
@@ -53,7 +54,9 @@ homeLayoutCpt = R.staticComponent "LayoutLanding" cpt
...
@@ -53,7 +54,9 @@ homeLayoutCpt = R.staticComponent "LayoutLanding" cpt
H.span {}
H.span {}
[ H.div { className: "container1" } [ jumboTitle landingData false ]
[ H.div { className: "container1" } [ jumboTitle landingData false ]
, H.div { className: "container1" } [] -- TODO put research form
, H.div { className: "container1" } [] -- TODO put research form
, H.div { className: "container1" } [ blocksRandomText' landingData ] ]
, H.div { className: "container1" } [ blocksRandomText' landingData ]
, license
]
------------------------------------------------------------------------
------------------------------------------------------------------------
...
...
src/Gargantext/License.purs
0 → 100644
View file @
6e3f3063
module Gargantext.License where
import Prelude
import Reactix as R
import Reactix.DOM.HTML as H
license :: R.Element
license = H.p {}
[ H.text "Gargantext "
, H.span {className: "glyphicon glyphicon-registration-mark"} []
, H.a { href: "http://www.cnrs.fr"
, target: "blank"
, title: "Project hosted by CNRS."
}
[ H.text ", Copyrights "
, H.span { className: "glyphicon glyphicon-copyright-mark" } []
, H.text " CNRS 2017-Present"
]
, H.a { href: "http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE"
, target: "blank"
, title: "Legal instructions of the project."
}
[ H.text ", Licences aGPLV3 and CECILL variant Affero compliant" ]
, H.text "."
]
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