Commit a8ba5031 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] change leader to owner

parent 9e3eeab9
...@@ -55,13 +55,13 @@ teamLayoutWrapper = R.createElement teamLayoutWrapperCpt ...@@ -55,13 +55,13 @@ teamLayoutWrapper = R.createElement teamLayoutWrapperCpt
teamLayoutWrapperCpt :: R.Component TeamProps teamLayoutWrapperCpt :: R.Component TeamProps
teamLayoutWrapperCpt = here.component "teamLayoutWrapper" cpt where teamLayoutWrapperCpt = here.component "teamLayoutWrapper" cpt where
cpt {nodeId, session, team: {team_leader_username, team_members}} _ = do cpt {nodeId, session, team: {team_owner_username, team_members}} _ = do
teamS <- T.useBox team_members teamS <- T.useBox team_members
team' <- T.useLive T.unequal teamS team' <- T.useLive T.unequal teamS
error <- T.useBox "" error <- T.useBox ""
error' <- T.useLive T.unequal error error' <- T.useLive T.unequal error
pure $ teamLayoutRows {nodeId, session, team: teamS, team', error, error', team_leader_username} pure $ teamLayoutRows {nodeId, session, team: teamS, team', error, error', team_owner_username}
type TeamRowProps = type TeamRowProps =
( nodeId :: ID ( nodeId :: ID
...@@ -70,7 +70,7 @@ type TeamRowProps = ...@@ -70,7 +70,7 @@ type TeamRowProps =
, error :: T.Box String , error :: T.Box String
, team' :: Array TeamMember , team' :: Array TeamMember
, error' :: String , error' :: String
, team_leader_username :: String , team_owner_username :: String
) )
teamLayoutRows :: R2.Leaf TeamRowProps teamLayoutRows :: R2.Leaf TeamRowProps
...@@ -78,12 +78,12 @@ teamLayoutRows = R2.leafComponent teamLayoutRowsCpt ...@@ -78,12 +78,12 @@ 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', team_leader_username} _ = do cpt { team, nodeId, session, error, team', error', team_owner_username} _ = do
case null team' of case null team' of
true -> pure $ H.div { style: {margin: "10px"}} true -> pure $ H.div { style: {margin: "10px"}}
[ H.h4 {} [H.text "Your team is empty, you can send some invitations."]] [ H.h4 {} [H.text "Your team is empty, you can send some invitations."]]
false -> pure $ Tools.panel (makeLeader team_leader_username : (map makeTeam team')) (H.div {} [H.text error']) false -> pure $ Tools.panel (makeLeader team_owner_username : (map makeTeam team')) (H.div {} [H.text error'])
where where
makeTeam :: TeamMember -> R.Element makeTeam :: TeamMember -> R.Element
......
...@@ -6,7 +6,7 @@ import GraphQL.Client.Args (NotNull, (=>>)) ...@@ -6,7 +6,7 @@ import GraphQL.Client.Args (NotNull, (=>>))
import GraphQL.Client.Variable (Var(..)) import GraphQL.Client.Variable (Var(..))
type Team type Team
= { team_leader_username :: String = { team_owner_username :: String
, team_members :: Array TeamMember , team_members :: Array TeamMember
} }
...@@ -22,7 +22,7 @@ type TeamDeleteM ...@@ -22,7 +22,7 @@ type TeamDeleteM
} }
teamQuery = { team: { team_node_id: Var :: _ "id" Int } =>> teamQuery = { team: { team_node_id: Var :: _ "id" Int } =>>
{ team_leader_username: unit { team_owner_username: unit
, team_members: { username: unit , team_members: { username: unit
, shared_folder_id: unit , shared_folder_id: unit
} }
......
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