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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
purescript-gargantext
Commits
3e01bbde
Commit
3e01bbde
authored
Apr 28, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[forest] node action rewrite to toestand
Also, make components for the panelAction case expression.
parent
4928fe08
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
363 additions
and
232 deletions
+363
-232
Forest.purs
src/Gargantext/Components/Forest.purs
+0
-1
Add.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
+44
-39
Contact.purs
...argantext/Components/Forest/Tree/Node/Action/Contact.purs
+28
-13
Delete.purs
...Gargantext/Components/Forest/Tree/Node/Action/Delete.purs
+47
-24
Documentation.purs
...ext/Components/Forest/Tree/Node/Action/Documentation.purs
+27
-15
Download.purs
...rgantext/Components/Forest/Tree/Node/Action/Download.purs
+53
-16
Link.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Link.purs
+0
-1
Merge.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
+0
-2
Move.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Move.purs
+0
-2
Search.purs
...Gargantext/Components/Forest/Tree/Node/Action/Search.purs
+0
-1
Share.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
+33
-18
Update.purs
...Gargantext/Components/Forest/Tree/Node/Action/Update.purs
+81
-49
Upload.purs
...Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
+19
-8
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+9
-20
Router.purs
src/Gargantext/Components/Router.purs
+22
-23
No files found.
src/Gargantext/Components/Forest.purs
View file @
3e01bbde
...
@@ -76,7 +76,6 @@ forestCpt = here.component "forest" cpt where
...
@@ -76,7 +76,6 @@ forestCpt = here.component "forest" cpt where
-- R.useEffect' $ do
-- R.useEffect' $ do
-- T.write_ (Just tasks') tasks
-- T.write_ (Just tasks') tasks
handed' <- T.useLive T.unequal handed
handed' <- T.useLive T.unequal handed
reloadForest' <- T.useLive T.unequal reloadForest
sessions' <- T.useLive T.unequal sessions
sessions' <- T.useLive T.unequal sessions
-- forestOpen' <- T.useLive T.unequal forestOpen
-- forestOpen' <- T.useLive T.unequal forestOpen
-- reloadRoot' <- T.useLive T.unequal reloadRoot
-- reloadRoot' <- T.useLive T.unequal reloadRoot
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
View file @
3e01bbde
...
@@ -7,6 +7,7 @@ import Data.Tuple.Nested ((/\))
...
@@ -7,6 +7,7 @@ import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff, launchAff_)
import Effect.Aff (Aff, launchAff_)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Prelude
import Gargantext.Prelude
...
@@ -59,45 +60,49 @@ type CreateNodeProps =
...
@@ -59,45 +60,49 @@ type CreateNodeProps =
, nodeTypes :: Array NodeType
, nodeTypes :: Array NodeType
)
)
addNodeView :: Record CreateNodeProps
addNodeView :: R2.Component CreateNodeProps
-> R.Element
addNodeView = R.createElement addNodeViewCpt
addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
addNodeViewCpt :: R.Component CreateNodeProps
where
addNodeViewCpt = here.component "addNodeView" cpt where
el = here.component "addNodeView" cpt
cpt { dispatch
cpt {id, name} _ = do
, id
nodeName@(name' /\ setNodeName) <- R.useState' "Name"
, name
nodeType'@(nt /\ setNodeType) <- R.useState' $ fromMaybe Folder $ head nodeTypes
, nodeTypes } _ = do
nodeName <- T.useBox "Name"
let
nodeName' <- T.useLive T.unequal nodeName
SettingsBox {edit} = settingsBox nt
nodeType <- T.useBox $ fromMaybe Folder $ head nodeTypes
setNodeType' nt = do
nodeType' <- T.useLive T.unequal nodeType
setNodeName $ const $ GT.prettyNodeType nt
setNodeType $ const nt
let
(maybeChoose /\ nt') = if length nodeTypes > 1
SettingsBox {edit} = settingsBox nodeType'
then ([ formChoiceSafe nodeTypes Error setNodeType' ] /\ nt)
setNodeType' nt = do
else ([H.div {} [H.text $ "Creating a node of type "
T.write_ (GT.prettyNodeType nt) nodeName
<> show defaultNt
T.write_ nt nodeType
<> " with name:"
(maybeChoose /\ nt') = if length nodeTypes > 1
]
then ([ formChoiceSafe nodeTypes Error setNodeType' ] /\ nodeType')
] /\ defaultNt
else ([H.div {} [H.text $ "Creating a node of type "
)
<> show defaultNt
where
<> " with name:"
defaultNt = (fromMaybe Error $ head nodeTypes)
]
maybeEdit = [ if edit
] /\ defaultNt
then inputWithEnter {
)
onBlur: \val -> setNodeName $ const val
where
, onEnter: \_ -> launchAff_ $ dispatch (AddNode name' nt')
defaultNt = (fromMaybe Error $ head nodeTypes)
, onValueChanged: \val -> setNodeName $ const val
maybeEdit = [ if edit
, autoFocus: true
then inputWithEnter {
, className: "form-control"
onBlur: \val -> T.write_ val nodeName
, defaultValue: name' -- (prettyNodeType nt')
, onEnter: \_ -> launchAff_ $ dispatch (AddNode nodeName' nt')
, placeholder: name' -- (prettyNodeType nt')
, onValueChanged: \val -> T.write_ val nodeName
, type: "text"
, autoFocus: true
}
, className: "form-control"
else H.div {} []
, defaultValue: nodeName' -- (prettyNodeType nt')
]
, placeholder: nodeName' -- (prettyNodeType nt')
, type: "text"
pure $ panel (maybeChoose <> maybeEdit) (submitButton (AddNode name' nt') dispatch)
}
else H.div {} []
]
pure $ panel (maybeChoose <> maybeEdit) (submitButton (AddNode nodeName' nt') dispatch)
-- END Create Node
-- END Create Node
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Contact.purs
View file @
3e01bbde
module Gargantext.Components.Forest.Tree.Node.Action.Contact where
module Gargantext.Components.Forest.Tree.Node.Action.Contact where
import Prelude
import Prelude
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Effect.Aff (Aff, launchAff)
import Effect.Aff (Aff, launchAff)
import Formula as F
import Formula as F
import Reactix as R
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Components.Forest.Tree.Node.Action (Action)
import Gargantext.Components.Forest.Tree.Node.Action.Contact.Types (AddContactParams(..))
import Gargantext.Components.Forest.Tree.Node.Action.Contact.Types (AddContactParams(..))
-- import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn)
import Gargantext.Routes as GR
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, post)
import Gargantext.Sessions (Session, post)
import Gargantext.Types (ID)
import Gargantext.Types (ID)
import Gargantext.Types as GT
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Contact"
here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Contact"
...
@@ -24,20 +23,36 @@ contactReq :: Session -> ID -> AddContactParams -> Aff ID
...
@@ -24,20 +23,36 @@ contactReq :: Session -> ID -> AddContactParams -> Aff ID
contactReq session nodeId =
contactReq session nodeId =
post session $ GR.NodeAPI GT.Annuaire (Just nodeId) "contact"
post session $ GR.NodeAPI GT.Annuaire (Just nodeId) "contact"
type ActionAddContact =
( dispatch :: Action -> Aff Unit
, id :: ID )
actionAddContact :: R2.Component ActionAddContact
actionAddContact = R.createElement actionAddContactCpt
actionAddContactCpt :: R.Component ActionAddContact
actionAddContactCpt = here.component "actionAddContact" cpt where
cpt { dispatch, id } _ = do
isOpen <- T.useBox true
pure $ textInputBox
{ boxAction: \p -> AddContact p
, boxName:"addContact"
, dispatch
, id
, isOpen
, params: {firstname:"First Name", lastname: "Last Name"} }
type TextInputBoxProps =
type TextInputBoxProps =
( id :: ID
( boxAction :: AddContactParams -> Action
, boxName :: String
, dispatch :: Action -> Aff Unit
, dispatch :: Action -> Aff Unit
,
params :: Record AddContactProps
,
id :: ID
, isOpen :: T.Box Boolean
, isOpen :: T.Box Boolean
, boxName :: String
, params :: Record AddContactProps )
, boxAction :: AddContactParams -> Action
)
type AddContactProps = ( firstname :: String, lastname :: String)
type AddContactProps = ( firstname :: String, lastname :: String
)
textInputBox :: R2.Leaf TextInputBoxProps
textInputBox :: R2.Leaf TextInputBoxProps
textInputBox props = R.createElement textInputBoxCpt props []
textInputBox props = R.createElement textInputBoxCpt props []
textInputBoxCpt :: R.Component TextInputBoxProps
textInputBoxCpt :: R.Component TextInputBoxProps
textInputBoxCpt = here.component "textInputBox" cpt where
textInputBoxCpt = here.component "textInputBox" cpt where
cpt p@{ boxName, boxAction, dispatch, isOpen
cpt p@{ boxName, boxAction, dispatch, isOpen
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Delete.purs
View file @
3e01bbde
...
@@ -2,18 +2,25 @@ module Gargantext.Components.Forest.Tree.Node.Action.Delete
...
@@ -2,18 +2,25 @@ module Gargantext.Components.Forest.Tree.Node.Action.Delete
where
where
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Gargantext.Prelude
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Gargantext.Types as GT
import Gargantext.Sessions (Session, delete, put_)
import Gargantext.Routes (SessionRoute(..))
import Gargantext.Types (NodeType(..))
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Reactix as R
import Reactix as R
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel)
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel)
import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, delete, put_)
import Gargantext.Types as GT
import Gargantext.Types (NodeType(..))
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Delete"
-- TODO Delete with asyncTaskWithType
-- TODO Delete with asyncTaskWithType
deleteNode :: Session -> NodeType -> GT.ID -> Aff GT.ID
deleteNode :: Session -> NodeType -> GT.ID -> Aff GT.ID
deleteNode session nt nodeId = delete session $ NodeAPI GT.Node (Just nodeId) ""
deleteNode session nt nodeId = delete session $ NodeAPI GT.Node (Just nodeId) ""
...
@@ -30,21 +37,37 @@ unpublishNode s p n = put_ s $ NodeAPI GT.Node p ("unpublish/" <> show n)
...
@@ -30,21 +37,37 @@ unpublishNode s p n = put_ s $ NodeAPI GT.Node p ("unpublish/" <> show n)
-- | Action : Delete
-- | Action : Delete
actionDelete :: NodeType -> (Action -> Aff Unit) -> R.Hooks R.Element
type Delete =
actionDelete NodeUser _ = do
( dispatch :: Action -> Aff Unit
pure $ panel [ H.div { style: {margin: "10px"}}
, nodeType :: NodeType )
[ H.text $ "Yes, we are RGPD compliant!"
<> " But you can not delete User Node yet."
actionDelete :: R2.Component Delete
<> " We are still on development."
actionDelete = R.createElement actionDeleteCpt
<> " Thanks for your comprehensin."
actionDeleteCpt :: R.Component Delete
actionDeleteCpt = here.component "actionDelete" cpt where
cpt props@{ nodeType: NodeUser } _ = pure $ actionDeleteUser props []
cpt props _ = pure $ actionDeleteOther props []
actionDeleteUser :: R2.Component Delete
actionDeleteUser = R.createElement actionDeleteUserCpt
actionDeleteUserCpt :: R.Component Delete
actionDeleteUserCpt = here.component "actionDeleteUser" cpt where
cpt _ _ = do
pure $ panel [ H.div { style: {margin: "10px"}}
[ H.text $ "Yes, we are RGPD compliant!"
<> " But you can not delete User Node yet."
<> " We are still on development."
<> " Thanks for your comprehensin."
]
] (H.div {} [])
actionDeleteOther :: R2.Component Delete
actionDeleteOther = R.createElement actionDeleteOtherCpt
actionDeleteOtherCpt :: R.Component Delete
actionDeleteOtherCpt = here.component "actionDeleteOther" cpt where
cpt { dispatch, nodeType } _ = do
pure $ panel (map (\t -> H.p {} [H.text t])
[ "Are your sure you want to delete it ?"
, "If yes, click again below."
]
]
]
) (submitButton (DeleteNode nodeType) dispatch)
(H.div {} [])
actionDelete nt dispatch = do
pure $ panel (map (\t -> H.p {} [H.text t])
[ "Are your sure you want to delete it ?"
, "If yes, click again below."
]
)
(submitButton (DeleteNode nt) dispatch)
src/Gargantext/Components/Forest/Tree/Node/Action/Documentation.purs
View file @
3e01bbde
module Gargantext.Components.Forest.Tree.Node.Action.Documentation where
module Gargantext.Components.Forest.Tree.Node.Action.Documentation where
import Gargantext.Prelude (map, pure, show, ($), (<>))
import Gargantext.Types (NodeType)
import Gargantext.Types as GT
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Gargantext.Prelude (map, pure, show, ($), (<>))
import Gargantext.Components.Forest.Tree.Node.Tools (panel)
import Gargantext.Components.Forest.Tree.Node.Tools (panel)
import Gargantext.Types (NodeType)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Documentation"
-- | Action: Show Documentation
-- | Action: Show Documentation
actionDoc :: NodeType -> R.Hooks R.Element
type ActionDoc =
actionDoc nodeType =
( nodeType :: NodeType )
pure $ panel ( [ infoTitle nodeType ]
<> (map (\info -> H.p {} [H.text info]) $ docOf nodeType)
actionDoc :: R2.Component ActionDoc
)
actionDoc = R.createElement actionDocCpt
( H.div {} [])
actionDocCpt :: R.Component ActionDoc
where
actionDocCpt = here.component "actionDoc" cpt where
infoTitle :: NodeType -> R.Element
cpt { nodeType } _ = do
infoTitle nt = H.div { style: {margin: "10px"}}
pure $ panel ([ infoTitle nodeType ]
[ H.h3 {} [H.text "Documentation about " ]
<> (map (\info -> H.p {} [H.text info]) $ docOf nodeType)
, H.h3 {className: GT.fldr nt true} [ H.text $ show nt ]
)
]
(H.div {} [])
where
infoTitle :: NodeType -> R.Element
infoTitle nt = H.div { style: {margin: "10px"}}
[ H.h3 {} [H.text "Documentation about " ]
, H.h3 {className: GT.fldr nt true} [ H.text $ show nt ]
]
-- | TODO add documentation of all NodeType
-- | TODO add documentation of all NodeType
docOf :: NodeType -> Array String
docOf :: NodeType -> Array String
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Download.purs
View file @
3e01bbde
module Gargantext.Components.Forest.Tree.Node.Action.Download where
module Gargantext.Components.Forest.Tree.Node.Action.Download where
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Forest.Tree.Node.Action (Action(DownloadNode))
import Gargantext.Components.Forest.Tree.Node.Action (Action(DownloadNode))
import Gargantext.Components.Forest.Tree.Node.Tools (fragmentPT, panel, submitButtonHref)
import Gargantext.Components.Forest.Tree.Node.Tools (fragmentPT, panel, submitButtonHref)
import Gargantext.Ends (url)
import Gargantext.Ends (url)
import Gargantext.Prelude (pure, ($))
import Gargantext.Prelude (pure, ($))
import Gargantext.Routes as Routes
import Gargantext.Routes as Routes
import Gargantext.Sessions (Session)
import Gargantext.Sessions (Session)
import Gargantext.Types (
NodeType(..),
ID)
import Gargantext.Types (ID)
import Gargantext.Types as GT
import Gargantext.Types as GT
import Reactix as R
import Gargantext.Utils.Reactix as R2
import Reactix.DOM.HTML as H
here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Documentation"
-- | Action : Download
-- | Action : Download
actionDownload :: NodeType -> ID -> Session -> R.Hooks R.Element
type ActionDownload =
actionDownload NodeList id session = pure $ panel [H.div {} [H.text info]]
( id :: ID
(submitButtonHref DownloadNode href)
, nodeType :: GT.NodeType
, session :: Session )
actionDownload :: R2.Component ActionDownload
actionDownload = R.createElement actionDownloadCpt
actionDownloadCpt :: R.Component ActionDownload
actionDownloadCpt = here.component "actionDownload" cpt where
cpt props@{ nodeType: GT.Corpus } _ = pure $ actionDownloadCorpus props []
cpt props@{ nodeType: GT.Graph } _ = pure $ actionDownloadGraph props []
cpt props@{ nodeType: GT.NodeList } _ = pure $ actionDownloadNodeList props []
cpt props@{ nodeType: _ } _ = pure $ actionDownloadOther props []
actionDownloadCorpus :: R2.Component ActionDownload
actionDownloadCorpus = R.createElement actionDownloadCorpusCpt
actionDownloadCorpusCpt :: R.Component ActionDownload
actionDownloadCorpusCpt = here.component "actionDownloadCorpus" cpt where
cpt { id, session } _ = do
pure $ panel [H.div {} [H.text info]]
(submitButtonHref DownloadNode href)
where
where
href = url session $ Routes.NodeAPI GT.
NodeList (Just id) "
"
href = url session $ Routes.NodeAPI GT.
Corpus (Just id) "export
"
info = "
Info about the List as JSON format
"
info = "
Download as JSON
"
actionDownload GT.Graph id session = pure $ panel [H.div {} [H.text info]]
actionDownloadGraph :: R2.Component ActionDownload
(submitButtonHref DownloadNode href)
actionDownloadGraph = R.createElement actionDownloadGraphCpt
actionDownloadGraphCpt :: R.Component ActionDownload
actionDownloadGraphCpt = here.component "actionDownloadGraph" cpt where
cpt { id, session } _ = do
pure $ panel [H.div {} [H.text info]]
(submitButtonHref DownloadNode href)
where
where
href = url session $ Routes.NodeAPI GT.Graph (Just id) "gexf"
href = url session $ Routes.NodeAPI GT.Graph (Just id) "gexf"
info = "Info about the Graph as GEXF format"
info = "Info about the Graph as GEXF format"
actionDownload GT.Corpus id session = pure $ panel [H.div {} [H.text info]]
actionDownloadNodeList :: R2.Component ActionDownload
(submitButtonHref DownloadNode href)
actionDownloadNodeList = R.createElement actionDownloadNodeListCpt
actionDownloadNodeListCpt :: R.Component ActionDownload
actionDownloadNodeListCpt = here.component "actionDownloadNodeList" cpt where
cpt { id, session } _ = do
pure $ panel [ H.div {} [H.text info] ]
(submitButtonHref DownloadNode href)
where
where
href = url session $ Routes.NodeAPI GT.
Corpus (Just id) "export
"
href = url session $ Routes.NodeAPI GT.
NodeList (Just id) "
"
info = "
Download as JSON
"
info = "
Info about the List as JSON format
"
{-
{-
-- TODO fix the route
-- TODO fix the route
...
@@ -40,5 +73,9 @@ actionDownload GT.Texts id session = pure $ panel [H.div {} [H.text info]]
...
@@ -40,5 +73,9 @@ actionDownload GT.Texts id session = pure $ panel [H.div {} [H.text info]]
href = url session $ Routes.NodeAPI GT.Texts (Just id) ""
href = url session $ Routes.NodeAPI GT.Texts (Just id) ""
info = "TODO: fix the backend route. What is the expected result ?"
info = "TODO: fix the backend route. What is the expected result ?"
-}
-}
actionDownload _ _ _ = pure $ fragmentPT $ "Soon, you will be able to download your file here "
actionDownloadOther :: R2.Component ActionDownload
actionDownloadOther = R.createElement actionDownloadOtherCpt
actionDownloadOtherCpt :: R.Component ActionDownload
actionDownloadOtherCpt = here.component "actionDownloadOther" cpt where
cpt { id, session } _ = do
pure $ fragmentPT $ "Soon, you will be able to download your file here "
src/Gargantext/Components/Forest/Tree/Node/Action/Link.purs
View file @
3e01bbde
...
@@ -49,7 +49,6 @@ linkNodeType _ = GT.Error
...
@@ -49,7 +49,6 @@ linkNodeType _ = GT.Error
linkNode :: R2.Component SubTreeParamsIn
linkNode :: R2.Component SubTreeParamsIn
linkNode = R.createElement linkNodeCpt
linkNode = R.createElement linkNodeCpt
linkNodeCpt :: R.Component SubTreeParamsIn
linkNodeCpt :: R.Component SubTreeParamsIn
linkNodeCpt = here.component "linkNode" cpt
linkNodeCpt = here.component "linkNode" cpt
where
where
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
View file @
3e01bbde
...
@@ -2,7 +2,6 @@ module Gargantext.Components.Forest.Tree.Node.Action.Merge where
...
@@ -2,7 +2,6 @@ module Gargantext.Components.Forest.Tree.Node.Action.Merge where
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Set as Set
import Data.Set as Set
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
...
@@ -26,7 +25,6 @@ mergeNodeReq session fromId toId =
...
@@ -26,7 +25,6 @@ mergeNodeReq session fromId toId =
mergeNode :: R2.Component SubTreeParamsIn
mergeNode :: R2.Component SubTreeParamsIn
mergeNode = R.createElement mergeNodeCpt
mergeNode = R.createElement mergeNodeCpt
mergeNodeCpt :: R.Component SubTreeParamsIn
mergeNodeCpt :: R.Component SubTreeParamsIn
mergeNodeCpt = here.component "mergeNode" cpt
mergeNodeCpt = here.component "mergeNode" cpt
where
where
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Move.purs
View file @
3e01bbde
module Gargantext.Components.Forest.Tree.Node.Action.Move where
module Gargantext.Components.Forest.Tree.Node.Action.Move where
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
...
@@ -26,7 +25,6 @@ moveNodeReq session fromId toId =
...
@@ -26,7 +25,6 @@ moveNodeReq session fromId toId =
moveNode :: R2.Component SubTreeParamsIn
moveNode :: R2.Component SubTreeParamsIn
moveNode = R.createElement moveNodeCpt
moveNode = R.createElement moveNodeCpt
moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = here.component "moveNode" cpt
moveNodeCpt = here.component "moveNode" cpt
where
where
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search.purs
View file @
3e01bbde
...
@@ -32,7 +32,6 @@ type Props =
...
@@ -32,7 +32,6 @@ type Props =
-- | Action : Search
-- | Action : Search
actionSearch :: R2.Component Props
actionSearch :: R2.Component Props
actionSearch = R.createElement actionSearchCpt
actionSearch = R.createElement actionSearchCpt
actionSearchCpt :: R.Component Props
actionSearchCpt :: R.Component Props
actionSearchCpt = here.component "actionSearch" cpt
actionSearchCpt = here.component "actionSearch" cpt
where
where
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
View file @
3e01bbde
...
@@ -4,7 +4,6 @@ import Data.Argonaut as Argonaut
...
@@ -4,7 +4,6 @@ import Data.Argonaut as Argonaut
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Prelude (($))
import Prelude (($))
import Reactix as R
import Reactix as R
...
@@ -15,7 +14,7 @@ import Gargantext.Components.Forest.Tree.Node.Action (Action)
...
@@ -15,7 +14,7 @@ import Gargantext.Components.Forest.Tree.Node.Action (Action)
import Gargantext.Components.Forest.Tree.Node.Action as Action
import Gargantext.Components.Forest.Tree.Node.Action as Action
import Gargantext.Components.Forest.Tree.Node.Tools as Tools
import Gargantext.Components.Forest.Tree.Node.Tools as Tools
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn)
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn)
import Gargantext.Prelude (class Eq, class Show, bind, pure)
import Gargantext.Prelude (class Eq, class Show, bind, pure
, Unit
)
import Gargantext.Routes as GR
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, post)
import Gargantext.Sessions (Session, post)
import Gargantext.Types (ID)
import Gargantext.Types (ID)
...
@@ -34,9 +33,6 @@ shareReq session nodeId =
...
@@ -34,9 +33,6 @@ shareReq session nodeId =
shareAction :: String -> Action
shareAction :: String -> Action
shareAction username = Action.ShareTeam username
shareAction username = Action.ShareTeam username
------------------------------------------------------------------------
textInputBox :: Record Tools.TextInputBoxProps -> R.Element
textInputBox p = Tools.textInputBox p []
------------------------------------------------------------------------
------------------------------------------------------------------------
data ShareNodeParams = ShareTeamParams { username :: String }
data ShareNodeParams = ShareTeamParams { username :: String }
...
@@ -57,11 +53,30 @@ instance encodeJsonShareNodeParams :: Argonaut.EncodeJson ShareNodeParams where
...
@@ -57,11 +53,30 @@ instance encodeJsonShareNodeParams :: Argonaut.EncodeJson ShareNodeParams where
------------------------------------------------------------------------
------------------------------------------------------------------------
shareNode :: Record SubTreeParamsIn -> R.Element
type ShareNode =
shareNode p = R.createElement shareNodeCpt p []
( id :: ID
, dispatch :: Action -> Aff Unit )
shareNodeCpt :: R.Component SubTreeParamsIn
shareNode :: R2.Component ShareNode
shareNode = R.createElement shareNodeCpt
shareNodeCpt :: R.Component ShareNode
shareNodeCpt = here.component "shareNode" cpt
shareNodeCpt = here.component "shareNode" cpt
where
cpt { dispatch, id } _ = do
isOpen <- T.useBox true
pure $ Tools.panel
[ Tools.textInputBox { boxAction: shareAction
, boxName: "Share"
, dispatch
, id
, isOpen
, text: "username" } []
] (H.div {} [])
------------------------------------------------------------------------
publishNode :: R2.Component SubTreeParamsIn
publishNode = R.createElement publishNodeCpt
publishNodeCpt :: R.Component SubTreeParamsIn
publishNodeCpt = here.component "publishNode" cpt
where
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action <- T.useBox (Action.SharePublic { params: Nothing })
action <- T.useBox (Action.SharePublic { params: Nothing })
...
@@ -73,13 +88,13 @@ shareNodeCpt = here.component "shareNode" cpt
...
@@ -73,13 +88,13 @@ shareNodeCpt = here.component "shareNode" cpt
Nothing -> H.div {} []
Nothing -> H.div {} []
_ -> H.div {} []
_ -> H.div {} []
pure $ Tools.panel
[ subTreeView { action
pure $ Tools.panel
, dispatch
[ subTreeView { action
, handed
, dispatch
, i
d
, hande
d
, nodeType
, id
, session
, nodeType
, subTreeParams
, session
} []
, subTreeParams
] button
} []
] button
src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs
View file @
3e01bbde
module Gargantext.Components.Forest.Tree.Node.Action.Update where
module Gargantext.Components.Forest.Tree.Node.Action.Update where
import Data.Tuple.Nested ((/\))
import Gargantext.Components.Forest.Tree.Node.Action.Update.Types
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Prelude
import Gargantext.Prelude
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Action.Update.Types
import Gargantext.Components.Forest.Tree.Node.Tools (formChoiceSafe, submitButton, panel)
import Gargantext.Components.Forest.Tree.Node.Tools (formChoiceSafe, submitButton, panel)
import Gargantext.Types (NodeType(..), ID)
import Gargantext.Types as GT
import Gargantext.Sessions (Session, post)
import Gargantext.Routes as GR
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, post)
import Gargantext.Types (NodeType(..), ID)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Update"
updateRequest :: UpdateNodeParams -> Session -> ID -> Aff GT.AsyncTaskWithType
updateRequest :: UpdateNodeParams -> Session -> ID -> Aff GT.AsyncTaskWithType
updateRequest updateNodeParams session nodeId = do
updateRequest updateNodeParams session nodeId = do
...
@@ -25,49 +29,77 @@ updateRequest updateNodeParams session nodeId = do
...
@@ -25,49 +29,77 @@ updateRequest updateNodeParams session nodeId = do
p = GR.NodeAPI GT.Node (Just nodeId) "update"
p = GR.NodeAPI GT.Node (Just nodeId) "update"
----------------------------------------------------------------------
----------------------------------------------------------------------
update :: NodeType
type UpdateProps =
-> (Action -> Aff Unit)
( dispatch :: Action -> Aff Unit
-> R.Hooks R.Element
, nodeType :: NodeType )
update NodeList dispatch = do
meth @( methodList /\ setMethod ) <- R.useState' Basic
update :: R2.Component UpdateProps
update = R.createElement updateCpt
let setMethod' = setMethod <<< const
updateCpt :: R.Component UpdateProps
updateCpt = here.component "update" cpt where
pure $ panel [ -- H.text "Update with"
cpt props@{ dispatch, nodeType: Dashboard } _ = pure $ updateDashboard props []
formChoiceSafe [Basic, Advanced, WithModel] Basic setMethod'
cpt props@{ dispatch, nodeType: Graph } _ = pure $ updateGraph props []
]
cpt props@{ dispatch, nodeType: NodeList } _ = pure $ updateNodeList props []
(submitButton (UpdateNode $ UpdateNodeParamsList {methodList}) dispatch)
cpt props@{ dispatch, nodeType: Texts } _ = pure $ updateTexts props []
cpt props@{ dispatch, nodeType: _ } _ = pure $ updateOther props []
update Graph dispatch = do
meth @( methodGraph /\ setMethod ) <- R.useState' Order1
updateDashboard :: R2.Component UpdateProps
updateDashboard = R.createElement updateDashboardCpt
let setMethod' = setMethod <<< const
updateDashboardCpt :: R.Component UpdateProps
updateDashboardCpt = here.component "updateDashboard" cpt where
pure $ panel [ -- H.text "Update with"
cpt { dispatch } _ = do
formChoiceSafe [Order1, Order2] Order1 setMethod'
methodBoard <- T.useBox All
]
methodBoard' <- T.useLive T.unequal methodBoard
(submitButton (UpdateNode $ UpdateNodeParamsGraph {methodGraph}) dispatch)
pure $ panel [ -- H.text "Update with"
update Texts dispatch = do
formChoiceSafe [All, Sources, Authors, Institutes, Ngrams] All (\val -> T.write_ val methodBoard)
meth @( methodTexts /\ setMethod ) <- R.useState' NewNgrams
]
(submitButton (UpdateNode $ UpdateNodeParamsBoard { methodBoard: methodBoard' }) dispatch)
let setMethod' = setMethod <<< const
updateGraph :: R2.Component UpdateProps
pure $ panel [ -- H.text "Update with"
updateGraph = R.createElement updateGraphCpt
formChoiceSafe [NewNgrams, NewTexts, Both] NewNgrams setMethod'
updateGraphCpt :: R.Component UpdateProps
]
updateGraphCpt = here.component "updateGraph" cpt where
(submitButton (UpdateNode $ UpdateNodeParamsTexts {methodTexts}) dispatch)
cpt { dispatch } _ = do
methodGraph <- T.useBox Order1
update Dashboard dispatch = do
methodGraph' <- T.useLive T.unequal methodGraph
meth @( methodBoard /\ setMethod ) <- R.useState' All
pure $ panel [ -- H.text "Update with"
let setMethod' = setMethod <<< const
formChoiceSafe [Order1, Order2] Order1 (\val -> T.write_ val methodGraph)
]
pure $ panel [ -- H.text "Update with"
(submitButton (UpdateNode $ UpdateNodeParamsGraph { methodGraph: methodGraph' }) dispatch)
formChoiceSafe [All, Sources, Authors, Institutes, Ngrams] All setMethod'
]
updateNodeList :: R2.Component UpdateProps
(submitButton (UpdateNode $ UpdateNodeParamsBoard {methodBoard}) dispatch)
updateNodeList = R.createElement updateNodeListCpt
updateNodeListCpt :: R.Component UpdateProps
update _ _ = pure $ H.div {} []
updateNodeListCpt = here.component "updateNodeList" cpt where
cpt { dispatch } _ = do
methodList <- T.useBox Basic
methodList' <- T.useLive T.unequal methodList
pure $ panel [ -- H.text "Update with"
formChoiceSafe [Basic, Advanced, WithModel] Basic (\val -> T.write_ val methodList)
]
(submitButton (UpdateNode $ UpdateNodeParamsList { methodList: methodList' }) dispatch)
updateTexts :: R2.Component UpdateProps
updateTexts = R.createElement updateTextsCpt
updateTextsCpt :: R.Component UpdateProps
updateTextsCpt = here.component "updateTexts" cpt where
cpt { dispatch } _ = do
methodTexts <- T.useBox NewNgrams
methodTexts' <- T.useLive T.unequal methodTexts
pure $ panel [ -- H.text "Update with"
formChoiceSafe [NewNgrams, NewTexts, Both] NewNgrams (\val -> T.write_ val methodTexts)
]
(submitButton (UpdateNode $ UpdateNodeParamsTexts { methodTexts: methodTexts' }) dispatch)
updateOther :: R2.Component UpdateProps
updateOther = R.createElement updateOtherCpt
updateOtherCpt :: R.Component UpdateProps
updateOtherCpt = here.component "updateOther" cpt where
cpt { dispatch } _ = do
pure $ H.div {} []
-- fragmentPT $ "Update " <> show nodeType
-- fragmentPT $ "Update " <> show nodeType
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
3e01bbde
...
@@ -40,20 +40,31 @@ here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Upload"
...
@@ -40,20 +40,31 @@ here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Upload"
-- UploadFile Action
-- UploadFile Action
-- | Action : Upload
-- | Action : Upload
actionUpload :: NodeType -> ID -> Session -> (Action -> Aff Unit) -> R.Hooks R.Element
type ActionUpload =
actionUpload NodeList id session dispatch =
( dispatch :: Action -> Aff Unit
pure $ uploadTermListView {dispatch, id, nodeType: GT.NodeList, session}
, id :: ID
, nodeType :: NodeType
actionUpload Corpus id session dispatch =
, session :: Session )
pure $ uploadFileView {dispatch, id, nodeType: Corpus, session}
actionUpload :: R2.Component ActionUpload
actionUpload = R.createElement actionUploadCpt
actionUploadCpt :: R.Component ActionUpload
actionUploadCpt = here.component "actionUpload" cpt where
cpt { nodeType: Corpus, dispatch, id, session } _ = pure $ uploadFileView {dispatch, id, nodeType: GT.Corpus, session}
cpt { nodeType: NodeList, dispatch, id, session } _ = pure $ uploadTermListView {dispatch, id, nodeType: GT.NodeList, session}
cpt props@{ nodeType: _, dispatch, id, session } _ = pure $ actionUploadOther props []
{-
{-
actionUpload Annuaire id session dispatch =
actionUpload Annuaire id session dispatch =
pure $ uploadFileView {dispatch, id, nodeType: Annuaire, session}
pure $ uploadFileView {dispatch, id, nodeType: Annuaire, session}
-}
-}
actionUpload _ _ _ _ =
actionUploadOther :: R2.Component ActionUpload
pure $ fragmentPT $ "Soon, upload for this NodeType."
actionUploadOther = R.createElement actionUploadOtherCpt
actionUploadOtherCpt :: R.Component ActionUpload
actionUploadOtherCpt = here.component "actionUploadOther" cpt where
cpt _ _ = do
pure $ fragmentPT $ "Soon, upload for this NodeType."
-- file upload types
-- file upload types
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
3e01bbde
...
@@ -169,13 +169,13 @@ panelAction p = R.createElement panelActionCpt p []
...
@@ -169,13 +169,13 @@ panelAction p = R.createElement panelActionCpt p []
panelActionCpt :: R.Component PanelActionProps
panelActionCpt :: R.Component PanelActionProps
panelActionCpt = here.component "panelAction" cpt
panelActionCpt = here.component "panelAction" cpt
where
where
cpt {action: Documentation nodeType} _ =
actionDoc nodeType
cpt {action: Documentation nodeType} _ =
pure $ actionDoc { nodeType } []
cpt {action: Download, id, nodeType, session} _ =
actionDownload nodeType id session
cpt {action: Download, id, nodeType, session} _ =
pure $ actionDownload { id, nodeType, session } []
cpt {action: Upload, dispatch, id, nodeType, session} _ =
actionUpload nodeType id session dispatch
cpt {action: Upload, dispatch, id, nodeType, session} _ =
pure $ actionUpload { dispatch, id, nodeType, session } []
cpt {action: Delete, nodeType, dispatch} _ =
actionDelete nodeType dispatch
cpt {action: Delete, nodeType, dispatch} _ =
pure $ actionDelete { dispatch, nodeType } []
cpt {action: Add xs, dispatch, id, name, nodeType} _ =
cpt {action: Add xs, dispatch, id, name, nodeType} _ =
pure $ addNodeView {dispatch, id, name, nodeType, nodeTypes: xs}
pure $ addNodeView {dispatch, id, name, nodeType, nodeTypes: xs}
[]
cpt {action: Refresh , dispatch, id, nodeType, session} _ =
update nodeType dispatch
cpt {action: Refresh , dispatch, id, nodeType, session} _ =
pure $ update { dispatch, nodeType } []
cpt {action: Config , dispatch, id, nodeType, session} _ =
cpt {action: Config , dispatch, id, nodeType, session} _ =
pure $ fragmentPT $ "Config " <> show nodeType
pure $ fragmentPT $ "Config " <> show nodeType
-- Functions using SubTree
-- Functions using SubTree
...
@@ -185,21 +185,10 @@ panelActionCpt = here.component "panelAction" cpt
...
@@ -185,21 +185,10 @@ panelActionCpt = here.component "panelAction" cpt
pure $ moveNode { dispatch, id, nodeType, session, subTreeParams, handed } []
pure $ moveNode { dispatch, id, nodeType, session, subTreeParams, handed } []
cpt {action: Link {subTreeParams}, dispatch, id, nodeType, session, handed} _ =
cpt {action: Link {subTreeParams}, dispatch, id, nodeType, session, handed} _ =
pure $ linkNode {dispatch, id, nodeType, session, subTreeParams, handed} []
pure $ linkNode {dispatch, id, nodeType, session, subTreeParams, handed} []
cpt {action : Share, dispatch, id, name } _ = do
cpt {action : Share, dispatch, id, name } _ = pure $ Share.shareNode { dispatch, id } []
isOpen <- T.useBox true
cpt {action : AddingContact, dispatch, id, name } _ = pure $ Contact.actionAddContact { dispatch, id } []
pure $ panel
[ textInputBox
{ boxAction: Share.shareAction, boxName: "Share"
, dispatch, id, text: "username", isOpen } []
] (H.div {} [])
cpt {action : AddingContact, dispatch, id, name } _ = do
isOpen <- T.useBox true
pure $ Contact.textInputBox
{ id, dispatch, isOpen, boxName:"addContact"
, params : {firstname:"First Name", lastname: "Last Name"}
, boxAction: \p -> AddContact p }
cpt {action : Publish {subTreeParams}, dispatch, id, nodeType, session, handed} _ =
cpt {action : Publish {subTreeParams}, dispatch, id, nodeType, session, handed} _ =
pure $ Share.
shareNode {dispatch, id, nodeType, session, subTreeParams, handed}
pure $ Share.
publishNode { dispatch, handed, id, nodeType, session, subTreeParams } []
cpt props@{action: SearchBox, id, session, dispatch, nodePopup} _ =
cpt props@{action: SearchBox, id, session, dispatch, nodePopup} _ =
pure $ actionSearch { dispatch, id: (Just id), nodePopup, session } []
pure $ actionSearch { dispatch, id: (Just id), nodePopup, session } []
cpt _ _ = pure $ H.div {} []
cpt _ _ = pure $ H.div {} []
src/Gargantext/Components/Router.purs
View file @
3e01bbde
...
@@ -192,8 +192,8 @@ sidePanelCpt = here.component "sidePanel" cpt where
...
@@ -192,8 +192,8 @@ sidePanelCpt = here.component "sidePanel" cpt where
, sidePanelState
, sidePanelState
, sidePanelLists
, sidePanelLists
, sidePanelTexts } } _ = do
, sidePanelTexts } } _ = do
sidePanelState' <- T.useLive T.unequal sidePanelState
session' <- T.useLive T.unequal session
session' <- T.useLive T.unequal session
sidePanelState' <- T.useLive T.unequal sidePanelState
case session' of
case session' of
Nothing -> pure $ H.div {} []
Nothing -> pure $ H.div {} []
...
@@ -209,19 +209,18 @@ openedSidePanelCpt :: R.Component (WithSession Props)
...
@@ -209,19 +209,18 @@ openedSidePanelCpt :: R.Component (WithSession Props)
openedSidePanelCpt = here.component "openedSidePanel" cpt where
openedSidePanelCpt = here.component "openedSidePanel" cpt where
cpt props@{ boxes: boxes@{ graphVersion
cpt props@{ boxes: boxes@{ graphVersion
, reloadForest
, reloadForest
, route
, sidePanelGraph
, sidePanelGraph
, sidePanelState
, sidePanelState
, sidePanelLists
, sidePanelLists
, sidePanelTexts }
, sidePanelTexts }
, session} _ = do
, session} _ = do
route' <- T.useLive T.unequal boxes.route
{ mGraph, mMetaData, removedNodeIds, selectedNodeIds, sideTab } <- GEST.focusedSidePanel sidePanelGraph
{ mGraph, mMetaData, removedNodeIds, selectedNodeIds, sideTab } <- GEST.focusedSidePanel sidePanelGraph
mGraph' <- T.useLive T.unequal mGraph
mGraph' <- T.useLive T.unequal mGraph
mGraphMetaData' <- T.useLive T.unequal mMetaData
mGraphMetaData' <- T.useLive T.unequal mMetaData
route' <- T.useLive T.unequal route
let className = "side-panel"
let wrapper = H.div { className: "side-panel" }
let wrapper = H.div { className }
case route' of
case route' of
GR.Lists s n -> do
GR.Lists s n -> do
...
@@ -258,7 +257,7 @@ annuaire = R.createElement annuaireCpt
...
@@ -258,7 +257,7 @@ annuaire = R.createElement annuaireCpt
annuaireCpt :: R.Component SessionNodeProps
annuaireCpt :: R.Component SessionNodeProps
annuaireCpt = here.component "annuaire" cpt where
annuaireCpt = here.component "annuaire" cpt where
cpt props@{ boxes, nodeId
, sessionId
} _ = do
cpt props@{ boxes, nodeId } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed (Record.merge { content: \session ->
pure $ authed (Record.merge { content: \session ->
annuaireLayout { frontends: defaultFrontends
annuaireLayout { frontends: defaultFrontends
...
@@ -287,11 +286,13 @@ corpusDocument = R.createElement corpusDocumentCpt
...
@@ -287,11 +286,13 @@ corpusDocument = R.createElement corpusDocumentCpt
corpusDocumentCpt :: R.Component CorpusDocumentProps
corpusDocumentCpt :: R.Component CorpusDocumentProps
corpusDocumentCpt = here.component "corpusDocument" cpt
corpusDocumentCpt = here.component "corpusDocument" cpt
where
where
cpt props@{ boxes, corpusId: corpusId', listId, nodeId
, sessionId
} _ = do
cpt props@{ boxes, corpusId: corpusId', listId, nodeId } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed (Record.merge { content: \session ->
pure $ authed (Record.merge { content: \session ->
documentMainLayout { mCorpusId: corpusId, listId: listId, nodeId, session } [] } sessionProps )[]
documentMainLayout { mCorpusId: Just corpusId'
where corpusId = Just corpusId'
, listId: listId
, nodeId
, session } [] } sessionProps )[]
dashboard :: R2.Component SessionNodeProps
dashboard :: R2.Component SessionNodeProps
dashboard = R.createElement dashboardCpt
dashboard = R.createElement dashboardCpt
...
@@ -311,11 +312,13 @@ document = R.createElement documentCpt
...
@@ -311,11 +312,13 @@ document = R.createElement documentCpt
documentCpt :: R.Component DocumentProps
documentCpt :: R.Component DocumentProps
documentCpt = here.component "document" cpt where
documentCpt = here.component "document" cpt where
cpt props@{ boxes, listId, nodeId
, sessionId
} _ = do
cpt props@{ boxes, listId, nodeId } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed (Record.merge { content: \session ->
pure $ authed (Record.merge { content: \session ->
documentMainLayout { listId, nodeId, mCorpusId, session } [] } sessionProps) []
documentMainLayout { listId
where mCorpusId = Nothing
, nodeId
, mCorpusId: Nothing
, session } [] } sessionProps) []
graphExplorer :: R2.Component SessionNodeProps
graphExplorer :: R2.Component SessionNodeProps
graphExplorer = R.createElement graphExplorerCpt
graphExplorer = R.createElement graphExplorerCpt
...
@@ -370,8 +373,7 @@ listsCpt = here.component "lists" cpt where
...
@@ -370,8 +373,7 @@ listsCpt = here.component "lists" cpt where
, sidePanelState
, sidePanelState
, sidePanelLists
, sidePanelLists
, tasks }
, tasks }
, nodeId
, nodeId } _ = do
, sessionId } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed (Record.merge { content: \session ->
pure $ authed (Record.merge { content: \session ->
Lists.listsLayout { nodeId
Lists.listsLayout { nodeId
...
@@ -396,7 +398,7 @@ routeFile = R.createElement routeFileCpt
...
@@ -396,7 +398,7 @@ routeFile = R.createElement routeFileCpt
routeFileCpt :: R.Component SessionNodeProps
routeFileCpt :: R.Component SessionNodeProps
routeFileCpt = here.component "routeFile" cpt where
routeFileCpt = here.component "routeFile" cpt where
cpt props@{ boxes, nodeId
, sessionId
} _ = do
cpt props@{ boxes, nodeId } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed (Record.merge { content: \session ->
pure $ authed (Record.merge { content: \session ->
fileLayout { nodeId, session } } sessionProps) []
fileLayout { nodeId, session } } sessionProps) []
...
@@ -411,7 +413,7 @@ routeFrame = R.createElement routeFrameCpt
...
@@ -411,7 +413,7 @@ routeFrame = R.createElement routeFrameCpt
routeFrameCpt :: R.Component RouteFrameProps
routeFrameCpt :: R.Component RouteFrameProps
routeFrameCpt = here.component "routeFrame" cpt where
routeFrameCpt = here.component "routeFrame" cpt where
cpt props@{ boxes, nodeId, nodeType
, sessionId
} _ = do
cpt props@{ boxes, nodeId, nodeType } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed (Record.merge { content: \session ->
pure $ authed (Record.merge { content: \session ->
frameLayout { nodeId, nodeType, session } } sessionProps) []
frameLayout { nodeId, nodeType, session } } sessionProps) []
...
@@ -421,7 +423,7 @@ team = R.createElement teamCpt
...
@@ -421,7 +423,7 @@ team = R.createElement teamCpt
teamCpt :: R.Component SessionNodeProps
teamCpt :: R.Component SessionNodeProps
teamCpt = here.component "team" cpt where
teamCpt = here.component "team" cpt where
cpt props@{ boxes, nodeId
, sessionId
} _ = do
cpt props@{ boxes, nodeId } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed (Record.merge { content: \session ->
pure $ authed (Record.merge { content: \session ->
corpusLayout { nodeId, session } } sessionProps) []
corpusLayout { nodeId, session } } sessionProps) []
...
@@ -443,8 +445,7 @@ textsCpt = here.component "texts" cpt
...
@@ -443,8 +445,7 @@ textsCpt = here.component "texts" cpt
, sidePanelState
, sidePanelState
, sidePanelTexts
, sidePanelTexts
, tasks }
, tasks }
, nodeId
, nodeId } _ = do
, sessionId } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed (Record.merge { content: \session ->
pure $ authed (Record.merge { content: \session ->
Texts.textsLayout { frontends: defaultFrontends
Texts.textsLayout { frontends: defaultFrontends
...
@@ -463,8 +464,7 @@ userCpt = here.component "user" cpt where
...
@@ -463,8 +464,7 @@ userCpt = here.component "user" cpt where
, sidePanelState
, sidePanelState
, sidePanelTexts
, sidePanelTexts
, tasks }
, tasks }
, nodeId
, nodeId } _ = do
, sessionId } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed (Record.merge { content: \session ->
pure $ authed (Record.merge { content: \session ->
userLayout { frontends: defaultFrontends
userLayout { frontends: defaultFrontends
...
@@ -489,8 +489,7 @@ contactCpt = here.component "contact" cpt where
...
@@ -489,8 +489,7 @@ contactCpt = here.component "contact" cpt where
, sidePanelTexts
, sidePanelTexts
, sidePanelState
, sidePanelState
, tasks }
, tasks }
, nodeId
, nodeId } _ = do
, sessionId } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
let forestedProps = RE.pick props :: Record Props
let forestedProps = RE.pick props :: Record Props
pure $ authed (Record.merge { content: \session ->
pure $ authed (Record.merge { content: \session ->
...
...
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