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
9cf33e2f
Commit
9cf33e2f
authored
Jun 27, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CSS|Ergo] subtree fix
parent
09db4e19
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
46 deletions
+57
-46
Login.css
dist/styles/Login.css
+1
-0
Login.sass
dist/styles/Login.sass
+1
-0
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+1
-22
Move.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Move.purs
+1
-1
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+26
-4
SubTree.purs
...Gargantext/Components/Forest/Tree/Node/Tools/SubTree.purs
+27
-19
No files found.
dist/styles/Login.css
View file @
9cf33e2f
...
@@ -204,6 +204,7 @@ a:focus, a:hover {
...
@@ -204,6 +204,7 @@ a:focus, a:hover {
.copy-from-corpus
.tree
.node
{
.copy-from-corpus
.tree
.node
{
padding-left
:
10px
;
padding-left
:
10px
;
margin-top
:
5px
;
}
}
.copy-from-corpus
.tree
.node
.name.clickable
{
.copy-from-corpus
.tree
.node
.name.clickable
{
color
:
#337ab7
;
color
:
#337ab7
;
...
...
dist/styles/Login.sass
View file @
9cf33e2f
...
@@ -192,6 +192,7 @@ a:focus, a:hover
...
@@ -192,6 +192,7 @@ a:focus, a:hover
.tree
.tree
.node
.node
padding-left
:
10px
padding-left
:
10px
margin-top
:
5px
.name
.name
&
.clickable
&
.clickable
color
:
#337ab7
color
:
#337ab7
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
9cf33e2f
...
@@ -14,6 +14,7 @@ import Gargantext.Components.Forest.Tree.Node.Box.Types (CommonProps)
...
@@ -14,6 +14,7 @@ import Gargantext.Components.Forest.Tree.Node.Box.Types (CommonProps)
import Gargantext.Components.Forest.Tree.Node.Tools.ProgressBar (asyncProgressBar, BarType(..))
import Gargantext.Components.Forest.Tree.Node.Tools.ProgressBar (asyncProgressBar, BarType(..))
import Gargantext.Components.Forest.Tree.Node.Tools.Task (Tasks)
import Gargantext.Components.Forest.Tree.Node.Tools.Task (Tasks)
import Gargantext.Components.Forest.Tree.Node.Tools.Sync (nodeActionsGraph, nodeActionsNodeList)
import Gargantext.Components.Forest.Tree.Node.Tools.Sync (nodeActionsGraph, nodeActionsNodeList)
import Gargantext.Components.Forest.Tree.Node.Tools (nodeText)
import Gargantext.Components.GraphExplorer.API as GraphAPI
import Gargantext.Components.GraphExplorer.API as GraphAPI
import Gargantext.Components.Lang (Lang(EN))
import Gargantext.Components.Lang (Lang(EN))
import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild)
import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild)
...
@@ -166,28 +167,6 @@ fldr nt open = if open
...
@@ -166,28 +167,6 @@ fldr nt open = if open
-}
-}
-- START node text
type NodeTextProps =
( isSelected :: Boolean
, name :: Name
)
nodeText :: Record NodeTextProps -> R.Element
nodeText p = R.createElement nodeTextCpt p []
nodeTextCpt :: R.Component NodeTextProps
nodeTextCpt = R.hooksComponent "G.C.F.T.N.B.nodeText" cpt
where
cpt { isSelected: true, name } _ = do
pure $ H.u {} [
H.b {} [
H.text ("| " <> name <> " | ")
]
]
cpt {isSelected: false, name} _ = do
pure $ H.text (name <> " ")
-- END node text
-- START nodeActions
-- START nodeActions
type NodeActionsProps =
type NodeActionsProps =
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Move.purs
View file @
9cf33e2f
...
@@ -4,7 +4,7 @@ module Gargantext.Components.Forest.Tree.Node.Action.Move
...
@@ -4,7 +4,7 @@ module Gargantext.Components.Forest.Tree.Node.Action.Move
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Gargantext.Components.Forest.Tree.Node.Action (
Props,
Action(..))
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel)
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel)
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (SubTreeParamsIn, subTreeView, SubTreeOut(..))
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (SubTreeParamsIn, subTreeView, SubTreeOut(..))
import Gargantext.Prelude
import Gargantext.Prelude
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
9cf33e2f
...
@@ -6,6 +6,7 @@ import Data.Set (Set)
...
@@ -6,6 +6,7 @@ import Data.Set (Set)
import Data.Set as Set
import Data.Set as Set
import Data.String as S
import Data.String as S
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Gargantext.Types (Name)
import Effect (Effect)
import Effect (Effect)
import Effect.Aff (Aff, launchAff)
import Effect.Aff (Aff, launchAff)
import Effect.Uncurried (mkEffectFn1)
import Effect.Uncurried (mkEffectFn1)
...
@@ -31,10 +32,9 @@ panel bodies submit =
...
@@ -31,10 +32,9 @@ panel bodies submit =
[ H.div { className: "row"
[ H.div { className: "row"
, style: {"margin":"10px"}
, style: {"margin":"10px"}
}
}
[ H.div { className: "col-md-1
0" }
[ H.div { className: "col-md-1
2" } bs
-- TODO add type for text or form here
-- TODO add type for text or form here
[ H.form {className: "form-horizontal"} bs
-- [ H.form {className: "form-horizontal"} bs ]
]
]
]
]
]
footer sb =
footer sb =
...
@@ -227,7 +227,7 @@ checkboxes :: forall a
...
@@ -227,7 +227,7 @@ checkboxes :: forall a
-> R.State (Set a)
-> R.State (Set a)
-> R.Element
-> R.Element
checkboxes xs (val /\ set) =
checkboxes xs (val /\ set) =
H.
div
{} $ map (\a -> H.div {} [ H.input { type: "checkbox"
H.
fieldset
{} $ map (\a -> H.div {} [ H.input { type: "checkbox"
, checked: Set.member a val
, checked: Set.member a val
, on: { click: \_ -> set
, on: { click: \_ -> set
$ const
$ const
...
@@ -239,4 +239,26 @@ checkboxes xs (val /\ set) =
...
@@ -239,4 +239,26 @@ checkboxes xs (val /\ set) =
) xs
) xs
-- START node text
type NodeTextProps =
( isSelected :: Boolean
, name :: Name
)
nodeText :: Record NodeTextProps -> R.Element
nodeText p = R.createElement nodeTextCpt p []
nodeTextCpt :: R.Component NodeTextProps
nodeTextCpt = R.hooksComponent "G.C.F.T.N.B.nodeText" cpt
where
cpt { isSelected: true, name } _ = do
pure $ H.u {} [
H.b {} [
H.text ("| " <> name <> " | ")
]
]
cpt {isSelected: false, name} _ = do
pure $ H.text (name <> " ")
-- END node text
src/Gargantext/Components/Forest/Tree/Node/Tools/SubTree.purs
View file @
9cf33e2f
module Gargantext.Components.Forest.Tree.Node.Tools.SubTree where
module Gargantext.Components.Forest.Tree.Node.Tools.SubTree where
import DOM.Simple.Console (log2)
import Data.Array as A
import Data.Array as A
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Effect.Uncurried (mkEffectFn1)
import Effect.Uncurried (mkEffectFn1)
import Effect.Aff (Aff
, launchAff
)
import Effect.Aff (Aff)
import Gargantext.Components.Forest.Tree.Node.Action (Props
, Action(..)
)
import Gargantext.Components.Forest.Tree.Node.Action (Props)
import Gargantext.Components.Forest.Tree.Node.Settings (SubTreeParams(..))
import Gargantext.Components.Forest.Tree.Node.Settings (SubTreeParams(..))
import Gargantext.Components.Forest.Tree.Node.Tools.FTree (FTree, LNode(..), NTree(..))
import Gargantext.Components.Forest.Tree.Node.Tools.FTree (FTree, LNode(..), NTree(..))
import Gargantext.Components.Forest.Tree.Node.Tools (nodeText)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude (
discard, map, pure, show, unit, ($), (&&), (/=), (<>), class Eq, const
)
import Gargantext.Prelude (
map, pure, show, ($), (&&), (/=), (<>), const, (==)
)
import Gargantext.Routes as GR
import Gargantext.Routes as GR
import Gargantext.Sessions (Session(..), get)
import Gargantext.Sessions (Session(..), get)
import Gargantext.Types as GT
import Gargantext.Types as GT
...
@@ -97,7 +95,7 @@ subTreeTreeViewCpt :: R.Component CorpusTreeProps
...
@@ -97,7 +95,7 @@ subTreeTreeViewCpt :: R.Component CorpusTreeProps
subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt
subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt
where
where
cpt p@{ id
cpt p@{ id
, tree: NTree (LNode { id:
source
Id
, tree: NTree (LNode { id:
target
Id
, name
, name
, nodeType
, nodeType
}
}
...
@@ -106,28 +104,38 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt
...
@@ -106,28 +104,38 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt
, dispatch
, dispatch
, subTreeOut
, subTreeOut
} _ = do
} _ = do
pure $ {- H.div {} [ H.h5 { className: GT.fldr nodeType true} []
pure $ H.div {} [ -- H.h5 { className: GT.fldr nodeType true} []
, -} H.div { className: "node" }
H.div { className: "node " <> GT.fldr nodeType true}
( [ H.span { className: "name " <> clickable
( [ H.span { className: "name " <> clickable
, on: { click: onClick }
, on: { click: onClick }
} [ H.text name ]
} [ nodeText { isSelected: isSelected targetId subTreeOutParams
, name
] <> children
}
)
]
-- ]
] <> children
)
]
where
where
SubTreeParams { valitypes } = subTreeParams
SubTreeParams { valitypes } = subTreeParams
children = map (\c -> subTreeTreeView (p { tree = c })) ary
children = map (\c -> subTreeTreeView (p { tree = c })) ary
validNodeType = (A.elem nodeType valitypes) && (id /= sourceId)
validNodeType = (A.elem nodeType valitypes) && (id /= targetId)
clickable = if validNodeType then "clickable" else ""
clickable = if validNodeType then "clickable" else ""
sbto@( subTreeOutParams /\ setSubTreeOut) = subTreeOut
sbto@( subTreeOutParams /\ setSubTreeOut) = subTreeOut
isSelected n sbtop = case sbtop of
Nothing -> false
(Just (SubTreeOut {out})) -> n == out
onClick _ = mkEffectFn1 $ \_ -> case validNodeType of
onClick _ = mkEffectFn1 $ \_ -> case validNodeType of
false -> setSubTreeOut (const Nothing)
false -> setSubTreeOut (const Nothing)
true -> setSubTreeOut (const $ Just $ SubTreeOut { in: id, out:
source
Id})
true -> setSubTreeOut (const $ Just $ SubTreeOut { in: id, out:
target
Id})
--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------
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