Merge pull request #5468 from element-hq/feature/fga/space_tweaks
Spaces : some tweaks around ui
This commit is contained in:
commit
a497703a90
59 changed files with 248 additions and 173 deletions
|
|
@ -30,7 +30,7 @@ class LeaveSpaceStateProvider : PreviewParameterProvider<LeaveSpaceState> {
|
|||
persistentListOf(
|
||||
aSelectableSpaceRoom(
|
||||
spaceRoom = aSpaceRoom(
|
||||
name = "A long space name that should be truncated",
|
||||
rawName = "A long space name that should be truncated",
|
||||
worldReadable = true,
|
||||
),
|
||||
isLastAdmin = true,
|
||||
|
|
|
|||
|
|
@ -13,8 +13,10 @@ import io.element.android.features.invite.api.acceptdecline.anAcceptDeclineInvit
|
|||
import io.element.android.libraries.architecture.AsyncAction
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.matrix.api.room.CurrentUserMembership
|
||||
import io.element.android.libraries.matrix.api.room.join.JoinRule
|
||||
import io.element.android.libraries.matrix.api.spaces.SpaceRoom
|
||||
import io.element.android.libraries.previewutils.room.aSpaceRoom
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
import kotlinx.collections.immutable.toImmutableMap
|
||||
import kotlinx.collections.immutable.toImmutableSet
|
||||
|
|
@ -25,7 +27,17 @@ open class SpaceStateProvider : PreviewParameterProvider<SpaceState> {
|
|||
aSpaceState(),
|
||||
aSpaceState(
|
||||
parentSpace = aSpaceRoom(
|
||||
name = null,
|
||||
joinRule = JoinRule.Public
|
||||
)
|
||||
),
|
||||
aSpaceState(
|
||||
parentSpace = aSpaceRoom(
|
||||
joinRule = JoinRule.Restricted(persistentListOf())
|
||||
)
|
||||
),
|
||||
aSpaceState(
|
||||
parentSpace = aSpaceRoom(
|
||||
rawName = null,
|
||||
numJoinedMembers = 5,
|
||||
childrenCount = 10,
|
||||
worldReadable = true,
|
||||
|
|
|
|||
|
|
@ -134,10 +134,9 @@ private fun SpaceViewContent(
|
|||
avatarData = currentSpace.getAvatarData(AvatarSize.SpaceHeader),
|
||||
name = currentSpace.name,
|
||||
topic = currentSpace.topic,
|
||||
joinRule = currentSpace.joinRule,
|
||||
visibility = currentSpace.visibility,
|
||||
heroes = currentSpace.heroes.toImmutableList(),
|
||||
numberOfMembers = currentSpace.numJoinedMembers,
|
||||
numberOfRooms = currentSpace.childrenCount,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.junit.Test
|
|||
class LeaveSpacePresenterTest {
|
||||
private val aSpace = aSpaceRoom(
|
||||
roomId = A_SPACE_ID,
|
||||
name = A_SPACE_NAME,
|
||||
rawName = A_SPACE_NAME,
|
||||
)
|
||||
|
||||
@Test
|
||||
|
|
@ -198,7 +198,7 @@ class LeaveSpacePresenterTest {
|
|||
private fun aLeaveSpaceRoom(
|
||||
spaceRoom: SpaceRoom = aSpaceRoom(
|
||||
roomId = A_SPACE_ID,
|
||||
name = A_SPACE_NAME,
|
||||
rawName = A_SPACE_NAME,
|
||||
),
|
||||
isLastAdmin: Boolean = false,
|
||||
) = LeaveSpaceRoom(
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class SpaceViewTest {
|
|||
|
||||
@Test
|
||||
fun `clicking on a room name invokes the expected callback`() {
|
||||
val aSpaceRoom = aSpaceRoom(roomId = A_ROOM_ID, name = A_ROOM_NAME)
|
||||
val aSpaceRoom = aSpaceRoom(roomId = A_ROOM_ID, rawName = A_ROOM_NAME)
|
||||
val eventsRecorder = EventsRecorder<SpaceEvents>(expectEvents = false)
|
||||
ensureCalledOnceWithParam(aSpaceRoom) {
|
||||
rule.setSpaceView(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue