mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-2637 Protocol | Support for the new filter protocol (#1514)
This commit is contained in:
parent
d4e74df058
commit
2df5bad8ac
9 changed files with 15 additions and 27 deletions
|
@ -117,7 +117,7 @@ class CreateSelectedFilterTest {
|
|||
val filter = DVFilter(
|
||||
relation = relationKey,
|
||||
value = true,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
operator = Block.Content.DataView.Filter.Operator.NO,
|
||||
condition = DVFilterCondition.EQUAL
|
||||
)
|
||||
|
||||
|
@ -187,7 +187,7 @@ class CreateSelectedFilterTest {
|
|||
val filter = DVFilter(
|
||||
relation = relationKey,
|
||||
value = true,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
operator = Block.Content.DataView.Filter.Operator.NO,
|
||||
condition = DVFilterCondition.EQUAL
|
||||
)
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ class FilterListTest {
|
|||
val filter = DVFilter(
|
||||
relation = relationKey,
|
||||
value = true,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
operator = Block.Content.DataView.Filter.Operator.NO,
|
||||
condition = DVFilterCondition.EQUAL
|
||||
)
|
||||
|
||||
|
@ -193,7 +193,7 @@ class FilterListTest {
|
|||
val filter = DVFilter(
|
||||
relation = relationKey,
|
||||
value = false,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
operator = Block.Content.DataView.Filter.Operator.NO,
|
||||
condition = DVFilterCondition.NOT_EQUAL
|
||||
)
|
||||
|
||||
|
@ -278,7 +278,7 @@ class FilterListTest {
|
|||
val filter = DVFilter(
|
||||
relation = relationKey,
|
||||
value = null,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
operator = Block.Content.DataView.Filter.Operator.NO,
|
||||
condition = DVFilterCondition.EQUAL
|
||||
)
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ data class Block(
|
|||
val id: Id = "",
|
||||
val relation: Key,
|
||||
val relationFormat: RelationFormat? = null,
|
||||
val operator: Operator = Operator.AND,
|
||||
val operator: Operator = Operator.NO,
|
||||
val condition: Condition,
|
||||
val quickOption: QuickOption = QuickOption.EXACT_DATE,
|
||||
val value: Any? = null
|
||||
|
|
|
@ -146,7 +146,7 @@ class UpdateDataViewViewer(
|
|||
val view: Id,
|
||||
val relationKey: String,
|
||||
val relationFormat: RelationFormat? = null,
|
||||
val operator: Block.Content.DataView.Filter.Operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
val operator: Block.Content.DataView.Filter.Operator = Block.Content.DataView.Filter.Operator.NO,
|
||||
val condition: Block.Content.DataView.Filter.Condition,
|
||||
val quickOption: Block.Content.DataView.Filter.QuickOption = Block.Content.DataView.Filter.QuickOption.EXACT_DATE,
|
||||
val value: Any? = null
|
||||
|
|
|
@ -826,7 +826,7 @@ open class FilterViewModel(
|
|||
viewerId: Id,
|
||||
relationKey: String,
|
||||
relationFormat: RelationFormat? = null,
|
||||
operator: DVFilterOperator = DVFilterOperator.AND,
|
||||
operator: DVFilterOperator = DVFilterOperator.NO,
|
||||
condition: DVFilterCondition,
|
||||
quickOption: DVFilterQuickOption = DVFilterQuickOption.EXACT_DATE,
|
||||
value: Any? = null
|
||||
|
|
|
@ -122,28 +122,28 @@ class CreateDVObjectTest : ObjectSetViewModelTestSetup() {
|
|||
DVFilter(
|
||||
relation = filter1Relation.key,
|
||||
relationFormat = RelationFormat.SHORT_TEXT,
|
||||
operator = DVFilterOperator.AND,
|
||||
operator = DVFilterOperator.NO,
|
||||
condition = DVFilterCondition.EQUAL,
|
||||
value = "321"
|
||||
),
|
||||
DVFilter(
|
||||
relation = filter2Relation.key,
|
||||
relationFormat = RelationFormat.CHECKBOX,
|
||||
operator = DVFilterOperator.AND,
|
||||
operator = DVFilterOperator.NO,
|
||||
condition = DVFilterCondition.EQUAL,
|
||||
value = true
|
||||
),
|
||||
DVFilter(
|
||||
relation = filter3Relation.key,
|
||||
relationFormat = RelationFormat.SHORT_TEXT,
|
||||
operator = DVFilterOperator.AND,
|
||||
operator = DVFilterOperator.NO,
|
||||
condition = DVFilterCondition.EQUAL,
|
||||
value = "456"
|
||||
),
|
||||
DVFilter(
|
||||
relation = filter4Relation.key,
|
||||
relationFormat = RelationFormat.SHORT_TEXT,
|
||||
operator = DVFilterOperator.AND,
|
||||
operator = DVFilterOperator.NO,
|
||||
condition = notPermittedConditions.random(),
|
||||
value = "456"
|
||||
)
|
||||
|
@ -209,7 +209,6 @@ class CreateDVObjectTest : ObjectSetViewModelTestSetup() {
|
|||
DVFilter(
|
||||
relation = prefilledRelation.key,
|
||||
relationFormat = prefilledRelation.relationFormat,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = Block.Content.DataView.Filter.Condition.EQUAL,
|
||||
value = "456"
|
||||
)
|
||||
|
@ -294,28 +293,24 @@ class CreateDVObjectTest : ObjectSetViewModelTestSetup() {
|
|||
DVFilter(
|
||||
relation = filter1Relation.key,
|
||||
relationFormat = RelationFormat.SHORT_TEXT,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = Block.Content.DataView.Filter.Condition.EQUAL,
|
||||
value = "321"
|
||||
),
|
||||
DVFilter(
|
||||
relation = filter2Relation.key,
|
||||
relationFormat = RelationFormat.CHECKBOX,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = Block.Content.DataView.Filter.Condition.EQUAL,
|
||||
value = true
|
||||
),
|
||||
DVFilter(
|
||||
relation = filter3Relation.key,
|
||||
relationFormat = RelationFormat.SHORT_TEXT,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = Block.Content.DataView.Filter.Condition.EQUAL,
|
||||
value = "456"
|
||||
),
|
||||
DVFilter(
|
||||
relation = filter4Relation.key,
|
||||
relationFormat = RelationFormat.SHORT_TEXT,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = notPermittedConditions.random(),
|
||||
value = "456"
|
||||
)
|
||||
|
@ -403,28 +398,24 @@ class CreateDVObjectTest : ObjectSetViewModelTestSetup() {
|
|||
DVFilter(
|
||||
relation = filter1Relation.key,
|
||||
relationFormat = RelationFormat.SHORT_TEXT,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = Block.Content.DataView.Filter.Condition.EQUAL,
|
||||
value = "321"
|
||||
),
|
||||
DVFilter(
|
||||
relation = filter2Relation.key,
|
||||
relationFormat = RelationFormat.CHECKBOX,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = Block.Content.DataView.Filter.Condition.EQUAL,
|
||||
value = true
|
||||
),
|
||||
DVFilter(
|
||||
relation = filter3Relation.key,
|
||||
relationFormat = RelationFormat.SHORT_TEXT,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = Block.Content.DataView.Filter.Condition.EQUAL,
|
||||
value = "456"
|
||||
),
|
||||
DVFilter(
|
||||
relation = filter4Relation.key,
|
||||
relationFormat = RelationFormat.SHORT_TEXT,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = notPermittedConditions.random(),
|
||||
value = "456"
|
||||
)
|
||||
|
@ -467,7 +458,6 @@ class CreateDVObjectTest : ObjectSetViewModelTestSetup() {
|
|||
DVFilter(
|
||||
relation = filterDate.key,
|
||||
relationFormat = RelationFormat.DATE,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = Block.Content.DataView.Filter.Condition.EQUAL,
|
||||
quickOption = quickOption,
|
||||
value = filterValue
|
||||
|
@ -618,7 +608,6 @@ class CreateDVObjectTest : ObjectSetViewModelTestSetup() {
|
|||
val filters = listOf(
|
||||
DVFilter(
|
||||
relation = filter1Relation.key,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = Block.Content.DataView.Filter.Condition.EQUAL,
|
||||
value = true
|
||||
)
|
||||
|
|
|
@ -1043,6 +1043,6 @@ class FilterViewModelInputFieldValueCreateTest {
|
|||
companion object {
|
||||
const val EMPTY_STRING = ""
|
||||
const val NOT_EMPTY_STRING = "not empty"
|
||||
val DEFAULT_OPERATOR = Block.Content.DataView.Filter.Operator.AND
|
||||
val DEFAULT_OPERATOR = Block.Content.DataView.Filter.Operator.NO
|
||||
}
|
||||
}
|
|
@ -171,7 +171,6 @@ class FilterViewModelInputFieldValueModifyTest {
|
|||
filters = listOf(
|
||||
Block.Content.DataView.Filter(
|
||||
relation = relation1.key,
|
||||
operator = Block.Content.DataView.Filter.Operator.AND,
|
||||
condition = Block.Content.DataView.Filter.Condition.LIKE,
|
||||
value = MockDataFactory.randomString()
|
||||
)
|
||||
|
@ -407,6 +406,6 @@ class FilterViewModelInputFieldValueModifyTest {
|
|||
companion object {
|
||||
const val EMPTY_STRING = ""
|
||||
const val NOT_EMPTY_STRING = "not empty"
|
||||
val DEFAULT_OPERATOR = Block.Content.DataView.Filter.Operator.AND
|
||||
val DEFAULT_OPERATOR = Block.Content.DataView.Filter.Operator.NO
|
||||
}
|
||||
}
|
|
@ -82,7 +82,7 @@ fun StubFilter(
|
|||
id: Id = MockDataFactory.randomUuid(),
|
||||
relationKey: Key = MockDataFactory.randomUuid(),
|
||||
relationFormat: RelationFormat = RelationFormat.LONG_TEXT,
|
||||
operator: DVFilterOperator = DVFilterOperator.AND,
|
||||
operator: DVFilterOperator = DVFilterOperator.NO,
|
||||
condition: DVFilterCondition = DVFilterCondition.EQUAL,
|
||||
quickOption: DVFilterQuickOption = DVFilterQuickOption.EXACT_DATE,
|
||||
value: Any? = null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue