aboutsummaryrefslogtreecommitdiffstats
path: root/frontend
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-06-06 15:23:23 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-06-06 15:23:23 +0200
commita569f8d7a2da3b2769a3bbf3414c164043321dd7 (patch)
treedd3c33d2e12b9eb903a3a5383add329d9dc65313 /frontend
parentfebd2d7a243d540fa083be78783059762fcb42c7 (diff)
remove form from list collection page
Diffstat (limited to 'frontend')
-rw-r--r--frontend/app/Page/ListCollection.hs26
1 files changed, 4 insertions, 22 deletions
diff --git a/frontend/app/Page/ListCollection.hs b/frontend/app/Page/ListCollection.hs
index b647040..16517d9 100644
--- a/frontend/app/Page/ListCollection.hs
+++ b/frontend/app/Page/ListCollection.hs
@@ -10,9 +10,7 @@ where
import Api
import Data.Aeson qualified as A
import Data.Aeson.KeyMap qualified as AM
-import Form qualified as F
import Miso
-import Miso.String (toMisoString)
import Schema
data Model = Model
@@ -34,32 +32,16 @@ initialModel collection = do
data Action
= NoOp
- | FormChanged A.Value
- | FormSubmitted A.Value
deriving (Eq, Show)
updateModel :: Action -> Model -> Effect Action Model
updateModel NoOp m = noEff m
-updateModel (FormChanged input) m = noEff m {input}
-updateModel (FormSubmitted output) m =
- m <# do
- const NoOp <$> consoleLog (toMisoString (A.encode output))
viewModel :: Model -> View Action
viewModel m =
div_ [] $
- [ schemaTable m.schema m.posts,
- viewSchema m.schema,
- viewForm m.input m.schema,
- viewInput m.input
+ [ h3_ [] [text "entities"],
+ schemaTable m.schema m.posts,
+ h3_ [] [text "schema"],
+ viewSchema m.schema
]
-
-viewForm :: A.Value -> Schema -> View Action
-viewForm input =
- fmap (either FormChanged FormSubmitted)
- . flip F.runForm input
- . schemaForm
-
-viewInput :: A.Value -> View Action
-viewInput input =
- pre_ [] [text (toMisoString (A.encode input))]