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
3b3ca047
Commit
3b3ca047
authored
Oct 18, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FOREST] Add with options (WIP).
parent
1d12348e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
Forest.purs
src/Gargantext/Components/Forest.purs
+2
-1
Add.purs
src/Gargantext/Components/Forest/Action/Add.purs
+23
-7
No files found.
src/Gargantext/Components/Forest.purs
View file @
3b3ca047
...
...
@@ -34,7 +34,8 @@ plus :: R2.Setter Boolean -> R.Element
plus showLogin =
H.button {on: {click}}
[ H.i { className: "glyphicon glyphicon-plus"} [] ]
-- TODO [ H.i { className: "material-icons md-36"} [] ]
-- TODO same as the one in the Login Modal (same CSS)
-- [ H.i { className: "material-icons md-36"} [] ]
where
click _ = do
showLogin (const true)
src/Gargantext/Components/Forest/Action/Add.purs
View file @
3b3ca047
...
...
@@ -58,7 +58,7 @@ createNodeView d p@{nodeType} (Just CreatePopup /\ setPopupOpen) = R.createEleme
pure $ H.div tooltipProps $
[ H.div {className: "panel panel-default"}
[ panelHeading
, panelBody nodeName nodeType
, panelBody
readNodeType
nodeName nodeType
, panelFooter nodeName nodeType
]
]
...
...
@@ -84,11 +84,14 @@ createNodeView d p@{nodeType} (Just CreatePopup /\ setPopupOpen) = R.createEleme
]
]
panelBody :: R.State String -> R.State NodeType -> R.Element
panelBody (_ /\ setNodeName) (nt /\ setNodeType) =
panelBody :: (String -> NodeType)
-> R.State String
-> R.State NodeType
-> R.Element
panelBody readIt (_ /\ setNodeName) (nt /\ setNodeType) =
H.div {className: "panel-body"}
[ H.div {className: "row"}
[ H.div {className: "col-md-1
2
"}
[ H.div {className: "col-md-1
0
"}
[ H.form {className: "form-horizontal"}
[ {- H.div {className: "form-group"}
[ H.input { type: "text"
...
...
@@ -100,16 +103,20 @@ createNodeView d p@{nodeType} (Just CreatePopup /\ setPopupOpen) = R.createEleme
]
, -} H.div {className: "form-group"}
[ R2.select { className: "form-control"
, onChange: mkEffectFn1 $ \e -> setNodeType $ const $ readNodeType $ e .. "target" .. "value"
, onChange: mkEffectFn1 $ \e -> setNodeType
$ const
$ readIt
$ e .. "target" .. "value"
}
(map
renderOption
nodeTypes)
(map
(\opt -> H.option {} [ H.text $ show opt ])
nodeTypes)
]
-- , H.text "config"
, showConfig nt
]
]
]
]
renderOption (opt :: NodeType) = H.option {} [ H.text $ show opt ]
panelFooter :: R.State String -> R.State NodeType -> R.Element
panelFooter (name' /\ _) (nt /\ _) =
...
...
@@ -128,3 +135,12 @@ createNodeView _ _ _ = R.createElement el {} []
cpt props _ = pure $ H.div {} []
-- END Create Node
showConfig :: NodeType -> R.Element
showConfig Graph = H.text $ show Graph
showConfig _ = H.text $ show ""
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