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
3ae4e5d5
Commit
3ae4e5d5
authored
Mar 25, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-scroll-fix
parents
7f26dc38
69db70a9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
108 additions
and
33 deletions
+108
-33
packages.json
.psc-package/local/.set/packages.json
+7
-0
package.json
package.json
+2
-0
packages.dhall
packages.dhall
+5
-0
psc-package.json
psc-package.json
+1
-0
App.purs
src/Gargantext/Components/App.purs
+65
-28
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+6
-5
Version.js
src/Gargantext/Version.js
+5
-0
Version.purs
src/Gargantext/Version.purs
+17
-0
No files found.
.psc-package/local/.set/packages.json
View file @
3ae4e5d5
...
@@ -3235,6 +3235,13 @@
...
@@ -3235,6 +3235,13 @@
"repo"
:
"https://github.com/natefaubion/purescript-variant.git"
,
"repo"
:
"https://github.com/natefaubion/purescript-variant.git"
,
"version"
:
"v6.0.1"
"version"
:
"v6.0.1"
},
},
"versions"
:
{
"dependencies"
:
[
"prelude"
],
"repo"
:
"https://github.com/hdgarrood/purescript-versions.git"
,
"version"
:
"v5.0.1"
},
"web-clipboard"
:
{
"web-clipboard"
:
{
"dependencies"
:
[
"dependencies"
:
[
"web-html"
"web-html"
...
...
package.json
View file @
3ae4e5d5
{
{
"name"
:
"Gargantext"
,
"version"
:
"0.0.0.4"
,
"scripts"
:
{
"scripts"
:
{
"rebase-set"
:
"spago package-set-upgrade && spago psc-package-insdhall"
,
"rebase-set"
:
"spago package-set-upgrade && spago psc-package-insdhall"
,
"rebuild-set"
:
"spago psc-package-insdhall"
,
"rebuild-set"
:
"spago psc-package-insdhall"
,
...
...
packages.dhall
View file @
3ae4e5d5
...
@@ -135,6 +135,11 @@ let additions =
...
@@ -135,6 +135,11 @@ let additions =
[ "prelude", "maybe", "strings" ]
[ "prelude", "maybe", "strings" ]
"https://github.com/truqu/purescript-read"
"https://github.com/truqu/purescript-read"
"v1.0.1"
"v1.0.1"
, versions =
mkPackage
[ "prelude" ]
"https://github.com/hdgarrood/purescript-versions.git"
"v5.0.1"
}
}
in upstream ⫽ overrides ⫽ additions
in upstream ⫽ overrides ⫽ additions
psc-package.json
View file @
3ae4e5d5
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
"tuples-native"
,
"tuples-native"
,
"uint"
,
"uint"
,
"uri"
,
"uri"
,
"versions"
,
"web-html"
"web-html"
]
]
}
}
src/Gargantext/Components/App.purs
View file @
3ae4e5d5
...
@@ -6,11 +6,13 @@ import Data.Array (fromFoldable)
...
@@ -6,11 +6,13 @@ import Data.Array (fromFoldable)
import Data.Foldable (intercalate)
import Data.Foldable (intercalate)
import Data.Maybe (Maybe(..), maybe')
import Data.Maybe (Maybe(..), maybe')
import Data.Tuple (fst, snd)
import Data.Tuple (fst, snd)
import Data.Tuple.Nested ((/\))
import Effect.Aff (launchAff_)
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.Components.Data.Lang (LandingLang(..))
import Gargantext.Components.Data.Lang (LandingLang(..))
import Gargantext.Components.Folder (folder)
import Gargantext.Components.Forest (forest)
import Gargantext.Components.Forest (forest)
import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.Login (login)
import Gargantext.Components.Login (login)
...
@@ -30,6 +32,7 @@ import Gargantext.Routes (AppRoute(..))
...
@@ -30,6 +32,7 @@ import Gargantext.Routes (AppRoute(..))
import Gargantext.Sessions (Sessions, useSessions)
import Gargantext.Sessions (Sessions, useSessions)
import Gargantext.Sessions as Sessions
import Gargantext.Sessions as Sessions
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Gargantext.Version as GV
-- TODO (what does this mean?)
-- TODO (what does this mean?)
-- tree changes endConfig state => trigger endConfig change in outerLayout, layoutFooter etc
-- tree changes endConfig state => trigger endConfig change in outerLayout, layoutFooter etc
...
@@ -50,7 +53,10 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
...
@@ -50,7 +53,10 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
let forested = forestLayout frontends (fst sessions) (fst route) (snd showLogin)
let forested = forestLayout frontends (fst sessions) (fst route) (snd showLogin)
let mCurrentRoute = fst route
let mCurrentRoute = fst route
let backends = fromFoldable defaultBackends
let backends = fromFoldable defaultBackends
let withSession = \sid f -> maybe' (\_ -> forested $ homeLayout LL_EN) f $ Sessions.lookup sid (fst sessions)
let ff f session = R.fragment [ f session, version { session } ]
let withSession sid f =
maybe' (const $ forested $ homeLayout LL_EN) (ff f) $ Sessions.lookup sid (fst sessions)
pure $ case fst showLogin of
pure $ case fst showLogin of
true -> forested $ login { sessions, backends, visible: showLogin }
true -> forested $ login { sessions, backends, visible: showLogin }
false ->
false ->
...
@@ -85,7 +91,7 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
...
@@ -85,7 +91,7 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
forestLayout :: Frontends -> Sessions -> AppRoute -> R2.Setter Boolean -> R.Element -> R.Element
forestLayout :: Frontends -> Sessions -> AppRoute -> R2.Setter Boolean -> R.Element -> R.Element
forestLayout frontends sessions route showLogin child = do
forestLayout frontends sessions route showLogin child = do
R.fragment [ topBar {}, R2.row [main], footer {} ]
R.fragment [ topBar {}, R2.row [main], footer {
} ]
where
where
main =
main =
R.fragment
R.fragment
...
@@ -221,34 +227,65 @@ liNav (LiNav { title : title'
...
@@ -221,34 +227,65 @@ liNav (LiNav { title : title'
]
]
]
]
type VersionProps =
(
session :: Sessions.Session
)
version :: Record VersionProps -> R.Element
version props = R.createElement versionCpt props []
versionCpt :: R.Component VersionProps
versionCpt = R.hooksComponent "G.C.A.version" cpt
where
cpt { session } _ = do
(ver /\ setVer) <- R.useState' "No Backend Version"
R.useEffect' $ do
launchAff_ $ do
v <- GV.getBackendVersion session
liftEffect $ setVer $ const v
pure $ H.div { className: "container" } [
H.footer {}
[
H.span {} [ H.text $ "Frontend version: " <> GV.version <> ", " ]
, H.span {} [ H.text $ "backend version: " <> ver ]
, warning ver GV.version
]
]
warning backendVer frontendVer =
if backendVer == frontendVer then
H.div {} []
else
H.div { className: "text-danger" } [ H.text "Versions do not match" ]
footer :: {} -> R.Element
footer :: {} -> R.Element
footer props = R.createElement footerCpt props []
footer props = R.createElement footerCpt props []
footerCpt :: R.Component ()
footerCpt :: R.Component ()
footerCpt = R.
staticComponent "G.C.Layout
.footer" cpt
footerCpt = R.
hooksComponent "G.C.A
.footer" cpt
where
where
cpt _ _ =
cpt _ _ = do
H.div { className: "container" }
pure $ H.div { className: "container" }
[ H.hr {}
[ H.hr {}
, H.footer {}
, H.footer {}
[ H.p {}
[ H.p {}
[ H.text "Gargantext "
[ H.text "Gargantext "
, H.span {className: "glyphicon glyphicon-registration-mark"} []
, H.span {className: "glyphicon glyphicon-registration-mark"} []
, H.text ", version 4.0"
, H.a { href: "http://www.cnrs.fr"
, H.a { href: "http://www.cnrs.fr"
, target: "blank"
, target: "blank"
, title: "Project hosted by CNRS."
, title: "Project hosted by CNRS."
}
}
[ H.text ", Copyrights "
[ H.text ", Copyrights "
, H.span { className: "glyphicon glyphicon-copyright-mark" } []
, H.span { className: "glyphicon glyphicon-copyright-mark" } []
, H.text " CNRS 2017-Present"
, H.text " CNRS 2017-Present"
]
]
, H.a { href: "http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE"
, H.a { href: "http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE"
, target: "blank"
, target: "blank"
, title: "Legal instructions of the project."
, title: "Legal instructions of the project."
}
}
[ H.text ", Licences aGPLV3 and CECILL variant Affero compliant" ]
[ H.text ", Licences aGPLV3 and CECILL variant Affero compliant" ]
, H.text "."
, H.text "."
]]
]]
]
]
src/Gargantext/Components/GraphExplorer.purs
View file @
3ae4e5d5
...
@@ -14,6 +14,12 @@ import Data.Set as Set
...
@@ -14,6 +14,12 @@ import Data.Set as Set
import Data.Tuple (fst, snd, Tuple(..))
import Data.Tuple (fst, snd, Tuple(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Math (log)
import Partial.Unsafe (unsafePartial)
import Reactix as R
import Reactix.DOM.HTML as RH
import Record as Record
import Gargantext.Components.Forest (forest)
import Gargantext.Components.Forest (forest)
import Gargantext.Components.Graph as Graph
import Gargantext.Components.Graph as Graph
import Gargantext.Components.GraphExplorer.Controls as Controls
import Gargantext.Components.GraphExplorer.Controls as Controls
...
@@ -30,11 +36,6 @@ import Gargantext.Sessions (Session, Sessions, get)
...
@@ -30,11 +36,6 @@ import Gargantext.Sessions (Session, Sessions, get)
import Gargantext.Types as Types
import Gargantext.Types as Types
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Math (log)
import Partial.Unsafe (unsafePartial)
import Reactix as R
import Reactix.DOM.HTML as RH
import Record as Record
type GraphId = Int
type GraphId = Int
...
...
src/Gargantext/Version.js
0 → 100644
View file @
3ae4e5d5
'use strict'
;
const
pkg
=
require
(
'../../package.json'
);
exports
.
version
=
pkg
.
version
;
src/Gargantext/Version.purs
0 → 100644
View file @
3ae4e5d5
module Gargantext.Version where
import Data.Maybe (Maybe(..))
import Effect.Aff (Aff)
import Gargantext.Config.REST as REST
import Gargantext.Ends (toUrl)
import Gargantext.Sessions (Session(..))
type Version = String
foreign import version :: Version
getBackendVersion :: Session -> Aff Version
getBackendVersion (Session { backend }) = REST.get Nothing (toUrl backend "version")
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