Commit 0ba5da96 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[DOC] documentation if team is empty

parent d88f3037
...@@ -2,7 +2,7 @@ module Gargantext.Components.Forest.Tree.Node.Action.ManageTeam where ...@@ -2,7 +2,7 @@ module Gargantext.Components.Forest.Tree.Node.Action.ManageTeam where
import Gargantext.Prelude import Gargantext.Prelude
import Data.Array (filter) import Data.Array (filter, null)
import Data.Either (Either(..)) import Data.Either (Either(..))
import Effect.Aff (runAff_) import Effect.Aff (runAff_)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
...@@ -78,18 +78,22 @@ teamLayoutRows = R2.leafComponent teamLayoutRowsCpt ...@@ -78,18 +78,22 @@ teamLayoutRows = R2.leafComponent teamLayoutRowsCpt
teamLayoutRowsCpt :: R.Component TeamRowProps teamLayoutRowsCpt :: R.Component TeamRowProps
teamLayoutRowsCpt = here.component "teamLayoutRows" cpt where teamLayoutRowsCpt = here.component "teamLayoutRows" cpt where
cpt { team, nodeId, session, error, team', error' } _ = do cpt { team, nodeId, session, error, team', error' } _ = do
pure $ Tools.panel (map makeTeam team') (H.div {} [H.text error']) case null team' of
true -> pure $ H.div { style: {margin: "10px"}}
[ H.h4 {} [H.text "Your team is empty, you can send some invitations."]]
false -> pure $ Tools.panel (map makeTeam team') (H.div {} [H.text error'])
where where
makeTeam :: TeamMember -> R.Element makeTeam :: TeamMember -> R.Element
makeTeam { username, shared_folder_id } = H.div {className: "from-group row"} [ H.div { className: "col-8" } [ H.text username ] makeTeam { username, shared_folder_id } = H.div {className: "from-group row"} [ H.div { className: "col-8" } [ H.text username ]
, H.a { className: "text-danger col-2 fa fa-times" , H.a { className: "text-danger col-2 fa fa-times"
, title: "Remove user from team" , title: "Remove user from team"
, type: "button" , type: "button"
, on: {click: submit shared_folder_id } , on: {click: submit shared_folder_id }
} [] } []
] ]
submit sharedFolderId _ = do submit sharedFolderId _ = do
runAff_ callback $ saveDeleteTeam { session, nodeId, sharedFolderId } runAff_ callback $ saveDeleteTeam { session, nodeId, sharedFolderId }
......
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