Commit 2e02f0f5 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[upload] fix default upload type value

parent 494295c0
Pipeline #1641 canceled with stage
......@@ -375,8 +375,9 @@ uploadTermListViewCpt :: R.Component Props
uploadTermListViewCpt = here.component "uploadTermListView" cpt
where
cpt {dispatch, id, nodeType} _ = do
let defaultUploadType = JSON
mFile <- T.useBox (Nothing :: Maybe UploadFile)
uploadType <- T.useBox CSV
uploadType <- T.useBox defaultUploadType
let input = H.input { type: "file"
, placeholder: "Choose file"
......@@ -387,7 +388,7 @@ uploadTermListViewCpt = here.component "uploadTermListView" cpt
let opt fileType = H.option { value: show fileType } [ H.text $ show fileType ]
let uploadTypeHtml = R2.select { className: "form-control"
, defaultValue: show JSON
, defaultValue: show defaultUploadType
, on: { change: onUploadTypeChange uploadType } } (opt <$> [ CSV, JSON ])
let footer = H.div {} [ uploadTermButton { dispatch
......@@ -447,6 +448,9 @@ uploadTermButtonCpt = here.component "uploadTermButton" cpt
mFile' <- T.useLive T.unequal mFile
uploadType' <- T.useLive T.unequal uploadType
R.useEffect' $ do
here.log2 "[uploadTermButton] uploadType'" uploadType'
let disabled = case mFile' of
Nothing -> "1"
Just _ -> ""
......
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