Commit 96dfcd3e authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Phylo] Hello Phylo sandbox done

parent 80f262ac
Pipeline #1533 canceled with stage
module Gargantext.Components.Nodes.Corpus.Phylo where
import Gargantext.Prelude
( Unit, bind, const, discard, pure, read, show, unit, ($), (<$>), (<>), (==) )
import Data.Array as A
import Data.List as List
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Tuple (Tuple(..), snd)
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect.Aff (launchAff_)
import Effect.Class (liftEffect)
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Components.Nodes.Corpus (fieldsCodeEditor)
import Gargantext.Components.Nodes.Corpus.Chart.Predefined as P
import Gargantext.Components.Nodes.Dashboard.Types as DT
import Gargantext.Components.Nodes.Types (FTField, FTFieldsWithIndex, defaultField)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Sessions (Session, sessionId)
import Gargantext.Types (NodeID)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
here :: R2.Here
here = R2.here "Gargantext.Components.Nodes.Corpus.Phylo"
type Props = ( nodeId :: NodeID, session :: Session )
phyloLayout :: R2.Component Props
phyloLayout = R.createElement phyloLayoutCpt
phyloLayoutCpt :: R.Component Props
phyloLayoutCpt = here.component "phyloLayout" cpt where
cpt { nodeId, session } content = do
pure $ H.h1 {} [ H.text "Hello Phylo" ]
...@@ -26,6 +26,7 @@ import Gargantext.Components.Nodes.Annuaire.User (userLayout) ...@@ -26,6 +26,7 @@ import Gargantext.Components.Nodes.Annuaire.User (userLayout)
import Gargantext.Components.Nodes.Annuaire.User.Contact (contactLayout) import Gargantext.Components.Nodes.Annuaire.User.Contact (contactLayout)
import Gargantext.Components.Nodes.Corpus (corpusLayout) import Gargantext.Components.Nodes.Corpus (corpusLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout) import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
import Gargantext.Components.Nodes.Corpus.Phylo (phyloLayout)
import Gargantext.Components.Nodes.Corpus.Document (documentMainLayout) import Gargantext.Components.Nodes.Corpus.Document (documentMainLayout)
import Gargantext.Components.Nodes.File (fileLayout) import Gargantext.Components.Nodes.File (fileLayout)
import Gargantext.Components.Nodes.Frame (frameLayout) import Gargantext.Components.Nodes.Frame (frameLayout)
...@@ -180,6 +181,7 @@ renderRouteCpt = here.component "renderRoute" cpt where ...@@ -180,6 +181,7 @@ renderRouteCpt = here.component "renderRoute" cpt where
GR.Lists s n -> lists (sessionNodeProps s n) [] GR.Lists s n -> lists (sessionNodeProps s n) []
GR.Login -> login' boxes GR.Login -> login' boxes
GR.PGraphExplorer s g -> graphExplorer (sessionNodeProps s g) [] GR.PGraphExplorer s g -> graphExplorer (sessionNodeProps s g) []
GR.PhyloExplorer s g -> phyloExplorer (sessionNodeProps s g) []
GR.RouteFile s n -> routeFile (sessionNodeProps s n) [] GR.RouteFile s n -> routeFile (sessionNodeProps s n) []
GR.RouteFrameCalc s n -> routeFrame (Record.merge { nodeType: NodeFrameCalc } $ sessionNodeProps s n) [] GR.RouteFrameCalc s n -> routeFrame (Record.merge { nodeType: NodeFrameCalc } $ sessionNodeProps s n) []
GR.RouteFrameCode s n -> routeFrame (Record.merge { nodeType: NodeFrameNotebook } $ sessionNodeProps s n) [] GR.RouteFrameCode s n -> routeFrame (Record.merge { nodeType: NodeFrameNotebook } $ sessionNodeProps s n) []
...@@ -335,6 +337,17 @@ graphExplorerCpt = here.component "graphExplorer" cpt where ...@@ -335,6 +337,17 @@ graphExplorerCpt = here.component "graphExplorer" cpt where
GraphExplorer.explorerLayout { boxes GraphExplorer.explorerLayout { boxes
, graphId: nodeId , graphId: nodeId
, session } [] } sessionProps) [] , session } [] } sessionProps) []
phyloExplorer :: R2.Component SessionNodeProps
phyloExplorer = R.createElement phyloExplorerCpt
phyloExplorerCpt :: R.Component SessionNodeProps
phyloExplorerCpt = here.component "phylo" cpt
where
cpt props@{ boxes, nodeId } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed (Record.merge { content: \session ->
phyloLayout { nodeId, session } [] } sessionProps) []
home :: R2.Component Props home :: R2.Component Props
home = R.createElement homeCpt home = R.createElement homeCpt
......
...@@ -24,6 +24,7 @@ router = oneOf ...@@ -24,6 +24,7 @@ router = oneOf
<*> (lit "document" *> int) <*> (lit "document" *> int)
, Dashboard <$> (route "dashboard" *> sid) <*> int , Dashboard <$> (route "dashboard" *> sid) <*> int
, PGraphExplorer <$> (route "graph" *> sid) <*> int , PGraphExplorer <$> (route "graph" *> sid) <*> int
, PhyloExplorer <$> (route "phylo" *> sid) <*> int
, Texts <$> (route "texts" *> sid) <*> int , Texts <$> (route "texts" *> sid) <*> int
, Lists <$> (route "lists" *> sid) <*> int , Lists <$> (route "lists" *> sid) <*> int
, ContactPage <$> (route "annuaire" *> sid) <*> int , ContactPage <$> (route "annuaire" *> sid) <*> int
......
...@@ -24,6 +24,7 @@ data AppRoute ...@@ -24,6 +24,7 @@ data AppRoute
| Lists SessionId Int | Lists SessionId Int
| Login | Login
| PGraphExplorer SessionId Int | PGraphExplorer SessionId Int
| PhyloExplorer SessionId Int
| RouteFile SessionId Int | RouteFile SessionId Int
| RouteFrameCalc SessionId Int | RouteFrameCalc SessionId Int
| RouteFrameCode SessionId Int | RouteFrameCode SessionId Int
...@@ -70,6 +71,7 @@ instance showAppRoute :: Show AppRoute where ...@@ -70,6 +71,7 @@ instance showAppRoute :: Show AppRoute where
show (Document _ s i) = "Document" <> show i <> " (" <> show s <> ")" show (Document _ s i) = "Document" <> show i <> " (" <> show s <> ")"
show (CorpusDocument s _ _ i) = "CorpusDocument" <> show i <> " (" <> show s <> ")" show (CorpusDocument s _ _ i) = "CorpusDocument" <> show i <> " (" <> show s <> ")"
show (PGraphExplorer s i) = "graphExplorer" <> show i <> " (" <> show s <> ")" show (PGraphExplorer s i) = "graphExplorer" <> show i <> " (" <> show s <> ")"
show (PhyloExplorer s i) = "phyloExplorer" <> show i <> " (" <> show s <> ")"
show (Dashboard s i) = "Dashboard" <> show i <> " (" <> show s <> ")" show (Dashboard s i) = "Dashboard" <> show i <> " (" <> show s <> ")"
show (Texts s i) = "texts" <> show i <> " (" <> show s <> ")" show (Texts s i) = "texts" <> show i <> " (" <> show s <> ")"
show (Lists s i) = "lists" <> show i <> " (" <> show s <> ")" show (Lists s i) = "lists" <> show i <> " (" <> show s <> ")"
...@@ -95,6 +97,7 @@ appPath (Corpus s i) = "corpus/" <> show s <> "/" <> show i ...@@ -95,6 +97,7 @@ appPath (Corpus s i) = "corpus/" <> show s <> "/" <> show i
appPath (Document s l i) = "list/" <> show s <> "/" <> show l <> "/document/" <> show i appPath (Document s l i) = "list/" <> show s <> "/" <> show l <> "/document/" <> show i
appPath (Dashboard s i) = "dashboard/" <> show s <> "/" <> show i appPath (Dashboard s i) = "dashboard/" <> show s <> "/" <> show i
appPath (PGraphExplorer s i) = "graph/" <> show s <> "/" <> show i appPath (PGraphExplorer s i) = "graph/" <> show s <> "/" <> show i
appPath (PhyloExplorer s i) = "phylo/" <> show s <> "/" <> show i
appPath (Texts s i) = "texts/" <> show s <> "/" <> show i appPath (Texts s i) = "texts/" <> show s <> "/" <> show i
appPath (Lists s i) = "lists/" <> show s <> "/" <> show i appPath (Lists s i) = "lists/" <> show s <> "/" <> show i
appPath (Annuaire s i) = "annuaire/" <> show s <> "/" <> show i appPath (Annuaire s i) = "annuaire/" <> show s <> "/" <> show i
...@@ -114,6 +117,7 @@ nodeTypeAppRoute GT.FolderPrivate s i = Just $ FolderPrivate s i ...@@ -114,6 +117,7 @@ nodeTypeAppRoute GT.FolderPrivate s i = Just $ FolderPrivate s i
nodeTypeAppRoute GT.FolderPublic s i = Just $ FolderPublic s i nodeTypeAppRoute GT.FolderPublic s i = Just $ FolderPublic s i
nodeTypeAppRoute GT.FolderShared s i = Just $ FolderShared s i nodeTypeAppRoute GT.FolderShared s i = Just $ FolderShared s i
nodeTypeAppRoute GT.Graph s i = Just $ PGraphExplorer s i nodeTypeAppRoute GT.Graph s i = Just $ PGraphExplorer s i
nodeTypeAppRoute GT.Phylo s i = Just $ PhyloExplorer s i
nodeTypeAppRoute GT.NodeContact s i = Just $ Annuaire s i nodeTypeAppRoute GT.NodeContact s i = Just $ Annuaire s i
nodeTypeAppRoute GT.NodeFile s i = Just $ RouteFile s i nodeTypeAppRoute GT.NodeFile s i = Just $ RouteFile s i
nodeTypeAppRoute GT.NodeList s i = Just $ Lists s i nodeTypeAppRoute GT.NodeList s i = Just $ Lists s i
......
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