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

DROID-885 Set | Enhancement | Change source logic (#2869)

* DROID-885 remove source from data view model + fix tests

* DROID-885 update from SetSource Event to blockDataviewTargetObjectIdSet

* DROID-885 fix tests

* DROID-885 SetTargetObjectId event

* DROID-885 get set of from set details + test

* DROID-885 inline set, deleted source view state

* DROID-885 editor blockView setTargetObjectId, event

* DROID-885 fix test + stub

* DROID-885 stub added

* DROID-885 test

* DROID-885 rename

* DROID-885 pr fix
This commit is contained in:
Konstantin Ivanov 2023-01-27 16:33:20 +01:00 committed by GitHub
parent aa58ae4d04
commit 87a2b73e8a
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 493 additions and 382 deletions

View file

@ -315,4 +315,26 @@ fun StubTableCells(columns: List<Block>, rows: List<Block>): List<Block> {
}
}
return cells.toList()
}
}
fun StubDataViewBlock(
id: Id = MockDataFactory.randomUuid(),
children: List<Id> = emptyList(),
fields: Block.Fields = Block.Fields.empty(),
backgroundColor: String? = null,
targetObjectId: Id = "",
viewers: List<Block.Content.DataView.Viewer> = emptyList(),
relations: List<Relation> = emptyList(),
relationsIndex: List<RelationLink> = emptyList(),
): Block = Block(
id = id,
content = Block.Content.DataView(
targetObjectId = targetObjectId,
relationsIndex = relationsIndex,
viewers = viewers,
relations = relations
),
children = children,
fields = fields,
backgroundColor = backgroundColor
)

View file

@ -6,12 +6,10 @@ fun StubDataView(
id : Id = MockDataFactory.randomUuid(),
views: List<DVViewer> = emptyList(),
relations: List<RelationLink> = emptyList(),
sources: List<Id> = emptyList(),
targetObjectId: Id = MockDataFactory.randomUuid()
) : Block = Block(
id = id,
content = DV(
sources = sources,
relations = emptyList(),
relationsIndex= relations,
viewers = views,
@ -45,6 +43,14 @@ fun StubDataViewViewRelation(
isVisible = isVisible
)
fun StubRelationLink(
key: Key = MockDataFactory.randomUuid(),
format: RelationFormat = RelationFormat.LONG_TEXT,
): RelationLink = RelationLink(
key = key,
format = format
)
fun StubSort(
relationKey: Key = MockDataFactory.randomUuid(),
type: DVSortType = DVSortType.ASC