Commit d9a28511 authored by Yoelis Acourt's avatar Yoelis Acourt

feat: disabled button when do database picked

parent 568bbd85
...@@ -23,6 +23,7 @@ import Gargantext.Components.ListSelection as ListSelection ...@@ -23,6 +23,7 @@ import Gargantext.Components.ListSelection as ListSelection
import Gargantext.Components.ListSelection.Types as ListSelection import Gargantext.Components.ListSelection.Types as ListSelection
import Gargantext.Config.Utils (handleRESTError) import Gargantext.Config.Utils (handleRESTError)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.UseFeatureFlag as Feature
import Gargantext.Sessions (Session(..)) import Gargantext.Sessions (Session(..))
import Gargantext.Types (FrontendError) import Gargantext.Types (FrontendError)
import Gargantext.Types as GT import Gargantext.Types as GT
...@@ -30,7 +31,6 @@ import Gargantext.Utils.Reactix as R2 ...@@ -30,7 +31,6 @@ import Gargantext.Utils.Reactix as R2
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
import Gargantext.Hooks.UseFeatureFlag as Feature
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField" here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField"
...@@ -751,11 +751,12 @@ submitButtonComponent = here.component "submitButton" cpt ...@@ -751,11 +751,12 @@ submitButtonComponent = here.component "submitButton" cpt
cpt { errors, onSearch, search, selection, session } _ = do cpt { errors, onSearch, search, selection, session } _ = do
search' <- T.useLive T.unequal search search' <- T.useLive T.unequal search
selection' <- T.useLive T.unequal selection selection' <- T.useLive T.unequal selection
{ datafield } <- T.read search
pure $ pure $
H.button H.button
{ className: "btn btn-primary" { className: "btn btn-primary " <> if datafield == External Empty then "disabled" else ""
, "type": "button" , "type": "button"
, "disabled": if datafield == External Empty then "true" else "false"
, on: { click: doSearch onSearch errors session selection' search' } , on: { click: doSearch onSearch errors session selection' search' }
, style: { width: "100%" } , style: { width: "100%" }
} }
......
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