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
0ad2f78f
Commit
0ad2f78f
authored
Jun 17, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Graph update method
parent
319d2496
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
3 deletions
+52
-3
Update.purs
...Gargantext/Components/Forest/Tree/Node/Action/Update.purs
+7
-1
Types.purs
...text/Components/Forest/Tree/Node/Action/Update/Types.purs
+45
-2
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs
View file @
0ad2f78f
...
...
@@ -46,7 +46,13 @@ update NodeList dispatch = do
]
(submitButton (UpdateNode $ UpdateNodeParamsList {method}) dispatch)
update Graph _ = pure $ H.div {} []
update Graph dispatch = do
meth @( method /\ setMethod ) <- R.useState' Order1
pure $ panel [ -- H.text "Update with"
formChoiceSafe [Order1, Order2] Order1 setMethod
]
(submitButton (UpdateNode $ UpdateNodeParamsGraph {method}) dispatch)
update Texts _ = pure $ H.div {} []
update _ _ = pure $ H.div {} []
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Update/Types.purs
View file @
0ad2f78f
...
...
@@ -8,8 +8,8 @@ import Data.Maybe (Maybe(..))
import Gargantext.Prelude (class Eq, class Read, class Show)
data UpdateNodeParams = UpdateNodeParamsList { method :: Method }
| UpdateNodeParamsGraph { method ::
String
}
data UpdateNodeParams = UpdateNodeParamsList
{ method :: Method }
| UpdateNodeParamsGraph { method ::
Metric
}
| UpdateNodeParamsTexts { method :: Int }
...
...
@@ -48,4 +48,47 @@ instance decodeJsonMethod :: Argonaut.DecodeJson Method where
instance encodeJsonMethod :: Argonaut.EncodeJson Method where
encodeJson = genericSumEncodeJson
----------------------------------------------------------------------
data Metric = Order1 | Order2
derive instance genericMetric :: Generic Metric _
derive instance eqMetric :: Eq Metric
instance showMetric :: Show Metric where
show = genericShow
instance readMetric :: Read Metric where
read "Order1" = Just Order1
read "Order2" = Just Order2
read _ = Nothing
instance decodeJsonMetric :: Argonaut.DecodeJson Metric where
decodeJson = genericSumDecodeJson
instance encodeJsonMetric :: Argonaut.EncodeJson Metric where
encodeJson = genericSumEncodeJson
----------------------------------------------------------------------
data Metric = Order1 | Order2
derive instance genericMetric :: Generic Metric _
derive instance eqMetric :: Eq Metric
instance showMetric :: Show Metric where
show = genericShow
instance readMetric :: Read Metric where
read "Order1" = Just Order1
read "Order2" = Just Order2
read _ = Nothing
instance decodeJsonMetric :: Argonaut.DecodeJson Metric where
decodeJson = genericSumDecodeJson
instance encodeJsonMetric :: Argonaut.EncodeJson Metric where
encodeJson = genericSumEncodeJson
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