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

DROID-2905 Primitives | Epic | Foundation for primitives (#2098)

Co-authored-by: Evgenii Kozlov <enklave.mare.balticum@protonmail.com>
This commit is contained in:
Konstantin Ivanov 2025-02-28 20:47:43 +01:00 committed by GitHub
parent 88aa30d64b
commit 4bc1e060f3
Signed by: github
GPG key ID: B5690EEEBB952194
153 changed files with 10877 additions and 1616 deletions

View file

@ -215,16 +215,6 @@ fun StubCallout(
backgroundColor = backgroundColor
)
fun StubRelation(
relationKey: String = MockDataFactory.randomString(),
format: RelationFormat = Relation.Format.SHORT_TEXT
): Relation = Relation(
key = relationKey,
name = MockDataFactory.randomString(),
format = format,
source = Relation.Source.values().random()
)
fun StubBookmark(
id: Id = MockDataFactory.randomString(),
url: Url? = MockDataFactory.randomString(),

View file

@ -24,6 +24,7 @@ fun StubObject(
targetObjectType: Id? = null,
identity: Id? = null,
fileExt: String? = null,
extraFields: Map<String, Any> = emptyMap()
): ObjectWrapper.Basic = ObjectWrapper.Basic(
map = mapOf(
Relations.ID to id,
@ -43,7 +44,7 @@ fun StubObject(
Relations.UNIQUE_KEY to uniqueKey,
Relations.IDENTITY to identity,
Relations.FILE_EXT to fileExt
)
) + extraFields
)
fun StubSpaceMember(
@ -104,7 +105,11 @@ fun StubObjectType(
isReadOnly: Boolean? = null,
isHidden: Boolean? = null,
sourceObject: Id? = null,
recommendedLayout: Double? = null
recommendedLayout: Double? = null,
recommendedRelations: List<String> = emptyList(),
recommendedHiddenRelations: List<String> = emptyList(),
recommendedFeaturedRelations: List<String> = emptyList(),
space: Id? = null
): ObjectWrapper.Type = ObjectWrapper.Type(
map = mapOf(
Relations.ID to id,
@ -121,5 +126,9 @@ fun StubObjectType(
Relations.SOURCE_OBJECT to sourceObject,
Relations.RECOMMENDED_LAYOUT to recommendedLayout,
Relations.UNIQUE_KEY to uniqueKey,
Relations.RECOMMENDED_RELATIONS to recommendedRelations,
Relations.RECOMMENDED_HIDDEN_RELATIONS to recommendedHiddenRelations,
Relations.RECOMMENDED_FEATURED_RELATIONS to recommendedFeaturedRelations,
Relations.SPACE_ID to space
)
)