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

Tech | Middleware 0.15.4 (#1493)

This commit is contained in:
Konstantin Ivanov 2021-05-26 10:15:32 +02:00 committed by GitHub
parent 0e446fe825
commit 302e95de28
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
82 changed files with 672 additions and 1029 deletions

View file

@ -2,9 +2,11 @@
## Version 0.2.0
## Version 0.1.11 [WIP]
### Middleware ⚙
* Updated middleware protocol to `0.15.3` (#1448)
* Updated middleware protocol to `0.15.4` (#1493)
## Version 0.1.9

View file

@ -152,9 +152,7 @@ class ClipboardTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id)
)
@ -417,9 +415,7 @@ class ClipboardTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id)
)

View file

@ -142,9 +142,7 @@ class CreateBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id)
)
@ -265,9 +263,7 @@ class CreateBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id)
)

View file

@ -100,9 +100,7 @@ class CreateRelationBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -182,9 +180,7 @@ class CreateRelationBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)
@ -267,9 +263,7 @@ class CreateRelationBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)

View file

@ -296,9 +296,7 @@ class DeleteBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id)
)
@ -531,9 +529,7 @@ class DeleteBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id, b.id)
)

View file

@ -78,9 +78,7 @@ class DescriptionTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)
@ -130,9 +128,7 @@ class DescriptionTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)

View file

@ -146,9 +146,7 @@ class FeaturedRelationTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, block1.id)
)
@ -258,9 +256,7 @@ class FeaturedRelationTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, block1.id)
)

View file

@ -6,6 +6,7 @@ import androidx.test.filters.LargeTest
import com.anytypeio.anytype.R
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.Layout
import com.anytypeio.anytype.core_models.SmartBlockType
import com.anytypeio.anytype.core_models.ext.content
import com.anytypeio.anytype.domain.cover.CoverType
import com.anytypeio.anytype.emojifier.data.DefaultDocumentEmojiIconProvider
@ -76,9 +77,7 @@ class LayoutTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(SmartBlockType.PAGE),
children = listOf(header.id, paragraph.id)
)
@ -128,9 +127,7 @@ class LayoutTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(SmartBlockType.PAGE),
children = listOf(header.id, paragraph.id)
)
@ -175,9 +172,7 @@ class LayoutTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(SmartBlockType.PAGE),
children = listOf(header.id, paragraph.id)
)
@ -223,9 +218,7 @@ class LayoutTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(SmartBlockType.PAGE),
children = listOf(header.id, paragraph.id)
)
@ -269,9 +262,7 @@ class LayoutTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(SmartBlockType.PAGE),
children = listOf(header.id, paragraph.id)
)
@ -317,9 +308,7 @@ class LayoutTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(SmartBlockType.PAGE),
children = listOf(header.id, paragraph.id)
)
@ -363,9 +352,7 @@ class LayoutTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(SmartBlockType.PAGE),
children = listOf(header.id, paragraph.id)
)

View file

@ -113,9 +113,7 @@ class ListBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(SmartBlockType.PAGE),
children = listOf(a.id)
)
@ -282,9 +280,7 @@ class ListBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id)
)

View file

@ -210,9 +210,7 @@ class MergeBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id)
)

View file

@ -100,9 +100,7 @@ class RelationBlockUITesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id, b.id)
)
@ -232,9 +230,7 @@ class RelationBlockUITesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, block1.id, block2.id, block3.id, block4.id, block5.id)
)
@ -394,9 +390,7 @@ class RelationBlockUITesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, block1.id, block2.id, block3.id, block4.id, block5.id)
)
@ -473,9 +467,7 @@ class RelationBlockUITesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id, b.id)
)
@ -562,9 +554,7 @@ class RelationBlockUITesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id, b.id)
)
@ -616,9 +606,7 @@ class RelationBlockUITesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, block.id)
)
@ -679,9 +667,7 @@ class RelationBlockUITesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -808,9 +794,7 @@ class RelationBlockUITesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -887,9 +871,7 @@ class RelationBlockUITesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -1021,9 +1003,7 @@ class RelationBlockUITesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, block1.id, block2.id, block3.id, block4.id, block5.id)
)

View file

@ -92,9 +92,7 @@ class ScrollAndMoveTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id, b.id)
)

View file

@ -10,7 +10,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.anytypeio.anytype.R
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_ui.widgets.text.TextInputWidget
import com.anytypeio.anytype.emojifier.data.DefaultDocumentEmojiIconProvider
import com.anytypeio.anytype.features.editor.base.EditorTestSetup
import com.anytypeio.anytype.features.editor.base.TestPageFragment
@ -19,7 +18,6 @@ import com.anytypeio.anytype.presentation.page.PageViewModel
import com.anytypeio.anytype.ui.page.PageFragment
import com.anytypeio.anytype.utils.*
import com.bartoszlipinski.disableanimationsrule.DisableAnimationsRule
import kotlinx.android.synthetic.main.fragment_page.*
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@ -88,9 +86,7 @@ class SlashTextWatcherTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -130,9 +126,7 @@ class SlashTextWatcherTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -174,9 +168,7 @@ class SlashTextWatcherTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -216,9 +208,7 @@ class SlashTextWatcherTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -259,9 +249,7 @@ class SlashTextWatcherTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -303,9 +291,7 @@ class SlashTextWatcherTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -345,9 +331,7 @@ class SlashTextWatcherTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -389,9 +373,7 @@ class SlashTextWatcherTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -448,9 +430,7 @@ class SlashTextWatcherTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, paragraph2.id)
)

View file

@ -113,9 +113,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -165,9 +163,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -217,9 +213,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -274,9 +268,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -331,9 +323,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -388,9 +378,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -445,9 +433,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -536,9 +522,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)
@ -632,9 +616,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, paragraph2.id)
)
@ -726,9 +708,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, paragraph2.id)
)
@ -825,9 +805,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, paragraph2.id)
)
@ -923,9 +901,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id, paragraph2.id)
)
@ -998,9 +974,7 @@ class SlashWidgetTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, paragraph.id)
)

View file

@ -74,9 +74,7 @@ class SplitBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
)
@ -227,9 +225,7 @@ class SplitBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
)
@ -378,9 +374,7 @@ class SplitBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
)
@ -529,9 +523,7 @@ class SplitBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
)
@ -680,9 +672,7 @@ class SplitBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
)
@ -833,9 +823,7 @@ class SplitBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
)
@ -986,9 +974,7 @@ class SplitBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
)
@ -1139,9 +1125,7 @@ class SplitBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
)
@ -1292,9 +1276,7 @@ class SplitBlockTesting : EditorTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
)

View file

@ -4,10 +4,7 @@ import androidx.core.os.bundleOf
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.anytypeio.anytype.R
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.DVViewerRelation
import com.anytypeio.anytype.core_models.ObjectType
import com.anytypeio.anytype.core_models.Relation
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.mocking.MockDataFactory
import com.anytypeio.anytype.ui.sets.ObjectSetFragment
import com.anytypeio.anytype.utils.checkHasText
@ -135,9 +132,7 @@ class ObjectSetGridColumnRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)

View file

@ -6,10 +6,7 @@ import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.anytypeio.anytype.R
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.DVViewerRelation
import com.anytypeio.anytype.core_models.ObjectType
import com.anytypeio.anytype.core_models.Relation
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.emojifier.data.DefaultDocumentEmojiIconProvider
import com.anytypeio.anytype.mocking.MockDataFactory
import com.anytypeio.anytype.presentation.relations.ObjectSetConfig
@ -144,9 +141,7 @@ class ObjectSetGridFileCellRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)

View file

@ -4,10 +4,7 @@ import androidx.core.os.bundleOf
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.anytypeio.anytype.R
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.DVViewerRelation
import com.anytypeio.anytype.core_models.ObjectType
import com.anytypeio.anytype.core_models.Relation
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.emojifier.data.DefaultDocumentEmojiIconProvider
import com.anytypeio.anytype.mocking.MockDataFactory
import com.anytypeio.anytype.presentation.relations.ObjectSetConfig
@ -108,9 +105,7 @@ class ObjectSetGridNumberCellRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)
@ -202,9 +197,7 @@ class ObjectSetGridNumberCellRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)
@ -296,9 +289,7 @@ class ObjectSetGridNumberCellRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)
@ -390,9 +381,7 @@ class ObjectSetGridNumberCellRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)
@ -484,9 +473,7 @@ class ObjectSetGridNumberCellRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)
@ -578,9 +565,7 @@ class ObjectSetGridNumberCellRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)

View file

@ -7,10 +7,7 @@ import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.anytypeio.anytype.R
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.DVViewerRelation
import com.anytypeio.anytype.core_models.ObjectType
import com.anytypeio.anytype.core_models.Relation
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.emojifier.data.DefaultDocumentEmojiIconProvider
import com.anytypeio.anytype.mocking.MockDataFactory
import com.anytypeio.anytype.presentation.relations.ObjectSetConfig
@ -143,9 +140,7 @@ class ObjectSetGridObjectCellRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)
@ -262,9 +257,7 @@ class ObjectSetGridObjectCellRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)

View file

@ -4,10 +4,7 @@ import androidx.core.os.bundleOf
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.anytypeio.anytype.R
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.DVViewerRelation
import com.anytypeio.anytype.core_models.ObjectType
import com.anytypeio.anytype.core_models.Relation
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.emojifier.data.DefaultDocumentEmojiIconProvider
import com.anytypeio.anytype.mocking.MockDataFactory
import com.anytypeio.anytype.presentation.relations.ObjectSetConfig
@ -170,9 +167,7 @@ class ObjectSetGridPrimitiveRelationTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)

View file

@ -6,10 +6,7 @@ import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.anytypeio.anytype.R
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.DVViewerRelation
import com.anytypeio.anytype.core_models.ObjectType
import com.anytypeio.anytype.core_models.Relation
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.emojifier.data.DefaultDocumentEmojiIconProvider
import com.anytypeio.anytype.mocking.MockDataFactory
import com.anytypeio.anytype.presentation.relations.ObjectSetConfig
@ -138,9 +135,7 @@ class ObjectSetGridTagCellRenderingTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)

View file

@ -7,6 +7,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.anytypeio.anytype.R
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.SmartBlockType
import com.anytypeio.anytype.core_models.ext.content
import com.anytypeio.anytype.mocking.MockDataFactory
import com.anytypeio.anytype.ui.sets.ObjectSetFragment
@ -68,9 +69,7 @@ class ObjectSetHeaderTest : TestObjectSetSetup() {
val root = Block(
id = ctx,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.SET
),
content = Block.Content.Smart(SmartBlockType.SET),
children = listOf(header.id, dataview.id)
)

View file

@ -65,11 +65,7 @@ data class Block(
/**
* Smart block.
*/
data class Smart(
val type: Type
) : Content() {
enum class Type { HOME, PAGE, ARCHIVE, BREADCRUMBS, PROFILE, SET }
}
data class Smart(val type: SmartBlockType = SmartBlockType.PAGE): Content()
/**
* Textual block.

View file

@ -21,13 +21,11 @@ sealed class Event {
val root: Id,
val details: Block.Details = Block.Details(emptyMap()),
val blocks: List<Block>,
val type: Type = Type.PAGE,
val type: SmartBlockType = SmartBlockType.PAGE,
val objectTypes: List<ObjectType> = emptyList(),
val objectTypePerObject: Map<String, String> = emptyMap(),
val relations: List<Relation> = emptyList()
) : Command() {
enum class Type { PAGE, HOME, PROFILE_PAGE, ARCHIVE, BREADCRUMBS, SET }
}
) : Command()
data class AddBlock(
override val context: String,

View file

@ -11,10 +11,8 @@ data class DocumentInfo(
val fields: Block.Fields,
val snippet: String?,
val hasInboundLinks: Boolean,
val type: Type
) {
enum class Type { PAGE, HOME, PROFILE_PAGE, ARCHIVE, SET, FILE, OBJECT_TYPE, RELATION }
}
val smartBlockType: SmartBlockType
)
data class PageLinks(val inbound: List<DocumentInfo>, val outbound: List<DocumentInfo>)

View file

@ -0,0 +1,21 @@
package com.anytypeio.anytype.core_models
enum class SmartBlockType {
BREADCRUMBS,
PAGE,
PROFILE_PAGE,
HOME,
ARCHIVE,
SET,
BUNDLED_OBJECT_TYPE,
CUSTOM_OBJECT_TYPE,
FILE,
TEMPLATE,
MARKETPLACE_TYPE,
MARKETPLACE_RELATION,
MARKETPLACE_TEMPLATE,
BUNDLED_RELATION,
INDEXED_RELATION,
ANYTYPE_PROFILE,
DATABASE
}

View file

@ -7,6 +7,5 @@ data class HomeDashboard(
val blocks: List<Block>,
val children: List<String>,
val fields: Block.Fields,
val type: Block.Content.Smart.Type,
val details: Block.Details = Block.Details(emptyMap())
)

View file

@ -1,23 +1,33 @@
package com.anytypeio.anytype.domain.page.navigation
import com.anytypeio.anytype.core_models.DocumentInfo
import com.anytypeio.anytype.core_models.SmartBlockType
import com.anytypeio.anytype.domain.base.BaseUseCase
import com.anytypeio.anytype.domain.base.Either
import com.anytypeio.anytype.domain.block.repo.BlockRepository
open class GetListPages(private val repo: BlockRepository) :
BaseUseCase<GetListPages.Response, Unit>() {
open class GetListPages(
private val repo: BlockRepository
) : BaseUseCase<GetListPages.Response, Unit>() {
override suspend fun run(params: Unit): Either<Throwable, Response> = safe {
val documents = repo.getListPages()
val pages = documents.filterNot { document ->
document.fields.isArchived == true
|| document.type == DocumentInfo.Type.SET
|| document.type == DocumentInfo.Type.HOME
|| document.type == DocumentInfo.Type.RELATION
|| document.type == DocumentInfo.Type.OBJECT_TYPE
// TODO Filter by profile object Anytype, maybe will change in future
|| document.id == ANYTYPE_PROFILE_ID
|| document.smartBlockType == SmartBlockType.SET
|| document.smartBlockType == SmartBlockType.BREADCRUMBS
|| document.smartBlockType == SmartBlockType.HOME
|| document.smartBlockType == SmartBlockType.BUNDLED_OBJECT_TYPE
|| document.smartBlockType == SmartBlockType.CUSTOM_OBJECT_TYPE
|| document.smartBlockType == SmartBlockType.MARKETPLACE_TYPE
|| document.smartBlockType == SmartBlockType.MARKETPLACE_TEMPLATE
|| document.smartBlockType == SmartBlockType.MARKETPLACE_RELATION
|| document.smartBlockType == SmartBlockType.FILE
|| document.smartBlockType == SmartBlockType.TEMPLATE
|| document.smartBlockType == SmartBlockType.BUNDLED_RELATION
|| document.smartBlockType == SmartBlockType.INDEXED_RELATION
|| document.smartBlockType == SmartBlockType.DATABASE
|| document.smartBlockType == SmartBlockType.ANYTYPE_PROFILE
}
Response(pages)
}

View file

@ -1,7 +1,7 @@
package com.anytypeio.anytype.domain.page.navigation
import com.anytypeio.anytype.core_models.DocumentInfo
import com.anytypeio.anytype.core_models.PageInfoWithLinks
import com.anytypeio.anytype.core_models.SmartBlockType
import com.anytypeio.anytype.domain.base.BaseUseCase
import com.anytypeio.anytype.domain.base.Either
import com.anytypeio.anytype.domain.block.repo.BlockRepository
@ -12,37 +12,48 @@ class GetPageInfoWithLinks(private val repo: BlockRepository) :
override suspend fun run(params: Params): Either<Throwable, Response> = safe {
repo.getPageInfoWithLinks(
pageId = params.pageId
)
.let {
Response(
pageInfoWithLinks = it.copy(
links = it.links.copy(
outbound = it.links.outbound.filterNot { doc ->
doc.fields.isArchived == true
|| doc.type == DocumentInfo.Type.SET
|| doc.type == DocumentInfo.Type.ARCHIVE
|| doc.type == DocumentInfo.Type.OBJECT_TYPE
|| doc.type == DocumentInfo.Type.RELATION
|| doc.type == DocumentInfo.Type.FILE
|| doc.type == DocumentInfo.Type.PROFILE_PAGE
// TODO Filter by profile object Anytype, maybe will change in future
|| doc.id == GetListPages.ANYTYPE_PROFILE_ID
},
inbound = it.links.inbound.filterNot { doc ->
doc.fields.isArchived == true
|| doc.type == DocumentInfo.Type.SET
|| doc.type == DocumentInfo.Type.ARCHIVE
|| doc.type == DocumentInfo.Type.OBJECT_TYPE
|| doc.type == DocumentInfo.Type.RELATION
|| doc.type == DocumentInfo.Type.FILE
|| doc.type == DocumentInfo.Type.PROFILE_PAGE
// TODO Filter by profile object Anytype, maybe will change in future
|| doc.id == GetListPages.ANYTYPE_PROFILE_ID
}
)
).let {
Response(
pageInfoWithLinks = it.copy(
links = it.links.copy(
outbound = it.links.outbound.filterNot { document ->
document.fields.isArchived == true
|| document.smartBlockType == SmartBlockType.SET
|| document.smartBlockType == SmartBlockType.BREADCRUMBS
|| document.smartBlockType == SmartBlockType.HOME
|| document.smartBlockType == SmartBlockType.BUNDLED_OBJECT_TYPE
|| document.smartBlockType == SmartBlockType.CUSTOM_OBJECT_TYPE
|| document.smartBlockType == SmartBlockType.MARKETPLACE_TYPE
|| document.smartBlockType == SmartBlockType.MARKETPLACE_TEMPLATE
|| document.smartBlockType == SmartBlockType.MARKETPLACE_RELATION
|| document.smartBlockType == SmartBlockType.FILE
|| document.smartBlockType == SmartBlockType.TEMPLATE
|| document.smartBlockType == SmartBlockType.BUNDLED_RELATION
|| document.smartBlockType == SmartBlockType.INDEXED_RELATION
|| document.smartBlockType == SmartBlockType.DATABASE
|| document.smartBlockType == SmartBlockType.ANYTYPE_PROFILE
},
inbound = it.links.inbound.filterNot { document ->
document.fields.isArchived == true
|| document.smartBlockType == SmartBlockType.SET
|| document.smartBlockType == SmartBlockType.BREADCRUMBS
|| document.smartBlockType == SmartBlockType.HOME
|| document.smartBlockType == SmartBlockType.BUNDLED_OBJECT_TYPE
|| document.smartBlockType == SmartBlockType.CUSTOM_OBJECT_TYPE
|| document.smartBlockType == SmartBlockType.MARKETPLACE_TYPE
|| document.smartBlockType == SmartBlockType.MARKETPLACE_TEMPLATE
|| document.smartBlockType == SmartBlockType.MARKETPLACE_RELATION
|| document.smartBlockType == SmartBlockType.FILE
|| document.smartBlockType == SmartBlockType.TEMPLATE
|| document.smartBlockType == SmartBlockType.BUNDLED_RELATION
|| document.smartBlockType == SmartBlockType.INDEXED_RELATION
|| document.smartBlockType == SmartBlockType.DATABASE
|| document.smartBlockType == SmartBlockType.ANYTYPE_PROFILE
}
)
)
}
)
}
}
data class Params(

View file

@ -934,9 +934,7 @@ class BlockExtensionTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id)
)
@ -977,9 +975,7 @@ class BlockExtensionTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id)
)
@ -1007,9 +1003,7 @@ class BlockExtensionTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id)
)

View file

@ -1,9 +1,10 @@
package com.anytypeio.anytype.domain.page.navigation
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.domain.block.repo.BlockRepository
import com.anytypeio.anytype.core_models.CoroutineTestRule
import com.anytypeio.anytype.core_models.DocumentInfo
import com.anytypeio.anytype.core_models.SmartBlockType
import com.anytypeio.anytype.domain.block.repo.BlockRepository
import com.nhaarman.mockitokotlin2.doReturn
import com.nhaarman.mockitokotlin2.stub
import kotlinx.coroutines.ExperimentalCoroutinesApi
@ -41,21 +42,21 @@ class GetListPagesTest {
fields = Block.Fields(mapOf("name" to "Alex")),
snippet = "Snippet1",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
),
DocumentInfo(
id = "9876",
fields = Block.Fields(mapOf("name" to "Mike", "isArchived" to false)),
snippet = "Snippet2",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
),
DocumentInfo(
id = "934",
fields = Block.Fields(mapOf("name" to "Leo", "isArchived" to true)),
snippet = "Snippet3",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
)
)
}
@ -72,7 +73,7 @@ class GetListPagesTest {
fields = Block.Fields(mapOf("name" to "Alex")),
snippet = "Snippet1",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
),
DocumentInfo(
id = "9876",
@ -84,7 +85,7 @@ class GetListPagesTest {
),
snippet = "Snippet2",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
)
),
actual = response.listPages

View file

@ -1,12 +1,7 @@
package com.anytypeio.anytype.domain.page.navigation
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.domain.block.repo.BlockRepository
import com.anytypeio.anytype.core_models.CoroutineTestRule
import com.anytypeio.anytype.core_models.DocumentInfo
import com.anytypeio.anytype.core_models.MockDataFactory
import com.anytypeio.anytype.core_models.PageInfoWithLinks
import com.anytypeio.anytype.core_models.PageLinks
import com.nhaarman.mockitokotlin2.doReturn
import com.nhaarman.mockitokotlin2.stub
import kotlinx.coroutines.ExperimentalCoroutinesApi
@ -47,7 +42,7 @@ class GetPageInfoWithLinksTest {
fields = Block.Fields.empty(),
snippet = "Snip",
hasInboundLinks = true,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
),
links = PageLinks(
inbound = listOf(
@ -56,21 +51,21 @@ class GetPageInfoWithLinksTest {
fields = Block.Fields(mapOf("name" to "Alex")),
snippet = "Snippet12",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
),
DocumentInfo(
id = "13",
fields = Block.Fields(mapOf("name" to "Mike", "isArchived" to false)),
snippet = "Snippet13",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
),
DocumentInfo(
id = "14",
fields = Block.Fields(mapOf("name" to "Leo", "isArchived" to true)),
snippet = "Snippet14",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
)
),
outbound = listOf(
@ -79,21 +74,21 @@ class GetPageInfoWithLinksTest {
fields = Block.Fields(mapOf("name" to "Teo")),
snippet = "Snippet15",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
),
DocumentInfo(
id = "16",
fields = Block.Fields(mapOf("name" to "Thom", "isArchived" to false)),
snippet = "Snippet16",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
),
DocumentInfo(
id = "17",
fields = Block.Fields(mapOf("name" to "Andrey", "isArchived" to true)),
snippet = "Snippet17",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
)
)
)
@ -114,7 +109,7 @@ class GetPageInfoWithLinksTest {
fields = Block.Fields(mapOf("name" to "Teo")),
snippet = "Snippet15",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
),
DocumentInfo(
id = "16",
@ -126,7 +121,7 @@ class GetPageInfoWithLinksTest {
),
snippet = "Snippet16",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
)
),
actual = outbound
@ -138,7 +133,7 @@ class GetPageInfoWithLinksTest {
fields = Block.Fields(mapOf("name" to "Alex")),
snippet = "Snippet12",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
),
DocumentInfo(
id = "13",
@ -150,7 +145,7 @@ class GetPageInfoWithLinksTest {
),
snippet = "Snippet13",
hasInboundLinks = false,
type = DocumentInfo.Type.PAGE
smartBlockType = SmartBlockType.PAGE
)
),
actual = inbound

View file

@ -201,7 +201,7 @@ class BlockMiddleware(
): Payload = middleware.setFields(command)
override suspend fun getTemplates(): List<ObjectType> {
return middleware.getObjectTypes().map { type -> type.toCoreModels() }
return middleware.getObjectTypes().map { it.toCoreModels() }
}
override suspend fun createTemplate(

View file

@ -7,14 +7,10 @@ import anytype.model.Block
import anytype.model.ObjectInfo
import anytype.model.ObjectInfoWithLinks
import anytype.model.Range
import anytype.relation.ObjectType
import anytype.relation.Relation
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.middleware.BuildConfig
import com.anytypeio.anytype.middleware.const.Constants
import com.anytypeio.anytype.middleware.mappers.toCoreModels
import com.anytypeio.anytype.middleware.mappers.toMiddlewareModel
import com.anytypeio.anytype.middleware.mappers.toPayload
import com.anytypeio.anytype.middleware.mappers.*
import com.anytypeio.anytype.middleware.model.CreateAccountResponse
import com.anytypeio.anytype.middleware.model.CreateWalletResponse
import com.anytypeio.anytype.middleware.model.SelectAccountResponse
@ -952,7 +948,7 @@ class Middleware(
}
@Throws(Exception::class)
fun getObjectTypes(): List<ObjectType> {
fun getObjectTypes(): List<MObjectType> {
val request = Rpc.ObjectType.List.Request()
if (BuildConfig.DEBUG) logRequest(request)
val response = service.objectTypeList(request)
@ -962,11 +958,11 @@ class Middleware(
}
@Throws(Exception::class)
fun objectTypeCreate(prototype: com.anytypeio.anytype.core_models.ObjectType.Prototype): ObjectType {
fun objectTypeCreate(prototype: ObjectType.Prototype): MObjectType {
val layout = prototype.layout.toMiddlewareModel()
val objectType = ObjectType(
val objectType = MObjectType(
name = prototype.name,
iconEmoji = prototype.emoji,
layout = layout
@ -1044,10 +1040,10 @@ class Middleware(
context: String,
target: String,
name: String,
format: com.anytypeio.anytype.core_models.Relation.Format
format: Relation.Format
): Pair<Id, Payload> {
val relation = Relation(
val relation = MRelation(
name = name,
format = format.toMiddlewareModel()
)
@ -1189,7 +1185,7 @@ class Middleware(
}
@Throws(Exception::class)
fun relationListAvailable(ctx: Id): List<Relation> {
fun relationListAvailable(ctx: Id): List<MRelation> {
val request = Rpc.Object.RelationListAvailable.Request(
contextId = ctx
)
@ -1233,7 +1229,7 @@ class Middleware(
blockId = dataview,
relationKey = relation,
recordId = record,
option = Relation.Option(text = name, color = color)
option = MRelationOption(text = name, color = color)
)
if (BuildConfig.DEBUG) logRequest(request)
val response = service.blockDataViewRecordRelationOptionAdd(request)
@ -1251,7 +1247,7 @@ class Middleware(
val request = Rpc.Object.RelationOptionAdd.Request(
contextId = ctx,
relationKey = relation,
option = Relation.Option(text = name, color = color)
option = MRelationOption(text = name, color = color)
)
if (BuildConfig.DEBUG) logRequest(request)
val response = service.objectRelationOptionAdd(request)

View file

@ -5,7 +5,6 @@ import com.anytypeio.anytype.core_models.Event
import com.anytypeio.anytype.middleware.mappers.toCoreModel
import com.anytypeio.anytype.middleware.mappers.toCoreModels
import com.anytypeio.anytype.middleware.mappers.toCoreModelsAlign
import com.anytypeio.anytype.middleware.mappers.toCoreModelsEvent
fun anytype.Event.Message.toCoreModels(
context: String
@ -21,12 +20,12 @@ fun anytype.Event.Message.toCoreModels(
objectShow != null -> {
val event = objectShow
checkNotNull(event)
val type = event.type.toCoreModelsEvent()
val type = event.type.toCoreModel()
Event.Command.ShowBlock(
context = context,
root = event.rootId,
blocks = event.blocks.toCoreModels(
types = mapOf(event.rootId to event.type)
types = mapOf(event.rootId to type)
),
details = Block.Details(
event.details.associate { details ->

View file

@ -33,9 +33,11 @@ typealias MDVRelation = anytype.model.Block.Content.Dataview.Relation
typealias MDVDateFormat = anytype.model.Block.Content.Dataview.Relation.DateFormat
typealias MDVTimeFormat = anytype.model.Block.Content.Dataview.Relation.TimeFormat
typealias MObjectType = anytype.relation.ObjectType
typealias MOTypeLayout = anytype.relation.ObjectType.Layout
typealias MRelationFormat = anytype.relation.RelationFormat
typealias MRelationDataSource = anytype.relation.Relation.DataSource
typealias MRelation = anytype.relation.Relation
typealias MRelationOption = anytype.relation.Relation.Option
typealias MObjectType = anytype.model.ObjectType
typealias MSmartBlockType = anytype.model.SmartBlockType
typealias MOTypeLayout = anytype.model.ObjectType.Layout
typealias MRelationFormat = anytype.model.RelationFormat
typealias MRelationDataSource = anytype.model.Relation.DataSource
typealias MRelation = anytype.model.Relation
typealias MRelationOption = anytype.model.Relation.Option

View file

@ -1,11 +1,9 @@
package com.anytypeio.anytype.middleware.mappers
import anytype.ResponseEvent
import anytype.SmartBlockType
import anytype.model.ObjectInfo
import anytype.model.ObjectInfoWithLinks
import anytype.model.ObjectLinksInfo
import anytype.relation.RelationFormat
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.middleware.interactor.toCoreModels
import timber.log.Timber
@ -89,8 +87,7 @@ fun List<MBlock>.toCoreModels(
fields = block.toCoreModelsFields(),
children = block.childrenIds,
content = Block.Content.Smart(
type = types[block.id]?.toCoreModelsBlock()
?: throw IllegalStateException("Type missing")
type = types[block.id] ?: throw IllegalStateException("Type missing")
)
)
}
@ -202,7 +199,7 @@ fun MBlock.toCoreModelsDataView(): Block.Content.DataView {
)
}
fun MBlock.toCoreModelsRelationBlock() : Block.Content.RelationBlock {
fun MBlock.toCoreModelsRelationBlock(): Block.Content.RelationBlock {
val content = checkNotNull(relation)
return Block.Content.RelationBlock(
key = content.key.ifEmpty { null },
@ -210,26 +207,6 @@ fun MBlock.toCoreModelsRelationBlock() : Block.Content.RelationBlock {
)
}
fun SmartBlockType.toCoreModelsBlock(): Block.Content.Smart.Type = when (this) {
SmartBlockType.Page -> Block.Content.Smart.Type.PAGE
SmartBlockType.Home -> Block.Content.Smart.Type.HOME
SmartBlockType.ProfilePage -> Block.Content.Smart.Type.PROFILE
SmartBlockType.Archive -> Block.Content.Smart.Type.ARCHIVE
SmartBlockType.Breadcrumbs -> Block.Content.Smart.Type.BREADCRUMBS
SmartBlockType.Set -> Block.Content.Smart.Type.SET
else -> throw IllegalStateException("Unexpected smart block type: $this")
}
fun SmartBlockType.toCoreModelsEvent(): Event.Command.ShowBlock.Type = when (this) {
SmartBlockType.Page -> Event.Command.ShowBlock.Type.PAGE
SmartBlockType.Home -> Event.Command.ShowBlock.Type.HOME
SmartBlockType.ProfilePage -> Event.Command.ShowBlock.Type.PROFILE_PAGE
SmartBlockType.Archive -> Event.Command.ShowBlock.Type.ARCHIVE
SmartBlockType.Breadcrumbs -> Event.Command.ShowBlock.Type.BREADCRUMBS
SmartBlockType.Set -> Event.Command.ShowBlock.Type.SET
else -> throw IllegalStateException("Unexpected smart block type: $this")
}
fun MBFileState.toCoreModels(): Block.Content.File.State = when (this) {
MBFileState.Empty -> Block.Content.File.State.EMPTY
MBFileState.Uploading -> Block.Content.File.State.UPLOADING
@ -435,21 +412,21 @@ fun MRelationDataSource.source(): Relation.Source = when (this) {
else -> throw IllegalStateException()
}
fun RelationFormat.format(): Relation.Format = when (this) {
RelationFormat.shorttext -> Relation.Format.SHORT_TEXT
RelationFormat.longtext -> Relation.Format.LONG_TEXT
RelationFormat.number -> Relation.Format.NUMBER
RelationFormat.date -> Relation.Format.DATE
RelationFormat.file_ -> Relation.Format.FILE
RelationFormat.checkbox -> Relation.Format.CHECKBOX
RelationFormat.url -> Relation.Format.URL
RelationFormat.email -> Relation.Format.EMAIL
RelationFormat.phone -> Relation.Format.PHONE
RelationFormat.emoji -> Relation.Format.EMOJI
RelationFormat.object_ -> Relation.Format.OBJECT
RelationFormat.status -> Relation.Format.STATUS
RelationFormat.tag -> Relation.Format.TAG
RelationFormat.relations -> Relation.Format.RELATIONS
fun MRelationFormat.format(): Relation.Format = when (this) {
MRelationFormat.shorttext -> Relation.Format.SHORT_TEXT
MRelationFormat.longtext -> Relation.Format.LONG_TEXT
MRelationFormat.number -> Relation.Format.NUMBER
MRelationFormat.date -> Relation.Format.DATE
MRelationFormat.file_ -> Relation.Format.FILE
MRelationFormat.checkbox -> Relation.Format.CHECKBOX
MRelationFormat.url -> Relation.Format.URL
MRelationFormat.email -> Relation.Format.EMAIL
MRelationFormat.phone -> Relation.Format.PHONE
MRelationFormat.emoji -> Relation.Format.EMOJI
MRelationFormat.object_ -> Relation.Format.OBJECT
MRelationFormat.status -> Relation.Format.STATUS
MRelationFormat.tag -> Relation.Format.TAG
MRelationFormat.relations -> Relation.Format.RELATIONS
}
fun MRelationOption.option(): Relation.Option = Relation.Option(
@ -479,16 +456,25 @@ fun ObjectInfo.toCoreModel(): DocumentInfo = DocumentInfo(
fields = details.toCoreModel(),
snippet = snippet,
hasInboundLinks = hasInboundLinks,
type = objectType.toCoreModel()
smartBlockType = objectType.toCoreModel()
)
fun ObjectInfo.Type.toCoreModel(): DocumentInfo.Type = when (this) {
ObjectInfo.Type.Page -> DocumentInfo.Type.PAGE
ObjectInfo.Type.Home -> DocumentInfo.Type.HOME
ObjectInfo.Type.ProfilePage -> DocumentInfo.Type.PROFILE_PAGE
ObjectInfo.Type.Archive -> DocumentInfo.Type.ARCHIVE
ObjectInfo.Type.Set -> DocumentInfo.Type.SET
ObjectInfo.Type.File -> DocumentInfo.Type.FILE
ObjectInfo.Type.ObjectType -> DocumentInfo.Type.OBJECT_TYPE
ObjectInfo.Type.Relation -> DocumentInfo.Type.RELATION
fun MSmartBlockType.toCoreModel(): SmartBlockType = when (this) {
MSmartBlockType.Breadcrumbs -> SmartBlockType.BREADCRUMBS
MSmartBlockType.Page -> SmartBlockType.PAGE
MSmartBlockType.ProfilePage -> SmartBlockType.PROFILE_PAGE
MSmartBlockType.Home -> SmartBlockType.HOME
MSmartBlockType.Archive -> SmartBlockType.ARCHIVE
MSmartBlockType.Database -> SmartBlockType.DATABASE
MSmartBlockType.Set -> SmartBlockType.SET
MSmartBlockType.STObjectType -> SmartBlockType.CUSTOM_OBJECT_TYPE
MSmartBlockType.File -> SmartBlockType.FILE
MSmartBlockType.Template -> SmartBlockType.TEMPLATE
MSmartBlockType.MarketplaceType -> SmartBlockType.MARKETPLACE_TYPE
MSmartBlockType.MarketplaceRelation -> SmartBlockType.MARKETPLACE_RELATION
MSmartBlockType.MarketplaceTemplate -> SmartBlockType.MARKETPLACE_TEMPLATE
MSmartBlockType.BundledRelation -> SmartBlockType.BUNDLED_RELATION
MSmartBlockType.IndexedRelation -> SmartBlockType.INDEXED_RELATION
MSmartBlockType.BundledObjectType -> SmartBlockType.BUNDLED_OBJECT_TYPE
MSmartBlockType.AnytypeProfile -> SmartBlockType.ANYTYPE_PROFILE
}

View file

@ -1,11 +1,11 @@
package com.anytypeio.anytype
import anytype.SmartBlockType
import anytype.model.Block
import com.anytypeio.anytype.common.MockDataFactory
import com.anytypeio.anytype.core_models.Event
import com.anytypeio.anytype.middleware.EventProxy
import com.anytypeio.anytype.middleware.interactor.MiddlewareEventChannel
import com.anytypeio.anytype.middleware.mappers.MSmartBlockType
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.runBlocking
@ -38,7 +38,7 @@ class MiddlewareEventChannelTest {
val msg = anytype.Event.Object.Show(
rootId = context,
blocks = emptyList(),
type = SmartBlockType.Page
type = MSmartBlockType.Page
)
val message = anytype.Event.Message(objectShow = msg)
@ -103,7 +103,7 @@ class MiddlewareEventChannelTest {
val msg = anytype.Event.Object.Show(
rootId = context,
blocks = emptyList(),
type = SmartBlockType.Page
type = MSmartBlockType.Page
)
val message = anytype.Event.Message(objectShow = msg)

View file

@ -1,6 +1,7 @@
package com.anytypeio.anytype.presentation.desktop
import com.anytypeio.anytype.core_models.Event
import com.anytypeio.anytype.core_models.SmartBlockType
import com.anytypeio.anytype.domain.misc.UrlBuilder
interface HomeDashboardEventConverter {
@ -19,7 +20,7 @@ interface HomeDashboardEventConverter {
builder = builder
)
is Event.Command.ShowBlock -> when (event.type) {
Event.Command.ShowBlock.Type.HOME -> {
SmartBlockType.HOME -> {
HomeDashboardStateMachine.Event.OnShowDashboard(
blocks = event.blocks,
context = event.context,
@ -29,7 +30,7 @@ interface HomeDashboardEventConverter {
objectTypes = event.objectTypes
)
}
Event.Command.ShowBlock.Type.PROFILE_PAGE -> {
SmartBlockType.PROFILE_PAGE -> {
HomeDashboardStateMachine.Event.OnShowProfile(
blocks = event.blocks,
context = event.context,

View file

@ -12,7 +12,6 @@ import com.anytypeio.anytype.presentation.page.editor.model.BlockView
import com.anytypeio.anytype.presentation.page.editor.model.UiBlock
import com.anytypeio.anytype.presentation.sets.buildGridRow
import com.anytypeio.anytype.presentation.sets.model.*
import com.anytypeio.anytype.presentation.sets.model.Viewer
import com.anytypeio.anytype.presentation.settings.EditorSettings
import timber.log.Timber
@ -273,7 +272,7 @@ fun List<Block>.toDashboardViews(
when (val content = block.content) {
is Block.Content.Smart -> {
when (content.type) {
Block.Content.Smart.Type.PROFILE -> {
SmartBlockType.PROFILE_PAGE -> {
DashboardView.Profile(
id = block.id,
name = details.details[block.id]?.name.orEmpty(),

View file

@ -973,7 +973,7 @@ class PageViewModel(
val content = root.content
check(content is Content.Smart)
when (content.type) {
Content.Smart.Type.PROFILE -> {
SmartBlockType.PROFILE_PAGE -> {
val details = orchestrator.stores.details.current().details
dispatch(
command = Command.OpenProfileMenu(
@ -1002,7 +1002,7 @@ class PageViewModel(
eventName = POPUP_PROFILE_MENU
)
}
Content.Smart.Type.PAGE -> {
SmartBlockType.PAGE -> {
val details = orchestrator.stores.details.current().details
controlPanelInteractor.onEvent(ControlPanelMachine.Event.OnDocumentMenuClicked)
dispatch(

View file

@ -40,7 +40,7 @@ class DefaultBlockViewRenderer(
if (anchor == root.id) {
root.content.let { cnt ->
if (cnt is Content.Smart && cnt.type == Content.Smart.Type.ARCHIVE) {
if (cnt is Content.Smart && cnt.type == SmartBlockType.ARCHIVE) {
result.add(
BlockView.Title.Archive(
mode = BlockView.Mode.READ,
@ -807,7 +807,7 @@ class DefaultBlockViewRenderer(
if (layout == null) {
// Retrieving layout based on smart block type:
layout = if (rootContent.type == Content.Smart.Type.PROFILE)
layout = if (rootContent.type == SmartBlockType.PROFILE_PAGE)
Layout.PROFILE
else {
// Falling back to default layout if layout is not defined

View file

@ -2,6 +2,7 @@ package com.anytypeio.anytype.presentation
import MockDataFactory
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.SmartBlockType
object MockBlockFactory {
@ -13,9 +14,7 @@ object MockBlockFactory {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(SmartBlockType.PAGE),
children = listOf(child)
),
Block(

View file

@ -40,9 +40,7 @@ object MockTypicalDocumentFactory {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(SmartBlockType.PAGE),
children = listOf(header.id, a.id)
)
return listOf(page, header, title, a)
@ -52,9 +50,7 @@ object MockTypicalDocumentFactory {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PROFILE
),
content = Block.Content.Smart(SmartBlockType.PROFILE_PAGE),
children = listOf(header.id, a.id)
)
return listOf(page, header, title, a)

View file

@ -1,10 +1,7 @@
package com.anytypeio.anytype.presentation.home
import MockDataFactory
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.Event
import com.anytypeio.anytype.core_models.Payload
import com.anytypeio.anytype.core_models.Position
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.core_utils.ext.shift
import com.anytypeio.anytype.domain.base.Either
import com.anytypeio.anytype.domain.block.interactor.Move
@ -34,9 +31,7 @@ class DashboardDragAndDropTest : DashboardTestSetup() {
val profile = Block(
id = MockDataFactory.randomUuid(),
children = emptyList(),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PROFILE
),
content = Block.Content.Smart(SmartBlockType.HOME),
fields = Block.Fields.empty()
)
@ -74,9 +69,7 @@ class DashboardDragAndDropTest : DashboardTestSetup() {
val dashboard = Block(
id = config.home,
content = Block.Content.Smart(
type = Block.Content.Smart.Type.HOME
),
content = Block.Content.Smart(SmartBlockType.HOME),
children = pages.map { page -> page.id },
fields = Block.Fields.empty()
)
@ -91,7 +84,7 @@ class DashboardDragAndDropTest : DashboardTestSetup() {
root = config.home,
context = config.home,
blocks = listOf(dashboard) + profile + pages,
type = Event.Command.ShowBlock.Type.HOME
type = SmartBlockType.HOME
)
)
)
@ -184,9 +177,7 @@ class DashboardDragAndDropTest : DashboardTestSetup() {
val dashboard = Block(
id = config.home,
content = Block.Content.Smart(
type = Block.Content.Smart.Type.HOME
),
content = Block.Content.Smart(SmartBlockType.HOME),
children = pages.map { page -> page.id },
fields = Block.Fields.empty()
)
@ -283,9 +274,7 @@ class DashboardDragAndDropTest : DashboardTestSetup() {
val dashboard = Block(
id = config.home,
content = Block.Content.Smart(
type = Block.Content.Smart.Type.HOME
),
content = Block.Content.Smart(SmartBlockType.HOME),
children = links.map { page -> page.id },
fields = Block.Fields.empty()
)
@ -382,9 +371,7 @@ class DashboardDragAndDropTest : DashboardTestSetup() {
val dashboard = Block(
id = config.home,
content = Block.Content.Smart(
type = Block.Content.Smart.Type.HOME
),
content = Block.Content.Smart(SmartBlockType.HOME),
children = links.map { page -> page.id },
fields = Block.Fields.empty()
)
@ -481,9 +468,7 @@ class DashboardDragAndDropTest : DashboardTestSetup() {
val dashboard = Block(
id = config.home,
content = Block.Content.Smart(
type = Block.Content.Smart.Type.HOME
),
content = Block.Content.Smart(SmartBlockType.HOME),
children = links.map { page -> page.id },
fields = Block.Fields.empty()
)

View file

@ -3,10 +3,7 @@ package com.anytypeio.anytype.presentation.home
import MockDataFactory
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.anytypeio.anytype.analytics.base.Analytics
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.Config
import com.anytypeio.anytype.core_models.Event
import com.anytypeio.anytype.core_models.Payload
import com.anytypeio.anytype.core_models.*
import com.anytypeio.anytype.core_models.ext.getChildrenIdsList
import com.anytypeio.anytype.domain.auth.interactor.GetProfile
import com.anytypeio.anytype.domain.base.Either
@ -215,9 +212,7 @@ class HomeDashboardViewModelTest {
val dashboard = Block(
id = config.home,
content = Block.Content.Smart(
type = Block.Content.Smart.Type.HOME
),
content = Block.Content.Smart(SmartBlockType.HOME),
children = listOf(page.id),
fields = Block.Fields.empty()
)
@ -234,7 +229,7 @@ class HomeDashboardViewModelTest {
root = config.home,
context = config.home,
blocks = listOf(dashboard, page),
type = Event.Command.ShowBlock.Type.HOME
type = SmartBlockType.HOME
)
)
)

View file

@ -46,9 +46,7 @@ class BlockReadModeTest : PageViewModelTest() {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id) + blocks.map { it.id }
)
) + listOf(header, title) + blocks

View file

@ -3,6 +3,7 @@ package com.anytypeio.anytype.presentation.page
import MockDataFactory
import com.anytypeio.anytype.core_models.Block
import com.anytypeio.anytype.core_models.Id
import com.anytypeio.anytype.core_models.SmartBlockType
import com.anytypeio.anytype.core_models.ext.asMap
import com.anytypeio.anytype.core_models.ext.content
import com.anytypeio.anytype.core_utils.tools.Counter
@ -132,9 +133,7 @@ class DefaultBlockViewRendererTest {
id = MockDataFactory.randomUuid(),
children = listOf(header.id, paragraph.id, toggle.id),
fields = Block.Fields.empty(),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
)
content = Block.Content.Smart()
)
val blocks = listOf(page, header, title, paragraph, toggle, checkbox)
@ -253,9 +252,7 @@ class DefaultBlockViewRendererTest {
id = MockDataFactory.randomUuid(),
children = listOf(header.id, paragraph.id, toggle.id),
fields = Block.Fields.empty(),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
)
content = Block.Content.Smart()
)
val blocks = listOf(page, header, title, paragraph, toggle, checkbox)
@ -361,9 +358,7 @@ class DefaultBlockViewRendererTest {
id = MockDataFactory.randomUuid(),
children = listOf(header.id, paragraph.id),
fields = Block.Fields.empty(),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
)
content = Block.Content.Smart()
)
val blocks = listOf(page, header, title, paragraph)
@ -445,9 +440,7 @@ class DefaultBlockViewRendererTest {
id = MockDataFactory.randomUuid(),
children = listOf(header.id, paragraph.id),
fields = Block.Fields.empty(),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
)
content = Block.Content.Smart()
)
val blocks = listOf(page, header, title, paragraph)
@ -540,9 +533,7 @@ class DefaultBlockViewRendererTest {
id = pageId,
children = listOf(header.id, paragraph.id),
fields = fields,
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PROFILE
)
content = Block.Content.Smart(SmartBlockType.PROFILE_PAGE)
)
val blocks = listOf(page, header, title, paragraph)
@ -635,9 +626,7 @@ class DefaultBlockViewRendererTest {
id = pageId,
children = listOf(header.id, paragraph.id),
fields = fields,
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
)
content = Block.Content.Smart()
)
val blocks = listOf(page, header, title, paragraph)
@ -820,7 +809,7 @@ class DefaultBlockViewRendererTest {
id = MockDataFactory.randomUuid(),
children = listOf(header.id, a.id),
fields = fields,
content = Block.Content.Smart(type = Block.Content.Smart.Type.PAGE)
content = Block.Content.Smart()
)
val details = mapOf(page.id to fields)
@ -951,7 +940,7 @@ class DefaultBlockViewRendererTest {
id = MockDataFactory.randomUuid(),
children = listOf(header.id, a.id),
fields = fields,
content = Block.Content.Smart(type = Block.Content.Smart.Type.PAGE)
content = Block.Content.Smart()
)
val details = mapOf(page.id to fields)
@ -1079,7 +1068,7 @@ class DefaultBlockViewRendererTest {
id = MockDataFactory.randomUuid(),
children = listOf(header.id, a.id),
fields = fields,
content = Block.Content.Smart(type = Block.Content.Smart.Type.PAGE)
content = Block.Content.Smart()
)
val details = mapOf(page.id to fields)
@ -1219,7 +1208,7 @@ class DefaultBlockViewRendererTest {
id = MockDataFactory.randomUuid(),
children = listOf(header.id, a.id),
fields = fields,
content = Block.Content.Smart(type = Block.Content.Smart.Type.PAGE)
content = Block.Content.Smart()
)
val details = mapOf(page.id to fields)

View file

@ -286,9 +286,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
),
header,
@ -473,9 +471,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
),
header,
@ -566,9 +562,7 @@ open class PageViewModelTest {
val smart = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(child)
)
@ -630,9 +624,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
),
header,
@ -736,9 +728,7 @@ open class PageViewModelTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
)
@ -892,9 +882,7 @@ open class PageViewModelTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
)
@ -1052,9 +1040,7 @@ open class PageViewModelTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(child)
)
@ -1146,9 +1132,7 @@ open class PageViewModelTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
)
@ -1248,7 +1232,7 @@ open class PageViewModelTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(child)
)
@ -1329,7 +1313,7 @@ open class PageViewModelTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(child)
)
@ -1491,9 +1475,7 @@ open class PageViewModelTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
)
@ -1662,9 +1644,7 @@ open class PageViewModelTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child.id)
)
@ -1742,9 +1722,7 @@ open class PageViewModelTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, firstChild.id, secondChild.id)
)
@ -1851,9 +1829,7 @@ open class PageViewModelTest {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child.id)
)
@ -2350,9 +2326,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(child)
),
Block(
@ -2484,9 +2458,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(title.id, file.id)
),
title,
@ -2547,7 +2519,7 @@ open class PageViewModelTest {
fields = Block.Fields(
map = mapOf("icon" to "")
),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, paragraph.id)
),
title,
@ -2614,7 +2586,7 @@ open class PageViewModelTest {
fields = Block.Fields(
map = mapOf("icon" to "")
),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, paragraph.id)
),
title,
@ -2668,7 +2640,7 @@ open class PageViewModelTest {
fields = Block.Fields(
map = mapOf("icon" to "")
),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, paragraph.id)
),
title,
@ -2726,7 +2698,7 @@ open class PageViewModelTest {
fields = Block.Fields(
map = mapOf("icon" to "")
),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, paragraph.id)
),
title,
@ -2793,7 +2765,7 @@ open class PageViewModelTest {
fields = Block.Fields(
map = mapOf("icon" to "")
),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, paragraph.id)
),
title,
@ -2853,7 +2825,7 @@ open class PageViewModelTest {
fields = Block.Fields(
map = mapOf("icon" to "")
),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, paragraph.id)
),
title,
@ -2913,7 +2885,7 @@ open class PageViewModelTest {
fields = Block.Fields(
map = mapOf("icon" to "")
),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, paragraph.id)
),
title,
@ -2978,7 +2950,7 @@ open class PageViewModelTest {
fields = Block.Fields(
map = mapOf("icon" to "")
),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, paragraph.id)
),
title,
@ -3043,9 +3015,7 @@ open class PageViewModelTest {
fields = Block.Fields(
map = mapOf("icon" to "")
),
content = Block.Content.Smart(
Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(title.id)
),
title
@ -3099,7 +3069,7 @@ open class PageViewModelTest {
fields = Block.Fields(
map = mapOf("icon" to "")
),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id)
),
title
@ -3181,7 +3151,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, paragraph.id)
),
title,
@ -3260,7 +3230,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, numbered.id)
),
title,
@ -3341,7 +3311,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(title.id, paragraph.id)
),
title,
@ -3402,7 +3372,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(paragraph.id)
),
paragraph
@ -3520,7 +3490,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(header.id) + paragraphs.map { it.id }
)
) + listOf(header, title) + paragraphs
@ -3694,7 +3664,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(header.id) + paragraphs.map { it.id }
)
) + listOf(header, title) + paragraphs
@ -4038,7 +4008,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(header.id) + paragraphs.map { it.id }
)
) + listOf(header, title) + paragraphs
@ -4153,9 +4123,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id) + paragraphs.map { it.id }
)
) + listOf(header, title) + paragraphs
@ -4278,7 +4246,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(header.id) + paragraphs.map { it.id }
)
) + listOf(header, title) + paragraphs
@ -4421,7 +4389,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(header.id) + paragraphs.map { it.id }
)
) + listOf(header, title) + paragraphs
@ -4562,9 +4530,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(
Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id) + paragraphs.map { it.id }
)
) + listOf(header, title) + paragraphs
@ -4697,7 +4663,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = blocks.map { it.id }
)
) + blocks
@ -4879,7 +4845,7 @@ open class PageViewModelTest {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = blocks.map { it.id }
)
) + blocks

View file

@ -50,9 +50,7 @@ class EditorAddBlockTest : EditorPresentationTestSetup() {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
),
block
@ -113,9 +111,7 @@ class EditorAddBlockTest : EditorPresentationTestSetup() {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(block.id)
),
block

View file

@ -80,9 +80,7 @@ class EditorBackspaceNestedDeleteTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, parent.id)
)
@ -209,9 +207,7 @@ class EditorBackspaceNestedDeleteTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, parent.id)
)
@ -355,9 +351,7 @@ class EditorBackspaceNestedDeleteTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, parent.id)
)
@ -506,9 +500,7 @@ class EditorBackspaceNestedDeleteTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, parent.id)
)

View file

@ -66,9 +66,7 @@ class EditorEmptySpaceInteractionTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)
@ -121,9 +119,7 @@ class EditorEmptySpaceInteractionTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)

View file

@ -45,9 +45,7 @@ class EditorEventSubscriptionTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id)
)

View file

@ -66,7 +66,7 @@ class EditorFocusTest : EditorPresentationTestSetup() {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
),
header,
@ -133,9 +133,7 @@ class EditorFocusTest : EditorPresentationTestSetup() {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
),
header,

View file

@ -71,9 +71,7 @@ class EditorGranularChangeTest : EditorPresentationTestSetup() {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, checkbox.id)
),
header,

View file

@ -290,9 +290,7 @@ class EditorListBlockTest : EditorPresentationTestSetup() {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
),
header,
@ -429,9 +427,7 @@ class EditorListBlockTest : EditorPresentationTestSetup() {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
),
header,
@ -567,9 +563,7 @@ class EditorListBlockTest : EditorPresentationTestSetup() {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
),
header,
@ -706,9 +700,7 @@ class EditorListBlockTest : EditorPresentationTestSetup() {
Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, child)
),
header,

View file

@ -105,9 +105,7 @@ class EditorMentionTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id)
)
@ -263,9 +261,7 @@ class EditorMentionTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id)
)
@ -431,9 +427,7 @@ class EditorMentionTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id)
)
@ -567,9 +561,7 @@ class EditorMentionTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id)
)

View file

@ -78,9 +78,7 @@ class EditorMergeTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, first.id, second.id)
)

View file

@ -68,9 +68,7 @@ class EditorMoveToTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, link.id)
)
@ -128,9 +126,7 @@ class EditorMoveToTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, txt.id)
)

View file

@ -76,9 +76,7 @@ class EditorMultiSelectModeTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id)
)
@ -296,9 +294,7 @@ class EditorMultiSelectModeTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id)
)
@ -502,9 +498,7 @@ class EditorMultiSelectModeTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, parent.id)
)
@ -717,9 +711,7 @@ class EditorMultiSelectModeTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, parent.id)
)
@ -926,9 +918,7 @@ class EditorMultiSelectModeTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, parent.id)
)
@ -1015,9 +1005,7 @@ class EditorMultiSelectModeTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id)
)
@ -1090,9 +1078,7 @@ class EditorMultiSelectModeTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id)
)

View file

@ -80,9 +80,7 @@ class EditorQuickStartingScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id, b.id)
)
@ -185,9 +183,7 @@ class EditorQuickStartingScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id, b.id)
)
@ -291,9 +287,7 @@ class EditorQuickStartingScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id, b.id)
)

View file

@ -85,9 +85,7 @@ class EditorRelationBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id, b.id)
)

View file

@ -77,9 +77,7 @@ class EditorScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id, c.id)
)
@ -173,9 +171,7 @@ class EditorScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id, c.id)
)
@ -248,9 +244,7 @@ class EditorScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id)
)
@ -363,9 +357,7 @@ class EditorScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id, c.id)
)
@ -453,9 +445,7 @@ class EditorScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id)
)
@ -526,9 +516,7 @@ class EditorScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id)
)
@ -599,9 +587,7 @@ class EditorScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id)
)
@ -674,9 +660,7 @@ class EditorScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(parent.id)
)
@ -771,9 +755,7 @@ class EditorScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(parent.id, block.id)
)
@ -902,9 +884,7 @@ class EditorScrollAndMoveTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id, c.id, d.id, e.id, f.id)
)

View file

@ -579,9 +579,7 @@ class EditorSlashWidgetActionsTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)

View file

@ -7,9 +7,9 @@ import com.anytypeio.anytype.core_models.ObjectType
import com.anytypeio.anytype.core_models.Relation
import com.anytypeio.anytype.presentation.MockTypicalDocumentFactory
import com.anytypeio.anytype.presentation.page.editor.model.Types
import com.anytypeio.anytype.presentation.page.editor.slash.SlashWidgetState
import com.anytypeio.anytype.presentation.page.editor.slash.SlashEvent
import com.anytypeio.anytype.presentation.page.editor.slash.SlashItem
import com.anytypeio.anytype.presentation.page.editor.slash.SlashWidgetState
import com.anytypeio.anytype.presentation.relations.DocumentRelationView
import com.anytypeio.anytype.presentation.relations.NumberParser
import com.anytypeio.anytype.presentation.relations.RelationListViewModel
@ -202,9 +202,7 @@ class EditorSlashWidgetClicksTest: EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -390,9 +388,7 @@ class EditorSlashWidgetClicksTest: EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, a.id, b.id)
)

View file

@ -9,9 +9,9 @@ import com.anytypeio.anytype.domain.block.interactor.UpdateTextColor
import com.anytypeio.anytype.domain.editor.Editor
import com.anytypeio.anytype.presentation.MockTypicalDocumentFactory
import com.anytypeio.anytype.presentation.page.PageViewModel
import com.anytypeio.anytype.presentation.page.editor.slash.SlashWidgetState
import com.anytypeio.anytype.presentation.page.editor.slash.SlashEvent
import com.anytypeio.anytype.presentation.page.editor.slash.SlashItem
import com.anytypeio.anytype.presentation.page.editor.slash.SlashWidgetState
import com.anytypeio.anytype.presentation.util.CoroutinesTestRule
import org.junit.Before
import org.junit.Rule
@ -65,9 +65,7 @@ class EditorSlashWidgetColorTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -152,9 +150,7 @@ class EditorSlashWidgetColorTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -239,9 +235,7 @@ class EditorSlashWidgetColorTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -449,9 +443,7 @@ class EditorSlashWidgetColorTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -536,9 +528,7 @@ class EditorSlashWidgetColorTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -623,9 +613,7 @@ class EditorSlashWidgetColorTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)

View file

@ -142,9 +142,7 @@ class EditorSlashWidgetMarksTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id, block2.id, block3.id)
)
@ -233,9 +231,7 @@ class EditorSlashWidgetMarksTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id, block2.id, block3.id)
)
@ -366,9 +362,7 @@ class EditorSlashWidgetMarksTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id, block2.id, block3.id)
)
@ -441,9 +435,7 @@ class EditorSlashWidgetMarksTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id, block2.id)
)
@ -574,9 +566,7 @@ class EditorSlashWidgetMarksTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id, block2.id, block3.id)
)
@ -649,9 +639,7 @@ class EditorSlashWidgetMarksTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id, block2.id)
)
@ -782,9 +770,7 @@ class EditorSlashWidgetMarksTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id, block2.id, block3.id)
)
@ -857,9 +843,7 @@ class EditorSlashWidgetMarksTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id, block2.id)
)

View file

@ -72,9 +72,7 @@ class EditorSlashWidgetStyleTypeTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id, block2.id)
)
@ -203,9 +201,7 @@ class EditorSlashWidgetStyleTypeTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id, block2.id, block3.id)
)

View file

@ -31,9 +31,7 @@ class EditorStartupTest : EditorPresentationTestSetup() {
Block(
id = "some id",
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = emptyList()
)
)

View file

@ -72,9 +72,7 @@ class EditorTextUpdateTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -148,9 +146,7 @@ class EditorTextUpdateTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -223,9 +219,7 @@ class EditorTextUpdateTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -299,9 +293,7 @@ class EditorTextUpdateTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)

View file

@ -60,9 +60,7 @@ class EditorTitleAddBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)
@ -117,9 +115,7 @@ class EditorTitleAddBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -163,9 +159,7 @@ class EditorTitleAddBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)
@ -216,9 +210,7 @@ class EditorTitleAddBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -258,9 +250,7 @@ class EditorTitleAddBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)
@ -319,9 +309,7 @@ class EditorTitleAddBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -369,9 +357,7 @@ class EditorTitleAddBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)
@ -423,9 +409,7 @@ class EditorTitleAddBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)
@ -466,9 +450,7 @@ class EditorTitleAddBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)
@ -520,9 +502,7 @@ class EditorTitleAddBlockTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id, block.id)
)

View file

@ -62,9 +62,7 @@ class EditorTitleTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)
@ -113,9 +111,7 @@ class EditorTitleTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(header.id)
)
@ -182,7 +178,7 @@ class EditorTitleTest : EditorPresentationTestSetup() {
Block(
id = root,
fields = Block.Fields.empty(),
content = Block.Content.Smart(Block.Content.Smart.Type.PAGE),
content = Block.Content.Smart(),
children = listOf(header.id)
),
header,

View file

@ -63,9 +63,7 @@ class EditorTurnIntoTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(parent.id)
)
@ -127,9 +125,7 @@ class EditorTurnIntoTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(parent.id)
)
@ -188,9 +184,7 @@ class EditorTurnIntoTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(a.id, b.id)
)
@ -300,9 +294,7 @@ class EditorTurnIntoTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(parent.id)
)
@ -397,9 +389,7 @@ class EditorTurnIntoTest : EditorPresentationTestSetup() {
val page = Block(
id = root,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(
type = Block.Content.Smart.Type.PAGE
),
content = Block.Content.Smart(),
children = listOf(parent.id)
)

View file

@ -64,7 +64,7 @@ class StyleConfigKtTest {
val given = Block(
id = child,
fields = Block.Fields(emptyMap()),
content = Block.Content.Smart(type = Block.Content.Smart.Type.HOME),
content = Block.Content.Smart(),
children = emptyList()
)

View file

@ -0,0 +1,15 @@
syntax = "proto3";
package anytype.storage;
option go_package = "pkg/lib/pb/storage";
import "models.proto";
import "file.proto";
import "google/protobuf/struct.proto";
message SmartBlockSnapshot {
map<string, uint64> state = 1;
repeated anytype.model.Block blocks = 2;
google.protobuf.Struct details = 3;
map<string, FileKeys> keysByHash = 4;
int64 clientTime = 5;
}

View file

@ -3,8 +3,6 @@ package anytype;
option go_package = "pb";
import "models.proto";
import "relation.proto";
import "events.proto";
import "google/protobuf/struct.proto";
@ -93,12 +91,12 @@ message Change {
}
message RelationAdd {
anytype.relation.Relation relation = 2;
anytype.model.Relation relation = 2;
}
message RelationUpdate {
message Dict {
repeated anytype.relation.Relation.Option dict = 2;
repeated anytype.model.Relation.Option dict = 2;
}
message ObjectTypes {
@ -107,7 +105,7 @@ message Change {
string key = 1;
oneof value {
anytype.relation.RelationFormat format = 2;
anytype.model.RelationFormat format = 2;
string name = 3;
google.protobuf.Value defaultValue = 4;
ObjectTypes objectTypes = 5;

View file

@ -4,7 +4,6 @@ option go_package = "pb";
import "models.proto";
import "localstore.proto";
import "relation.proto";
import "events.proto";
import "google/protobuf/struct.proto";
@ -1122,7 +1121,7 @@ message Rpc {
message Request {
string contextId = 1;
string blockId = 2;
anytype.relation.Relation relation = 3;
anytype.model.Relation relation = 3;
}
message Response {
@ -1431,14 +1430,14 @@ message Rpc {
message Request {
string contextId = 1;
string blockId = 2; // id of dataview block to add relation
anytype.relation.Relation relation = 3;
anytype.model.Relation relation = 3;
}
message Response {
Error error = 1;
ResponseEvent event = 2;
string relationKey = 3; // deprecated
anytype.relation.Relation relation = 4;
anytype.model.Relation relation = 4;
message Error {
Code code = 1;
@ -1457,7 +1456,7 @@ message Rpc {
string contextId = 1;
string blockId = 2; // id of dataview block to add relation
string relationKey = 3; // key of relation to update
anytype.relation.Relation relation = 4;
anytype.model.Relation relation = 4;
}
message Response {
@ -1506,14 +1505,14 @@ message Rpc {
string contextId = 1;
string blockId = 2; // id of dataview block to add relation
string relationKey = 3; // relation key to add the option
anytype.relation.Relation.Option option = 4; // id of select options will be autogenerated
anytype.model.Relation.Option option = 4; // id of select options will be autogenerated
string recordId = 5; // id of record which is used to add an option
}
message Response {
Error error = 1;
ResponseEvent event = 2;
anytype.relation.Relation.Option option = 3;
anytype.model.Relation.Option option = 3;
message Error {
Code code = 1;
@ -1532,7 +1531,7 @@ message Rpc {
string contextId = 1;
string blockId = 2; // id of dataview block to add relation
string relationKey = 3; // relation key to add the option
anytype.relation.Relation.Option option = 4; // id of select options will be autogenerated
anytype.model.Relation.Option option = 4; // id of select options will be autogenerated
string recordId = 5; // id of record which is used to update an option
}
@ -1586,7 +1585,7 @@ message Rpc {
message Response {
Error error = 1;
repeated anytype.relation.Relation relations = 2;
repeated anytype.model.Relation relations = 2;
message Error {
Code code = 1;
@ -2723,7 +2722,7 @@ message Rpc {
message Response {
Error error = 1;
repeated anytype.relation.ObjectType objectTypes = 2;
repeated anytype.model.ObjectType objectTypes = 2;
message Error {
Code code = 1;
@ -2741,12 +2740,12 @@ message Rpc {
message Create {
message Request {
anytype.relation.ObjectType objectType = 1;
anytype.model.ObjectType objectType = 1;
}
message Response {
Error error = 1;
anytype.relation.ObjectType objectType = 2;
anytype.model.ObjectType objectType = 2;
message Error {
Code code = 1;
@ -2767,12 +2766,12 @@ message Rpc {
message Add {
message Request {
string objectTypeUrl = 1;
repeated anytype.relation.Relation relations = 2;
repeated anytype.model.Relation relations = 2;
}
message Response {
Error error = 1;
repeated anytype.relation.Relation relations = 2;
repeated anytype.model.Relation relations = 2;
message Error {
Code code = 1;
@ -2816,7 +2815,7 @@ message Rpc {
message Update {
message Request {
string objectTypeUrl = 1;
anytype.relation.Relation relation = 2;
anytype.model.Relation relation = 2;
}
message Response {
@ -2845,7 +2844,7 @@ message Rpc {
message Response {
Error error = 1;
repeated anytype.relation.Relation relations = 2;
repeated anytype.model.Relation relations = 2;
message Error {
Code code = 1;
@ -2868,14 +2867,14 @@ message Rpc {
message RelationAdd {
message Request {
string contextId = 1;
anytype.relation.Relation relation = 2;
anytype.model.Relation relation = 2;
}
message Response {
Error error = 1;
ResponseEvent event = 2;
string relationKey = 3; // deprecated
anytype.relation.Relation relation = 4;
anytype.model.Relation relation = 4;
message Error {
Code code = 1;
@ -2893,7 +2892,7 @@ message Rpc {
message Request {
string contextId = 1;
string relationKey = 2; // key of relation to update
anytype.relation.Relation relation = 3;
anytype.model.Relation relation = 3;
}
message Response {
@ -2940,13 +2939,13 @@ message Rpc {
message Request {
string contextId = 1;
string relationKey = 2; // relation key to add the option
anytype.relation.Relation.Option option = 3; // id of select options will be autogenerated
anytype.model.Relation.Option option = 3; // id of select options will be autogenerated
}
message Response {
Error error = 1;
ResponseEvent event = 2;
anytype.relation.Relation.Option option = 3;
anytype.model.Relation.Option option = 3;
message Error {
Code code = 1;
@ -2964,7 +2963,7 @@ message Rpc {
message Request {
string contextId = 1;
string relationKey = 2; // relation key to add the option
anytype.relation.Relation.Option option = 3; // id of select options will be autogenerated
anytype.model.Relation.Option option = 3; // id of select options will be autogenerated
}
message Response {
@ -3014,7 +3013,7 @@ message Rpc {
}
message Response {
Error error = 1;
repeated anytype.relation.Relation relations = 2;
repeated anytype.model.Relation relations = 2;
message Error {
Code code = 1;
@ -3036,6 +3035,7 @@ message Rpc {
string fullText = 3;
int32 offset = 4;
int32 limit = 5;
repeated string objectTypeFilter = 6;
}
message Response {

View file

@ -3,8 +3,6 @@ package anytype;
option go_package = "pb";
import "models.proto";
import "relation.proto";
import "google/protobuf/struct.proto";
/*
@ -115,12 +113,12 @@ message Event {
message Relations {
message Set {
string id = 1; // context objectId
repeated anytype.relation.Relation relations = 2;
repeated anytype.model.Relation relations = 2;
}
message Amend {
string id = 1; // context objectId
repeated anytype.relation.Relation relations = 2;
repeated anytype.model.Relation relations = 2;
}
message Remove {
@ -133,7 +131,7 @@ message Event {
message Set {
string id = 1; // context objectId
string relationKey = 2;
anytype.relation.Relation relation = 3; // missing value means relation should be removed
anytype.model.Relation relation = 3; // missing value means relation should be removed
}
message Remove {
string id = 1; // context objectId
@ -149,15 +147,15 @@ message Event {
string rootId = 1; // Root block id
repeated anytype.model.Block blocks = 2; // dependent simple blocks (descendants)
repeated Object.Details.Set details = 3; // details for the current and dependent objects
SmartBlockType type = 4;
model.SmartBlockType type = 4;
message RelationWithValuePerObject {
string objectId = 1;
repeated anytype.relation.RelationWithValue relations = 2;
repeated anytype.model.RelationWithValue relations = 2;
}
repeated anytype.relation.ObjectType objectTypes = 5; // objectTypes contains ONLY to get layouts for the actual and all dependent objects. Relations are currently omitted // todo: switch to other pb model
repeated anytype.relation.Relation relations = 7; // combined relations of object's type + extra relations. If object doesn't has some relation key in the details this means client should hide it and only suggest when adding existing one
repeated anytype.model.ObjectType objectTypes = 5; // objectTypes contains ONLY to get layouts for the actual and all dependent objects. Relations are currently omitted // todo: switch to other pb model
repeated anytype.model.Relation relations = 7; // combined relations of object's type + extra relations. If object doesn't has some relation key in the details this means client should hide it and only suggest when adding existing one
anytype.model.Restrictions restrictions = 8; // object restrictions
}
}
@ -573,7 +571,7 @@ message Event {
message RelationSet {
string id = 1; // dataview block's id
string relationKey = 2; // relation key to update
anytype.relation.Relation relation = 3;
anytype.model.Relation relation = 3;
}
// sent when the active view's visible records should be replaced
@ -724,31 +722,6 @@ message Event {
}
}
enum SmartBlockType {
Breadcrumbs = 0;
Page = 0x10;
ProfilePage = 0x11;
Home = 0x20;
Archive = 0x30;
Database = 0x40;
Set = 0x41; // only have dataview simpleblock
ObjectType = 0x60; // have relations list
File = 0x100;
Template = 0x120;
MarketplaceType = 0x110;
MarketplaceRelation = 0x111;
MarketplaceTemplate = 0x112;
BundledRelation = 0x200;
IndexedRelation = 0x201;
BundledObjectType = 0x202;
AnytypeProfile = 0x203;
}
message ResponseEvent {
repeated Event.Message messages = 1;
string contextId = 2;

View file

@ -0,0 +1,63 @@
syntax = "proto3";
package anytype.storage;
option go_package = "pkg/lib/pb/storage";
import "google/protobuf/struct.proto";
message Step {
string name = 1;
Link link = 2;
}
message FileKeys {
map<string,string> keysByPath = 1;
}
message FileInfo {
string mill = 1;
string checksum = 2;
string source = 3;
string opts = 4;
string hash = 5;
string key = 6;
string media = 7;
string name = 8;
int64 size = 9;
int64 added = 10;
google.protobuf.Struct meta = 11;
repeated string targets = 12;
EncryptionMode encMode = 13;
string metaHash = 14;
enum EncryptionMode {
AES_GCM = 0;
AES_CFB = 1;
}
}
message Directory {
map<string, FileInfo> files = 1;
}
message DirectoryList {
repeated Directory items = 1;
}
message Node {
string name = 1;
bool pin = 2;
bool plaintext = 3;
string mill = 4;
map<string, string> opts = 5;
google.protobuf.Struct json_schema = 6;
map<string, Link> links = 8;
}
message Link {
string use = 1;
bool pin = 2;
bool plaintext = 3;
string mill = 4;
map<string, string> opts = 5;
google.protobuf.Struct json_schema = 6;
}

View file

@ -3,29 +3,17 @@ package anytype.model;
option go_package = "pkg/lib/pb/model";
import "google/protobuf/struct.proto";
import "relation.proto";
import "models.proto";
message ObjectInfo {
string id = 1;
repeated string objectTypeUrls = 2;
google.protobuf.Struct details = 3;
anytype.relation.Relations relations = 4;
Relations relations = 4;
string snippet = 5;
bool hasInboundLinks = 6;
Type objectType = 7;
enum Type {
Page = 0;
Home = 1;
ProfilePage = 2;
Archive = 3;
Set = 5;
File = 6;
ObjectType = 7;
Relation = 8;
}
SmartBlockType objectType = 7;
}
message ObjectDetails {

View file

@ -2,18 +2,41 @@ syntax = "proto3";
package anytype.model;
option go_package = "pkg/lib/pb/model";
import "relation.proto";
import "google/protobuf/struct.proto";
// deprecated
message SmartBlockSnapshotBase {
repeated Block blocks = 1;
google.protobuf.Struct details = 2;
google.protobuf.Struct fileKeys = 3;
repeated anytype.relation.Relation extraRelations = 4;
repeated Relation extraRelations = 4;
repeated string objectTypes = 5;
}
enum SmartBlockType {
Breadcrumbs = 0;
Page = 0x10;
ProfilePage = 0x11;
Home = 0x20;
Archive = 0x30;
Database = 0x40;
Set = 0x41; // only have dataview simpleblock
STObjectType = 0x60; // have relations list
File = 0x100;
Template = 0x120;
MarketplaceType = 0x110;
MarketplaceRelation = 0x111;
MarketplaceTemplate = 0x112;
BundledRelation = 0x200;
IndexedRelation = 0x201;
BundledObjectType = 0x202;
AnytypeProfile = 0x203;
}
message Block {
string id = 1;
google.protobuf.Struct fields = 2;
@ -204,7 +227,7 @@ message Block {
string source = 1;
repeated View views = 2;
// index 3 is deprecated, was used for schemaURL in old-format sets
repeated anytype.relation.Relation relations = 4;
repeated model.Relation relations = 4;
string activeView = 3; // saved within a session
message View {
@ -377,4 +400,116 @@ message Restrictions {
}
message ObjectType {
string url = 1; // leave empty in case you want to create the new one
string name = 2; // name of objectType (can be localized for bundled types)
repeated Relation relations = 3; // cannot contain more than one Relation with the same RelationType
Layout layout = 4;
string iconEmoji = 5; // emoji symbol
string description = 6;
bool hidden = 7;
repeated SmartBlockType types = 8;
enum Layout {
basic = 0;
profile = 1;
todo = 2;
set = 3;
objectType = 4;
relation = 5;
file = 6;
dashboard = 7;
image = 8;
database = 20; // to be released later
}
}
message Layout {
ObjectType.Layout id = 1;
string name = 2;
repeated Relation requiredRelations = 3; // relations required for this object type
}
message RelationWithValue {
Relation relation = 1;
google.protobuf.Value value = 2;
}
// Relation describe the human-interpreted relation type. It may be something like "Date of creation, format=date" or "Assignee, format=objectId, objectType=person"
message Relation {
// Key under which the value is stored in the map. Must be unique for the object type.
// It usually auto-generated bsonid, but also may be something human-readable in case of prebuilt types.
string key = 1;
RelationFormat format = 2; // format of the underlying data
string name = 3; // name to show (can be localized for bundled types)
google.protobuf.Value defaultValue = 4;
DataSource dataSource = 5; // where the data is stored
bool hidden = 6; // internal, not displayed to user (e.g. coverX, coverY)
bool readOnly = 7; // not editable by user
bool multi = 8; // allow multiple values (stored in pb list)
repeated string objectTypes = 9; // URL of object type, empty to allow link to any object
// index 10, 11 was used in internal-only builds. Can be reused, but may break some test accounts
repeated Option selectDict = 12; // default dictionary with unique values to choose for select/multiSelect format
int32 maxCount = 13; // max number of values can be set for this relation. 0 means no limit. 1 means the value can be stored in non-repeated field
string description = 14;
// on-store fields, injected only locally
Scope scope = 20; // scope from which this relation have been aggregated
string creator = 21; // creator profile id
message Option {
string id = 1; // id generated automatically if omitted
string text = 2;
string color = 3; // stored
Scope scope = 4; // on-store contains only local-scope relations. All others injected on-the-fly
enum Scope {
local = 0; // stored within the object/aggregated from set
relation = 1; // aggregated from all relation of this relation's key
format = 2; // aggregated from all relations of this relation's format
}
}
enum Scope {
object = 0; // stored within the object
type = 1; // stored within the object type
setOfTheSameType = 2; // aggregated from the dataview of sets of the same object type
objectsOfTheSameType = 3; // aggregated from the dataview of sets of the same object type
library = 4; // aggregated from relations library
}
enum DataSource {
details = 0; // default, stored inside the object's details
derived = 1; // stored locally, e.g. in badger or generated on the fly
account = 2; // stored in the account DB. means existing only for specific anytype account
}
}
// RelationFormat describes how the underlying data is stored in the google.protobuf.Value and how it should be validated/sanitized
enum RelationFormat {
longtext = 0; // string
shorttext = 1; // string, usually short enough. May be truncated
number = 2; // double
status = 3; // string (choose one from a list)
tag = 11; // list of string (choose multiple from a list)
date = 4; // int64(pb.Value doesn't have int64) or string
file = 5; // relation can has objects of specific types: file, image, audio, video
checkbox = 6; // boolean
url = 7; // string with sanity check
email = 8; // string with sanity check
phone = 9; // string with sanity check
emoji = 10; // one emoji, can contains multiple utf-8 symbols
object = 100; // relation can has objectType to specify objectType
relations = 101; // base64-encoded
}
message Relations {
repeated Relation relations = 1;
}

View file

@ -1,123 +0,0 @@
syntax = "proto3";
package anytype.relation;
option go_package = "pkg/lib/pb/relation";
import "google/protobuf/struct.proto";
message Detail {
string key = 1;
google.protobuf.Value value = 2;
}
message ObjectType {
string url = 1; // leave empty in case you want to create the new one
string name = 2; // name of objectType (can be localized for bundled types)
repeated Relation relations = 3; // cannot contain more than one Relation with the same RelationType
Layout layout = 4;
string iconEmoji = 5; // emoji symbol
string description = 6;
bool hidden = 7;
enum Layout {
basic = 0;
profile = 1;
todo = 2;
set = 3;
objectType = 4;
relation = 5;
file = 6;
dashboard = 7;
image = 8;
database = 20; // to be released later
}
}
message Layout {
ObjectType.Layout id = 1;
string name = 2;
repeated Relation requiredRelations = 3; // relations required for this object type
}
message RelationWithValue {
Relation relation = 1;
google.protobuf.Value value = 2;
}
// Relation describe the human-interpreted relation type. It may be something like "Date of creation, format=date" or "Assignee, format=objectId, objectType=person"
message Relation {
// Key under which the value is stored in the map. Must be unique for the object type.
// It usually auto-generated bsonid, but also may be something human-readable in case of prebuilt types.
string key = 1;
RelationFormat format = 2; // format of the underlying data
string name = 3; // name to show (can be localized for bundled types)
google.protobuf.Value defaultValue = 4;
DataSource dataSource = 5; // where the data is stored
bool hidden = 6; // internal, not displayed to user (e.g. coverX, coverY)
bool readOnly = 7; // not editable by user
bool multi = 8; // allow multiple values (stored in pb list)
repeated string objectTypes = 9; // URL of object type, empty to allow link to any object
// index 10, 11 was used in internal-only builds. Can be reused, but may break some test accounts
repeated Option selectDict = 12; // default dictionary with unique values to choose for select/multiSelect format
int32 maxCount = 13; // max number of values can be set for this relation. 0 means no limit. 1 means the value can be stored in non-repeated field
string description = 14;
// on-store fields, injected only locally
Scope scope = 20; // scope from which this relation have been aggregated
string creator = 21; // creator profile id
message Option {
string id = 1; // id generated automatically if omitted
string text = 2;
string color = 3; // stored
Scope scope = 4; // on-store contains only local-scope relations. All others injected on-the-fly
enum Scope {
local = 0; // stored within the object/aggregated from set
relation = 1; // aggregated from all relation of this relation's key
format = 2; // aggregated from all relations of this relation's format
}
}
enum Scope {
object = 0; // stored within the object
type = 1; // stored within the object type
setOfTheSameType = 2; // aggregated from the dataview of sets of the same object type
objectsOfTheSameType = 3; // aggregated from the dataview of sets of the same object type
library = 4; // aggregated from relations library
}
enum DataSource {
details = 0; // default, stored inside the object's details
derived = 1; // stored locally, e.g. in badger or generated on the fly
account = 2; // stored in the account DB. means existing only for specific anytype account
}
}
// RelationFormat describes how the underlying data is stored in the google.protobuf.Value and how it should be validated/sanitized
enum RelationFormat {
longtext = 0; // string
shorttext = 1; // string, usually short enough. May be truncated
number = 2; // double
status = 3; // string (choose one from a list)
tag = 11; // list of string (choose multiple from a list)
date = 4; // int64(pb.Value doesn't have int64) or string
file = 5; // relation can has objects of specific types: file, image, audio, video
checkbox = 6; // boolean
url = 7; // string with sanity check
email = 8; // string with sanity check
phone = 9; // string with sanity check
emoji = 10; // one emoji, can contains multiple utf-8 symbols
object = 100; // relation can has objectType to specify objectType
relations = 101; // base64-encoded
}
message Relations {
repeated Relation relations = 1;
}