Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ownCloud admins and users.

## Summary

* Bugfix - Edit space option available when there is no connection: [#4742](https://github.com/owncloud/android/issues/4742)
* Change - Migrate tests to the new kotlinx-coroutines-test API: [#4710](https://github.com/owncloud/android/issues/4710)
* Change - Increase rating dialog delay: [#4744](https://github.com/owncloud/android/pull/4744)
* Enhancement - Show members of a space: [#4612](https://github.com/owncloud/android/issues/4612)
Expand All @@ -48,6 +49,14 @@ ownCloud admins and users.

## Details

* Bugfix - Edit space option available when there is no connection: [#4742](https://github.com/owncloud/android/issues/4742)

A new condition has been added to hide the edit space option when no network
connection is available.

https://github.com/owncloud/android/issues/4742
https://github.com/owncloud/android/pull/4750

* Change - Migrate tests to the new kotlinx-coroutines-test API: [#4710](https://github.com/owncloud/android/issues/4710)

Some tests from view model classes have been refactored in order to use the new
Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/4750
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Edit space option available when there is no connection

A new condition has been added to hide the edit space option when no network connection is available.

https://github.com/owncloud/android/issues/4742
https://github.com/owncloud/android/pull/4750
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author Jorge Aguado Recio
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2025 ownCloud GmbH.
* Copyright (C) 2026 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -94,6 +94,7 @@ class SpacesListFragment :
private var userPermissions = mutableSetOf<UserPermissions>()
private var editQuotaPermission = false
private var selectedImagePath: String? = null
private var accountId: String? = null
private lateinit var currentSpace: OCSpace

private val spacesListViewModel: SpacesListViewModel by viewModel {
Expand Down Expand Up @@ -205,7 +206,10 @@ class SpacesListFragment :
when (val uiResult = event.peekContent()) {
is UIResult.Success -> {
Timber.d("The account id for $accountName is: ${uiResult.data}")
uiResult.data?.let { spacesListViewModel.getUserPermissions(it) }
uiResult.data?.let {
accountId = it
spacesListViewModel.getUserPermissions(it)
}
}
is UIResult.Loading -> { }
is UIResult.Error -> {
Expand All @@ -231,6 +235,7 @@ class SpacesListFragment :
is UIResult.Loading -> { }
is UIResult.Error -> {
Timber.e(uiResult.error, "Failed to retrieve user permissions for account $accountName")
userPermissions.clear()
binding.fabCreateSpace.isVisible = false
}
}
Expand Down Expand Up @@ -304,6 +309,7 @@ class SpacesListFragment :

override fun onThreeDotButtonClick(ocSpace: OCSpace) {
currentSpace = ocSpace
accountId?.let { spacesListViewModel.getUserPermissions(it) }
spacesListViewModel.filterMenuOptions(ocSpace, userPermissions)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @author Jorge Aguado Recio
*
* Copyright (C) 2025 ownCloud GmbH.
* Copyright (C) 2026 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -49,7 +49,7 @@ class FilterSpaceMenuOptionsUseCase(
optionsToShow.add(SpaceMenuOption.MEMBERS)
}

if (editPermission || isSpaceManager) {
if (editPermission || (isSpaceManager && currentSpace.isDisabled)) {
optionsToShow.add(SpaceMenuOption.EDIT)
}

Expand Down
Loading