Commit 72aeb6ae authored by Sudhir Kumar's avatar Sudhir Kumar

renamed some module names

parent fd1f668f
'use strict';
exports.isNull = function(v) {
return v === null;
};
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 .?|
module GraphExplorer.Types where module Gargantext.Components.GraphExplorer.Types where
import Prelude import Prelude
......
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
} }
module Gargantext.Data.Lang module Gargantext.Components.Data.Lang where
where
data Lang = EN | FR data Lang = EN | FR
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
} }
} }
] ]
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
} }
} }
] ]
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
......
module Modal where module Gargantext.Components.Modals.Modal where
import Control.Monad.Eff (Eff) import Control.Monad.Eff (Eff)
import Prelude (Unit) import Prelude (Unit)
......
...@@ -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
......
module Tab where module Gargantext.Components.Tab where
import Data.Array (fold) import Data.Array (fold)
import Data.Lens (Lens', Prism', over, view) import Data.Lens (Lens', Prism', over, view)
......
module NTree where module Gargantext.Components.Tree where
import Prelude hiding (div) import Prelude hiding (div)
......
module Gargantext.REST where module Gargantext.Config.REST where
import Data.Argonaut import Data.Argonaut
import Data.HTTP.Method (Method(..)) import Data.HTTP.Method (Method(..))
......
module Navigation where module Gargantext.Navigation where
import DOM
import Gargantext.Data.Lang
import Prelude hiding (div) import Prelude hiding (div)
import AddCorpusview as AC import AddCorpusview as AC
import DocAnnotation as D
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, log) import Control.Monad.Eff.Console (CONSOLE, log)
import CorpusAnalysis as CA import CorpusAnalysis as CA
import Data.Array (concat, head, length) import DOM (DOM)
import Data.Array (length)
import Data.Either (Either(..)) 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 (Lens', Prism', lens, over, prism)
import Data.Maybe (Maybe(Nothing, Just), fromJust) import Data.Maybe (Maybe(Nothing, Just))
import Data.Tuple (Tuple(..)) import DocAnnotation as D
import DocView as DV import DocView as DV
import Gargantext.Components.Tree as Tree
import Gargantext.Dashboard as Dsh
import Gargantext.Components.Data.Lang (Lang(..))
import Gargantext.Router (Routes(..))
import Gargantext.Users as U
import Graph as GE
import Landing as L import Landing as L
import Login as LN import Gargantext.Components.Login as LN
import Modal (modalShow) import Gargantext.Components.Modals.Modal (modalShow)
import NTree (fnTransform, loadDefaultNode)
import NTree as NT
import Network.HTTP.Affjax (AJAX) import Network.HTTP.Affjax (AJAX)
import PageRouter (Routes(..)) import NgramsTable as NG
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 Routing.Hash.Aff (setHash)
import SearchForm as S import SearchForm as S
import Tabview as TV import Tabview as TV
import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultPerformAction, defaultRender, focus, modifyState, simpleSpec, withState) import Thermite (PerformAction, Render, Spec, _render, 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 E e = (dom :: DOM, ajax :: AJAX, console :: CONSOLE | e)
...@@ -53,7 +45,7 @@ type AppState = ...@@ -53,7 +45,7 @@ type AppState =
, searchState :: S.State , searchState :: S.State
, userPage :: U.State , userPage :: U.State
, docAnnotationView :: D.State , docAnnotationView :: D.State
, ntreeView :: NT.State , ntreeView :: Tree.State
, tabview :: TV.State , tabview :: TV.State
, search :: String , search :: String
, corpusAnalysis :: CA.State , corpusAnalysis :: CA.State
...@@ -75,7 +67,7 @@ initAppState = ...@@ -75,7 +67,7 @@ initAppState =
, searchState : S.initialState , searchState : S.initialState
, userPage : U.initialState , userPage : U.initialState
, docAnnotationView : D.initialState , docAnnotationView : D.initialState
, ntreeView : NT.exampleTree , ntreeView : Tree.exampleTree
, tabview : TV.initialState , tabview : TV.initialState
, search : "" , search : ""
, corpusAnalysis : CA.initialState , corpusAnalysis : CA.initialState
...@@ -97,7 +89,7 @@ data Action ...@@ -97,7 +89,7 @@ data Action
| SearchA S.Action | SearchA S.Action
| UserPageA U.Action | UserPageA U.Action
| DocAnnotationViewA D.Action | DocAnnotationViewA D.Action
| TreeViewA NT.Action | TreeViewA Tree.Action
| TabViewA TV.Action | TabViewA TV.Action
| GraphExplorerA GE.Action | GraphExplorerA GE.Action
| DashboardA Dsh.Action | DashboardA Dsh.Action
...@@ -123,12 +115,10 @@ performAction (ShowLogin) _ _ = void do ...@@ -123,12 +115,10 @@ performAction (ShowLogin) _ _ = void do
liftEff $ modalShow "loginModal" liftEff $ modalShow "loginModal"
modifyState $ _ {showLogin = true} modifyState $ _ {showLogin = true}
performAction (ShowAddcorpus) _ _ = void do performAction (ShowAddcorpus) _ _ = void do
liftEff $ modalShow "addCorpus" liftEff $ modalShow "addCorpus"
modifyState $ _ {showCorpus = true} modifyState $ _ {showCorpus = true}
performAction Go _ _ = void do performAction Go _ _ = void do
liftEff $ modalShow "addCorpus" liftEff $ modalShow "addCorpus"
modifyState $ _ {showCorpus = true} modifyState $ _ {showCorpus = true}
...@@ -140,7 +130,7 @@ performAction Initialize _ state = void do ...@@ -140,7 +130,7 @@ performAction Initialize _ state = void do
case state.initialized of case state.initialized of
false -> do false -> do
lnodes <- lift $ loadDefaultNode lnodes <- lift $ Tree.loadDefaultNode
case lnodes of case lnodes of
Left err -> do Left err -> do
...@@ -153,19 +143,15 @@ performAction Initialize _ state = void do ...@@ -153,19 +143,15 @@ performAction Initialize _ state = void do
Right docs -> do Right docs -> do
modifyState $ _ { initialized = true modifyState $ _ { initialized = true
, ntreeView = if length d > 0 , ntreeView = if length d > 0
then NT.exampleTree then Tree.exampleTree
--then fnTransform $ unsafePartial $ fromJust $ head d --then fnTransform $ unsafePartial $ fromJust $ head d
else NT.initialState else Tree.initialState
, docViewState = docs , docViewState = docs
} }
_ -> do _ -> do
modifyState id modifyState id
performAction Go _ _ = void do
_ <- lift $ setHash "/addCorpus"
modifyState id
performAction _ _ _ = void do performAction _ _ _ = void do
modifyState id modifyState id
...@@ -179,55 +165,45 @@ _landingAction = prism LandingA \action -> ...@@ -179,55 +165,45 @@ _landingAction = prism LandingA \action ->
LandingA caction -> Right caction LandingA caction -> Right caction
_-> Left action _-> Left action
_loginState :: Lens' AppState LN.State _loginState :: Lens' AppState LN.State
_loginState = lens (\s -> s.loginState) (\s ss -> s{loginState = ss}) _loginState = lens (\s -> s.loginState) (\s ss -> s{loginState = ss})
_loginAction :: Prism' Action LN.Action _loginAction :: Prism' Action LN.Action
_loginAction = prism LoginA \action -> _loginAction = prism LoginA \action ->
case action of case action of
LoginA caction -> Right caction LoginA caction -> Right caction
_-> Left action _-> Left action
_addCorpusState :: Lens' AppState AC.State _addCorpusState :: Lens' AppState AC.State
_addCorpusState = lens (\s -> s.addCorpusState) (\s ss -> s{addCorpusState = ss}) _addCorpusState = lens (\s -> s.addCorpusState) (\s ss -> s{addCorpusState = ss})
_addCorpusAction :: Prism' Action AC.Action _addCorpusAction :: Prism' Action AC.Action
_addCorpusAction = prism AddCorpusA \action -> _addCorpusAction = prism AddCorpusA \action ->
case action of case action of
AddCorpusA caction -> Right caction AddCorpusA caction -> Right caction
_-> Left action _-> Left action
_docViewState :: Lens' AppState DV.State _docViewState :: Lens' AppState DV.State
_docViewState = lens (\s -> s.docViewState) (\s ss -> s{docViewState = ss}) _docViewState = lens (\s -> s.docViewState) (\s ss -> s{docViewState = ss})
_docViewAction :: Prism' Action DV.Action _docViewAction :: Prism' Action DV.Action
_docViewAction = prism DocViewA \action -> _docViewAction = prism DocViewA \action ->
case action of case action of
DocViewA caction -> Right caction DocViewA caction -> Right caction
_-> Left action _-> Left action
_searchState :: Lens' AppState S.State _searchState :: Lens' AppState S.State
_searchState = lens (\s -> s.searchState) (\s ss -> s{searchState = ss}) _searchState = lens (\s -> s.searchState) (\s ss -> s{searchState = ss})
_searchAction :: Prism' Action S.Action _searchAction :: Prism' Action S.Action
_searchAction = prism SearchA \action -> _searchAction = prism SearchA \action ->
case action of case action of
SearchA caction -> Right caction SearchA caction -> Right caction
_-> Left action _-> Left action
_userPageState :: Lens' AppState U.State _userPageState :: Lens' AppState U.State
_userPageState = lens (\s -> s.userPage) (\s ss -> s{userPage = ss}) _userPageState = lens (\s -> s.userPage) (\s ss -> s{userPage = ss})
_userPageAction :: Prism' Action U.Action _userPageAction :: Prism' Action U.Action
_userPageAction = prism UserPageA \action -> _userPageAction = prism UserPageA \action ->
case action of case action of
...@@ -243,29 +219,24 @@ _dashBoardAction = prism DashboardA \action -> ...@@ -243,29 +219,24 @@ _dashBoardAction = prism DashboardA \action ->
_docAnnotationViewState :: Lens' AppState D.State _docAnnotationViewState :: Lens' AppState D.State
_docAnnotationViewState = lens (\s -> s.docAnnotationView) (\s ss -> s{docAnnotationView = ss}) _docAnnotationViewState = lens (\s -> s.docAnnotationView) (\s ss -> s{docAnnotationView = ss})
_docAnnotationViewAction :: Prism' Action D.Action _docAnnotationViewAction :: Prism' Action D.Action
_docAnnotationViewAction = prism DocAnnotationViewA \action -> _docAnnotationViewAction = prism DocAnnotationViewA \action ->
case action of case action of
DocAnnotationViewA caction -> Right caction DocAnnotationViewA caction -> Right caction
_-> Left action _-> Left action
_treeState :: Lens' AppState Tree.State
_treeState :: Lens' AppState NT.State
_treeState = lens (\s -> s.ntreeView) (\s ss -> s {ntreeView = ss}) _treeState = lens (\s -> s.ntreeView) (\s ss -> s {ntreeView = ss})
_treeAction :: Prism' Action Tree.Action
_treeAction :: Prism' Action NT.Action
_treeAction = prism TreeViewA \action -> _treeAction = prism TreeViewA \action ->
case action of case action of
TreeViewA caction -> Right caction TreeViewA caction -> Right caction
_-> Left action _-> Left action
_tabviewState :: Lens' AppState TV.State _tabviewState :: Lens' AppState TV.State
_tabviewState = lens (\s -> s.tabview) (\s ss -> s {tabview = ss}) _tabviewState = lens (\s -> s.tabview) (\s ss -> s {tabview = ss})
_tabviewAction :: Prism' Action TV.Action _tabviewAction :: Prism' Action TV.Action
_tabviewAction = prism TabViewA \action -> _tabviewAction = prism TabViewA \action ->
case action of case action of
...@@ -293,8 +264,6 @@ _graphExplorerAction = prism GraphExplorerA \action -> ...@@ -293,8 +264,6 @@ _graphExplorerAction = prism GraphExplorerA \action ->
GraphExplorerA caction -> Right caction GraphExplorerA caction -> Right caction
_-> Left action _-> Left action
_ngState :: Lens' AppState NG.State _ngState :: Lens' AppState NG.State
_ngState = lens (\s -> s.ngState) (\s ss -> s{ngState = ss}) _ngState = lens (\s -> s.ngState) (\s ss -> s{ngState = ss})
...@@ -304,7 +273,6 @@ _ngAction = prism NgramsA \action -> ...@@ -304,7 +273,6 @@ _ngAction = prism NgramsA \action ->
NgramsA caction -> Right caction NgramsA caction -> Right caction
_-> Left action _-> 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
...@@ -337,7 +305,6 @@ pagesComponent s = ...@@ -337,7 +305,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 =
...@@ -362,7 +329,7 @@ layout0 layout = ...@@ -362,7 +329,7 @@ layout0 layout =
cont = 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 "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 +361,6 @@ layoutSidebar = over _render \render d p s c -> ...@@ -394,7 +361,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 +369,6 @@ divLogo = a [ className "navbar-brand logoSmall" ...@@ -403,7 +369,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 +377,6 @@ divDropdownLeft = divDropdownLeft' (LiNav { title : "About Gargantext" ...@@ -412,7 +377,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 +387,6 @@ divDropdownLeft' mb = ul [className "nav navbar-nav"] ...@@ -423,7 +387,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 +402,6 @@ menuButton (LiNav { title : title' ...@@ -439,7 +402,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 +455,6 @@ menuElements ns = dropDown $ intercalate divider $ map (map liNav) ns ...@@ -493,7 +455,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 +476,6 @@ liNav (LiNav { title : title' ...@@ -515,8 +476,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 +521,6 @@ divDropdownRight d = ...@@ -562,8 +521,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 +547,6 @@ layoutFooter = simpleSpec performAction render ...@@ -590,7 +547,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
......
...@@ -21,7 +21,7 @@ import Data.Maybe (Maybe(..), fromMaybe) ...@@ -21,7 +21,7 @@ import Data.Maybe (Maybe(..), fromMaybe)
import Data.MediaType.Common (applicationJSON) import Data.MediaType.Common (applicationJSON)
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import Landing as L import Landing as L
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 Prelude hiding (div) import Prelude hiding (div)
......
module DocView where module DocView 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, attempt) import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff.Class (liftAff) 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 (Eff)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (CONSOLE, log) import Control.Monad.Eff.Console (CONSOLE, log)
import DOM (DOM) import DOM (DOM)
import DOM.HTML (window) as DOM import DOM.HTML (window) as DOM
...@@ -19,16 +14,21 @@ import DOM.HTML.Types (htmlDocumentToParentNode) as DOM ...@@ -19,16 +14,21 @@ import DOM.HTML.Types (htmlDocumentToParentNode) as DOM
import DOM.HTML.Window (document) as DOM 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.Argonaut
import Data.Array (filter, replicate) import Data.Array (filter, replicate)
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Generic (class Generic, gShow)
import Data.HTTP.Method (Method(..)) import Data.HTTP.Method (Method(..))
import Data.Maybe (fromJust) import Data.Maybe (fromJust)
import Data.MediaType.Common (applicationJSON) import Data.MediaType.Common (applicationJSON)
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import Gargantext.Chart (p'')
import Gargantext.Charts.ECharts
import Gargantext.Dashboard (globalPublis)
import Gargantext.Config.REST (get)
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 (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 as R
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 (a, b, b', br', div, h3, i, input, li, option, select, span, table, tbody, td, text, thead, th, tr, ul, nav)
...@@ -37,8 +37,6 @@ import ReactDOM as RDOM ...@@ -37,8 +37,6 @@ import ReactDOM as RDOM
import Thermite (PerformAction, Render, Spec, cotransform, createReactSpec, defaultPerformAction, modifyState, simpleSpec) 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
......
module Tabview where module Tabview where
import Prelude hiding (div)
import Authorview as AV import Authorview 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 DocView as DV
import Gargantext.Components.Tab as Tab
import Network.HTTP.Affjax (AJAX) import Network.HTTP.Affjax (AJAX)
import Prelude hiding (div)
import React.DOM (a, div, li, text, ul)
import React.DOM.Props (_data, _id, aria, className, href, role)
import Sourceview as SV import Sourceview as SV
import Tab (tabs)
import Tab as Tab
import Termsview as TV import Termsview as TV
import Thermite (Render, Spec, _performAction, _render, defaultPerformAction, defaultRender, focus, focusState, simpleSpec, withState) import Thermite (Spec, focus)
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
......
...@@ -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
......
...@@ -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 Gargantext.Components.GraphExplorer.Types (Cluster(..), Edge(..), GraphData(..), Legend(..), Node(..), getLegendData)
import Gargantext.Utils (getter)
import GraphExplorer.Sigmajs (Color(Color), SigmaEasing, SigmaGraphData(SigmaGraphData), SigmaNode, SigmaSettings, canvas, edgeShape, edgeShapes, forceAtlas2, sStyle, sigma, sigmaEasing, sigmaEdge, sigmaEnableWebGL, sigmaNode, sigmaSettings) import 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 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
......
module Gargantext.Users.API module Gargantext.Users.API where
where
import Gargantext.Users.Types import Prelude
import Gargantext.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
......
...@@ -8,19 +8,19 @@ module Gargantext.Users.Types ...@@ -8,19 +8,19 @@ module Gargantext.Users.Types
) )
where where
import Prelude (($))
import Gargantext.Users.Types.Lens import Gargantext.Users.Types.Lens
import Gargantext.Users.Types.Types import Gargantext.Users.Types.Types
import Gargantext.Users.Types.States import Gargantext.Users.Types.States
import Brevets as B import 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 Projects as PS import Projects as PS
import Tab (tabs) import Gargantext.Components.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
......
...@@ -11,7 +11,7 @@ import Gargantext.Users.Types.Types (User) ...@@ -11,7 +11,7 @@ import Gargantext.Users.Types.Types (User)
import Network.HTTP.Affjax (AJAX) import Network.HTTP.Affjax (AJAX)
import Projects as PS import Projects as PS
import Publications as P import Publications 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)
......
...@@ -6,7 +6,7 @@ import Data.Maybe (Maybe(..)) ...@@ -6,7 +6,7 @@ import Data.Maybe (Maybe(..))
import Gargantext.Users.Types.Types (User) import Gargantext.Users.Types.Types (User)
import Projects as PS import Projects as PS
import Publications as P import Publications as P
import Tab as Tab import Gargantext.Components.Tab as Tab
data Action data Action
= NoOp = NoOp
...@@ -32,4 +32,3 @@ initialState = ...@@ -32,4 +32,3 @@ initialState =
, projects : PS.initialState , projects : PS.initialState
, user: Nothing , user: Nothing
} }
module Gargantext.Users.Types.Types where module Gargantext.Users.Types.Types where
import Prelude
import Data.Argonaut (class DecodeJson, decodeJson, (.?)) import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Generic (class Generic)
import Data.Maybe (Maybe) import Data.Maybe (Maybe)
import Prelude (bind, pure, ($)) import Gargantext.Utils.DecodeMaybe ((.?|))
import DecodeMaybe
newtype User = newtype User =
User { User {
......
module Landing where module Landing 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.Components.Lang.Landing.EnUS as En
import Gargantext.Lang.Landing.FrFR as Fr 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 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 newtype State = State
{ userName :: String { userName :: String
...@@ -43,21 +42,21 @@ performAction :: forall eff props. PerformAction ( console :: CONSOLE ...@@ -43,21 +42,21 @@ performAction :: forall eff props. PerformAction ( console :: CONSOLE
| eff | eff
) State props Action ) State props Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
T.modifyState \state -> state modifyState \state -> state
performAction Documentation _ _ = void do performAction Documentation _ _ = void do
T.modifyState \state -> state modifyState \state -> state
performAction Enter _ _ = void do performAction Enter _ _ = void do
lift $ setHash "/search" lift $ setHash "/search"
T.modifyState \state -> state modifyState \state -> state
performAction Login _ _ = void do performAction Login _ _ = void do
lift $ setHash "/login" lift $ setHash "/login"
T.modifyState \state -> state modifyState \state -> state
performAction SignUp _ _ = void do performAction SignUp _ _ = void do
T.modifyState \state -> state modifyState \state -> state
-- Layout | -- Layout |
......
module PageRouter where module Gargantext.Router where
import Prelude import Prelude
......
module Utils where module Gargantext.Utils where
import Prelude import Prelude
......
module DecodeMaybe where module Gargantext.Utils.DecodeMaybe where
import Prelude import Prelude
......
...@@ -11,9 +11,9 @@ import DOM.HTML.Window (document) as DOM ...@@ -11,9 +11,9 @@ 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.Navigation (dispatchAction, initAppState, layoutSpec)
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment