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
7f97bed3
Commit
7f97bed3
authored
Jan 20, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[bootstrap v4] open parent when moving node
parent
25507fe9
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
51 deletions
+44
-51
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+3
-1
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+1
-1
Action.purs
src/Gargantext/Components/Forest/Tree/Node/Action.purs
+1
-0
Move.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Move.purs
+7
-6
Share.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
+2
-2
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+8
-8
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+18
-28
SubTree.purs
...Gargantext/Components/Forest/Tree/Node/Tools/SubTree.purs
+4
-5
No files found.
src/Gargantext/Components/Forest/Tree.purs
View file @
7f97bed3
...
...
@@ -455,11 +455,13 @@ performAction (UploadArbitraryFile mName blob) { asyncTasks: (_ /\ dispatch)
performAction DownloadNode _ = do
liftEffect $ log "[performAction] DownloadNode"
-------
performAction (MoveNode {params}) p@{session} =
performAction (MoveNode {params}) p@{ openNodes: (_ /\ setOpenNodes)
, session } =
case params of
Nothing -> performAction NoAction p
Just (SubTreeOut {in:in',out}) -> do
void $ moveNodeReq session in' out
liftEffect $ setOpenNodes (Set.insert (mkNodeId session out))
performAction RefreshTree p
performAction (MergeNode {params}) p@{session} =
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
7f97bed3
...
...
@@ -115,7 +115,7 @@ nodeMainSpan = R.createElement nodeMainSpanCpt
, name: name' props
, nodeType
, session
}
}
[]
, fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType }
, H.div {} (map (\t -> asyncProgressBar { asyncTask: t
...
...
src/Gargantext/Components/Forest/Tree/Node/Action.purs
View file @
7f97bed3
...
...
@@ -2,6 +2,7 @@ module Gargantext.Components.Forest.Tree.Node.Action where
import Data.Maybe (Maybe(..))
import Effect.Aff (Aff)
import Gargantext.Prelude (class Show, Unit)
import Gargantext.Sessions (Session)
import Gargantext.Types as GT
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Move.purs
View file @
7f97bed3
...
...
@@ -6,15 +6,16 @@ import Effect.Aff (Aff)
import Reactix as R
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.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn)
import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, put_)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Move"
moveNodeReq :: Session -> GT.ID -> GT.ID -> Aff (Array GT.ID)
...
...
@@ -23,11 +24,11 @@ moveNodeReq session fromId toId =
moveNode :: Record SubTreeParamsIn -> R.Element
moveNode p = R.createElement moveNodeCpt p []
moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = R.hooksComponentWithModule thisModule "moveNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = R.hooksComponentWithModule thisModule "moveNode" cpt
cpt { dispatch, handed, id, nodeType, session, subTreeParams } _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing})
let button = case valAction of
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
View file @
7f97bed3
...
...
@@ -20,8 +20,8 @@ import Gargantext.Sessions (Session, post)
import Gargantext.Types (ID)
import Gargantext.Types as GT
import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson)
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Share"
------------------------------------------------------------------------
...
...
@@ -34,7 +34,7 @@ shareAction username = Action.ShareTeam username
------------------------------------------------------------------------
textInputBox :: Record Tools.TextInputBoxProps -> R.Element
textInputBox
= Tools.textInputBox
textInputBox
p = Tools.textInputBox p []
------------------------------------------------------------------------
data ShareNodeParams = ShareTeamParams { username :: String }
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
7f97bed3
...
...
@@ -100,7 +100,7 @@ nodePopupView p = R.createElement nodePopupCpt p []
, id
, text: name
, isOpen: renameIsOpen
}
}
[]
else
H.span { className: "text-primary center" } [H.text p.name]
]
...
...
@@ -291,7 +291,7 @@ panelAction p = R.createElement panelActionCpt p []
, id
, text: "username"
, isOpen
}
}
[]
] $ H.div {} []
cpt {action : AddingContact, dispatch, id, name } _ = do
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
7f97bed3
...
...
@@ -64,22 +64,23 @@ type TextInputBoxProps =
, boxAction :: String -> Action
)
textInputBox :: R
ecord TextInputBoxProps -> R.Element
textInputBox p
@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R.createElement el p []
textInputBox :: R
2.Component TextInputBoxProps
textInputBox p
rops@{ boxName } = R.createElement el props
where
el :: R.Component TextInputBoxProps
el = R.hooksComponentWithModule thisModule (boxName <> "Box") cpt
cpt
{id, text
} _ = do
cpt
p@{ boxAction, dispatch, id, isOpen: (true /\ setIsOpen), text
} _ = do
renameNodeNameRef <- R.useRef text
pure $ H.div {
className: "from-group row"
}
pure $ H.div {
className: "from-group row"
}
[ textInput renameNodeNameRef
, submitBtn renameNodeNameRef
, cancelBtn
]
where
textInput renameNodeNameRef =
H.div {
className: "col-8"
}
H.div {
className: "col-8"
}
[ inputWithEnter {
onEnter: submit renameNodeNameRef
, onValueChanged: R.setRef renameNodeNameRef
...
...
@@ -90,23 +91,15 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R
, placeholder: (boxName <> " Node")
, type: "text"
}
-- [ H.input { type: "text"
-- , placeholder: (boxName <> " Node")
-- , defaultValue: text
-- , className: "form-control"
-- , on: { input: setRenameNodeName
-- <<< const
-- <<< R.unsafeEventValue }
-- }
]
submitBtn renameNodeNameRef =
H.a {
className: "col-2 " <>
glyphicon "floppy-o"
H.a {
className: "col-2 " <>
glyphicon "floppy-o"
, type: "button"
, on: { click: submit renameNodeNameRef }
, title: "Submit"
} []
cancelBtn =
H.a {className: "text-danger col-2 " <> glyphicon "times"
H.a {
className: "text-danger col-2 " <> glyphicon "times"
, type: "button"
, on: { click: \_ -> setIsOpen $ const false }
, title: "Cancel"
...
...
@@ -114,10 +107,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R
submit renameNodeNameRef _ = do
setIsOpen $ const false
launchAff_ $ dispatch ( boxAction $ R.readRef renameNodeNameRef )
textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p []
where
el = R.hooksComponentWithModule thisModule (boxName <> "Box") cpt
cpt {text} _ = pure $ H.div {} []
cpt { isOpen: (false /\ _) } _ = pure $ H.div {} []
-- | END Rename Box
...
...
@@ -300,12 +290,12 @@ type NodeLinkProps = (
, handed :: GT.Handed
)
nodeLink :: Record NodeLinkProps -> R.Element
nodeLink p = R.createElement nodeLinkCpt p []
nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R.hooksComponentWithModule thisModule "nodeLink" cpt
nodeLink :: R2.Component NodeLinkProps
nodeLink = R.createElement nodeLinkCpt
where
nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R.hooksComponentWithModule thisModule "nodeLink" cpt
cpt { folderOpen: (_ /\ setFolderOpen)
, frontends
, handed
...
...
@@ -358,10 +348,10 @@ type NodeTextProps =
nodeText :: Record NodeTextProps -> R.Element
nodeText p = R.createElement nodeTextCpt p []
nodeTextCpt :: R.Component NodeTextProps
nodeTextCpt = R.hooksComponentWithModule thisModule "nodeText" cpt
where
nodeTextCpt :: R.Component NodeTextProps
nodeTextCpt = R.hooksComponentWithModule thisModule "nodeText" cpt
cpt { isSelected: true, name } _ = do
pure $ H.u {} [
H.b {} [
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools/SubTree.purs
View file @
7f97bed3
...
...
@@ -3,7 +3,6 @@ module Gargantext.Components.Forest.Tree.Node.Tools.SubTree where
import Data.Array as A
import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\))
import Effect.Uncurried (mkEffectFn1)
import Effect.Aff (Aff)
import React.SyntheticEvent as E
import Reactix as R
...
...
@@ -19,8 +18,8 @@ import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes as GR
import Gargantext.Sessions (Session(..), get)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Forest.Tree.Node.Tools.SubTree"
type SubTreeParamsIn =
...
...
@@ -37,10 +36,10 @@ type SubTreeParamsProps =
subTreeView :: Record SubTreeParamsProps -> R.Element
subTreeView props = R.createElement subTreeViewCpt props []
subTreeViewCpt :: R.Component SubTreeParamsProps
subTreeViewCpt = R.hooksComponentWithModule thisModule "subTreeView" cpt
where
subTreeViewCpt :: R.Component SubTreeParamsProps
subTreeViewCpt = R.hooksComponentWithModule thisModule "subTreeView" cpt
cpt params@{ action
, dispatch
, handed
...
...
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