Commit 1bb7434e authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-list-charts

parents 701f2182 fbeac876
module Gargantext.Components.Forest.Tree.Node.Box where module Gargantext.Components.Forest.Tree.Node.Box where
import Data.Array as A import Data.Array as A
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..), isJust)
import Data.String as S import Data.String as S
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff) import Effect.Aff (Aff)
...@@ -162,7 +162,14 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt ...@@ -162,7 +162,14 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
mPanelAction :: R.State (Record NodePopupS) mPanelAction :: R.State (Record NodePopupS)
-> Record NodePopupProps -> Record NodePopupProps
-> R.Element -> R.Element
mPanelAction ({action: Nothing } /\ _) _ = H.div {} [] mPanelAction ({action: Nothing } /\ _) _ =
H.div {className:"center fa-hand-pointer-o"}
[ H.h4 {} [H.text " Select available actions of this node"]
, H.ul {} [ H.h5 {style:{color:"black"} , className: "fa-thumbs-o-up" } [H.text " Black: yes you can use it" ]
, H.h5 {style:{color:"orange"}, className: "fa-exclamation-triangle"} [H.text " Orange: almost useable" ]
, H.h5 {style:{color:"red"} , className: "fa-rocket" } [H.text " Red: development in progress" ]
]
]
mPanelAction ({action: Just action} /\ _) props = mPanelAction ({action: Just action} /\ _) props =
panelAction { action panelAction { action
, dispatch : props.dispatch , dispatch : props.dispatch
...@@ -199,20 +206,27 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt ...@@ -199,20 +206,27 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt
(action == (Just todo) ) (action == (Just todo) )
, id: show todo , id: show todo
, title: show todo , title: show todo
, onClick : mkEffectFn1 $ \_ -> undo *> doToDo , onClick : mkEffectFn1 $ \_ -> {-undo *>-} doToDo
} }
[] []
] ]
where where
action' = if action == (Just todo) -- FIXME
-- If uncommenting the code below
-- then mpanelAction state is not
-- updated and leads to some bug (state of subtree
-- not updated and search value not initilized)
-- else current action' forces the user to click twice when
-- changing the action button.
action' = if isJust action {-== (Just todo)-}
then Nothing then Nothing
else (Just todo) else (Just todo)
{- -- This shows the Help of this button
undo = setNodePopup undo = setNodePopup
$ const (node { action = Nothing }) $ const (node { action = Nothing })
-}
doToDo = setNodePopup doToDo = setNodePopup $ const (node { action = action' })
$ const (node { action = action' })
iconAStyle :: GT.NodeType -> NodeAction -> { color :: String iconAStyle :: GT.NodeType -> NodeAction -> { color :: String
, paddingTop :: String , paddingTop :: String
......
...@@ -126,8 +126,8 @@ settingsBox FolderShared = ...@@ -126,8 +126,8 @@ settingsBox FolderShared =
SettingsBox { show : true SettingsBox { show : true
, edit : true , edit : true
, doc : Documentation FolderShared , doc : Documentation FolderShared
, buttons : [ Add [Team, FolderShared] , buttons : [ Add [Team, Folder]
-- , Delete -- , Delete
] ]
} }
......
...@@ -8,7 +8,7 @@ import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..)) ...@@ -8,7 +8,7 @@ import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..))
data Status = Stable | Test | Dev data Status = Stable | Test | Dev
hasStatus :: NodeType -> NodeAction -> Status hasStatus :: NodeType -> NodeAction -> Status
hasStatus _ SearchBox = Dev hasStatus _ SearchBox = Test
hasStatus _ Refresh = Dev hasStatus _ Refresh = Dev
hasStatus _ Config = Dev hasStatus _ Config = Dev
hasStatus _ (Link _) = Dev hasStatus _ (Link _) = Dev
......
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