Commit 63b43fbf authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Types] fix for backend (WIP)

parent 30d727dd
...@@ -46,32 +46,32 @@ update :: NodeType ...@@ -46,32 +46,32 @@ update :: NodeType
-> (Action -> Aff Unit) -> (Action -> Aff Unit)
-> R.Hooks R.Element -> R.Hooks R.Element
update NodeList dispatch = do update NodeList dispatch = do
meth @( method /\ setMethod ) <- R.useState' Basic meth @( methodList /\ setMethod ) <- R.useState' Basic
pure $ panel [ -- H.text "Update with" pure $ panel [ -- H.text "Update with"
formChoiceSafe [Basic, Advanced, WithModel] Basic setMethod formChoiceSafe [Basic, Advanced, WithModel] Basic setMethod
] ]
(submitButton (UpdateNode $ UpdateNodeParamsList {method}) dispatch) (submitButton (UpdateNode $ UpdateNodeParamsList {methodList}) dispatch)
update Graph dispatch = do update Graph dispatch = do
meth @( method /\ setMethod ) <- R.useState' Order1 meth @( methodGraph /\ setMethod ) <- R.useState' Order1
pure $ panel [ -- H.text "Update with" pure $ panel [ -- H.text "Update with"
formChoiceSafe [Order1, Order2] Order1 setMethod formChoiceSafe [Order1, Order2] Order1 setMethod
] ]
(submitButton (UpdateNode $ UpdateNodeParamsGraph {method}) dispatch) (submitButton (UpdateNode $ UpdateNodeParamsGraph {methodGraph}) dispatch)
update Texts dispatch = do update Texts dispatch = do
meth @( method /\ setMethod ) <- R.useState' NewNgrams meth @( methodTexts /\ setMethod ) <- R.useState' NewNgrams
pure $ panel [ -- H.text "Update with" pure $ panel [ -- H.text "Update with"
formChoiceSafe [NewNgrams, NewTexts, Both] NewNgrams setMethod formChoiceSafe [NewNgrams, NewTexts, Both] NewNgrams setMethod
] ]
(submitButton (UpdateNode $ UpdateNodeParamsTexts {method}) dispatch) (submitButton (UpdateNode $ UpdateNodeParamsTexts {methodTexts}) dispatch)
update Dashboard dispatch = do update Dashboard dispatch = do
meth @( method /\ setMethod ) <- R.useState' All meth @( methodBoard /\ setMethod ) <- R.useState' All
pure $ panel [ -- H.text "Update with" pure $ panel [ -- H.text "Update with"
formChoiceSafe [All, Sources, Authors, Institutes, Ngrams] All setMethod formChoiceSafe [All, Sources, Authors, Institutes, Ngrams] All setMethod
] ]
(submitButton (UpdateNode $ UpdateNodeParamsBoard {method}) dispatch) (submitButton (UpdateNode $ UpdateNodeParamsBoard {methodBoard}) dispatch)
update _ _ = pure $ H.div {} [] update _ _ = pure $ H.div {} []
......
...@@ -8,10 +8,10 @@ import Data.Maybe (Maybe(..)) ...@@ -8,10 +8,10 @@ import Data.Maybe (Maybe(..))
import Gargantext.Prelude (class Eq, class Read, class Show) import Gargantext.Prelude (class Eq, class Read, class Show)
data UpdateNodeParams = UpdateNodeParamsList { method :: Method } data UpdateNodeParams = UpdateNodeParamsList { methodList :: Method }
| UpdateNodeParamsGraph { method :: Metric } | UpdateNodeParamsGraph { methodGraph :: Metric }
| UpdateNodeParamsTexts { method :: Granularity } | UpdateNodeParamsTexts { methodTexts :: Granularity }
| UpdateNodeParamsBoard { method :: Charts } | UpdateNodeParamsBoard { methodBoard :: Charts }
derive instance eqUpdateNodeParams :: Eq UpdateNodeParams derive instance eqUpdateNodeParams :: Eq UpdateNodeParams
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment