Skip to content

Commit

Permalink
DROID-3120 Files | Show hidden files in Manage space files screen (#1910
Browse files Browse the repository at this point in the history
)
  • Loading branch information
konstantiniiv authored Dec 12, 2024
1 parent 0a42774 commit 85d64f7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1106,44 +1106,52 @@ object ObjectSearchConstants {
)
)

fun filesFilters(space: Id) = listOf(
DVFilter(
relation = Relations.IS_DELETED,
condition = DVFilterCondition.NOT_EQUAL,
value = true
),
DVFilter(
relation = Relations.IS_ARCHIVED,
condition = DVFilterCondition.NOT_EQUAL,
value = true
),
DVFilter(
relation = Relations.IS_HIDDEN,
condition = DVFilterCondition.NOT_EQUAL,
value = true
),
DVFilter(
relation = Relations.IS_HIDDEN_DISCOVERY,
condition = DVFilterCondition.NOT_EQUAL,
value = true
),
DVFilter(
relation = Relations.LAYOUT,
condition = DVFilterCondition.IN,
value = listOf(
ObjectType.Layout.IMAGE.code.toDouble(),
ObjectType.Layout.FILE.code.toDouble(),
ObjectType.Layout.VIDEO.code.toDouble(),
ObjectType.Layout.AUDIO.code.toDouble(),
ObjectType.Layout.PDF.code.toDouble()
fun filesFilters(space: Id, hiddenDiscovery: Boolean = true) = buildList {
addAll(
listOf(
DVFilter(
relation = Relations.IS_DELETED,
condition = DVFilterCondition.NOT_EQUAL,
value = true
),
DVFilter(
relation = Relations.IS_ARCHIVED,
condition = DVFilterCondition.NOT_EQUAL,
value = true
),
DVFilter(
relation = Relations.IS_HIDDEN,
condition = DVFilterCondition.NOT_EQUAL,
value = true
),
DVFilter(
relation = Relations.LAYOUT,
condition = DVFilterCondition.IN,
value = listOf(
ObjectType.Layout.IMAGE.code.toDouble(),
ObjectType.Layout.FILE.code.toDouble(),
ObjectType.Layout.VIDEO.code.toDouble(),
ObjectType.Layout.AUDIO.code.toDouble(),
ObjectType.Layout.PDF.code.toDouble()
)
),
DVFilter(
relation = Relations.SPACE_ID,
condition = DVFilterCondition.EQUAL,
value = space
)
)
),
DVFilter(
relation = Relations.SPACE_ID,
condition = DVFilterCondition.EQUAL,
value = space
)
)
if (hiddenDiscovery) {
add(
DVFilter(
relation = Relations.IS_HIDDEN_DISCOVERY,
condition = DVFilterCondition.NOT_EQUAL,
value = true
)
)
}
}

fun setsByObjectTypeFilters(types: List<Id>) = listOf(
DVFilter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class CollectionViewModel(
}

fun onStart(subscription: Subscription) {
Timber.i("CollectionViewModel, onStart, subscription:${subscription}")
val isFirstLaunch = this.subscription == Subscription.None
this.subscription = subscription
if (permission.value?.isOwnerOrEditor() == true && isFirstLaunch && (subscription == Subscription.Bin || subscription == Subscription.Files)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ sealed class Subscription(
)
),
limit = 0,
space = { spaces -> ObjectSearchConstants.filesFilters(spaces) }
space = { spaces ->
ObjectSearchConstants.filesFilters(
space = spaces,
hiddenDiscovery = false
)
}
)

data object None : Subscription("", emptyList(), emptyList(), 0, space = { emptyList() })
Expand Down

0 comments on commit 85d64f7

Please sign in to comment.