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

GO-3938 Increase revision for system date relations

This commit is contained in:
kirillston 2025-04-17 17:01:50 +03:00
parent 66358d952e
commit 079e7242d4
No known key found for this signature in database
GPG key ID: BE4BF014F0ECDFE8
8 changed files with 684 additions and 805 deletions

View file

@ -25,6 +25,7 @@ func RelationFromDetails(det *domain.Details) *Relation {
Description: det.GetString(bundle.RelationKeyDescription),
Creator: det.GetString(bundle.RelationKeyCreator),
Revision: det.GetInt64(bundle.RelationKeyRevision),
IncludeTime: det.GetBool(bundle.RelationKeyIncludeTime),
},
}
@ -59,8 +60,9 @@ func (r *Relation) ToDetails() *domain.Details {
bundle.RelationKeyRelationReadonlyValue: domain.Bool(r.GetReadOnly()),
bundle.RelationKeyType: domain.String(bundle.TypeKeyRelation.BundledURL()),
// TODO Is it ok?
bundle.RelationKeyUniqueKey: domain.String(domain.RelationKey(r.GetKey()).URL()),
bundle.RelationKeyRevision: domain.Int64(r.GetRevision()),
bundle.RelationKeyUniqueKey: domain.String(domain.RelationKey(r.GetKey()).URL()),
bundle.RelationKeyRevision: domain.Int64(r.GetRevision()),
bundle.RelationKeyIncludeTime: domain.Bool(r.GetIncludeTime()),
})
}

View file

@ -2013,9 +2013,7 @@
- [Block.Content.Dataview.Filter.Condition](#anytype-model-Block-Content-Dataview-Filter-Condition)
- [Block.Content.Dataview.Filter.Operator](#anytype-model-Block-Content-Dataview-Filter-Operator)
- [Block.Content.Dataview.Filter.QuickOption](#anytype-model-Block-Content-Dataview-Filter-QuickOption)
- [Block.Content.Dataview.Relation.DateFormat](#anytype-model-Block-Content-Dataview-Relation-DateFormat)
- [Block.Content.Dataview.Relation.FormulaType](#anytype-model-Block-Content-Dataview-Relation-FormulaType)
- [Block.Content.Dataview.Relation.TimeFormat](#anytype-model-Block-Content-Dataview-Relation-TimeFormat)
- [Block.Content.Dataview.Sort.EmptyType](#anytype-model-Block-Content-Dataview-Sort-EmptyType)
- [Block.Content.Dataview.Sort.Type](#anytype-model-Block-Content-Dataview-Sort-Type)
- [Block.Content.Dataview.View.Size](#anytype-model-Block-Content-Dataview-View-Size)
@ -30328,9 +30326,6 @@ Bookmark is to keep a web-link and to preview a content.
| key | [string](#string) | | |
| isVisible | [bool](#bool) | | |
| width | [int32](#int32) | | the displayed column % calculated based on other visible relations |
| dateIncludeTime | [bool](#bool) | | |
| timeFormat | [Block.Content.Dataview.Relation.TimeFormat](#anytype-model-Block-Content-Dataview-Relation-TimeFormat) | | |
| dateFormat | [Block.Content.Dataview.Relation.DateFormat](#anytype-model-Block-Content-Dataview-Relation-DateFormat) | | |
| formula | [Block.Content.Dataview.Relation.FormulaType](#anytype-model-Block-Content-Dataview-Relation-FormulaType) | | |
| align | [Block.Align](#anytype-model-Block-Align) | | |
@ -31596,6 +31591,7 @@ default dictionary with unique values to choose for select/multiSelect format |
deprecated, to be removed |
| creator | [string](#string) | | creator profile id |
| revision | [int64](#int64) | | revision of system relation. Used to check if we should change relation content or not |
| includeTime | [bool](#bool) | | indicates whether value of relation with date format should be processed with seconds precision |
@ -31922,21 +31918,6 @@ stored |
<a name="anytype-model-Block-Content-Dataview-Relation-DateFormat"></a>
### Block.Content.Dataview.Relation.DateFormat
| Name | Number | Description |
| ---- | ------ | ----------- |
| MonthAbbrBeforeDay | 0 | Jul 30, 2020 |
| MonthAbbrAfterDay | 1 | 30 Jul 2020 |
| Short | 2 | 30/07/2020 |
| ShortUS | 3 | 07/30/2020 |
| ISO | 4 | 2020-07-30 |
<a name="anytype-model-Block-Content-Dataview-Relation-FormulaType"></a>
### Block.Content.Dataview.Relation.FormulaType
@ -31961,18 +31942,6 @@ stored |
<a name="anytype-model-Block-Content-Dataview-Relation-TimeFormat"></a>
### Block.Content.Dataview.Relation.TimeFormat
| Name | Number | Description |
| ---- | ------ | ----------- |
| Format12 | 0 | |
| Format24 | 1 | |
<a name="anytype-model-Block-Content-Dataview-Sort-EmptyType"></a>
### Block.Content.Dataview.Sort.EmptyType

View file

@ -223,6 +223,9 @@ func generateRelations() error {
if relation.Revision != 0 {
dictS[Id("Revision")] = Lit(relation.Revision)
}
if relation.IncludeTime {
dictS[Id("IncludeTime")] = Lit(relation.IncludeTime)
}
dict[Id(relConst(relation.Key))] = Block(dictS)
}

View file

@ -9,7 +9,7 @@ import (
"github.com/anyproto/anytype-heart/pkg/lib/pb/model"
)
const RelationChecksum = "a23583f8faef1cbfcd05ca1d2761538e67bbdd1336d1a467a0d657b5f986b313"
const RelationChecksum = "24ee576ec18180e32126c1cfec180d973d9f370d7449fe724446fe72cbe49275"
const (
RelationKeyTag domain.RelationKey = "tag"
RelationKeyCamera domain.RelationKey = "camera"
@ -160,6 +160,7 @@ const (
RelationKeyAutoWidgetTargets domain.RelationKey = "autoWidgetTargets"
RelationKeyAutoWidgetDisabled domain.RelationKey = "autoWidgetDisabled"
RelationKeyPluralName domain.RelationKey = "pluralName"
RelationKeyIncludeTime domain.RelationKey = "includeTime"
)
var (
@ -170,11 +171,13 @@ var (
Description: "Date when the file were added into the anytype",
Format: model.RelationFormat_date,
Id: "_braddedDate",
IncludeTime: true,
Key: "addedDate",
MaxCount: 1,
Name: "Added date",
ReadOnly: true,
ReadOnlyRelation: true,
Revision: 1,
Scope: model.Relation_type,
},
RelationKeyAperture: {
@ -464,11 +467,13 @@ var (
Description: "Date when the object was initially created",
Format: model.RelationFormat_date,
Id: "_brcreatedDate",
IncludeTime: true,
Key: "createdDate",
MaxCount: 1,
Name: "Creation date",
ReadOnly: true,
ReadOnlyRelation: true,
Revision: 1,
Scope: model.Relation_type,
},
RelationKeyCreator: {
@ -561,11 +566,13 @@ var (
Description: "",
Format: model.RelationFormat_date,
Id: "_brdueDate",
IncludeTime: true,
Key: "dueDate",
MaxCount: 1,
Name: "Due date",
ReadOnly: false,
ReadOnlyRelation: true,
Revision: 1,
Scope: model.Relation_type,
},
RelationKeyEmail: {
@ -897,6 +904,19 @@ var (
ReadOnlyRelation: true,
Scope: model.Relation_type,
},
RelationKeyIncludeTime: {
DataSource: model.Relation_details,
Description: "Should time be shown for relation values with date format",
Format: model.RelationFormat_checkbox,
Hidden: true,
Id: "_brincludeTime",
Key: "includeTime",
Name: "IncludeTime",
ReadOnly: true,
ReadOnlyRelation: true,
Scope: model.Relation_type,
},
RelationKeyIngredients: {
DataSource: model.Relation_details,
@ -1084,11 +1104,13 @@ var (
Description: "Date when the object was modified last time",
Format: model.RelationFormat_date,
Id: "_brlastModifiedDate",
IncludeTime: true,
Key: "lastModifiedDate",
MaxCount: 1,
Name: "Last modified date",
ReadOnly: true,
ReadOnlyRelation: true,
Revision: 1,
Scope: model.Relation_type,
},
RelationKeyLastOpenedDate: {
@ -1097,11 +1119,13 @@ var (
Description: "Date when the object was modified last opened",
Format: model.RelationFormat_date,
Id: "_brlastOpenedDate",
IncludeTime: true,
Key: "lastOpenedDate",
MaxCount: 1,
Name: "Last opened date",
ReadOnly: true,
ReadOnlyRelation: true,
Revision: 1,
Scope: model.Relation_type,
},
RelationKeyLastUsedDate: {
@ -1111,12 +1135,13 @@ var (
Format: model.RelationFormat_date,
Hidden: true,
Id: "_brlastUsedDate",
IncludeTime: true,
Key: "lastUsedDate",
MaxCount: 1,
Name: "Last used date",
ReadOnly: true,
ReadOnlyRelation: true,
Revision: 1,
Revision: 2,
Scope: model.Relation_type,
},
RelationKeyLatestAclHeadId: {
@ -1982,11 +2007,13 @@ var (
Format: model.RelationFormat_date,
Hidden: true,
Id: "_brsyncDate",
IncludeTime: true,
Key: "syncDate",
MaxCount: 1,
Name: "Sync date",
ReadOnly: true,
ReadOnlyRelation: true,
Revision: 1,
Scope: model.Relation_type,
},
RelationKeySyncError: {
@ -2105,11 +2132,13 @@ var (
Format: model.RelationFormat_date,
Hidden: true,
Id: "_brtimestamp",
IncludeTime: true,
Key: "timestamp",
MaxCount: 1,
Name: "Timestamp",
ReadOnly: true,
ReadOnlyRelation: true,
Revision: 1,
Scope: model.Relation_type,
},
RelationKeyToBeDeletedDate: {
@ -2119,11 +2148,13 @@ var (
Format: model.RelationFormat_date,
Hidden: true,
Id: "_brtoBeDeletedDate",
IncludeTime: true,
Key: "toBeDeletedDate",
MaxCount: 1,
Name: "Date to delete",
ReadOnly: true,
ReadOnlyRelation: true,
Revision: 1,
Scope: model.Relation_type,
},
RelationKeyType: {

View file

@ -37,7 +37,8 @@
"name": "Creation date",
"readonly": true,
"source": "derived",
"includeTime": true
"includeTime": true,
"revision": 1
},
{
"description": "Date when the object will be deleted from your device",
@ -48,7 +49,8 @@
"name": "Date to delete",
"readonly": true,
"source": "account",
"includeTime": true
"includeTime": true,
"revision": 1
},
{
"description": "Prioritized target types for the relation's value",
@ -383,7 +385,8 @@
"name": "Last modified date",
"readonly": true,
"source": "derived",
"includeTime": true
"includeTime": true,
"revision": 1
},
{
"description": "List of recommended relations",
@ -431,7 +434,8 @@
"name": "Last opened date",
"readonly": true,
"source": "account",
"includeTime": true
"includeTime": true,
"revision": 1
},
{
"format": "object",
@ -465,7 +469,8 @@
"name": "Due date",
"readonly": false,
"source": "details",
"includeTime": true
"includeTime": true,
"revision": 1
},
{
"description": "1 emoji(can contains multiple UTF symbols) used as an icon",
@ -548,7 +553,8 @@
"name": "Added date",
"readonly": true,
"source": "details",
"includeTime": true
"includeTime": true,
"revision": 1
},
{
"description": "Person who is responsible for this task or object",
@ -1301,7 +1307,7 @@
"name": "Last used date",
"readonly": true,
"source": "local",
"revision": 1,
"revision": 2,
"includeTime": true
},
{
@ -1364,7 +1370,8 @@
"name": "Sync date",
"readonly": true,
"source": "local",
"includeTime": true
"includeTime": true,
"revision": 1
},
{
"description": "Object sync error",
@ -1415,7 +1422,8 @@
"name": "Timestamp",
"readonly": true,
"source": "derived",
"includeTime": true
"includeTime": true,
"revision": 1
},
{
"description": "Width of object's layout",
@ -1553,6 +1561,6 @@
"maxCount": 0,
"name": "IncludeTime",
"readonly": true,
"source": "local"
"source": "details"
}
]

File diff suppressed because it is too large Load diff

View file

@ -832,6 +832,7 @@ message Relation {
Scope scope = 20; // deprecated, to be removed
string creator = 21; // creator profile id
int64 revision = 22; // revision of system relation. Used to check if we should change relation content or not
bool includeTime = 23; // indicates whether value of relation with date format should be processed with seconds precision
message Option {
string id = 1; // id generated automatically if omitted

View file

@ -40,6 +40,7 @@ var (
bundle.RelationKeyIconName,
bundle.RelationKeyPluralName,
bundle.RelationKeyRecommendedLayout,
bundle.RelationKeyIncludeTime,
}
customObjectFilterKeys = []domain.RelationKey{