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
Christian Merten
purescript-gargantext
Commits
59fff972
Commit
59fff972
authored
Jul 17, 2018
by
Mael NICOLAS
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
e72a0197
3390ab0c
Changes
66
Show whitespace changes
Inline
Side-by-side
Showing
66 changed files
with
1082 additions
and
364 deletions
+1082
-364
Facets.purs
src/Facets.purs
+0
-6
Charts.js
src/Gargantext/Components/Charts/Charts.js
+0
-0
Charts.purs
src/Gargantext/Components/Charts/Charts.purs
+2
-2
Color.purs
src/Gargantext/Components/Charts/Options/Color.purs
+3
-2
Data.purs
src/Gargantext/Components/Charts/Options/Data.purs
+2
-4
ECharts.js
src/Gargantext/Components/Charts/Options/ECharts.js
+0
-0
ECharts.purs
src/Gargantext/Components/Charts/Options/ECharts.purs
+13
-16
Font.purs
src/Gargantext/Components/Charts/Options/Font.purs
+6
-4
Legend.purs
src/Gargantext/Components/Charts/Options/Legend.purs
+3
-3
Position.purs
src/Gargantext/Components/Charts/Options/Position.purs
+3
-2
Series.purs
src/Gargantext/Components/Charts/Options/Series.purs
+4
-3
Type.purs
src/Gargantext/Components/Charts/Options/Type.purs
+8
-11
Sigmajs.js
src/Gargantext/Components/GraphExplorer/Sigmajs.js
+0
-0
Sigmajs.purs
src/Gargantext/Components/GraphExplorer/Sigmajs.purs
+3
-2
Types.purs
src/Gargantext/Components/GraphExplorer/Types.purs
+1
-1
Landing.purs
src/Gargantext/Components/Lang/Data/Landing.purs
+1
-3
Lang.purs
src/Gargantext/Components/Lang/Data/Lang.purs
+3
-0
EnUS.purs
src/Gargantext/Components/Lang/Landing/EnUS.purs
+5
-8
FrFR.purs
src/Gargantext/Components/Lang/Landing/FrFR.purs
+5
-8
Login.purs
src/Gargantext/Components/Login.purs
+2
-5
Modal.js
src/Gargantext/Components/Modals/Modal.js
+0
-0
Modal.purs
src/Gargantext/Components/Modals/Modal.purs
+3
-2
RandomText.purs
src/Gargantext/Components/RandomText.purs
+9
-18
Tab.purs
src/Gargantext/Components/Tab.purs
+3
-2
Tree.purs
src/Gargantext/Components/Tree.purs
+1
-2
REST.purs
src/Gargantext/Config/REST.purs
+6
-9
Corpus.purs
src/Gargantext/Pages/Corpus.purs
+9
-18
Annotation.purs
src/Gargantext/Pages/Corpus/Doc/Annotation.purs
+1
-1
Body.purs
src/Gargantext/Pages/Corpus/Doc/Body.purs
+9
-10
Document.purs
src/Gargantext/Pages/Corpus/Doc/Document.purs
+13
-32
Facets.purs
src/Gargantext/Pages/Corpus/Doc/Facets.purs
+12
-15
Authors.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Authors.purs
+2
-2
Dashboard.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Dashboard.purs
+5
-6
Documents.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Documents.purs
+1
-2
Graph.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Graph.purs
+8
-9
Sources.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Sources.purs
+3
-3
Terms.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Terms.purs
+2
-4
NgramsItem.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Terms/NgramsItem.purs
+3
-3
NgramsTable.purs
...Gargantext/Pages/Corpus/Doc/Facets/Terms/NgramsTable.purs
+2
-2
Brevets.purs
src/Gargantext/Pages/Corpus/User/Brevets.purs
+1
-1
Users.purs
src/Gargantext/Pages/Corpus/User/Users.purs
+7
-0
API.purs
src/Gargantext/Pages/Corpus/User/Users/API.purs
+4
-5
Specs.purs
src/Gargantext/Pages/Corpus/User/Users/Specs.purs
+5
-5
Renders.purs
src/Gargantext/Pages/Corpus/User/Users/Specs/Renders.purs
+2
-2
Types.purs
src/Gargantext/Pages/Corpus/User/Users/Types.purs
+12
-12
Lens.purs
src/Gargantext/Pages/Corpus/User/Users/Types/Lens.purs
+7
-7
States.purs
src/Gargantext/Pages/Corpus/User/Users/Types/States.purs
+6
-8
Types.purs
src/Gargantext/Pages/Corpus/User/Users/Types/Types.purs
+0
-0
Folder.purs
src/Gargantext/Pages/Folder.purs
+2
-3
Home.purs
src/Gargantext/Pages/Home.purs
+12
-0
Actions.purs
src/Gargantext/Pages/Home/Actions.purs
+56
-0
Specs.purs
src/Gargantext/Pages/Home/Specs.purs
+12
-51
States.purs
src/Gargantext/Pages/Home/States.purs
+33
-0
Layout.purs
src/Gargantext/Pages/Layout.purs
+81
-0
Actions.purs
src/Gargantext/Pages/Layout/Actions.purs
+194
-0
Specs.purs
src/Gargantext/Pages/Layout/Specs.purs
+350
-0
States.purs
src/Gargantext/Pages/Layout/States.purs
+118
-0
Search.purs
src/Gargantext/Pages/Search.purs
+2
-3
Router.purs
src/Gargantext/Router.purs
+14
-14
Users.purs
src/Gargantext/Users.purs
+0
-7
Utils.purs
src/Gargantext/Utils.purs
+1
-1
DecodeMaybe.js
src/Gargantext/Utils/DecodeMaybe.js
+0
-0
DecodeMaybe.purs
src/Gargantext/Utils/DecodeMaybe.purs
+1
-1
DecodeMaybe.js
src/GraphExplorer/DecodeMaybe.js
+0
-5
DecodeMaybe.purs
src/GraphExplorer/DecodeMaybe.purs
+0
-17
Main.purs
src/Main.purs
+6
-2
No files found.
src/Facets.purs
deleted
100644 → 0
View file @
e72a0197
module Facets where
import Prelude hiding (div)
type State = String
src/Gargantext/C
hart
.js
→
src/Gargantext/C
omponents/Charts/Charts
.js
View file @
59fff972
File moved
src/Gargantext/C
hart
.purs
→
src/Gargantext/C
omponents/Charts/Charts
.purs
View file @
59fff972
module Gargantext.C
hart
where
module Gargantext.C
omponents.Charts.Charts
where
import Prelude
(($), (<<<), (<$>)
)
import Prelude
hiding (min
)
import CSS (Color, white)
import CSS (Color, white)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
...
...
src/Gargantext/C
hart
s/Color.purs
→
src/Gargantext/C
omponents/Charts/Option
s/Color.purs
View file @
59fff972
module Gargantext.C
hart
s.Color
module Gargantext.C
omponents.Charts.Option
s.Color
( ChartColor()
( ChartColor()
, chartColor
, chartColor
, transparent
, transparent
) where
) where
import Prelude ((<<<))
import Prelude
import CSS (Color, toHexString)
import CSS (Color, toHexString)
import Color (rgba)
import Color (rgba)
...
...
src/Gargantext/C
hart
s/Data.purs
→
src/Gargantext/C
omponents/Charts/Option
s/Data.purs
View file @
59fff972
module Gargantext.C
hart
s.Data where
module Gargantext.C
omponents.Charts.Option
s.Data where
import Gargantext.Charts.Font (TextStyle, Icon)
import Gargantext.Components.Charts.Options.Font (TextStyle, Icon)
import Prelude ((<<<))
import Unsafe.Coerce (unsafeCoerce)
type DataN =
type DataN =
{ name :: String
{ name :: String
...
...
src/Gargantext/C
hart
s/ECharts.js
→
src/Gargantext/C
omponents/Charts/Option
s/ECharts.js
View file @
59fff972
File moved
src/Gargantext/C
hart
s/ECharts.purs
→
src/Gargantext/C
omponents/Charts/Option
s/ECharts.purs
View file @
59fff972
module Gargantext.C
hart
s.ECharts where
module Gargantext.C
omponents.Charts.Option
s.ECharts where
import Prelude (($), map, class Show, show, (<<<), (==))
import Prelude
import Data.Array (length)
import CSS (black,
blue, italic, violet, white, yellow
)
import CSS (black,
italic, violet
)
import CSS.Common (normal)
import CSS.Common (normal)
import Gargantext.Charts.Series
import Data.Array (length)
import Gargantext.Charts.Data
import Gargantext.Charts.Color (chartColor, transparent)
import Gargantext.Charts.Font (IconOptions(..), Shape(..), TextStyle, chartFontStyle, chartFontWeight, icon)
import Gargantext.Charts.Legend (legendType, LegendMode(..), PlainOrScroll(..), selectedMode, Orientation(..), orient)
import Gargantext.Charts.Position (Align(..), LeftRelativePosition(..), TopRelativePosition(..), numberPosition, percentPosition, relativePosition)
import Gargantext.Charts.Type (DataZoom, Echarts, Legend, Option, Title, Tooltip, XAxis, YAxis)
import Data.Either (Either(..))
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Gargantext.Components.Charts.Options.Color (chartColor, transparent)
import Gargantext.Components.Charts.Options.Data (DataN, DataS, DataV)
import Gargantext.Components.Charts.Options.Font (IconOptions(..), Shape(..), TextStyle, chartFontStyle, chartFontWeight, icon)
import Gargantext.Components.Charts.Options.Legend (legendType, LegendMode(..), PlainOrScroll(..), selectedMode, Orientation(..), orient)
import Gargantext.Components.Charts.Options.Position (Align(..), LeftRelativePosition(..), TopRelativePosition(..), numberPosition, percentPosition, relativePosition)
import Gargantext.Components.Charts.Options.Series (Series, SeriesName, SeriesShape(..), seriesType)
import Gargantext.Components.Charts.Options.Type (DataZoom, Echarts, Legend, Option, Title, Tooltip, XAxis, YAxis)
import React as R
import React as R
import React.DOM (p)
foreign import eChartsClass :: R.ReactClass Echarts
foreign import eChartsClass :: R.ReactClass Echarts
...
@@ -293,5 +292,3 @@ textStyle =
...
@@ -293,5 +292,3 @@ textStyle =
,textShadowOffsetX: 0.0
,textShadowOffsetX: 0.0
,textShadowOffsetY: 0.0
,textShadowOffsetY: 0.0
}
}
src/Gargantext/C
hart
s/Font.purs
→
src/Gargantext/C
omponents/Charts/Option
s/Font.purs
View file @
59fff972
module Gargantext.C
hart
s.Font
module Gargantext.C
omponents.Charts.Option
s.Font
(
(
TextStyle,
TextStyle,
ChartFontStyle(),
ChartFontStyle(),
...
@@ -12,12 +12,14 @@ module Gargantext.Charts.Font
...
@@ -12,12 +12,14 @@ module Gargantext.Charts.Font
icon
icon
) where
) where
import Prelude (Unit, ($), (<<<), (<>))
import CSS (FontStyle(..), FontWeight(..), Prefixed(..), Value(..))
import CSS (FontStyle(..), FontWeight(..), Prefixed(..), Value(..))
import Gargantext.Charts.Color (ChartColor)
import Gargantext.Charts.Position (LeftRelativePosition, Position, TopRelativePosition)
import Data.Generic (class Generic, gShow)
import Data.Generic (class Generic, gShow)
import Data.String (toLower)
import Data.String (toLower)
import Prelude (Unit, ($), (<<<), (<>))
import Gargantext.Components.Charts.Options.Color (ChartColor)
import Gargantext.Components.Charts.Options.Position (LeftRelativePosition, Position, TopRelativePosition)
type TextStyle =
type TextStyle =
{ color :: ChartColor
{ color :: ChartColor
...
...
src/Gargantext/C
hart
s/Legend.purs
→
src/Gargantext/C
omponents/Charts/Option
s/Legend.purs
View file @
59fff972
module Gargantext.C
hart
s.Legend
module Gargantext.C
omponents.Charts.Option
s.Legend
(
(
LegendType(..),
LegendType(..),
PlainOrScroll(..),
PlainOrScroll(..),
...
@@ -11,9 +11,10 @@ module Gargantext.Charts.Legend
...
@@ -11,9 +11,10 @@ module Gargantext.Charts.Legend
selectedMode
selectedMode
) where
) where
import Prelude (class Show, show, (<<<))
import Data.Generic (class Generic, gShow)
import Data.Generic (class Generic, gShow)
import Data.String (toLower)
import Data.String (toLower)
import Prelude (class Show, show, (<<<))
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
newtype LegendType = LegendType String
newtype LegendType = LegendType String
...
@@ -45,4 +46,3 @@ selectedMode :: LegendMode -> SelectedMode
...
@@ -45,4 +46,3 @@ selectedMode :: LegendMode -> SelectedMode
selectedMode (Bool b) = unsafeCoerce b
selectedMode (Bool b) = unsafeCoerce b
selectedMode (Single) = unsafeCoerce "single"
selectedMode (Single) = unsafeCoerce "single"
selectedMode (Multiple) = unsafeCoerce "multiple"
selectedMode (Multiple) = unsafeCoerce "multiple"
src/Gargantext/C
hart
s/Position.purs
→
src/Gargantext/C
omponents/Charts/Option
s/Position.purs
View file @
59fff972
module Gargantext.C
hart
s.Position
module Gargantext.C
omponents.Charts.Option
s.Position
(
(
Position(),
Position(),
numberPosition,
numberPosition,
...
@@ -9,7 +9,8 @@ module Gargantext.Charts.Position
...
@@ -9,7 +9,8 @@ module Gargantext.Charts.Position
LeftRelativePosition(..)
LeftRelativePosition(..)
) where
) where
import Prelude (class Show, show, ($), (<>))
import Prelude
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
-- | The type `Position` is made to render a css position.
-- | The type `Position` is made to render a css position.
...
...
src/Gargantext/C
hart
s/Series.purs
→
src/Gargantext/C
omponents/Charts/Option
s/Series.purs
View file @
59fff972
module Gargantext.C
hart
s.Series where
module Gargantext.C
omponents.Charts.Option
s.Series where
import Gargantext.Charts.Data (DataS)
import Prelude
import Prelude (class Show, show, (<<<))
import Gargantext.Components.Charts.Options.Data (DataS)
newtype SeriesType = SeriesType String
newtype SeriesType = SeriesType String
...
...
src/Gargantext/C
hart
s/Type.purs
→
src/Gargantext/C
omponents/Charts/Option
s/Type.purs
View file @
59fff972
module Gargantext.C
hart
s.Type where
module Gargantext.C
omponents.Charts.Option
s.Type where
import
Gargantext.Charts.Font
import
Prelude
import CSS (Color)
import CSS (Color)
import Gargantext.Charts.Series
import Gargantext.Charts.Data
import Gargantext.Charts.Color (ChartColor(..))
import Gargantext.Charts.Font (Icon, icon, TextStyle)
import Gargantext.Charts.Legend (LegendType, SelectedMode, selectedMode, Orient)
import Gargantext.Charts.Position (LeftRelativePosition, Position, TopRelativePosition)
import Data.Either (Either)
import Data.Maybe (Maybe)
import Data.Maybe (Maybe)
import Prelude (Unit, (<<<))
import Gargantext.Components.Charts.Options.Color (ChartColor)
import Gargantext.Components.Charts.Options.Data (DataN, DataV)
import Gargantext.Components.Charts.Options.Font (TextStyle)
import Gargantext.Components.Charts.Options.Legend (LegendType, Orient, SelectedMode)
import Gargantext.Components.Charts.Options.Position (LeftRelativePosition, Position, TopRelativePosition)
import Gargantext.Components.Charts.Options.Series (Series)
newtype ChartAlign = ChartAlign String
newtype ChartAlign = ChartAlign String
...
...
src/GraphExplorer/Sigmajs.js
→
src/G
argantext/Components/G
raphExplorer/Sigmajs.js
View file @
59fff972
File moved
src/GraphExplorer/Sigmajs.purs
→
src/G
argantext/Components/G
raphExplorer/Sigmajs.purs
View file @
59fff972
module GraphExplorer.Sigmajs where
module Gargantext.Components.GraphExplorer.Sigmajs where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff (Eff)
import Prelude (Unit)
import React (ReactClass, ReactElement, createElement)
import React (ReactClass, ReactElement, createElement)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
...
...
src/GraphExplorer/Types.purs
→
src/G
argantext/Components/G
raphExplorer/Types.purs
View file @
59fff972
module GraphExplorer.Types where
module G
argantext.Components.G
raphExplorer.Types where
import Prelude
import Prelude
...
...
src/Gargantext/Data/Landing.purs
→
src/Gargantext/
Components/Lang/
Data/Landing.purs
View file @
59fff972
module Gargantext.Data.Landing
module Gargantext.Components.Data.Landing where
where
data LandingData = LandingData { name :: String
data LandingData = LandingData { name :: String
...
@@ -24,4 +23,3 @@ data Button = Button { title :: String
...
@@ -24,4 +23,3 @@ data Button = Button { title :: String
, text :: String
, text :: String
, href :: String
, href :: String
}
}
src/Gargantext/Data/Lang.purs
→
src/Gargantext/
Components/Lang/
Data/Lang.purs
View file @
59fff972
module Gargantext.Data.Lang
module Gargantext.Components.Data.Lang where
where
data Lang = EN | FR
data Lang = EN | FR
src/Gargantext/Lang/Landing/EnUS.purs
→
src/Gargantext/
Components/
Lang/Landing/EnUS.purs
View file @
59fff972
module Gargantext.Lang.Landing.EnUS
module Gargantext.Components.Lang.Landing.EnUS where
where
import Gargantext.Data.Landing
import Gargantext.
Components.
Data.Landing
landingData :: LandingData
landingData :: LandingData
landingData = LandingData { name : "Gargantext"
landingData = LandingData { name : "Gargantext"
...
@@ -44,5 +43,3 @@ blockTexts = [ BlockText { title : "Random sentences in Gargantua's Books chapte
...
@@ -44,5 +43,3 @@ blockTexts = [ BlockText { title : "Random sentences in Gargantua's Books chapte
}
}
}
}
]
]
src/Gargantext/Lang/Landing/FrFR.purs
→
src/Gargantext/
Components/
Lang/Landing/FrFR.purs
View file @
59fff972
module Gargantext.Lang.Landing.FrFR
module Gargantext.Components.Lang.Landing.FrFR where
where
import Gargantext.Data.Landing
import Gargantext.
Components.
Data.Landing
landingData :: LandingData
landingData :: LandingData
landingData = LandingData { name : "Gargantext"
landingData = LandingData { name : "Gargantext"
...
@@ -44,5 +43,3 @@ blockTexts = [ BlockText { title : "Phrases aléatoires issues de l'oeuvre de Fr
...
@@ -44,5 +43,3 @@ blockTexts = [ BlockText { title : "Phrases aléatoires issues de l'oeuvre de Fr
}
}
}
}
]
]
src/Login.purs
→
src/
Gargantext/Components/
Login.purs
View file @
59fff972
module Login where
module
Gargantext.Components.
Login where
import Prelude hiding (div)
import Prelude hiding (div)
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Aff.Console (log)
import Control.Monad.Aff.Console (log)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
...
@@ -19,19 +18,17 @@ import Data.HTTP.Method (Method(..))
...
@@ -19,19 +18,17 @@ import Data.HTTP.Method (Method(..))
import Data.Lens (over)
import Data.Lens (over)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.MediaType.Common (applicationJSON)
import Data.MediaType.Common (applicationJSON)
import Modal (modalHide)
import
Gargantext.Components.Modals.
Modal (modalHide)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.RequestHeader (RequestHeader(..))
import Network.HTTP.RequestHeader (RequestHeader(..))
import React.DOM (a, button, div, h2, h4, h5, i, input, label, p, span, text)
import React.DOM (a, button, div, h2, h4, h5, i, input, label, p, span, text)
import React.DOM.Props (_data, _id, _type, aria, className, href, maxLength, name, onClick, onInput, placeholder, role, target, value)
import React.DOM.Props (_data, _id, _type, aria, className, href, maxLength, name, onClick, onInput, placeholder, role, target, value)
import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, _render, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, _render, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
-- TODO: ask for login (modal) or account creation after 15 mn when user is not logged and has made one search at least
-- TODO: ask for login (modal) or account creation after 15 mn when user is not logged and has made one search at least
newtype State = State
newtype State = State
{ username :: String
{ username :: String
, password :: String
, password :: String
...
...
src/Modal.js
→
src/
Gargantext/Components/Modals/
Modal.js
View file @
59fff972
File moved
src/Modal.purs
→
src/
Gargantext/Components/Modals/
Modal.purs
View file @
59fff972
module Modal where
module
Gargantext.Components.Modals.
Modal where
import Control.Monad.Eff (Eff)
import Prelude (Unit)
import Prelude (Unit)
import Control.Monad.Eff (Eff)
foreign import modalShow :: forall eff. String -> Eff eff Unit
foreign import modalShow :: forall eff. String -> Eff eff Unit
foreign import modalHide :: forall eff. String -> Eff eff Unit
foreign import modalHide :: forall eff. String -> Eff eff Unit
src/Gargantext/RandomText.purs
→
src/Gargantext/
Components/
RandomText.purs
View file @
59fff972
...
@@ -17,27 +17,18 @@ randomChars : randomizes chars in a word.
...
@@ -17,27 +17,18 @@ randomChars : randomizes chars in a word.
TODO: add some tests as examples.
TODO: add some tests as examples.
-}
-}
module Gargantext.RandomText where
module Gargantext.
Components.
RandomText where
import Prelude
import Prelude
import Control.Monad.Eff (Eff
(..)
)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Random (RANDOM
(..)
, randomInt)
import Control.Monad.Eff.Random (RANDOM, randomInt)
import Data.Array (drop, dropEnd, filter, foldl, head, length, tail, take, takeEnd, (!!))
import Data.Maybe (Maybe(Nothing, Just), fromJust)
import Data.Maybe (Maybe(Nothing, Just), fromJust)
import Data.Array ( length, (!!), filter, foldl
import Data.String (Pattern(..), fromCharArray, split, toCharArray)
, head, tail
, take, takeEnd
, drop, dropEnd
)
import Data.String ( toCharArray, fromCharArray
, split, Pattern(..)
)
import Data.Tuple.Nested ((/\))
import Partial (crash)
import Partial (crash)
import Partial.Unsafe (unsafePartial)
import Partial.Unsafe (unsafePartial)
import Unsafe.Coerce (unsafeCoerce)
-------------------------------------------------------------------
-------------------------------------------------------------------
randomSentences :: forall a. String -> Eff ( random :: RANDOM | a ) String
randomSentences :: forall a. String -> Eff ( random :: RANDOM | a ) String
...
...
src/Tab.purs
→
src/
Gargantext/Components/
Tab.purs
View file @
59fff972
module Tab where
module Gargantext.Components.Tab where
import Prelude hiding (div)
import Data.Array (fold)
import Data.Array (fold)
import Data.Lens (Lens', Prism', over, view)
import Data.Lens (Lens', Prism', over, view)
import Data.List (List, mapWithIndex, toUnfoldable)
import Data.List (List, mapWithIndex, toUnfoldable)
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Prelude hiding (div)
import React (ReactElement)
import React (ReactElement)
import React.DOM (a, div, nav, text)
import React.DOM (a, div, nav, text)
import React.DOM.Props (className, onClick)
import React.DOM.Props (className, onClick)
...
...
src/
N
Tree.purs
→
src/
Gargantext/Components/
Tree.purs
View file @
59fff972
module
N
Tree where
module
Gargantext.Components.
Tree where
import Prelude hiding (div)
import Prelude hiding (div)
...
@@ -9,7 +9,6 @@ import Control.Monad.Eff.Console (CONSOLE, log)
...
@@ -9,7 +9,6 @@ import Control.Monad.Eff.Console (CONSOLE, log)
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.HTTP.Method (Method(..))
import Data.HTTP.Method (Method(..))
import Data.Newtype (class Newtype)
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import React (ReactElement)
import React (ReactElement)
...
...
src/Gargantext/REST.purs
→
src/Gargantext/
Config/
REST.purs
View file @
59fff972
module Gargantext.REST where
module Gargantext.
Config.
REST where
import Data.Argonaut
import Prelude
import Data.HTTP.Method (Method(..))
import Network.HTTP.RequestHeader (RequestHeader(..))
import Prelude (bind, ($), pure, show)
import Data.MediaType.Common (applicationJSON)
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import Data.Argonaut (class DecodeJson, decodeJson)
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.HTTP.Method (Method(..))
import Data.MediaType.Common (applicationJSON)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.RequestHeader (RequestHeader(..))
get :: forall eff t2 t31. DecodeJson t31 => String ->
get :: forall eff t2 t31. DecodeJson t31 => String ->
Aff (console :: CONSOLE, ajax :: AJAX| eff)
Aff (console :: CONSOLE, ajax :: AJAX| eff)
...
...
src/
AddCorpusview
.purs
→
src/
Gargantext/Pages/Corpus
.purs
View file @
59fff972
module AddCorpusview where
module Gargantext.Pages.Corpus where
import Prelude hiding (div)
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Aff.Console (log)
import Control.Monad.Aff.Console (log)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import DOM.HTML (window)
import DOM.HTML.Location (host)
import DOM.HTML.Window (localStorage)
import DOM.WebStorage.Storage (getItem, setItem)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, jsonEmptyObject, (.?), (:=), (~>))
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, jsonEmptyObject, (.?), (:=), (~>))
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.HTTP.Method (Method(..))
import Data.HTTP.Method (Method(..))
import Data.Lens (Lens', Prism', lens, over)
import Data.Lens (over)
import Data.List (List, fold, fromFoldable, toUnfoldable)
import Data.Maybe (Maybe(Just))
import Data.Maybe (Maybe(..), fromMaybe)
import Data.MediaType.Common (applicationJSON)
import Data.MediaType.Common (applicationJSON)
import Data.Tuple (Tuple(..))
import Gargantext.Components.Modals.Modal (modalHide)
import Landing as L
import Modal (modalHide)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.RequestHeader (RequestHeader(..))
import Network.HTTP.RequestHeader (RequestHeader(..))
import Prelude hiding (div)
import React (ReactElement)
import React (ReactElement)
import React.DOM (
a, button, div, form, h2, h3, h4, h5, i, input, label, li, p
, span, text, ul)
import React.DOM (
button, div, h3, h5, li
, span, text, ul)
import React.DOM.Props (_data, _id, _type, aria, className,
href, maxLength, name, onClick, onInput, placeholder, role, target, valu
e)
import React.DOM.Props (_data, _id, _type, aria, className,
onClick, rol
e)
import Routing.Hash.Aff (setHash)
import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, _render, cotransform, focus, foreach, modifyState, simpleSpec, withState)
import Thermite (PerformAction, Render, Spec, _render, cotransform, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
type State =
type State =
{ select_database :: Boolean
{ select_database :: Boolean
...
...
src/
Doc
Annotation.purs
→
src/
Gargantext/Pages/Corpus/Doc/
Annotation.purs
View file @
59fff972
module
Doc
Annotation where
module
Gargantext.Pages.Corpus.Doc.
Annotation where
import Prelude hiding (div)
import Prelude hiding (div)
import React (ReactElement)
import React (ReactElement)
...
...
src/
CorpusAnalysis
.purs
→
src/
Gargantext/Pages/Corpus/Doc/Body
.purs
View file @
59fff972
module CorpusAnalysis where
module Gargantext.Pages.Corpus.Doc.Body where
import Prelude hiding (div)
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import Data.Array (fold)
import Data.Array (fold)
import Gargantext.Components.Charts.Options.ECharts (chart)
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard (globalPublis)
import Gargantext.Pages.Corpus.Doc.Facets as Tab
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import Prelude (id, void)
import React.DOM (div, h3, hr, i, p, text)
import Prelude hiding (div)
import React.DOM (div, h3, hr, i, p, span, text, input)
import React.DOM.Props (className, style)
import React.DOM.Props (className, style)
import Tabview as Tab
import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
import Thermite (PerformAction, Render, Spec, defaultPerformAction, modifyState, simpleSpec)
import Gargantext.Charts.ECharts (chart)
import Gargantext.Dashboard (globalPublis)
type State = Tab.State
type State = Tab.State
...
...
src/
DocView
.purs
→
src/
Gargantext/Pages/Corpus/Doc/Document
.purs
View file @
59fff972
module
DocView
where
module
Gargantext.Pages.Corpus.Doc.Document
where
import Data.Argonaut
import Prelude
import Data.Generic (class Generic, gShow)
import Gargantext.Charts.ECharts
import Gargantext.Chart (p'')
import Gargantext.Dashboard (globalPublis)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Aff (Aff)
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff
(
Eff)
import Control.Monad.Eff
.Class (lift
Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Control.Monad.Eff.Console (CONSOLE, log)
import DOM (DOM)
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import DOM.HTML (window) as DOM
import Data.Array (filter)
import DOM.HTML.Types (htmlDocumentToParentNode) as DOM
import DOM.HTML.Window (document) as DOM
import DOM.Node.ParentNode (QuerySelector(..))
import DOM.Node.ParentNode (querySelector) as DOM
import Data.Array (filter, replicate)
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.HTTP.Method (Method(..))
import Data.Generic (class Generic, gShow)
import Data.Maybe (fromJust)
import Data.MediaType.Common (applicationJSON)
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Gargantext.Components.Charts.Charts (p'')
import Network.HTTP.RequestHeader (RequestHeader(..))
import Gargantext.Config.REST (get)
import Partial.Unsafe (unsafePartial)
import Network.HTTP.Affjax (AJAX)
import Prelude (class Eq, class Ord, class Show, Unit, bind, map, not, pure, show, void, ($), (*), (+), (-), (/), (<), (<$>), (<>), (==), (>), (>=), (>>=))
import React (ReactElement)
import React (ReactElement)
import React as R
import React.DOM (a, b, b', br', div, input, option, select, span, table, tbody, td, text, th, thead, tr)
import React.DOM (a, b, b', br', div, h3, i, input, li, option, select, span, table, tbody, td, text, thead, th, tr, ul, nav)
import React.DOM.Props (_type, className, href, onChange, onClick, scope, selected, value)
import React.DOM.Props (Props, _type, className, href, onChange, onClick, selected, value, scope, _id, role, _data, aria)
import Thermite (PerformAction, Render, Spec, cotransform, defaultPerformAction, modifyState, simpleSpec)
import ReactDOM as RDOM
import Thermite (PerformAction, Render, Spec, cotransform, createReactSpec, defaultPerformAction, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
import Gargantext.REST (get)
--main :: forall e. Eff (dom:: DOM, console :: CONSOLE, ajax :: AJAX | e) Unit
--main :: forall e. Eff (dom:: DOM, console :: CONSOLE, ajax :: AJAX | e) Unit
--main = do
--main = do
...
...
src/
Tabview
.purs
→
src/
Gargantext/Pages/Corpus/Doc/Facets
.purs
View file @
59fff972
module
Tabview
where
module
Gargantext.Pages.Corpus.Doc.Facets
where
import Authorview as AV
import Prelude hiding (div)
import Gargantext.Pages.Corpus.Doc.Facets.Authors as AV
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import Data.Array (fold)
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.Lens (Lens', Prism', lens,
over, prism, view
)
import Data.Lens (Lens', Prism', lens,
prism
)
import Data.List (
List,
fromFoldable)
import Data.List (fromFoldable)
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import DocView as DV
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Components.Tab as Tab
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import Prelude hiding (div)
import Gargantext.Pages.Corpus.Doc.Facets.Sources as SV
import React.DOM (a, div, li, text, ul)
import Gargantext.Pages.Corpus.Doc.Facets.Terms as TV
import React.DOM.Props (_data, _id, aria, className, href, role)
import Thermite (Spec, focus)
import Sourceview as SV
import Tab (tabs)
import Tab as Tab
import Termsview as TV
import Thermite (Render, Spec, _performAction, _render, defaultPerformAction, defaultRender, focus, focusState, simpleSpec, withState)
data Action
data Action
= DocviewA DV.Action
= DocviewA DV.Action
...
@@ -117,7 +114,7 @@ _tabAction = prism TabViewA \ action ->
...
@@ -117,7 +114,7 @@ _tabAction = prism TabViewA \ action ->
tab1 :: forall eff props. Spec ( dom :: DOM, console :: CONSOLE, ajax :: AJAX| eff) State props Action
tab1 :: forall eff props. Spec ( dom :: DOM, console :: CONSOLE, ajax :: AJAX| eff) State props Action
tab1 = tabs _tablens _tabAction $ fromFoldable [ Tuple "Doc View" docPageSpec
tab1 =
Tab.
tabs _tablens _tabAction $ fromFoldable [ Tuple "Doc View" docPageSpec
, Tuple "Author View" authorPageSpec
, Tuple "Author View" authorPageSpec
, Tuple "Source View" sourcePageSpec
, Tuple "Source View" sourcePageSpec
, Tuple "Terms View" termsPageSpec
, Tuple "Terms View" termsPageSpec
...
...
src/
Authorview
.purs
→
src/
Gargantext/Pages/Corpus/Doc/Facets/Authors
.purs
View file @
59fff972
module
Authorview
where
module
Gargantext.Pages.Corpus.Doc.Facets.Authors
where
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import Data.Array (fold)
import Data.Array (fold)
import
DocView
as D
import
Gargantext.Pages.Corpus.Doc.Document
as D
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import Prelude hiding (div)
import Prelude hiding (div)
import React.DOM (h3, text)
import React.DOM (h3, text)
...
...
src/Gargantext/Dashboard.purs
→
src/Gargantext/
Pages/Corpus/Doc/Facets/
Dashboard.purs
View file @
59fff972
module Gargantext.Dashboard where
module Gargantext.Pages.Corpus.Doc.Facets.Dashboard where
import Prelude
import Prelude (($), (<>), show, pure, unit, map)
import Data.Array (zip)
import Data.Array (zip)
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Gargantext.Charts.ECharts
import Gargantext.Components.Charts.Options.ECharts
import Gargantext.Charts.Series
import Gargantext.Components.Charts.Options.Series
import DOM (DOM)
import DOM (DOM)
import Data.Unit (Unit)
import Data.Unit (Unit)
import Data.Int (toNumber)
import Data.Int (toNumber)
import React.DOM (div, h1, text, title)
import React.DOM (div, h1, text, title)
import React.DOM.Props (className)
import React.DOM.Props (className)
import Thermite (PerformAction, Render, Spec, simpleSpec)
import Thermite (PerformAction, Render, Spec, simpleSpec)
...
...
src/
Publication
s.purs
→
src/
Gargantext/Pages/Corpus/Doc/Facets/Document
s.purs
View file @
59fff972
module Publications where
module Gargantext.Pages.Corpus.Doc.Facets.Documents where
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
...
...
src/Graph.purs
→
src/G
argantext/Pages/Corpus/Doc/Facets/G
raph.purs
View file @
59fff972
module Graph where
module G
argantext.Pages.Corpus.Doc.Facets.G
raph where
import Prelude hiding (div)
import Prelude hiding (div)
...
@@ -10,26 +10,25 @@ import Control.Monad.Eff.Console (CONSOLE, log)
...
@@ -10,26 +10,25 @@ import Control.Monad.Eff.Console (CONSOLE, log)
import Control.Monad.Eff.Unsafe (unsafePerformEff)
import Control.Monad.Eff.Unsafe (unsafePerformEff)
import DOM (DOM)
import DOM (DOM)
import Data.Argonaut (decodeJson)
import Data.Argonaut (decodeJson)
import Data.Array (length, mapWithIndex,
take,
(!!))
import Data.Array (length, mapWithIndex, (!!))
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.HTTP.Method (Method(..))
import Data.HTTP.Method (Method(..))
import Data.Int (toNumber)
import Data.Int (toNumber)
import Data.Maybe (Maybe(..), fromJust)
import Data.Maybe (Maybe(..), fromJust)
import Data.MediaType.Common (applicationJSON)
import Data.MediaType.Common (applicationJSON)
import Data.Newtype (class Newtype)
import Data.Newtype (class Newtype)
import GraphExplorer.Sigmajs (Color(Color), SigmaEasing, SigmaGraphData(SigmaGraphData), SigmaNode, SigmaSettings, canvas, edgeShape, edgeShapes, forceAtlas2, sStyle, sigma, sigmaEasing, sigmaEdge, sigmaEnableWebGL, sigmaNode, sigmaSettings)
import Gargantext.Components.GraphExplorer.Sigmajs (Color(Color), SigmaEasing, SigmaGraphData(SigmaGraphData), SigmaNode, SigmaSettings, canvas, edgeShape, edgeShapes, forceAtlas2, sStyle, sigma, sigmaEasing, sigmaEdge, sigmaEnableWebGL, sigmaNode, sigmaSettings)
import GraphExplorer.Types (Cluster(..), Edge(..), GraphData(..), Legend(..), Node(..), getLegendData)
import Gargantext.Components.GraphExplorer.Types (Cluster(..), Edge(..), GraphData(..), Legend(..), Node(..), getLegendData)
import Gargantext.Utils (getter)
import Math (cos, sin)
import Math (cos, sin)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.RequestHeader (RequestHeader(..))
import Network.HTTP.RequestHeader (RequestHeader(..))
import Partial.Unsafe (unsafePartial)
import Partial.Unsafe (unsafePartial)
import Prelude (map)
import React (ReactElement)
import React (ReactElement, createElement)
import React.DOM (a, br', button, div, form', input, li, li', menu, option, p, select, span, text, ul, ul')
import React.DOM (a, br', button, div, form', input, li, li', menu, option, p, select, span, text, ul, ul')
import React.DOM.Props (_
data, _id, _type, aria, checked, className, href, name, onChange, placeholder, role
, style, title, value)
import React.DOM.Props (_
id, _type, checked, className, href, name, onChange, placeholder
, style, title, value)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
import Utils (getter)
data Action = NoOp
data Action = NoOp
| LoadGraph String
| LoadGraph String
...
...
src/
Sourceview
.purs
→
src/
Gargantext/Pages/Corpus/Doc/Facets/Sources
.purs
View file @
59fff972
module
Sourceview
where
module
Gargantext.Pages.Corpus.Doc.Facets.Sources
where
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import Data.Array (fold)
import Data.Array (fold)
import
DocView
as D
import
Gargantext.Pages.Corpus.Doc.Document
as D
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import Prelude hiding (div)
import Prelude hiding (div)
import React.DOM (h3, text)
import React.DOM (h3, text)
import Thermite (
PerformAction, Render, Spec, defaultPerformAction, modifyState
, simpleSpec)
import Thermite (
Render, Spec, defaultPerformAction
, simpleSpec)
type State = D.State
type State = D.State
...
...
src/
Termsview
.purs
→
src/
Gargantext/Pages/Corpus/Doc/Facets/Terms
.purs
View file @
59fff972
module Termsview where
module Gargantext.Pages.Corpus.Doc.Facets.Terms where
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import Data.Array (fold)
import Data.Array (fold)
import
DocView
as D
import
Gargantext.Pages.Corpus.Doc.Document
as D
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import Prelude hiding (div)
import Prelude hiding (div)
import React.DOM (h3, text)
import React.DOM (h3, text)
...
...
src/NgramsItem.purs
→
src/
Gargantext/Pages/Corpus/Doc/Facets/Terms/
NgramsItem.purs
View file @
59fff972
module NgramsItem where
module
Gargantext.Pages.Corpus.Doc.Facets.Terms.
NgramsItem where
import Prelude
import Prelude
...
@@ -8,9 +8,9 @@ import Data.Newtype (class Newtype)
...
@@ -8,9 +8,9 @@ import Data.Newtype (class Newtype)
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import React (ReactElement)
import React (ReactElement)
import React.DOM (input, span, td, text, tr)
import React.DOM (input, span, td, text, tr)
import React.DOM.Props (_type, checked, className,
color,
onChange, style, title)
import React.DOM.Props (_type, checked, className, onChange, style, title)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Utils (getter, setter)
import
Gargantext.
Utils (getter, setter)
newtype State = State
newtype State = State
{ term :: Term
{ term :: Term
...
...
src/NgramsTable.purs
→
src/
Gargantext/Pages/Corpus/Doc/Facets/Terms/
NgramsTable.purs
View file @
59fff972
module NgramsTable where
module
Gargantext.Pages.Corpus.Doc.Facets.Terms.
NgramsTable where
import CSS.TextAlign (center, textAlign)
import CSS.TextAlign (center, textAlign)
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
...
@@ -9,7 +9,7 @@ import Data.Lens (Lens', Prism', lens, over, prism)
...
@@ -9,7 +9,7 @@ import Data.Lens (Lens', Prism', lens, over, prism)
import Data.List (List)
import Data.List (List)
import Data.Tuple (Tuple(..), uncurry)
import Data.Tuple (Tuple(..), uncurry)
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import NgramsItem as NI
import
Gargantext.Pages.Corpus.Doc.Facets.Terms.
NgramsItem as NI
import Prelude (class Eq, class Ord, class Show, Unit, bind, map, not, pure, show, void, ($), (*), (+), (-), (/), (<), (<$>), (<>), (==), (>), (>=), (>>=))
import Prelude (class Eq, class Ord, class Show, Unit, bind, map, not, pure, show, void, ($), (*), (+), (-), (/), (<), (<$>), (<>), (==), (>), (>=), (>>=))
import React (ReactElement)
import React (ReactElement)
import React.DOM hiding (style)
import React.DOM hiding (style)
...
...
src/Brevets.purs
→
src/
Gargantext/Pages/Corpus/User/
Brevets.purs
View file @
59fff972
module Brevets where
module
Gargantext.Pages.Corpus.User.
Brevets where
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
...
...
src/Gargantext/Pages/Corpus/User/Users.purs
0 → 100644
View file @
59fff972
module Gargantext.Pages.Corpus.User.Users
(module Gargantext.Pages.Corpus.User.Users.Types,
module Gargantext.Pages.Corpus.User.Users.Specs)
where
import Gargantext.Pages.Corpus.User.Users.Types
import Gargantext.Pages.Corpus.User.Users.Specs
src/Gargantext/Users/API.purs
→
src/Gargantext/
Pages/Corpus/User/
Users/API.purs
View file @
59fff972
module Gargantext.Users.API
module Gargantext.Pages.Corpus.User.Users.API where
where
import
Gargantext.Users.Types
import
Prelude
import Gargantext.Pages.Corpus.User.Users.Types (Action(..), State, User, _user)
import Control.Monad.Aff (Aff)
import Control.Monad.Aff (Aff)
import Control.Monad.Aff.Console (CONSOLE, log)
import Control.Monad.Aff.Console (CONSOLE, log)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Class (lift)
...
@@ -10,9 +10,8 @@ import DOM (DOM)
...
@@ -10,9 +10,8 @@ import DOM (DOM)
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.Lens (set)
import Data.Lens (set)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Gargantext.REST (get)
import Gargantext.
Config.
REST (get)
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import Prelude (bind, id, show, void, ($), (<<<), (<>))
import Thermite (PerformAction, modifyState)
import Thermite (PerformAction, modifyState)
getUser :: forall eff. Int -> Aff
getUser :: forall eff. Int -> Aff
...
...
src/Gargantext/Users/Specs.purs
→
src/Gargantext/
Pages/Corpus/User/
Users/Specs.purs
View file @
59fff972
module Gargantext.Users.Specs
module Gargantext.
Pages.Corpus.User.
Users.Specs
(module Gargantext.Users.Specs.Renders,
(module Gargantext.
Pages.Corpus.User.
Users.Specs.Renders,
layoutUser)
layoutUser)
where
where
import Gargantext.Users.Specs.Renders
import Gargantext.
Pages.Corpus.User.
Users.Specs.Renders
import Control.Monad.Aff.Console (CONSOLE)
import Control.Monad.Aff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import Thermite (Spec, simpleSpec)
import Thermite (Spec, simpleSpec)
import Gargantext.Users.Types (Action, State)
import Gargantext.
Pages.Corpus.User.
Users.Types (Action, State)
import Gargantext.Users.API (performAction)
import Gargantext.
Pages.Corpus.User.
Users.API (performAction)
layoutUser :: forall props eff . Spec ( console :: CONSOLE
layoutUser :: forall props eff . Spec ( console :: CONSOLE
, ajax :: AJAX
, ajax :: AJAX
...
...
src/Gargantext/Users/Specs/Renders.purs
→
src/Gargantext/
Pages/Corpus/User/
Users/Specs/Renders.purs
View file @
59fff972
module Gargantext.Users.Specs.Renders
module Gargantext.
Pages.Corpus.User.
Users.Specs.Renders
where
where
import Gargantext.Users.Types
import Gargantext.
Pages.Corpus.User.
Users.Types
import Data.List (List, toUnfoldable, zip)
import Data.List (List, toUnfoldable, zip)
import Data.Map (Map, empty, keys, values)
import Data.Map (Map, empty, keys, values)
...
...
src/Gargantext/Users/Types.purs
→
src/Gargantext/
Pages/Corpus/User/
Users/Types.purs
View file @
59fff972
module Gargantext.Users.Types
module Gargantext.
Pages.Corpus.User.
Users.Types
(module Gargantext.Users.Types.Types,
(module Gargantext.
Pages.Corpus.User.
Users.Types.Types,
module Gargantext.Users.Types.Lens,
module Gargantext.
Pages.Corpus.User.
Users.Types.Lens,
module Gargantext.Users.Types.States,
module Gargantext.
Pages.Corpus.User.
Users.Types.States,
brevetSpec,
brevetSpec,
projectSpec,
projectSpec,
facets
facets
)
)
where
where
import Gargantext.Users.Types.Lens
import Prelude (($))
import Gargantext.Users.Types.Types
import Gargantext.Users.Types.States
import Brevets as B
import Gargantext.Pages.Corpus.User.Users.Types.Lens
import Gargantext.Pages.Corpus.User.Users.Types.Types
import Gargantext.Pages.Corpus.User.Users.Types.States
import Gargantext.Pages.Corpus.User.Brevets as B
import Control.Monad.Aff.Console (CONSOLE)
import Control.Monad.Aff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import Data.List (fromFoldable)
import Data.List (fromFoldable)
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import Prelude (($))
import Gargantext.Pages.Folder as PS
import Projects as PS
import Gargantext.Components.Tab (tabs)
import Tab (tabs)
import Thermite (Spec, focus)
import Thermite (Spec, focus)
brevetSpec :: forall eff props. Spec (dom :: DOM, console::CONSOLE, ajax :: AJAX | eff) State props Action
brevetSpec :: forall eff props. Spec (dom :: DOM, console::CONSOLE, ajax :: AJAX | eff) State props Action
...
@@ -32,7 +32,7 @@ projectSpec = focus _projectslens _projectsAction PS.projets
...
@@ -32,7 +32,7 @@ projectSpec = focus _projectslens _projectsAction PS.projets
facets :: forall eff props. Spec ( dom :: DOM, console :: CONSOLE, ajax :: AJAX| eff) State props Action
facets :: forall eff props. Spec ( dom :: DOM, console :: CONSOLE, ajax :: AJAX| eff) State props Action
facets = tabs _tablens _tabAction $ fromFoldable
facets = tabs _tablens _tabAction $ fromFoldable
[ Tuple "Publications(12)" publicationSpec
[ Tuple "Publications
(12)" publicationSpec
, Tuple "Brevets (2)" brevetSpec
, Tuple "Brevets (2)" brevetSpec
, Tuple "Projets IMT (5)" projectSpec
, Tuple "Projets IMT (5)" projectSpec
]
]
src/Gargantext/Users/Types/Lens.purs
→
src/Gargantext/
Pages/Corpus/User/
Users/Types/Lens.purs
View file @
59fff972
module Gargantext.Users.Types.Lens where
module Gargantext.
Pages.Corpus.User.
Users.Types.Lens where
import Brevets as B
import
Gargantext.Pages.Corpus.User.
Brevets as B
import Control.Monad.Aff.Console (CONSOLE)
import Control.Monad.Aff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.Lens (Lens', Prism', lens, prism)
import Data.Lens (Lens', Prism', lens, prism)
import Data.Maybe (Maybe)
import Data.Maybe (Maybe)
import Gargantext.Users.Types.States (Action(..), State)
import Gargantext.
Pages.Corpus.User.
Users.Types.States (Action(..), State)
import Gargantext.Users.Types.Types (User)
import Gargantext.
Pages.Corpus.User.
Users.Types.Types (User)
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import
Projects
as PS
import
Gargantext.Pages.Folder
as PS
import
Publication
s as P
import
Gargantext.Pages.Corpus.Doc.Facets.Document
s as P
import Tab as Tab
import
Gargantext.Components.
Tab as Tab
import Thermite (Spec, focus)
import Thermite (Spec, focus)
_user :: Lens' State (Maybe User)
_user :: Lens' State (Maybe User)
...
...
src/Gargantext/Users/Types/States.purs
→
src/Gargantext/
Pages/Corpus/User/
Users/Types/States.purs
View file @
59fff972
module Gargantext.Users.Types.States
module Gargantext.Pages.Corpus.User.Users.Types.States where
where
import Brevets as B
import
Gargantext.Pages.Corpus.User.
Brevets as B
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Gargantext.Users.Types.Types (User)
import Gargantext.
Pages.Corpus.User.
Users.Types.Types (User)
import
Projects
as PS
import
Gargantext.Pages.Folder
as PS
import
Publication
s as P
import
Gargantext.Pages.Corpus.Doc.Facets.Document
s as P
import Tab as Tab
import
Gargantext.Components.
Tab as Tab
data Action
data Action
= NoOp
= NoOp
...
@@ -32,4 +31,3 @@ initialState =
...
@@ -32,4 +31,3 @@ initialState =
, projects : PS.initialState
, projects : PS.initialState
, user: Nothing
, user: Nothing
}
}
src/Gargantext/Users/Types/Types.purs
→
src/Gargantext/
Pages/Corpus/User/
Users/Types/Types.purs
View file @
59fff972
File moved
src/
Projects
.purs
→
src/
Gargantext/Pages/Folder
.purs
View file @
59fff972
module Projects where
module Gargantext.Pages.Folder where
import Prelude (id, void)
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import Prelude (id, void)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
...
...
src/Gargantext/Pages/Home.purs
0 → 100644
View file @
59fff972
module Gargantext.Pages.Home
( module Gargantext.Pages.Home.States
, module Gargantext.Pages.Home.Actions
, module Gargantext.Pages.Home.Specs
) where
import Gargantext.Pages.Home.States
import Gargantext.Pages.Home.Actions
import Gargantext.Pages.Home.Specs
-- Dispatch here
src/Gargantext/Pages/Home/Actions.purs
0 → 100644
View file @
59fff972
module Gargantext.Pages.Home.Actions where
import Prelude hiding (div)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..))
import Gargantext.Components.Data.Lang (Lang(..))
import Gargantext.Pages.Home.States (State(..))
import Network.HTTP.Affjax (AJAX)
import React (ReactElement)
import React.DOM (a, div, h3, i, img, p, span, text)
import React.DOM.Props (Props, _id, aria, className, href, src, target, title)
import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
data Action
= NoOp
| Documentation
| Enter
| Login
| SignUp
performAction :: forall eff props. PerformAction ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff
) State props Action
performAction NoOp _ _ = void do
modifyState \state -> state
performAction Documentation _ _ = void do
modifyState \state -> state
performAction Enter _ _ = void do
lift $ setHash "/search"
modifyState \state -> state
performAction Login _ _ = void do
lift $ setHash "/login"
modifyState \state -> state
performAction SignUp _ _ = void do
modifyState \state -> state
src/
Landing
.purs
→
src/
Gargantext/Pages/Home/Specs
.purs
View file @
59fff972
module
Landing
where
module
Gargantext.Pages.Home.Specs
where
import Gargantext.Data.Landing
import Gargantext.Data.Lang
import Prelude hiding (div)
import Prelude hiding (div)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import DOM (DOM)
import Gargantext.Lang.Landing.EnUS as En
import Gargantext.Lang.Landing.FrFR as Fr
import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..))
import Gargantext.Components.Data.Lang (Lang(..))
import Gargantext.Pages.Home.States (State(..))
import Gargantext.Pages.Home.Actions (Action(..), performAction)
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import React (ReactElement)
import React (ReactElement)
import React.DOM (a,
button, div, footer, h1, h3, hr, i, img, li, p, span, text, ul
)
import React.DOM (a,
div, h3, i, img, p, span, text
)
import React.DOM.Props (Props, _
data, _id, aria, className, href, onClick, role, src, style, tabIndex
, target, title)
import React.DOM.Props (Props, _
id, aria, className, href, src
, target, title)
import Routing.Hash.Aff (setHash)
import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, simpleSpec)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Thermite as T
newtype State = State
{ userName :: String
, password :: String
}
initialState :: State
initialState = State
{userName : ""
, password : ""
}
data Action
= NoOp
| Documentation
| Enter
| Login
| SignUp
performAction :: forall eff props. PerformAction ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff
) State props Action
performAction NoOp _ _ = void do
T.modifyState \state -> state
performAction Documentation _ _ = void do
T.modifyState \state -> state
performAction Enter _ _ = void do
lift $ setHash "/search"
T.modifyState \state -> state
performAction Login _ _ = void do
lift $ setHash "/login"
T.modifyState \state -> state
performAction SignUp _ _ = void do
T.modifyState \state -> state
-- Layout |
-- Layout |
...
...
src/Gargantext/Pages/Home/States.purs
0 → 100644
View file @
59fff972
module Gargantext.Pages.Home.States where
import Prelude hiding (div)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..))
import Gargantext.Components.Data.Lang (Lang(..))
import Network.HTTP.Affjax (AJAX)
import React (ReactElement)
import React.DOM (a, div, h3, i, img, p, span, text)
import React.DOM.Props (Props, _id, aria, className, href, src, target, title)
import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
newtype State = State
{ userName :: String
, password :: String
}
initialState :: State
initialState = State
{userName : ""
, password : ""
}
src/Gargantext/Pages/Layout.purs
0 → 100644
View file @
59fff972
module Gargantext.Pages.Layout where
import Prelude hiding (div)
import Gargantext.Components.Login as LN
import Gargantext.Pages.Layout.Actions (Action(..))
import Gargantext.Pages.Corpus as AC
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Home as L
import Gargantext.Pages.Search as S
import Gargantext.Router (Routes(..))
dispatchAction :: forall t115 t445 t447.
Bind t445 => Applicative t445 =>
(Action -> t445 t447) -> t115 -> Routes -> t445 Unit
dispatchAction dispatcher _ Home = do
_ <- dispatcher Initialize
_ <- dispatcher $ SetRoute Home
_ <- dispatcher $ LandingA L.NoOp
pure unit
dispatchAction dispatcher _ Login = do
_ <- dispatcher Initialize
_ <- dispatcher $ SetRoute Login
_ <- dispatcher $ LoginA LN.NoOp
pure unit
dispatchAction dispatcher _ AddCorpus = do
_ <- dispatcher $ SetRoute AddCorpus
_ <- dispatcher $ AddCorpusA AC.LoadDatabaseDetails
pure unit
dispatchAction dispatcher _ DocView = do
_ <- dispatcher $ SetRoute $ DocView
_ <- dispatcher $ DocViewA $ DV.LoadData
pure unit
dispatchAction dispatcher _ SearchView = do
_ <- dispatcher $ SetRoute $ SearchView
_ <- dispatcher $ SearchA $ S.NoOp
pure unit
dispatchAction dispatcher _ (UserPage id) = do
_ <- dispatcher $ SetRoute $ UserPage id
_ <- dispatcher $ UserPageA $ U.NoOp
_ <- dispatcher $ UserPageA $ U.FetchUser id
pure unit
dispatchAction dispatcher _ (DocAnnotation i) = do
_ <- dispatcher $ SetRoute $ DocAnnotation i
_ <- dispatcher $ DocAnnotationViewA $ D.NoOp
pure unit
dispatchAction dispatcher _ Tabview = do
_ <- dispatcher $ SetRoute $ Tabview
_ <- dispatcher $ TabViewA $ TV.NoOp
pure unit
dispatchAction dispatcher _ CorpusAnalysis = do
_ <- dispatcher $ SetRoute $ CorpusAnalysis
--_ <- dispatcher $ CorpusAnalysisA $ CA.NoOp
pure unit
dispatchAction dispatcher _ PGraphExplorer = do
_ <- dispatcher $ SetRoute $ PGraphExplorer
_ <- dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
pure unit
dispatchAction dispatcher _ NGramsTable = do
_ <- dispatcher $ SetRoute $ NGramsTable
_ <- dispatcher $ NgramsA $ NG.NoOp
pure unit
dispatchAction dispatcher _ Dashboard = do
_ <- dispatcher $ SetRoute $ Dashboard
pure unit
src/Gargantext/Pages/Layout/Actions.purs
0 → 100644
View file @
59fff972
module Gargantext.Pages.Layout.Actions where
import Prelude hiding (div)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (CONSOLE, log)
import DOM (DOM)
import Data.Array (length)
import Data.Either (Either(..))
import Data.Lens (Lens', Prism', lens, prism)
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Body as CA
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Components.Login as LN
import Gargantext.Components.Modals.Modal (modalShow)
import Gargantext.Components.Tree as Tree
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
import Gargantext.Pages.Corpus as AC
import Gargantext.Router (Routes(..))
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
import Gargantext.Pages.Home as L
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Search as S
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Layout.States (AppState)
import Gargantext.Pages.Corpus.Doc.Document as DV
import Network.HTTP.Affjax (AJAX)
import Thermite (PerformAction, modifyState)
data Action
= Initialize
| LandingA L.Action
| LoginA LN.Action
| SetRoute Routes
| AddCorpusA AC.Action
| DocViewA DV.Action
| SearchA S.Action
| UserPageA U.Action
| DocAnnotationViewA D.Action
| TreeViewA Tree.Action
| TabViewA TV.Action
| GraphExplorerA GE.Action
| DashboardA Dsh.Action
| Search String
| Go
| CorpusAnalysisA CA.Action
| ShowLogin
| ShowAddcorpus
| NgramsA NG.Action
performAction :: forall eff props. PerformAction ( dom :: DOM
, ajax :: AJAX
, console :: CONSOLE
| eff
) AppState props Action
performAction (SetRoute route) _ _ = void do
modifyState $ _ {currentRoute = pure route}
performAction (Search s) _ _ = void do
modifyState $ _ {search = s}
performAction (ShowLogin) _ _ = void do
liftEff $ modalShow "loginModal"
modifyState $ _ {showLogin = true}
performAction (ShowAddcorpus) _ _ = void do
liftEff $ modalShow "addCorpus"
modifyState $ _ {showCorpus = true}
performAction Go _ _ = void do
liftEff $ modalShow "addCorpus"
modifyState $ _ {showCorpus = true}
-- _ <- lift $ setHash "/addCorpus"
--modifyState id
performAction Initialize _ state = void do
_ <- liftEff $ log "loading Initial nodes"
case state.initialized of
false -> do
lnodes <- lift $ Tree.loadDefaultNode
case lnodes of
Left err -> do
modifyState id
Right d -> do
page <- lift $ DV.loadPage
case page of
Left err -> do
modifyState id
Right docs -> do
modifyState $ _ { initialized = true
, ntreeView = if length d > 0
then Tree.exampleTree
--then fnTransform $ unsafePartial $ fromJust $ head d
else Tree.initialState
, docViewState = docs
}
_ -> do
modifyState id
performAction _ _ _ = void do
modifyState id
----------------------------------------------------------
_landingAction :: Prism' Action L.Action
_landingAction = prism LandingA \action ->
case action of
LandingA caction -> Right caction
_-> Left action
_loginAction :: Prism' Action LN.Action
_loginAction = prism LoginA \action ->
case action of
LoginA caction -> Right caction
_-> Left action
_addCorpusAction :: Prism' Action AC.Action
_addCorpusAction = prism AddCorpusA \action ->
case action of
AddCorpusA caction -> Right caction
_-> Left action
_docViewAction :: Prism' Action DV.Action
_docViewAction = prism DocViewA \action ->
case action of
DocViewA caction -> Right caction
_-> Left action
_searchAction :: Prism' Action S.Action
_searchAction = prism SearchA \action ->
case action of
SearchA caction -> Right caction
_-> Left action
_userPageAction :: Prism' Action U.Action
_userPageAction = prism UserPageA \action ->
case action of
UserPageA caction -> Right caction
_-> Left action
_dashBoardAction :: Prism' Action Dsh.Action
_dashBoardAction = prism DashboardA \action ->
case action of
DashboardA caction -> Right caction
_ -> Left action
_docAnnotationViewAction :: Prism' Action D.Action
_docAnnotationViewAction = prism DocAnnotationViewA \action ->
case action of
DocAnnotationViewA caction -> Right caction
_-> Left action
_treeAction :: Prism' Action Tree.Action
_treeAction = prism TreeViewA \action ->
case action of
TreeViewA caction -> Right caction
_-> Left action
_tabviewAction :: Prism' Action TV.Action
_tabviewAction = prism TabViewA \action ->
case action of
TabViewA caction -> Right caction
_-> Left action
_corpusAction :: Prism' Action CA.Action
_corpusAction = prism CorpusAnalysisA \action ->
case action of
CorpusAnalysisA caction -> Right caction
_-> Left action
_graphExplorerAction :: Prism' Action GE.Action
_graphExplorerAction = prism GraphExplorerA \action ->
case action of
GraphExplorerA caction -> Right caction
_-> Left action
_ngAction :: Prism' Action NG.Action
_ngAction = prism NgramsA \action ->
case action of
NgramsA caction -> Right caction
_-> Left action
src/
Navigation
.purs
→
src/
Gargantext/Pages/Layout/Specs
.purs
View file @
59fff972
module
Navigation
where
module
Gargantext.Pages.Layout.Specs
where
import DOM
import Gargantext.Data.Lang
import Prelude hiding (div)
import Prelude hiding (div)
import Control.Monad.Eff.Console (CONSOLE)
import AddCorpusview as AC
import DOM (DOM)
import DocAnnotation as D
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (CONSOLE, log)
import CorpusAnalysis as CA
import Data.Array (concat, head, length)
import Data.Either (Either(..))
import Data.Foldable (fold, intercalate)
import Data.Foldable (fold, intercalate)
import Data.Lens (Lens', Prism', lens, over, prism)
import Data.Lens (over)
import Data.Maybe (Maybe(Nothing, Just), fromJust)
import Data.Maybe (Maybe(Nothing, Just))
import Data.Tuple (Tuple(..))
import DocView as DV
import Gargantext.Components.Data.Lang (Lang(..))
import Landing as L
import Gargantext.Components.Login as LN
import Login as LN
import Gargantext.Components.Tree as Tree
import Modal (modalShow)
import NTree (fnTransform, loadDefaultNode)
-- | [Naming] metrics indicator: reduce spaces between "," and "_"
import NTree as NT
import Gargantext.Pages.Layout.States ( _addCorpusState
, _corpusState
, _dashBoardSate
, _docAnnotationViewState
, _docViewState
, _graphExplorerState
, _landingState
, _loginState
, _ngState
, _searchState
, _tabviewState
, _treeState
, _userPageState
)
-- | [Naming] metrics indicator: reduce spaces between "," and "_"
import Gargantext.Pages.Layout.Actions ( _addCorpusAction
, _corpusAction
, _dashBoardAction
, _docAnnotationViewAction
, _docViewAction
, _graphExplorerAction
, _landingAction
, _loginAction
, _ngAction
, _searchAction
, _tabviewAction
, _treeAction
, _userPageAction
)
import Gargantext.Pages.Corpus as AC
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Body as CA
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Home as L
import Gargantext.Pages.Layout.Actions (Action(..), performAction)
import Gargantext.Pages.Layout.States (AppState, E)
import Gargantext.Pages.Search as S
import Gargantext.Router (Routes(..))
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import PageRouter (Routes(..))
import Partial.Unsafe (unsafePartial)
import React (ReactElement)
import React (ReactElement)
import React.DOM (a, button, div, footer, form, hr, i, img, input, li, p, span, text, ul)
import React.DOM (a, button, div, footer, hr, img, input, li, p, span, text, ul)
import React.DOM.Props (Props, _data, _id, _type, aria, className, href, name, onChange, onClick, placeholder, role, src, style, tabIndex, target, title)
import React.DOM.Props (_data, _id, _type, aria, className, href, onChange, onClick, placeholder, role, src, style, tabIndex, target, title)
import React.DOM.Props as RP
import Thermite (Render, Spec, _render, defaultPerformAction, defaultRender, focus, simpleSpec, withState)
import Routing.Hash.Aff (setHash)
import SearchForm as S
import Tabview as TV
import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultPerformAction, defaultRender, focus, modifyState, simpleSpec, withState)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
import Gargantext.Users as U
import NgramsTable as NG
import Gargantext.Dashboard as Dsh
import Graph as GE
type E e = (dom :: DOM, ajax :: AJAX, console :: CONSOLE | e)
type AppState =
{ currentRoute :: Maybe Routes
, landingState :: L.State
, loginState :: LN.State
, addCorpusState :: AC.State
, docViewState :: DV.State
, searchState :: S.State
, userPage :: U.State
, docAnnotationView :: D.State
, ntreeView :: NT.State
, tabview :: TV.State
, search :: String
, corpusAnalysis :: CA.State
, showLogin :: Boolean
, showCorpus :: Boolean
, graphExplorer :: GE.State
, initialized :: Boolean
, ngState :: NG.State
, dashboard :: Dsh.State
}
initAppState :: AppState
initAppState =
{ currentRoute : Just Home
, landingState : L.initialState
, loginState : LN.initialState
, addCorpusState : AC.initialState
, docViewState : DV.tdata
, searchState : S.initialState
, userPage : U.initialState
, docAnnotationView : D.initialState
, ntreeView : NT.exampleTree
, tabview : TV.initialState
, search : ""
, corpusAnalysis : CA.initialState
, showLogin : false
, showCorpus : false
, graphExplorer : GE.initialState
, initialized : false
, ngState : NG.initialState
, dashboard : Dsh.initialState
}
data Action
= Initialize
| LandingA L.Action
| LoginA LN.Action
| SetRoute Routes
| AddCorpusA AC.Action
| DocViewA DV.Action
| SearchA S.Action
| UserPageA U.Action
| DocAnnotationViewA D.Action
| TreeViewA NT.Action
| TabViewA TV.Action
| GraphExplorerA GE.Action
| DashboardA Dsh.Action
| Search String
| Go
| CorpusAnalysisA CA.Action
| ShowLogin
| ShowAddcorpus
| NgramsA NG.Action
performAction :: forall eff props. PerformAction ( dom :: DOM
, ajax :: AJAX
, console :: CONSOLE
| eff
) AppState props Action
performAction (SetRoute route) _ _ = void do
modifyState $ _ {currentRoute = pure route}
performAction (Search s) _ _ = void do
modifyState $ _ {search = s}
performAction (ShowLogin) _ _ = void do
liftEff $ modalShow "loginModal"
modifyState $ _ {showLogin = true}
performAction (ShowAddcorpus) _ _ = void do
liftEff $ modalShow "addCorpus"
modifyState $ _ {showCorpus = true}
performAction Go _ _ = void do
liftEff $ modalShow "addCorpus"
modifyState $ _ {showCorpus = true}
-- _ <- lift $ setHash "/addCorpus"
--modifyState id
performAction Initialize _ state = void do
_ <- liftEff $ log "loading Initial nodes"
case state.initialized of
false -> do
lnodes <- lift $ loadDefaultNode
case lnodes of
Left err -> do
modifyState id
Right d -> do
page <- lift $ DV.loadPage
case page of
Left err -> do
modifyState id
Right docs -> do
modifyState $ _ { initialized = true
, ntreeView = if length d > 0
then NT.exampleTree
--then fnTransform $ unsafePartial $ fromJust $ head d
else NT.initialState
, docViewState = docs
}
_ -> do
modifyState id
performAction Go _ _ = void do
_ <- lift $ setHash "/addCorpus"
modifyState id
performAction _ _ _ = void do
modifyState id
---- Lens and Prism
_landingState :: Lens' AppState L.State
_landingState = lens (\s -> s.landingState) (\s ss -> s{landingState = ss})
_landingAction :: Prism' Action L.Action
_landingAction = prism LandingA \action ->
case action of
LandingA caction -> Right caction
_-> Left action
_loginState :: Lens' AppState LN.State
_loginState = lens (\s -> s.loginState) (\s ss -> s{loginState = ss})
_loginAction :: Prism' Action LN.Action
_loginAction = prism LoginA \action ->
case action of
LoginA caction -> Right caction
_-> Left action
_addCorpusState :: Lens' AppState AC.State
_addCorpusState = lens (\s -> s.addCorpusState) (\s ss -> s{addCorpusState = ss})
_addCorpusAction :: Prism' Action AC.Action
_addCorpusAction = prism AddCorpusA \action ->
case action of
AddCorpusA caction -> Right caction
_-> Left action
_docViewState :: Lens' AppState DV.State
_docViewState = lens (\s -> s.docViewState) (\s ss -> s{docViewState = ss})
_docViewAction :: Prism' Action DV.Action
_docViewAction = prism DocViewA \action ->
case action of
DocViewA caction -> Right caction
_-> Left action
_searchState :: Lens' AppState S.State
_searchState = lens (\s -> s.searchState) (\s ss -> s{searchState = ss})
_searchAction :: Prism' Action S.Action
_searchAction = prism SearchA \action ->
case action of
SearchA caction -> Right caction
_-> Left action
_userPageState :: Lens' AppState U.State
_userPageState = lens (\s -> s.userPage) (\s ss -> s{userPage = ss})
_userPageAction :: Prism' Action U.Action
_userPageAction = prism UserPageA \action ->
case action of
UserPageA caction -> Right caction
_-> Left action
_dashBoardAction :: Prism' Action Dsh.Action
_dashBoardAction = prism DashboardA \action ->
case action of
DashboardA caction -> Right caction
_ -> Left action
_docAnnotationViewState :: Lens' AppState D.State
_docAnnotationViewState = lens (\s -> s.docAnnotationView) (\s ss -> s{docAnnotationView = ss})
_docAnnotationViewAction :: Prism' Action D.Action
_docAnnotationViewAction = prism DocAnnotationViewA \action ->
case action of
DocAnnotationViewA caction -> Right caction
_-> Left action
_treeState :: Lens' AppState NT.State
_treeState = lens (\s -> s.ntreeView) (\s ss -> s {ntreeView = ss})
_treeAction :: Prism' Action NT.Action
_treeAction = prism TreeViewA \action ->
case action of
TreeViewA caction -> Right caction
_-> Left action
_tabviewState :: Lens' AppState TV.State
_tabviewState = lens (\s -> s.tabview) (\s ss -> s {tabview = ss})
_tabviewAction :: Prism' Action TV.Action
_tabviewAction = prism TabViewA \action ->
case action of
TabViewA caction -> Right caction
_-> Left action
_corpusState :: Lens' AppState CA.State
_corpusState = lens (\s -> s.corpusAnalysis) (\s ss -> s {corpusAnalysis = ss})
_corpusAction :: Prism' Action CA.Action
_corpusAction = prism CorpusAnalysisA \action ->
case action of
CorpusAnalysisA caction -> Right caction
_-> Left action
_dashBoardSate :: Lens' AppState Dsh.State
_dashBoardSate = lens (\s -> s.dashboard) (\s ss -> s {dashboard = ss})
_graphExplorerState :: Lens' AppState GE.State
_graphExplorerState = lens (\s -> s.graphExplorer) (\s ss -> s{graphExplorer = ss})
_graphExplorerAction :: Prism' Action GE.Action
_graphExplorerAction = prism GraphExplorerA \action ->
case action of
GraphExplorerA caction -> Right caction
_-> Left action
_ngState :: Lens' AppState NG.State
_ngState = lens (\s -> s.ngState) (\s ss -> s{ngState = ss})
_ngAction :: Prism' Action NG.Action
_ngAction = prism NgramsA \action ->
case action of
NgramsA caction -> Right caction
_-> Left action
pagesComponent :: forall props eff. AppState -> Spec (E eff) AppState props Action
pagesComponent :: forall props eff. AppState -> Spec (E eff) AppState props Action
pagesComponent s =
pagesComponent s =
case s.currentRoute of
case s.currentRoute of
Just route ->
Just route -> selectSpec route
selectSpec route
Nothing -> selectSpec Home
Nothing ->
selectSpec Home
where
where
selectSpec :: Routes -> Spec ( ajax :: AJAX
selectSpec :: Routes -> Spec ( ajax :: AJAX
, console :: CONSOLE
, console :: CONSOLE
...
@@ -337,7 +94,6 @@ pagesComponent s =
...
@@ -337,7 +94,6 @@ pagesComponent s =
routingSpec :: forall props eff. Spec (ajax :: AJAX, console :: CONSOLE, dom :: DOM |eff) AppState props Action
routingSpec :: forall props eff. Spec (ajax :: AJAX, console :: CONSOLE, dom :: DOM |eff) AppState props Action
routingSpec = simpleSpec performAction defaultRender
routingSpec = simpleSpec performAction defaultRender
layout0 :: forall eff props. Spec (E eff) AppState props Action
layout0 :: forall eff props. Spec (E eff) AppState props Action
-> Spec (E eff) AppState props Action
-> Spec (E eff) AppState props Action
layout0 layout =
layout0 layout =
...
@@ -352,17 +108,15 @@ layout0 layout =
...
@@ -352,17 +108,15 @@ layout0 layout =
outerLayout =
outerLayout =
cont $ fold
cont $ fold
[ withState \st ->
[ withState \st ->
if ((\(LN.State s) -> s.loginC) st.loginState == true) then ls as
if ((\(LN.State s) -> s.loginC) st.loginState == true)
then ls as
else outerLayout1
else outerLayout1
, rs bs ]
, rs bs ]
ls = over _render \render d p s c ->
ls = over _render \render d p s c -> [ div [className "col-md-2" ] (render d p s c) ]
[div [className "col-md-2"] (render d p s c)]
rs = over _render \render d p s c -> [ div [className "col-md-10"] (render d p s c) ]
rs = over _render \render d p s c ->
cont = over _render \render d p s c -> [ div [className "row" ] (render d p s c) ]
[ div [className "col-md-10"] (render d p s c) ]
cont = over _render \render d p s c ->
[ div [ className "row" ] (render d p s c) ]
as = focus _treeState _treeAction
NT
.treeview
as = focus _treeState _treeAction
Tree
.treeview
bs = innerLayout $ layout
bs = innerLayout $ layout
...
@@ -394,7 +148,6 @@ layoutSidebar = over _render \render d p s c ->
...
@@ -394,7 +148,6 @@ layoutSidebar = over _render \render d p s c ->
]
]
divLogo :: ReactElement
divLogo :: ReactElement
divLogo = a [ className "navbar-brand logoSmall"
divLogo = a [ className "navbar-brand logoSmall"
, href "#/"
, href "#/"
...
@@ -403,7 +156,6 @@ divLogo = a [ className "navbar-brand logoSmall"
...
@@ -403,7 +156,6 @@ divLogo = a [ className "navbar-brand logoSmall"
] []
] []
]
]
divDropdownLeft :: ReactElement
divDropdownLeft :: ReactElement
divDropdownLeft = divDropdownLeft' (LiNav { title : "About Gargantext"
divDropdownLeft = divDropdownLeft' (LiNav { title : "About Gargantext"
, href : "#"
, href : "#"
...
@@ -412,7 +164,6 @@ divDropdownLeft = divDropdownLeft' (LiNav { title : "About Gargantext"
...
@@ -412,7 +164,6 @@ divDropdownLeft = divDropdownLeft' (LiNav { title : "About Gargantext"
}
}
)
)
divDropdownLeft' :: LiNav -> ReactElement
divDropdownLeft' :: LiNav -> ReactElement
divDropdownLeft' mb = ul [className "nav navbar-nav"]
divDropdownLeft' mb = ul [className "nav navbar-nav"]
[ ul [className "nav navbar-nav pull-left"]
[ ul [className "nav navbar-nav pull-left"]
...
@@ -423,7 +174,6 @@ divDropdownLeft' mb = ul [className "nav navbar-nav"]
...
@@ -423,7 +174,6 @@ divDropdownLeft' mb = ul [className "nav navbar-nav"]
]
]
]
]
menuButton :: LiNav -> ReactElement
menuButton :: LiNav -> ReactElement
menuButton (LiNav { title : title'
menuButton (LiNav { title : title'
, href : href'
, href : href'
...
@@ -439,7 +189,6 @@ menuButton (LiNav { title : title'
...
@@ -439,7 +189,6 @@ menuButton (LiNav { title : title'
, text (" " <> text')
, text (" " <> text')
]
]
menuElements' :: ReactElement
menuElements' :: ReactElement
menuElements' = menuElements-- title, icon, text
menuElements' = menuElements-- title, icon, text
[ -- ===========================================================
[ -- ===========================================================
...
@@ -493,7 +242,6 @@ menuElements ns = dropDown $ intercalate divider $ map (map liNav) ns
...
@@ -493,7 +242,6 @@ menuElements ns = dropDown $ intercalate divider $ map (map liNav) ns
-- , target :: String
-- , target :: String
-- }
-- }
data LiNav = LiNav { title :: String
data LiNav = LiNav { title :: String
, href :: String
, href :: String
, icon :: String
, icon :: String
...
@@ -515,8 +263,6 @@ liNav (LiNav { title : title'
...
@@ -515,8 +263,6 @@ liNav (LiNav { title : title'
]
]
]
]
-- TODO put the search form in the center of the navBar
-- TODO put the search form in the center of the navBar
divSearchBar :: forall props eff. Spec (ajax :: AJAX, console :: CONSOLE, dom :: DOM |eff) AppState props Action
divSearchBar :: forall props eff. Spec (ajax :: AJAX, console :: CONSOLE, dom :: DOM |eff) AppState props Action
divSearchBar = simpleSpec performAction render
divSearchBar = simpleSpec performAction render
...
@@ -562,8 +308,6 @@ divDropdownRight d =
...
@@ -562,8 +308,6 @@ divDropdownRight d =
]
]
]
]
layoutFooter :: forall props eff. Spec (ajax :: AJAX, console :: CONSOLE, dom :: DOM |eff) AppState props Action
layoutFooter :: forall props eff. Spec (ajax :: AJAX, console :: CONSOLE, dom :: DOM |eff) AppState props Action
layoutFooter = simpleSpec performAction render
layoutFooter = simpleSpec performAction render
where
where
...
@@ -590,7 +334,6 @@ layoutFooter = simpleSpec performAction render
...
@@ -590,7 +334,6 @@ layoutFooter = simpleSpec performAction render
]
]
]
]
layoutSpec :: forall eff props. Spec (E eff) AppState props Action
layoutSpec :: forall eff props. Spec (E eff) AppState props Action
layoutSpec =
layoutSpec =
fold
fold
...
@@ -605,69 +348,3 @@ layoutSpec =
...
@@ -605,69 +348,3 @@ layoutSpec =
container :: Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
container :: Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
container = over _render \render d p s c ->
container = over _render \render d p s c ->
(render d p s c)
(render d p s c)
dispatchAction :: forall t115 t445 t447.
Bind t445 => Applicative t445 =>
(Action -> t445 t447) -> t115 -> Routes -> t445 Unit
dispatchAction dispatcher _ Home = do
_ <- dispatcher Initialize
_ <- dispatcher $ SetRoute Home
_ <- dispatcher $ LandingA L.NoOp
pure unit
dispatchAction dispatcher _ Login = do
_ <- dispatcher Initialize
_ <- dispatcher $ SetRoute Login
_ <- dispatcher $ LoginA LN.NoOp
pure unit
dispatchAction dispatcher _ AddCorpus = do
_ <- dispatcher $ SetRoute AddCorpus
_ <- dispatcher $ AddCorpusA AC.LoadDatabaseDetails
pure unit
dispatchAction dispatcher _ DocView = do
_ <- dispatcher $ SetRoute $ DocView
_ <- dispatcher $ DocViewA $ DV.LoadData
pure unit
dispatchAction dispatcher _ SearchView = do
_ <- dispatcher $ SetRoute $ SearchView
_ <- dispatcher $ SearchA $ S.NoOp
pure unit
dispatchAction dispatcher _ (UserPage id) = do
_ <- dispatcher $ SetRoute $ UserPage id
_ <- dispatcher $ UserPageA $ U.NoOp
_ <- dispatcher $ UserPageA $ U.FetchUser id
pure unit
dispatchAction dispatcher _ (DocAnnotation i) = do
_ <- dispatcher $ SetRoute $ DocAnnotation i
_ <- dispatcher $ DocAnnotationViewA $ D.NoOp
pure unit
dispatchAction dispatcher _ Tabview = do
_ <- dispatcher $ SetRoute $ Tabview
_ <- dispatcher $ TabViewA $ TV.NoOp
pure unit
dispatchAction dispatcher _ CorpusAnalysis = do
_ <- dispatcher $ SetRoute $ CorpusAnalysis
--_ <- dispatcher $ CorpusAnalysisA $ CA.NoOp
pure unit
dispatchAction dispatcher _ PGraphExplorer = do
_ <- dispatcher $ SetRoute $ PGraphExplorer
_ <- dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
pure unit
dispatchAction dispatcher _ NGramsTable = do
_ <- dispatcher $ SetRoute $ NGramsTable
_ <- dispatcher $ NgramsA $ NG.NoOp
pure unit
dispatchAction dispatcher _ Dashboard = do
_ <- dispatcher $ SetRoute $ Dashboard
pure unit
src/Gargantext/Pages/Layout/States.purs
0 → 100644
View file @
59fff972
module Gargantext.Pages.Layout.States where
import Prelude hiding (div)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (CONSOLE, log)
import DOM (DOM)
import Data.Array (length)
import Data.Either (Either(..))
import Data.Lens (Lens', Prism', lens, prism)
import Data.Maybe (Maybe(Just))
import Gargantext.Components.Login as LN
import Gargantext.Components.Modals.Modal (modalShow)
import Gargantext.Components.Tree as Tree
import Gargantext.Pages.Corpus as AC
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Body as CA
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Home as L
import Gargantext.Pages.Search as S
import Gargantext.Router (Routes(..))
import Network.HTTP.Affjax (AJAX)
import Thermite (PerformAction, modifyState)
type E e = (dom :: DOM, ajax :: AJAX, console :: CONSOLE | e)
type AppState =
{ currentRoute :: Maybe Routes
, landingState :: L.State
, loginState :: LN.State
, addCorpusState :: AC.State
, docViewState :: DV.State
, searchState :: S.State
, userPage :: U.State
, docAnnotationView :: D.State
, ntreeView :: Tree.State
, tabview :: TV.State
, search :: String
, corpusAnalysis :: CA.State
, showLogin :: Boolean
, showCorpus :: Boolean
, graphExplorer :: GE.State
, initialized :: Boolean
, ngState :: NG.State
, dashboard :: Dsh.State
}
initAppState :: AppState
initAppState =
{ currentRoute : Just Home
, landingState : L.initialState
, loginState : LN.initialState
, addCorpusState : AC.initialState
, docViewState : DV.tdata
, searchState : S.initialState
, userPage : U.initialState
, docAnnotationView : D.initialState
, ntreeView : Tree.exampleTree
, tabview : TV.initialState
, search : ""
, corpusAnalysis : CA.initialState
, showLogin : false
, showCorpus : false
, graphExplorer : GE.initialState
, initialized : false
, ngState : NG.initialState
, dashboard : Dsh.initialState
}
---------------------------------------------------------
_landingState :: Lens' AppState L.State
_landingState = lens (\s -> s.landingState) (\s ss -> s{landingState = ss})
_loginState :: Lens' AppState LN.State
_loginState = lens (\s -> s.loginState) (\s ss -> s{loginState = ss})
_addCorpusState :: Lens' AppState AC.State
_addCorpusState = lens (\s -> s.addCorpusState) (\s ss -> s{addCorpusState = ss})
_docViewState :: Lens' AppState DV.State
_docViewState = lens (\s -> s.docViewState) (\s ss -> s{docViewState = ss})
_searchState :: Lens' AppState S.State
_searchState = lens (\s -> s.searchState) (\s ss -> s{searchState = ss})
_userPageState :: Lens' AppState U.State
_userPageState = lens (\s -> s.userPage) (\s ss -> s{userPage = ss})
_docAnnotationViewState :: Lens' AppState D.State
_docAnnotationViewState = lens (\s -> s.docAnnotationView) (\s ss -> s{docAnnotationView = ss})
_treeState :: Lens' AppState Tree.State
_treeState = lens (\s -> s.ntreeView) (\s ss -> s {ntreeView = ss})
_tabviewState :: Lens' AppState TV.State
_tabviewState = lens (\s -> s.tabview) (\s ss -> s {tabview = ss})
_corpusState :: Lens' AppState CA.State
_corpusState = lens (\s -> s.corpusAnalysis) (\s ss -> s {corpusAnalysis = ss})
_dashBoardSate :: Lens' AppState Dsh.State
_dashBoardSate = lens (\s -> s.dashboard) (\s ss -> s {dashboard = ss})
_graphExplorerState :: Lens' AppState GE.State
_graphExplorerState = lens (\s -> s.graphExplorer) (\s ss -> s{graphExplorer = ss})
_ngState :: Lens' AppState NG.State
_ngState = lens (\s -> s.ngState) (\s ss -> s{ngState = ss})
src/
SearchForm
.purs
→
src/
Gargantext/Pages/Search
.purs
View file @
59fff972
module SearchForm where
module Gargantext.Pages.Search where
import Control.Monad.Aff.Console (CONSOLE)
import Control.Monad.Aff.Console (CONSOLE)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Cont.Trans (lift)
...
@@ -11,7 +10,7 @@ import React.DOM.Props (_id, _type, className, name, onClick, onInput, placehold
...
@@ -11,7 +10,7 @@ import React.DOM.Props (_id, _type, className, name, onClick, onInput, placehold
import Routing.Hash.Aff (setHash)
import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
import
Landing
as L
import
Gargantext.Pages.Home
as L
type State =
type State =
{
{
...
...
src/
Page
Router.purs
→
src/
Gargantext/
Router.purs
View file @
59fff972
module
Page
Router where
module
Gargantext.
Router where
import Prelude
import Prelude
...
...
src/Gargantext/Users.purs
deleted
100644 → 0
View file @
e72a0197
module Gargantext.Users
(module Gargantext.Users.Types,
module Gargantext.Users.Specs)
where
import Gargantext.Users.Types
import Gargantext.Users.Specs
src/Utils.purs
→
src/
Gargantext/
Utils.purs
View file @
59fff972
module Utils where
module
Gargantext.
Utils where
import Prelude
import Prelude
...
...
src/DecodeMaybe.js
→
src/
Gargantext/Utils/
DecodeMaybe.js
View file @
59fff972
File moved
src/DecodeMaybe.purs
→
src/
Gargantext/Utils/
DecodeMaybe.purs
View file @
59fff972
module DecodeMaybe where
module
Gargantext.Utils.
DecodeMaybe where
import Prelude
import Prelude
...
...
src/GraphExplorer/DecodeMaybe.js
deleted
100644 → 0
View file @
e72a0197
'use strict'
;
exports
.
isNull
=
function
(
v
)
{
return
v
===
null
;
};
src/GraphExplorer/DecodeMaybe.purs
deleted
100644 → 0
View file @
e72a0197
module GraphExplorer.DecodeMaybe where
import Prelude
import Data.Argonaut (class DecodeJson, JObject, getFieldOptional)
import Data.Either (Either)
import Data.Maybe (Maybe(..))
foreign import isNull :: forall a. a -> Boolean
getFieldOptional' :: forall a. DecodeJson a => JObject -> String -> Either String (Maybe a)
getFieldOptional' o s = (case _ of
Just v -> if isNull v then Nothing else v
Nothing -> Nothing
) <$> (getFieldOptional o s)
infix 7 getFieldOptional' as .?|
src/Main.purs
View file @
59fff972
...
@@ -11,9 +11,13 @@ import DOM.HTML.Window (document) as DOM
...
@@ -11,9 +11,13 @@ import DOM.HTML.Window (document) as DOM
import DOM.Node.ParentNode (QuerySelector(..))
import DOM.Node.ParentNode (QuerySelector(..))
import DOM.Node.ParentNode (querySelector) as DOM
import DOM.Node.ParentNode (querySelector) as DOM
import Data.Maybe (fromJust)
import Data.Maybe (fromJust)
import Navigation (dispatchAction, initAppState, layoutSpec)
import Gargantext.Pages.Layout (dispatchAction)
import Gargantext.Pages.Layout.Specs (layoutSpec)
import Gargantext.Pages.Layout.States (initAppState)
import Gargantext.Router (routeHandler, routing)
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
import PageRouter (routeHandler, routing)
import Partial.Unsafe (unsafePartial)
import Partial.Unsafe (unsafePartial)
import React as R
import React as R
import ReactDOM as RDOM
import ReactDOM as RDOM
...
...
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