change(roles and permissions): change title for space
This commit is contained in:
@@ -35,6 +35,7 @@ class ChangeRoomPermissionsPresenter(
|
||||
) : Presenter<ChangeRoomPermissionsState> {
|
||||
companion object {
|
||||
private fun itemsForSection(section: RoomPermissionsSection) = when (section) {
|
||||
RoomPermissionsSection.SpaceDetails,
|
||||
RoomPermissionsSection.RoomDetails -> persistentListOf(
|
||||
RoomPermissionType.ROOM_NAME,
|
||||
RoomPermissionType.ROOM_AVATAR,
|
||||
@@ -53,9 +54,10 @@ class ChangeRoomPermissionsPresenter(
|
||||
|
||||
private fun RoomPermissionsSection.shouldShow(isSpace: Boolean): Boolean {
|
||||
return when (this) {
|
||||
RoomPermissionsSection.RoomDetails -> true
|
||||
RoomPermissionsSection.RoomDetails -> !isSpace
|
||||
RoomPermissionsSection.MembershipModeration -> true
|
||||
RoomPermissionsSection.MessagesAndContent -> !isSpace
|
||||
RoomPermissionsSection.SpaceDetails -> isSpace
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ data class ChangeRoomPermissionsState(
|
||||
}
|
||||
|
||||
enum class RoomPermissionsSection {
|
||||
SpaceDetails,
|
||||
RoomDetails,
|
||||
MessagesAndContent,
|
||||
MembershipModeration,
|
||||
|
||||
@@ -74,7 +74,6 @@ fun ChangeRoomPermissionsView(
|
||||
selectedOption = state.selectedRoleForType(permissionType),
|
||||
options = SelectableRole.entries.toImmutableList(),
|
||||
onSelectOption = { role ->
|
||||
println("Selected $role for $permissionType")
|
||||
state.eventSink(
|
||||
ChangeRoomPermissionsEvent.ChangeMinimumRoleForAction(
|
||||
action = permissionType,
|
||||
@@ -114,9 +113,10 @@ fun ChangeRoomPermissionsView(
|
||||
|
||||
@Composable
|
||||
private fun titleForSection(section: RoomPermissionsSection): String = when (section) {
|
||||
RoomPermissionsSection.RoomDetails -> stringResource(R.string.screen_room_change_permissions_room_details)
|
||||
RoomPermissionsSection.MessagesAndContent -> stringResource(R.string.screen_room_change_permissions_messages_and_content)
|
||||
RoomPermissionsSection.MembershipModeration -> stringResource(R.string.screen_room_change_permissions_member_moderation)
|
||||
RoomPermissionsSection.SpaceDetails -> stringResource(R.string.screen_room_roles_and_permissions_space_details)
|
||||
RoomPermissionsSection.RoomDetails -> stringResource(R.string.screen_room_roles_and_permissions_room_details)
|
||||
RoomPermissionsSection.MessagesAndContent -> stringResource(R.string.screen_room_roles_and_permissions_messages_and_content)
|
||||
RoomPermissionsSection.MembershipModeration -> stringResource(R.string.screen_room_roles_and_permissions_member_moderation)
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
<string name="screen_room_change_permissions_messages_and_content">"Messages and content"</string>
|
||||
<string name="screen_room_change_permissions_moderators">"Admins and moderators"</string>
|
||||
<string name="screen_room_change_permissions_remove_people">"Remove people and decline requests to join"</string>
|
||||
<string name="screen_room_change_permissions_room_avatar">"Change room avatar"</string>
|
||||
<string name="screen_room_change_permissions_room_avatar">"Change avatar"</string>
|
||||
<string name="screen_room_change_permissions_room_details">"Room details"</string>
|
||||
<string name="screen_room_change_permissions_room_name">"Change room name"</string>
|
||||
<string name="screen_room_change_permissions_room_topic">"Change room topic"</string>
|
||||
<string name="screen_room_change_permissions_room_name">"Change name"</string>
|
||||
<string name="screen_room_change_permissions_room_topic">"Change topic"</string>
|
||||
<string name="screen_room_change_permissions_send_messages">"Send messages"</string>
|
||||
<string name="screen_room_change_role_administrators_title">"Edit Admins"</string>
|
||||
<string name="screen_room_change_role_confirm_add_admin_description">"You will not be able to undo this action. You are promoting the user to have the same power level as you."</string>
|
||||
@@ -66,5 +66,6 @@
|
||||
<string name="screen_room_roles_and_permissions_reset_confirm_title">"Reset permissions?"</string>
|
||||
<string name="screen_room_roles_and_permissions_roles_header">"Roles"</string>
|
||||
<string name="screen_room_roles_and_permissions_room_details">"Room details"</string>
|
||||
<string name="screen_room_roles_and_permissions_space_details">"Space details"</string>
|
||||
<string name="screen_room_roles_and_permissions_title">"Roles and permissions"</string>
|
||||
</resources>
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
<string name="screen_room_change_permissions_messages_and_content">"Messages and content"</string>
|
||||
<string name="screen_room_change_permissions_moderators">"Admins and moderators"</string>
|
||||
<string name="screen_room_change_permissions_remove_people">"Remove people and decline requests to join"</string>
|
||||
<string name="screen_room_change_permissions_room_avatar">"Change room avatar"</string>
|
||||
<string name="screen_room_change_permissions_room_avatar">"Change avatar"</string>
|
||||
<string name="screen_room_change_permissions_room_details">"Room details"</string>
|
||||
<string name="screen_room_change_permissions_room_name">"Change room name"</string>
|
||||
<string name="screen_room_change_permissions_room_topic">"Change room topic"</string>
|
||||
<string name="screen_room_change_permissions_room_name">"Change name"</string>
|
||||
<string name="screen_room_change_permissions_room_topic">"Change topic"</string>
|
||||
<string name="screen_room_change_permissions_send_messages">"Send messages"</string>
|
||||
<string name="screen_room_change_role_administrators_title">"Edit Admins"</string>
|
||||
<string name="screen_room_change_role_confirm_add_admin_description">"You will not be able to undo this action. You are promoting the user to have the same power level as you."</string>
|
||||
|
||||
@@ -371,6 +371,7 @@
|
||||
"includeRegex" : [
|
||||
"screen_room_change_.*",
|
||||
"screen_room_roles_.*",
|
||||
"screen\\.room_roles_and_permissions\\..*",
|
||||
"screen_room_member_list.*"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user