Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
7f5bce4a
Commit
7f5bce4a
authored
Jun 22, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REFACT] SubTree: org of files/modules
parent
69f83025
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+4
-4
SubTree.purs
...Gargantext/Components/Forest/Tree/Node/Tools/SubTree.purs
+18
-18
No files found.
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
7f5bce4a
...
@@ -8,7 +8,6 @@ import Effect.Aff (Aff)
...
@@ -8,7 +8,6 @@ import Effect.Aff (Aff)
import Effect.Uncurried (mkEffectFn1)
import Effect.Uncurried (mkEffectFn1)
import Gargantext.Components.Forest.Tree.Node.Action (Action)
import Gargantext.Components.Forest.Tree.Node.Action (Action)
import Gargantext.Components.Forest.Tree.Node.Action.Add (NodePopup(..), addNodeView)
import Gargantext.Components.Forest.Tree.Node.Action.Add (NodePopup(..), addNodeView)
import Gargantext.Components.Forest.Tree.Node.Action.CopyFrom (copyFromCorpusView)
import Gargantext.Components.Forest.Tree.Node.Action.Delete (actionDelete)
import Gargantext.Components.Forest.Tree.Node.Action.Delete (actionDelete)
import Gargantext.Components.Forest.Tree.Node.Action.Documentation (actionDoc)
import Gargantext.Components.Forest.Tree.Node.Action.Documentation (actionDoc)
import Gargantext.Components.Forest.Tree.Node.Action.Download (actionDownload)
import Gargantext.Components.Forest.Tree.Node.Action.Download (actionDownload)
...
@@ -21,6 +20,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload (actionUpload)
...
@@ -21,6 +20,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload (actionUpload)
import Gargantext.Components.Forest.Tree.Node.Box.Types (NodePopupProps, NodePopupS)
import Gargantext.Components.Forest.Tree.Node.Box.Types (NodePopupProps, NodePopupS)
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox, SubTreeParams(..))
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox, SubTreeParams(..))
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT)
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT)
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView)
import Gargantext.Prelude (Unit, bind, const, map, pure, show, ($), (<>), (==), (<))
import Gargantext.Prelude (Unit, bind, const, map, pure, show, ($), (<>), (==), (<))
import Gargantext.Sessions (Session)
import Gargantext.Sessions (Session)
import Gargantext.Types (Name, ID)
import Gargantext.Types (Name, ID)
...
@@ -240,13 +240,13 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
...
@@ -240,13 +240,13 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
-----------
-----------
cpt {action: Merge {subTreeParams}, dispatch, id, nodeType, session} _ = do
cpt {action: Merge {subTreeParams}, dispatch, id, nodeType, session} _ = do
pure $
copyFromCorpus
View {dispatch, id, nodeType, session, subTreeParams}
pure $
subTree
View {dispatch, id, nodeType, session, subTreeParams}
cpt {action: Move {subTreeParams}, dispatch, id, nodeType, session} _ = do
cpt {action: Move {subTreeParams}, dispatch, id, nodeType, session} _ = do
pure $
copyFromCorpus
View {dispatch, id, nodeType, session, subTreeParams}
pure $
subTree
View {dispatch, id, nodeType, session, subTreeParams}
cpt {action: Link {subTreeParams}, dispatch, id, nodeType, session} _ = do
cpt {action: Link {subTreeParams}, dispatch, id, nodeType, session} _ = do
pure $
copyFromCorpus
View {dispatch, id, nodeType, session, subTreeParams}
pure $
subTree
View {dispatch, id, nodeType, session, subTreeParams}
-----------
-----------
cpt {action : Share, dispatch, id, name } _ = do
cpt {action : Share, dispatch, id, name } _ = do
...
...
src/Gargantext/Components/Forest/Tree/Node/
Action/CopyFrom
.purs
→
src/Gargantext/Components/Forest/Tree/Node/
Tools/SubTree
.purs
View file @
7f5bce4a
module Gargantext.Components.Forest.Tree.Node.
Action.CopyFrom
where
module Gargantext.Components.Forest.Tree.Node.
Tools.SubTree
where
import DOM.Simple.Console (log2)
import DOM.Simple.Console (log2)
import Data.Array as A
import Data.Array as A
...
@@ -24,11 +24,11 @@ type SubTreeParamsProps =
...
@@ -24,11 +24,11 @@ type SubTreeParamsProps =
| Props
| Props
)
)
copyFromCorpus
View :: Record SubTreeParamsProps -> R.Element
subTree
View :: Record SubTreeParamsProps -> R.Element
copyFromCorpusView props = R.createElement copyFromCorpus
ViewCpt props []
subTreeView props = R.createElement subTree
ViewCpt props []
copyFromCorpus
ViewCpt :: R.Component SubTreeParamsProps
subTree
ViewCpt :: R.Component SubTreeParamsProps
copyFromCorpusViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpus
View" cpt
subTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTree
View" cpt
where
where
cpt params@{ dispatch
cpt params@{ dispatch
, id
, id
...
@@ -41,7 +41,7 @@ copyFromCorpusViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpusView" cpt
...
@@ -41,7 +41,7 @@ copyFromCorpusViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpusView" cpt
useLoader session (loadSubTree showtypes) $
useLoader session (loadSubTree showtypes) $
\tree ->
\tree ->
copyFromCorpus
ViewLoaded { dispatch
subTree
ViewLoaded { dispatch
, id
, id
, nodeType
, nodeType
, session
, session
...
@@ -65,23 +65,23 @@ type CorpusTreeProps =
...
@@ -65,23 +65,23 @@ type CorpusTreeProps =
| SubTreeParamsProps
| SubTreeParamsProps
)
)
copyFromCorpus
ViewLoaded :: Record CorpusTreeProps -> R.Element
subTree
ViewLoaded :: Record CorpusTreeProps -> R.Element
copyFromCorpusViewLoaded props = R.createElement copyFromCorpus
ViewLoadedCpt props []
subTreeViewLoaded props = R.createElement subTree
ViewLoadedCpt props []
copyFromCorpus
ViewLoadedCpt :: R.Component CorpusTreeProps
subTree
ViewLoadedCpt :: R.Component CorpusTreeProps
copyFromCorpusViewLoadedCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpus
ViewLoadedCpt" cpt
subTreeViewLoadedCpt = R.hooksComponent "G.C.F.T.N.A.U.subTree
ViewLoadedCpt" cpt
where
where
cpt p@{dispatch, id, nodeType, session, tree} _ = do
cpt p@{dispatch, id, nodeType, session, tree} _ = do
pure $ H.div { className: "copy-from-corpus" }
pure $ H.div { className: "copy-from-corpus" }
[ H.div { className: "tree" }
[ H.div { className: "tree" }
[
copyFromCorpus
TreeView p]
[
subTree
TreeView p]
]
]
copyFromCorpus
TreeView :: Record CorpusTreeProps -> R.Element
subTree
TreeView :: Record CorpusTreeProps -> R.Element
copyFromCorpusTreeView props = R.createElement copyFromCorpus
TreeViewCpt props []
subTreeTreeView props = R.createElement subTree
TreeViewCpt props []
copyFromCorpus
TreeViewCpt :: R.Component CorpusTreeProps
subTree
TreeViewCpt :: R.Component CorpusTreeProps
copyFromCorpusTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpus
TreeViewCpt" cpt
subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTree
TreeViewCpt" cpt
where
where
cpt p@{id, tree: NTree (LNode { id: sourceId, name, nodeType }) ary, subTreeParams} _ = do
cpt p@{id, tree: NTree (LNode { id: sourceId, name, nodeType }) ary, subTreeParams} _ = do
pure $ {- H.div {} [ H.h5 { className: GT.fldr nodeType true} []
pure $ {- H.div {} [ H.h5 { className: GT.fldr nodeType true} []
...
@@ -97,7 +97,7 @@ copyFromCorpusTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpusTreeVi
...
@@ -97,7 +97,7 @@ copyFromCorpusTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpusTreeVi
SubTreeParams { valitypes } = subTreeParams
SubTreeParams { valitypes } = subTreeParams
children = map (\c ->
copyFromCorpus
TreeView (p { tree = c })) ary
children = map (\c ->
subTree
TreeView (p { tree = c })) ary
validNodeType = (A.elem nodeType valitypes) && (id /= sourceId)
validNodeType = (A.elem nodeType valitypes) && (id /= sourceId)
...
@@ -106,8 +106,8 @@ copyFromCorpusTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpusTreeVi
...
@@ -106,8 +106,8 @@ copyFromCorpusTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpusTreeVi
onClick _ = case validNodeType of
onClick _ = case validNodeType of
false -> pure unit
false -> pure unit
true -> do
true -> do
log2 "[
copyFromCorpus
TreeViewCpt] issue copy into" id
log2 "[
subTree
TreeViewCpt] issue copy into" id
log2 "[
copyFromCorpus
TreeViewCpt] issue copy from" sourceId
log2 "[
subTree
TreeViewCpt] issue copy from" sourceId
--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------
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