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
72eab75f
Commit
72eab75f
authored
Jun 17, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Board update method (WIP)
parent
137702d0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
Update.purs
...Gargantext/Components/Forest/Tree/Node/Action/Update.purs
+13
-0
Types.purs
...text/Components/Forest/Tree/Node/Action/Update/Types.purs
+22
-1
Settings.purs
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
+3
-1
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs
View file @
72eab75f
...
...
@@ -34,6 +34,12 @@ updateRequest (UpdateNodeParamsTexts meth) session nodeId = do
where
p = GR.NodeAPI GT.Node (Just nodeId) (GT.asyncTaskTypePath GT.UpdateNode)
updateRequest (UpdateNodeParamsBoard meth) session nodeId = do
task <- put session p meth
pure $ GT.AsyncTaskWithType {task, typ: GT.UpdateNode } -- TODO add NodeType
where
p = GR.NodeAPI GT.Node (Just nodeId) (GT.asyncTaskTypePath GT.UpdateNode)
----------------------------------------------------------------------
update :: NodeType
...
...
@@ -60,6 +66,13 @@ update Texts dispatch = do
]
(submitButton (UpdateNode $ UpdateNodeParamsTexts {method}) dispatch)
update Dashboard dispatch = do
meth @( method /\ setMethod ) <- R.useState' AllCharts
pure $ panel [ -- H.text "Update with"
formChoiceSafe [AllCharts] AllCharts setMethod
]
(submitButton (UpdateNode $ UpdateNodeParamsBoard {method}) dispatch)
update _ _ = pure $ H.div {} []
-- fragmentPT $ "Update " <> show nodeType
src/Gargantext/Components/Forest/Tree/Node/Action/Update/Types.purs
View file @
72eab75f
...
...
@@ -11,7 +11,7 @@ import Gargantext.Prelude (class Eq, class Read, class Show)
data UpdateNodeParams = UpdateNodeParamsList { method :: Method }
| UpdateNodeParamsGraph { method :: Metric }
| UpdateNodeParamsTexts { method :: Granularity }
| UpdateNodeParamsBoard { method :: Charts }
derive instance eqUpdateNodeParams :: Eq UpdateNodeParams
...
...
@@ -93,3 +93,24 @@ instance encodeJsonGranularity :: Argonaut.EncodeJson Granularity where
encodeJson = genericSumEncodeJson
----------------------------------------------------------------------
data Charts = AllCharts
derive instance genericChart :: Generic Charts _
derive instance eqChart :: Eq Charts
instance showChart :: Show Charts where
show = genericShow
instance readChart :: Read Charts where
read "AllCharts" = Just AllCharts
read _ = Nothing
instance decodeJsonChart :: Argonaut.DecodeJson Charts where
decodeJson = genericSumDecodeJson
instance encodeJsonChart :: Argonaut.EncodeJson Charts where
encodeJson = genericSumEncodeJson
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
View file @
72eab75f
...
...
@@ -198,7 +198,9 @@ settingsBox Dashboard =
SettingsBox { show : true
, edit : false
, doc : Documentation Dashboard
, buttons : []
, buttons : [ Refresh
, Delete
]
}
settingsBox Annuaire =
...
...
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