Commit 30d727dd authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FEAT] Update : increasing the type of Board params

parent 72eab75f
......@@ -67,9 +67,9 @@ update Texts dispatch = do
(submitButton (UpdateNode $ UpdateNodeParamsTexts {method}) dispatch)
update Dashboard dispatch = do
meth @( method /\ setMethod ) <- R.useState' AllCharts
meth @( method /\ setMethod ) <- R.useState' All
pure $ panel [ -- H.text "Update with"
formChoiceSafe [AllCharts] AllCharts setMethod
formChoiceSafe [All, Sources, Authors, Institutes, Ngrams] All setMethod
]
(submitButton (UpdateNode $ UpdateNodeParamsBoard {method}) dispatch)
......
......@@ -94,7 +94,7 @@ instance encodeJsonGranularity :: Argonaut.EncodeJson Granularity where
----------------------------------------------------------------------
data Charts = AllCharts
data Charts = Sources | Authors | Institutes | Ngrams | All
derive instance genericChart :: Generic Charts _
......@@ -104,8 +104,12 @@ instance showChart :: Show Charts where
show = genericShow
instance readChart :: Read Charts where
read "AllCharts" = Just AllCharts
read _ = Nothing
read "Sources " = Just Sources
read "Authors" = Just Authors
read "Institutes" = Just Institutes
read "Ngrams" = Just Ngrams
read "AllCharts" = Just All
read _ = Nothing
instance decodeJsonChart :: Argonaut.DecodeJson Charts where
decodeJson = genericSumDecodeJson
......
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