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

DROID-2872 Create object | Filter by templates object type (#1710)

This commit is contained in:
Konstantin Ivanov 2024-10-22 17:14:36 +02:00 committed by Evgenii Kozlov
parent 52c88342ab
commit f9bb2f4c48
2 changed files with 10 additions and 0 deletions

View file

@ -90,6 +90,10 @@ fun ObjectState.DataView.isCreateObjectAllowed(objectType: ObjectWrapper.Type? =
return true
}
if (objectType?.uniqueKey == ObjectTypeIds.TEMPLATE) {
return false
}
val skipLayouts = fileLayouts + systemLayouts + listOf(ObjectType.Layout.PARTICIPANT)
return !skipLayouts.contains(objectType?.recommendedLayout)
}

View file

@ -14,6 +14,7 @@ import com.anytypeio.anytype.core_models.RelationFormat
import com.anytypeio.anytype.core_models.Relations
import com.anytypeio.anytype.core_models.primitives.SpaceId
import com.anytypeio.anytype.core_models.primitives.TypeKey
import com.anytypeio.anytype.core_models.restrictions.ObjectRestriction
import com.anytypeio.anytype.domain.library.StoreSearchParams
import com.anytypeio.anytype.presentation.objects.SupportedLayouts
@ -787,6 +788,11 @@ object ObjectSearchConstants {
DVFilter(
relation = Relations.UNIQUE_KEY,
condition = DVFilterCondition.NOT_EMPTY
),
DVFilter(
relation = Relations.UNIQUE_KEY,
condition = DVFilterCondition.NOT_EQUAL,
value = ObjectTypeUniqueKeys.TEMPLATE
)
)
)