diff --git a/common/src/main/scala/industries/sunshine/planningpoker/Models.scala b/common/src/main/scala/industries/sunshine/planningpoker/Models.scala index 7d0f693..a22be67 100644 --- a/common/src/main/scala/industries/sunshine/planningpoker/Models.scala +++ b/common/src/main/scala/industries/sunshine/planningpoker/Models.scala @@ -17,6 +17,7 @@ object Models { * \- whether current player has access to button to finish the round */ final case class RoomStateView( + roomName: String, players: List[Player], me: PlayerID, allowedCards: List[String], @@ -26,6 +27,7 @@ object Models { object RoomStateView { val empty = RoomStateView( + "", List.empty, PlayerID(0), List.empty, @@ -70,6 +72,7 @@ object Models { .find(_.id == playerId) .fold(ifEmpty = RoomStateView.empty)((me: Player) => RoomStateView( + id.name, players, me.id, allowedCards, diff --git a/common/src/main/scala/industries/sunshine/planningpoker/TestModels.scala b/common/src/main/scala/industries/sunshine/planningpoker/TestModels.scala index 7da765f..2481e99 100644 --- a/common/src/main/scala/industries/sunshine/planningpoker/TestModels.scala +++ b/common/src/main/scala/industries/sunshine/planningpoker/TestModels.scala @@ -24,79 +24,79 @@ object TestModels { // val testSessions = Map(testSessionId -> (testRoomBackend.id, me.id)) // val testRooms = Map(testRoomBackend.id -> testRoomBackend) - val testChangesList = List( - RoomStateView( - players = List(me), - me = me.id, - allowedCards = List("xs", "s", "m", "l", "xl"), - round = RoundStateView.Voting(myCard = None, alreadyVoted = List.empty), - canCloseRound = true - ), - RoomStateView( - players = List(me, pony), - me = me.id, - allowedCards = List("xs", "s", "m", "l", "xl"), - round = RoundStateView.Voting(myCard = None, alreadyVoted = List.empty), - canCloseRound = true - ), - RoomStateView( - players = List(me, birdy, pony), - me = me.id, - allowedCards = List("xs", "s", "m", "l", "xl"), - round = RoundStateView.Voting(myCard = None, alreadyVoted = List.empty), - canCloseRound = true - ), - RoomStateView( - players = List(me, birdy, pony), - me = me.id, - allowedCards = List("xs", "s", "m", "l", "xl"), - round = RoundStateView.Voting(myCard = None, alreadyVoted = List(birdy.id)), - canCloseRound = true - ), - RoomStateView( - players = List(me, birdy, pony), - me = me.id, - allowedCards = List("xs", "s", "m", "l", "xl"), - round = RoundStateView.Voting(myCard = Some("m"), alreadyVoted = List(birdy.id)), - canCloseRound = true - ), - RoomStateView( - players = List(me, birdy, pony), - me = me.id, - allowedCards = List("xs", "s", "m", "l", "xl"), - round = RoundStateView.Voting(myCard = Some("m"), alreadyVoted = List(birdy.id)), - canCloseRound = true - ), - RoomStateView( - players = List(me, birdy, pony, horsey), - me = me.id, - allowedCards = List("xs", "s", "m", "l", "xl"), - round = RoundStateView.Voting(myCard = Some("m"), alreadyVoted = List(birdy.id)), - canCloseRound = true - ), - RoomStateView( - players = List(me, birdy, pony, horsey), - me = me.id, - allowedCards = List("xs", "s", "m", "l", "xl"), - round = RoundStateView.Voting(myCard = Some("m"), alreadyVoted = List(birdy.id, horsey.id)), - canCloseRound = true - ), - RoomStateView( - players = List(me, birdy, pony, horsey), - me = me.id, - allowedCards = List("xs", "s", "m", "l", "xl"), - round = RoundStateView - .Voting(myCard = Some("m"), alreadyVoted = List(birdy.id, horsey.id, pony.id)), - canCloseRound = true - ), - RoomStateView( - players = List(me, birdy, pony, horsey), - me = me.id, - allowedCards = List("xs", "s", "m", "l", "xl"), - round = RoundStateView.Viewing( - List(me.id -> "m", pony.id -> "l", birdy.id -> "s", horsey.id -> "m") - ), - canCloseRound = true - ) - ) + // val testChangesList = List( + // RoomStateView( + // players = List(me), + // me = me.id, + // allowedCards = List("xs", "s", "m", "l", "xl"), + // round = RoundStateView.Voting(myCard = None, alreadyVoted = List.empty), + // canCloseRound = true + // ), + // RoomStateView( + // players = List(me, pony), + // me = me.id, + // allowedCards = List("xs", "s", "m", "l", "xl"), + // round = RoundStateView.Voting(myCard = None, alreadyVoted = List.empty), + // canCloseRound = true + // ), + // RoomStateView( + // players = List(me, birdy, pony), + // me = me.id, + // allowedCards = List("xs", "s", "m", "l", "xl"), + // round = RoundStateView.Voting(myCard = None, alreadyVoted = List.empty), + // canCloseRound = true + // ), + // RoomStateView( + // players = List(me, birdy, pony), + // me = me.id, + // allowedCards = List("xs", "s", "m", "l", "xl"), + // round = RoundStateView.Voting(myCard = None, alreadyVoted = List(birdy.id)), + // canCloseRound = true + // ), + // RoomStateView( + // players = List(me, birdy, pony), + // me = me.id, + // allowedCards = List("xs", "s", "m", "l", "xl"), + // round = RoundStateView.Voting(myCard = Some("m"), alreadyVoted = List(birdy.id)), + // canCloseRound = true + // ), + // RoomStateView( + // players = List(me, birdy, pony), + // me = me.id, + // allowedCards = List("xs", "s", "m", "l", "xl"), + // round = RoundStateView.Voting(myCard = Some("m"), alreadyVoted = List(birdy.id)), + // canCloseRound = true + // ), + // RoomStateView( + // players = List(me, birdy, pony, horsey), + // me = me.id, + // allowedCards = List("xs", "s", "m", "l", "xl"), + // round = RoundStateView.Voting(myCard = Some("m"), alreadyVoted = List(birdy.id)), + // canCloseRound = true + // ), + // RoomStateView( + // players = List(me, birdy, pony, horsey), + // me = me.id, + // allowedCards = List("xs", "s", "m", "l", "xl"), + // round = RoundStateView.Voting(myCard = Some("m"), alreadyVoted = List(birdy.id, horsey.id)), + // canCloseRound = true + // ), + // RoomStateView( + // players = List(me, birdy, pony, horsey), + // me = me.id, + // allowedCards = List("xs", "s", "m", "l", "xl"), + // round = RoundStateView + // .Voting(myCard = Some("m"), alreadyVoted = List(birdy.id, horsey.id, pony.id)), + // canCloseRound = true + // ), + // RoomStateView( + // players = List(me, birdy, pony, horsey), + // me = me.id, + // allowedCards = List("xs", "s", "m", "l", "xl"), + // round = RoundStateView.Viewing( + // List(me.id -> "m", pony.id -> "l", birdy.id -> "s", horsey.id -> "m") + // ), + // canCloseRound = true + // ) + // ) } diff --git a/frontend/src/main/scala/industries/sunshine/planningpoker/RoomView.scala b/frontend/src/main/scala/industries/sunshine/planningpoker/RoomView.scala index d6ab57d..363db7f 100644 --- a/frontend/src/main/scala/industries/sunshine/planningpoker/RoomView.scala +++ b/frontend/src/main/scala/industries/sunshine/planningpoker/RoomView.scala @@ -35,7 +35,11 @@ object RoomView { val wsFinalDeathSignal = wsStream.closed.collect { case (_, false) => () } div( - className := "w-full h-full border-4 border-amber-900 flex flex-col", + className := "w-full h-full border-4 border-amber-900 flex flex-col relative", + div( + className := "absolute top-2 right-2", + child.text <-- roomStateSignal.map(st => s"Room name: '${st.roomName}'"), + ), OtherPlayers.render(roomStateSignal), TableView.renderTable(roomStateSignal), OwnHandControls.render(roomStateSignal),