mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Update appearance of admins when changing moderators. (#2654)
This commit is contained in:
@@ -7324,7 +7324,7 @@
|
|||||||
repositoryURL = "https://github.com/element-hq/compound-ios";
|
repositoryURL = "https://github.com/element-hq/compound-ios";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = revision;
|
kind = revision;
|
||||||
revision = 19bc4c5cf9c69b7b7aeb9ac8c937c2c81a83e8b1;
|
revision = 6d42477c54a1dae128e0cb3645e3d00a53a5736c;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
F76A08D0EA29A07A54F4EB4D /* XCRemoteSwiftPackageReference "swift-collections" */ = {
|
F76A08D0EA29A07A54F4EB4D /* XCRemoteSwiftPackageReference "swift-collections" */ = {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/element-hq/compound-ios",
|
"location" : "https://github.com/element-hq/compound-ios",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "19bc4c5cf9c69b7b7aeb9ac8c937c2c81a83e8b1"
|
"revision" : "6d42477c54a1dae128e0cb3645e3d00a53a5736c"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -529,6 +529,7 @@
|
|||||||
"screen_room_change_role_confirm_demote_self_description" = "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.";
|
"screen_room_change_role_confirm_demote_self_description" = "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.";
|
||||||
"screen_room_change_role_confirm_demote_self_title" = "Demote yourself?";
|
"screen_room_change_role_confirm_demote_self_title" = "Demote yourself?";
|
||||||
"screen_room_change_role_invited_member_name" = "%1$@ (Pending)";
|
"screen_room_change_role_invited_member_name" = "%1$@ (Pending)";
|
||||||
|
"screen_room_change_role_moderators_admin_section_footer" = "Admins automatically have moderator privileges";
|
||||||
"screen_room_change_role_moderators_title" = "Edit Moderators";
|
"screen_room_change_role_moderators_title" = "Edit Moderators";
|
||||||
"screen_room_change_role_unsaved_changes_description" = "You have unsaved changes.";
|
"screen_room_change_role_unsaved_changes_description" = "You have unsaved changes.";
|
||||||
"screen_room_change_role_unsaved_changes_title" = "Save changes?";
|
"screen_room_change_role_unsaved_changes_title" = "Save changes?";
|
||||||
|
|||||||
@@ -1287,6 +1287,8 @@ internal enum L10n {
|
|||||||
internal static func screenRoomChangeRoleInvitedMemberName(_ p1: Any) -> String {
|
internal static func screenRoomChangeRoleInvitedMemberName(_ p1: Any) -> String {
|
||||||
return L10n.tr("Localizable", "screen_room_change_role_invited_member_name", String(describing: p1))
|
return L10n.tr("Localizable", "screen_room_change_role_invited_member_name", String(describing: p1))
|
||||||
}
|
}
|
||||||
|
/// Admins automatically have moderator privileges
|
||||||
|
internal static var screenRoomChangeRoleModeratorsAdminSectionFooter: String { return L10n.tr("Localizable", "screen_room_change_role_moderators_admin_section_footer") }
|
||||||
/// Edit Moderators
|
/// Edit Moderators
|
||||||
internal static var screenRoomChangeRoleModeratorsTitle: String { return L10n.tr("Localizable", "screen_room_change_role_moderators_title") }
|
internal static var screenRoomChangeRoleModeratorsTitle: String { return L10n.tr("Localizable", "screen_room_change_role_moderators_title") }
|
||||||
/// Admins
|
/// Admins
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ struct RoomChangeRolesScreen: View {
|
|||||||
|
|
||||||
RoomChangeRolesScreenSection(members: context.viewState.administrators,
|
RoomChangeRolesScreenSection(members: context.viewState.administrators,
|
||||||
title: L10n.screenRoomChangeRoleSectionAdministrators,
|
title: L10n.screenRoomChangeRoleSectionAdministrators,
|
||||||
|
isAdministratorsSection: true,
|
||||||
context: context)
|
context: context)
|
||||||
RoomChangeRolesScreenSection(members: context.viewState.moderators,
|
RoomChangeRolesScreenSection(members: context.viewState.moderators,
|
||||||
title: L10n.screenRoomChangeRoleSectionModerators,
|
title: L10n.screenRoomChangeRoleSectionModerators,
|
||||||
|
|||||||
+12
-1
@@ -20,6 +20,7 @@ import SwiftUI
|
|||||||
struct RoomChangeRolesScreenSection: View {
|
struct RoomChangeRolesScreenSection: View {
|
||||||
let members: [RoomMemberDetails]
|
let members: [RoomMemberDetails]
|
||||||
let title: String
|
let title: String
|
||||||
|
var isAdministratorsSection = false
|
||||||
|
|
||||||
@ObservedObject var context: RoomChangeRolesScreenViewModel.Context
|
@ObservedObject var context: RoomChangeRolesScreenViewModel.Context
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ struct RoomChangeRolesScreenSection: View {
|
|||||||
ForEach(members, id: \.id) { member in
|
ForEach(members, id: \.id) { member in
|
||||||
RoomChangeRolesScreenRow(member: member,
|
RoomChangeRolesScreenRow(member: member,
|
||||||
imageProvider: context.imageProvider,
|
imageProvider: context.imageProvider,
|
||||||
isSelected: context.viewState.isMemberSelected(member)) {
|
isSelected: isMemberSelected(member)) {
|
||||||
context.send(viewAction: .toggleMember(member))
|
context.send(viewAction: .toggleMember(member))
|
||||||
}
|
}
|
||||||
.disabled(member.role == .administrator)
|
.disabled(member.role == .administrator)
|
||||||
@@ -37,7 +38,17 @@ struct RoomChangeRolesScreenSection: View {
|
|||||||
} header: {
|
} header: {
|
||||||
Text(title)
|
Text(title)
|
||||||
.compoundListSectionHeader()
|
.compoundListSectionHeader()
|
||||||
|
} footer: {
|
||||||
|
if isAdministratorsSection, context.viewState.mode == .moderator {
|
||||||
|
Text(L10n.screenRoomChangeRoleModeratorsAdminSectionFooter)
|
||||||
|
.compoundListSectionFooter()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func isMemberSelected(_ member: RoomMemberDetails) -> Bool {
|
||||||
|
// We always show administrators as selected, even on the moderators screen.
|
||||||
|
member.role == .administrator || context.viewState.isMemberSelected(member)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:8f8a5ad7a853f08fa0624ca707c41b56f7fbc2075ac66631c32e0e3118ea9b9a
|
oid sha256:c050947321b872cef937327f956f6ce282b585164e334a2ded0c1a6871b97a25
|
||||||
size 207428
|
size 207373
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:6c2bfebcfb57baa6582ca914e3380ca382b4017c758b7c7b2af90a9680e7ddbb
|
oid sha256:190ec9f06d0f707b2d992dc119a9d823431afc851364ed909026c144f95fb7f0
|
||||||
size 206724
|
size 219356
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:89d3928a5ae405e6f1b695044b54f94aedb3ddfce583b6ba2e2b667c4eeba157
|
oid sha256:522510aba055a62fdcb83e53bc9878a88cf294b4d527cfd3aa00e7b539e3ddf1
|
||||||
size 233785
|
size 233731
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:2dd12a574b0287d8f3d4342fb207c76321fa2e8cf9b8f9773463ee1686f13211
|
oid sha256:cdf1b427af9c26275b95bea13f54b9512c32517b5d555d56eae3586f40e0d814
|
||||||
size 234107
|
size 261310
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:143c3399a49fd85bedeee78a0f739189208a2500b339afc07cc5bc6cc99ed686
|
oid sha256:2fcb5ae8d29561a48629bf39d6650bdae16bb4c100120e1bbd62fcf3c4903dda
|
||||||
size 156940
|
size 156870
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:92fe524e9a4fb9115fadc5e43f5f89d950573d6a0750fb83e87f61a729781a06
|
oid sha256:7459909962885d224379cb5445ffa1fda6dd870b7fe23314122caf74c945e33e
|
||||||
size 156764
|
size 168977
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:dc861092e7490dbd5fe06a541dbcd1dd46aa378dd41015e6e6619f0158f88843
|
oid sha256:f9941bc0720587c6feb921a8ab16a832dc75cf1a045612049a4d45d2a9fa2161
|
||||||
size 180421
|
size 180352
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:274993576e92cd103dced5b43595d4ae234811a49a0d20cf4fffc58fbf0bed7b
|
oid sha256:6033f58c1c9ee18d423fbbfa21514a2ba4244386c0d94efe77b02c33b2df84e4
|
||||||
size 179459
|
size 206795
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:9d015139ff3d614fe612060872d9214c5215255f11363152232ffe75a5ed9a79
|
oid sha256:46807025feb73e117f6b28714c6bed1a57f07715805ff095414b6d3434b50e02
|
||||||
size 171955
|
size 171903
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:bf8bd2bedda7e59353aaf9bcd52fdd3c9cd247e530ceec7e629fcc1f930f23bc
|
oid sha256:020740b909cc24411a71c50a3441d7e5eed03ff4f36012ac8a59dcf23a0fb765
|
||||||
size 179850
|
size 179788
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:a5f00e0da1089b66c6cf8c256bec3adf8ccd11b51569cb19258c97eec3f7b5ba
|
oid sha256:30a969cfda9312547cd3aeaec4b481c166fed86857859eee4a7fe9d1cf1428c7
|
||||||
size 112584
|
size 112494
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:b9cd8c744acbd7733f3099ec865aa0d3205136f3f2bef09399a53d798af4409b
|
oid sha256:b35ae18d8da3e7d8f6e7329c91da9f160a593778844173351839caa0ba70d512
|
||||||
size 116515
|
size 116418
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:434837f715137f03e5f48cb56ab1d0193fc9f6b48bb61a10b0ccbae589c7f594
|
oid sha256:5a7670f624c66f3afb698d0d5850fdf12a02ea3b740c8b6408760a569f05bcfd
|
||||||
size 173698
|
size 173650
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:7fc74562fe429572eb56ccb21b84593ac1e3fc21f0235739b9d77cb5f5343cba
|
oid sha256:0d5dc513c8698a4f398e311501b4bedb2937a8bd43938309f4b4054e4951cfdc
|
||||||
size 194132
|
size 194090
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:b2e97717f2bd4917e118ff501d89a005a415193b713c57a45dbc70599988d634
|
oid sha256:9cae79385828ec65bf7559d955ab8c49d5d4021bdfdbae92f92758a04586d393
|
||||||
size 119132
|
size 119079
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:403d910dae5ed50cefebead6e4be0621ba68945fd411ded7be4f92609b3c6c39
|
oid sha256:b2dee14f97dca60fb4641f0128e3cd5c803876f9aeb2a8fb301b8e9fe5800cb6
|
||||||
size 144688
|
size 144633
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:2c24a8f5a2258304c5dfbbe02447951c14537aa73af08335b5b376ee0e1fd822
|
oid sha256:dea655a3375f6af082632d59c7ac020d24f292d8c7bb789bca13e2089425e7ed
|
||||||
size 173981
|
size 175262
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:4b1efe1ef6bbbecd3778576f3dc821c677c923e21c7660a635f09552af3abee3
|
oid sha256:a037983772251085fa9efbfcbb6a614f43939be42e2d698283385a4770a0b7ed
|
||||||
size 181258
|
size 181006
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:466cb2533515beb73b365230afc8f542679deaeccf63213bb6b3ce46e300237a
|
oid sha256:1c91a05fdf3a77b8bd445ab4be1c5da96cd0823ad1cf8cb0c77cba6d5cc8a3af
|
||||||
size 172744
|
size 178792
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:8a83c79774e8216fb517311a97993d1159173705b69bdcfb0c7b0f52e17648e5
|
oid sha256:e42b73ed2750ed6a0ea0a32700fb2729ecf5b13aaf2e243563d38a5f0e086723
|
||||||
size 178534
|
size 180195
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ packages:
|
|||||||
# path: ../matrix-rust-sdk
|
# path: ../matrix-rust-sdk
|
||||||
Compound:
|
Compound:
|
||||||
url: https://github.com/element-hq/compound-ios
|
url: https://github.com/element-hq/compound-ios
|
||||||
revision: 19bc4c5cf9c69b7b7aeb9ac8c937c2c81a83e8b1
|
revision: 6d42477c54a1dae128e0cb3645e3d00a53a5736c
|
||||||
# path: ../compound-ios
|
# path: ../compound-ios
|
||||||
AnalyticsEvents:
|
AnalyticsEvents:
|
||||||
url: https://github.com/matrix-org/matrix-analytics-events
|
url: https://github.com/matrix-org/matrix-analytics-events
|
||||||
|
|||||||
Reference in New Issue
Block a user