handle the case where a non parent joined space is already available in the existing restricted join rule

This commit is contained in:
Mauro Romito
2025-12-11 16:53:13 +01:00
committed by Mauro
parent 00b2895e25
commit 55e88245f5
13 changed files with 266 additions and 42 deletions
@@ -15,8 +15,8 @@ struct ManageAuthorizedSpacesScreen: View {
Form {
header
if !context.viewState.authorizedSpacesSelection.joinedParentSpaces.isEmpty {
joinedParentsSection
if !context.viewState.authorizedSpacesSelection.joinedSpaces.isEmpty {
joinedSpacesSection
}
if !context.viewState.authorizedSpacesSelection.unknownSpacesIDs.isEmpty {
@@ -46,9 +46,9 @@ struct ManageAuthorizedSpacesScreen: View {
}
}
private var joinedParentsSection: some View {
private var joinedSpacesSection: some View {
Section {
ForEach(context.viewState.authorizedSpacesSelection.joinedParentSpaces, id: \.id) { space in
ForEach(context.viewState.authorizedSpacesSelection.joinedSpaces, id: \.id) { space in
ListRow(label: .avatar(title: space.name,
description: space.canonicalAlias,
icon: avatar(space: space)),
@@ -102,7 +102,7 @@ struct ManageAuthorizedSpacesScreen: View {
// MARK: - Previews
struct ManageAuthorizedSpacesScreen_Previews: PreviewProvider, TestablePreview {
static let viewModel = ManageAuthorizedSpacesScreenViewModel(authorizedSpacesSelection: .init(joinedParentSpaces: .mockJoinedSpaces2,
static let viewModel = ManageAuthorizedSpacesScreenViewModel(authorizedSpacesSelection: .init(joinedSpaces: .mockJoinedSpaces2,
unknownSpacesIDs: ["!unknown-space-id-1",
"!unknown-space-id-2",
"!unknown-space-id-3"],