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:
parent
aa58ae4d04
commit
87a2b73e8a
59 changed files with 493 additions and 382 deletions
|
@ -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
|
||||
)
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue