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

DROID-302 Relations | Enhancement | Set Relation.SOURCE as target relation for reloading bookmark object (#2554)

This commit is contained in:
Evgenii Kozlov 2022-08-24 16:16:47 +03:00
parent 7ae6a6654a
commit a444345ea1
7 changed files with 7 additions and 6 deletions

View file

@ -3,7 +3,7 @@ on:
pull_request:
# add "synchronize" in "types", in order to trigger workflow for pull request commit(s) pushes.
types: [opened]
branches: [develop]
branches: [develop, release/0-10-0]
name: Run debug unit tests
jobs:
setup-android:

View file

@ -90,7 +90,7 @@ sealed class ObjectWrapper {
private val default = map.withDefault { null }
val name: String? by default
val description: String? by default
val url: String? by default
val source: String? by default
val iconEmoji: String? by default
val iconImage: String? by default
val picture: String? by default

View file

@ -32,6 +32,7 @@ object Relations {
const val SET_OF = "setOf"
const val IS_HIGHLIGHTED = "isHighlighted"
const val URL = "url"
const val SOURCE = "source"
const val PAGE_COVER = "pageCover"

View file

@ -1259,7 +1259,7 @@ class DefaultBlockViewRenderer @Inject constructor(
} else {
BlockView.Media.Bookmark(
id = block.id,
url = obj.url.orEmpty(),
url = obj.source.orEmpty(),
title = obj.name,
description = obj.description,
imageUrl = obj.picture?.let { urlBuilder.image(it) },

View file

@ -107,7 +107,7 @@ class RelationTextValueViewModel(
actions.value = buildList {
add(RelationValueAction.Url.Browse(value))
add(RelationValueAction.Url.Copy(value))
if (relation.key == Relations.URL && obj.type.contains(ObjectType.BOOKMARK_TYPE)) {
if (relation.key == Relations.SOURCE && obj.type.contains(ObjectType.BOOKMARK_TYPE)) {
add(RelationValueAction.Url.Reload(value))
}
}

View file

@ -5231,7 +5231,7 @@ class DefaultBlockViewRendererTest {
mapOf(
Relations.NAME to bookmarkTitle,
Relations.DESCRIPTION to bookmarkDescription,
Relations.URL to bookmarkUrl
Relations.SOURCE to bookmarkUrl
)
)
)

View file

@ -502,7 +502,7 @@ class EditorLockPageTest : EditorPresentationTestSetup() {
mapOf(
Relations.NAME to bookmarkTitle,
Relations.DESCRIPTION to bookmarkDescription,
Relations.URL to bookmarkUrl
Relations.SOURCE to bookmarkUrl
)
)
)