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

DROID-3185 File as Object | New layout ui, part 1 (#1947)

This commit is contained in:
Konstantin Ivanov 2024-12-23 15:53:37 +01:00 committed by konstantiniiv
parent 4f60643653
commit d979ff0e25
44 changed files with 876 additions and 607 deletions

View file

@ -94,9 +94,11 @@ fun StubFile(
backgroundColor: String? = null,
targetObjectId: Id = MockDataFactory.randomString(),
name: String = MockDataFactory.randomString(),
mime: String = MockDataFactory.randomString(),
size: Long = MockDataFactory.randomLong(),
type: Block.Content.File.Type? = null,
state: Block.Content.File.State? = null,
type: Block.Content.File.Type = Block.Content.File.Type.FILE,
state: Block.Content.File.State = Block.Content.File.State.DONE,
addedAt: Long = MockDataFactory.randomLong()
) : Block = Block(
id = id,
children = children,
@ -107,7 +109,9 @@ fun StubFile(
name = name,
targetObjectId = targetObjectId,
type = type,
state = state
state = state,
mime = mime,
addedAt = addedAt
)
)

View file

@ -22,7 +22,8 @@ fun StubObject(
isHidden: Boolean? = null,
links: List<Id> = emptyList(),
targetObjectType: Id? = null,
identity: Id? = null
identity: Id? = null,
fileExt: String? = null,
): ObjectWrapper.Basic = ObjectWrapper.Basic(
map = mapOf(
Relations.ID to id,
@ -40,7 +41,8 @@ fun StubObject(
Relations.LINKS to links,
Relations.TARGET_OBJECT_TYPE to targetObjectType,
Relations.UNIQUE_KEY to uniqueKey,
Relations.IDENTITY to identity
Relations.IDENTITY to identity,
Relations.FILE_EXT to fileExt
)
)

View file

@ -84,20 +84,6 @@ object MockBlockFactory {
)
)
fun makeFileBlock(): Block = Block(
id = MockDataFactory.randomUuid(),
fields = Block.Fields(emptyMap()),
content = Block.Content.File(
targetObjectId = MockDataFactory.randomUuid(),
name = MockDataFactory.randomString(),
state = Block.Content.File.State.DONE,
mime = MockDataFactory.randomString(),
size = MockDataFactory.randomLong(),
type = Block.Content.File.Type.FILE
),
children = emptyList()
)
fun makeTitleBlock(): Block = Block(
id = MockDataFactory.randomUuid(),
fields = Block.Fields(emptyMap()),