mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-609 Sets | Enhancement | Viewer atomic changes (#2866)
* DROID-609 updateView event, fields * DROID-609 legacy * DROID-609 set, update fields in state * DROID-609 code style * DROID-609 add test * DROID-609 view update commands * DROID-609 fix commands proto * DROID-609 data view update commands, data + mw * DROID-609 add param to command * DROID-609 update data view use case update * DROID-609 data view update use case, invoke * DROID-609 fix after mw update * DROID-609 data view commands, data module * DROID-609 fix tests * DROID-609 filters legacy * DROID-609 add id param to filter model * DROID-609 legacy * DROID-609 legacy * DROID-609 legacy * DROID-609 param id added to sort model * DROID-609 show toast command * DROID-609 update events * DROID-609 sorts logic * DROID-609 filters and relations commands * DROID-609 update data view use case * DROID-609 sorts view fixes * DROID-609 fix commands * DROID-609 mw commands * DROID-609 rename * DROID-609 rename * DROID-609 fix tests * DROID-609 test fix * DROID-609 fix test * DROID-609 pr fixes * DROID-609 pr fix * DROID-609 ci start * DROID-609 ci off * DROID-609 pr fix
This commit is contained in:
parent
ba3b4a3f6c
commit
948b5ade22
78 changed files with 1528 additions and 1161 deletions
|
@ -3,15 +3,15 @@ package com.anytypeio.anytype.core_models
|
|||
import com.anytypeio.anytype.test_utils.MockDataFactory
|
||||
|
||||
fun StubDataView(
|
||||
id : Id = MockDataFactory.randomUuid(),
|
||||
id: Id = MockDataFactory.randomUuid(),
|
||||
views: List<DVViewer> = emptyList(),
|
||||
relations: List<RelationLink> = emptyList(),
|
||||
targetObjectId: Id = MockDataFactory.randomUuid()
|
||||
) : Block = Block(
|
||||
): Block = Block(
|
||||
id = id,
|
||||
content = DV(
|
||||
relations = emptyList(),
|
||||
relationsIndex= relations,
|
||||
relationsIndex = relations,
|
||||
viewers = views,
|
||||
targetObjectId = targetObjectId
|
||||
),
|
||||
|
@ -20,25 +20,33 @@ fun StubDataView(
|
|||
)
|
||||
|
||||
fun StubDataViewView(
|
||||
id : Id = MockDataFactory.randomUuid(),
|
||||
id: Id = MockDataFactory.randomUuid(),
|
||||
filters: List<DVFilter> = emptyList(),
|
||||
sorts: List<DVSort> = emptyList(),
|
||||
type: DVViewerType = DVViewerType.GRID,
|
||||
name: String = MockDataFactory.randomString(),
|
||||
viewerRelations: List<DVViewerRelation> = emptyList()
|
||||
) : DVViewer = DVViewer(
|
||||
viewerRelations: List<DVViewerRelation> = emptyList(),
|
||||
cardSize: DVViewerCardSize = DVViewerCardSize.SMALL,
|
||||
hideIcon: Boolean = false,
|
||||
coverFit: Boolean = false,
|
||||
coverRelationKey: String? = null
|
||||
): DVViewer = DVViewer(
|
||||
id = id,
|
||||
filters = filters,
|
||||
sorts = sorts,
|
||||
type = type,
|
||||
name = name,
|
||||
viewerRelations = viewerRelations
|
||||
viewerRelations = viewerRelations,
|
||||
cardSize = cardSize,
|
||||
hideIcon = hideIcon,
|
||||
coverFit = coverFit,
|
||||
coverRelationKey = coverRelationKey
|
||||
)
|
||||
|
||||
fun StubDataViewViewRelation(
|
||||
key: Key = MockDataFactory.randomUuid(),
|
||||
isVisible: Boolean = MockDataFactory.randomBoolean()
|
||||
) : DVViewerRelation = DVViewerRelation(
|
||||
): DVViewerRelation = DVViewerRelation(
|
||||
key = key,
|
||||
isVisible = isVisible
|
||||
)
|
||||
|
@ -52,23 +60,26 @@ fun StubRelationLink(
|
|||
)
|
||||
|
||||
fun StubSort(
|
||||
id: Id = MockDataFactory.randomUuid(),
|
||||
relationKey: Key = MockDataFactory.randomUuid(),
|
||||
type: DVSortType = DVSortType.ASC
|
||||
): DVSort = DVSort(
|
||||
id = id,
|
||||
relationKey = relationKey,
|
||||
type = type
|
||||
)
|
||||
|
||||
fun StubFilter(
|
||||
id: Id = MockDataFactory.randomUuid(),
|
||||
relationKey: Key = MockDataFactory.randomUuid(),
|
||||
relationFormat: RelationFormat = RelationFormat.LONG_TEXT,
|
||||
operator: DVFilterOperator = DVFilterOperator.AND,
|
||||
condition: DVFilterCondition = DVFilterCondition.EQUAL,
|
||||
quickOption: DVFilterQuickOption = DVFilterQuickOption.EXACT_DATE,
|
||||
value: Any? = null
|
||||
|
||||
): DVFilter = DVFilter(
|
||||
relationKey = relationKey,
|
||||
id = id,
|
||||
relation = relationKey,
|
||||
relationFormat = relationFormat,
|
||||
operator = operator,
|
||||
condition = condition,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue