1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-3043 Chats | Fix | Disable the ability to manually create additional chats in spaces (#1786)

This commit is contained in:
Evgenii Kozlov 2024-11-08 15:00:38 +01:00 committed by GitHub
parent 7bfab8bfe1
commit 6d37e175d7
Signed by: github
GPG key ID: B5690EEEBB952194
6 changed files with 13 additions and 19 deletions

View file

@ -2395,7 +2395,7 @@ fun ObjectWrapper.Basic.navigation() : OpenObjectNavigation {
space = requireNotNull(spaceId)
)
}
ObjectType.Layout.CHAT -> {
ObjectType.Layout.CHAT_DERIVED -> {
OpenObjectNavigation.OpenDiscussion(
target = id,
space = requireNotNull(spaceId)
@ -2441,7 +2441,7 @@ fun ObjectType.Layout.navigation(
space = space
)
}
ObjectType.Layout.CHAT -> {
ObjectType.Layout.CHAT_DERIVED -> {
OpenObjectNavigation.OpenDiscussion(
target = target,
space = space

View file

@ -56,9 +56,9 @@ class ObjectTypeChangeViewModel(
private val pipeline = combine(searchQuery, setup) { query, setup ->
val recommendedLayouts = if (setup.isWithFiles) {
SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts + listOf(ObjectType.Layout.CHAT)
SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts
} else {
SupportedLayouts.editorLayouts + listOf(ObjectType.Layout.CHAT)
SupportedLayouts.editorLayouts
}
val myTypes = proceedWithGettingMyTypes(
query = query,

View file

@ -16,8 +16,7 @@ object SupportedLayouts {
ObjectType.Layout.NOTE,
ObjectType.Layout.BOOKMARK,
ObjectType.Layout.AUDIO,
ObjectType.Layout.PDF,
ObjectType.Layout.CHAT
ObjectType.Layout.PDF
)
val editorLayouts = listOf(
ObjectType.Layout.BASIC,
@ -53,8 +52,7 @@ object SupportedLayouts {
ObjectType.Layout.COLLECTION,
ObjectType.Layout.TODO,
ObjectType.Layout.NOTE,
ObjectType.Layout.BOOKMARK,
ObjectType.Layout.CHAT
ObjectType.Layout.BOOKMARK
)
val addAsLinkToLayouts = editorLayouts + listOf(

View file

@ -95,7 +95,6 @@ class LimitObjectTypeViewModel(
relation = Relations.RECOMMENDED_LAYOUT,
condition = DVFilterCondition.NOT_IN,
value = listOf(
ObjectType.Layout.CHAT.code.toDouble(),
ObjectType.Layout.CHAT_DERIVED.code.toDouble()
)
)

View file

@ -314,10 +314,7 @@ object ObjectSearchConstants {
DVFilter(
relation = Relations.RECOMMENDED_LAYOUT,
condition = DVFilterCondition.NOT_IN,
value = listOf(
ObjectType.Layout.CHAT.code.toDouble(),
ObjectType.Layout.CHAT_DERIVED.code.toDouble()
)
value = listOf(ObjectType.Layout.CHAT_DERIVED.code.toDouble())
)
)
}

View file

@ -109,7 +109,7 @@ class ObjectTypeChangeViewModelTest {
val vm = givenViewModel()
val expectedMyTypesFilters = ObjectSearchConstants.filterTypes(
recommendedLayouts = SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts + listOf(ObjectType.Layout.CHAT)
recommendedLayouts = SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts
)
// TESTING
@ -152,7 +152,7 @@ class ObjectTypeChangeViewModelTest {
val vm = givenViewModel()
val expectedMyTypesFilters = ObjectSearchConstants.filterTypes(
recommendedLayouts = SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts + listOf(ObjectType.Layout.CHAT)
recommendedLayouts = SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts
)
val expectedMyTypeKeys = ObjectSearchConstants.defaultKeysObjectType
@ -248,7 +248,7 @@ class ObjectTypeChangeViewModelTest {
val vm = givenViewModel()
val expectedMyTypesFilters = ObjectSearchConstants.filterTypes(
recommendedLayouts = SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts + listOf(ObjectType.Layout.CHAT)
recommendedLayouts = SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts
)
val expectedMyTypeKeys = ObjectSearchConstants.defaultKeysObjectType
@ -426,7 +426,7 @@ class ObjectTypeChangeViewModelTest {
val expectedInstalledTypeUniqueKey = ObjectTypeIds.PAGE
val expectedMyTypesFilters = ObjectSearchConstants.filterTypes(
recommendedLayouts = SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts + listOf(ObjectType.Layout.CHAT)
recommendedLayouts = SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts
)
val expectedMyTypeKeys = ObjectSearchConstants.defaultKeysObjectType
@ -434,7 +434,7 @@ class ObjectTypeChangeViewModelTest {
val expectedMarketplaceTypeFilters = buildList {
addAll(
ObjectSearchConstants.filterTypes(
recommendedLayouts = SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts + listOf(ObjectType.Layout.CHAT)
recommendedLayouts = SupportedLayouts.editorLayouts + SupportedLayouts.fileLayouts
)
)
add(
@ -566,7 +566,7 @@ class ObjectTypeChangeViewModelTest {
val vm = givenViewModel()
val expectedMyTypesFilters = ObjectSearchConstants.filterTypes(
recommendedLayouts = SupportedLayouts.editorLayouts + listOf(ObjectType.Layout.CHAT)
recommendedLayouts = SupportedLayouts.editorLayouts
)
// TESTING