mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-07 21:37:04 +09:00
Merge pull request #2357 from anyproto/go-3938-add-include-time-relation
GO-3938 Add includeTime relation - details level
This commit is contained in:
commit
db70139990
8 changed files with 703 additions and 603 deletions
|
@ -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.RelationKeyRelationFormatIncludeTime),
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -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.RelationKeyRelationFormatIncludeTime: domain.Bool(r.GetIncludeTime()),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -30994,9 +30994,11 @@ 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) | | |
|
||||
| dateIncludeTime | [bool](#bool) | | bool isReadOnly = 4; // deprecated
|
||||
|
||||
deprecated |
|
||||
| timeFormat | [Block.Content.Dataview.Relation.TimeFormat](#anytype-model-Block-Content-Dataview-Relation-TimeFormat) | | deprecated |
|
||||
| dateFormat | [Block.Content.Dataview.Relation.DateFormat](#anytype-model-Block-Content-Dataview-Relation-DateFormat) | | deprecated |
|
||||
| formula | [Block.Content.Dataview.Relation.FormulaType](#anytype-model-Block-Content-Dataview-Relation-FormulaType) | | |
|
||||
| align | [Block.Align](#anytype-model-Block-Align) | | |
|
||||
|
||||
|
@ -32265,6 +32267,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 |
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ type Relation struct {
|
|||
Source string `json:"source"`
|
||||
Description string `json:"description"`
|
||||
Revision int `json:"revision"`
|
||||
IncludeTime bool `json:"includeTime"` // nolint: tagliatelle
|
||||
}
|
||||
|
||||
type ObjectType struct {
|
||||
|
@ -222,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)
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"github.com/anyproto/anytype-heart/pkg/lib/pb/model"
|
||||
)
|
||||
|
||||
const RelationChecksum = "cdc6fa237642478b9015b70d8664f9a5b18b652060461798b019d2401958a61d"
|
||||
const RelationChecksum = "b196956336cb7348a79d913d5e8e0a3f542424d3b175070725b90444114eaf0f"
|
||||
const (
|
||||
RelationKeyTag domain.RelationKey = "tag"
|
||||
RelationKeyCamera domain.RelationKey = "camera"
|
||||
|
@ -164,6 +164,7 @@ const (
|
|||
RelationKeyPluralName domain.RelationKey = "pluralName"
|
||||
RelationKeyHeaderRelationsLayout domain.RelationKey = "headerRelationsLayout"
|
||||
RelationKeyApiObjectKey domain.RelationKey = "apiObjectKey"
|
||||
RelationKeyRelationFormatIncludeTime domain.RelationKey = "relationFormatIncludeTime"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -174,11 +175,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: {
|
||||
|
@ -483,11 +486,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: {
|
||||
|
@ -1117,11 +1122,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: {
|
||||
|
@ -1130,11 +1137,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: {
|
||||
|
@ -1144,12 +1153,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: {
|
||||
|
@ -1552,6 +1562,19 @@ var (
|
|||
ReadOnlyRelation: true,
|
||||
Scope: model.Relation_type,
|
||||
},
|
||||
RelationKeyRelationFormatIncludeTime: {
|
||||
|
||||
DataSource: model.Relation_details,
|
||||
Description: "Should time be shown for relation values with date format",
|
||||
Format: model.RelationFormat_checkbox,
|
||||
Hidden: true,
|
||||
Id: "_brrelationFormatIncludeTime",
|
||||
Key: "relationFormatIncludeTime",
|
||||
Name: "IncludeTime",
|
||||
ReadOnly: true,
|
||||
ReadOnlyRelation: true,
|
||||
Scope: model.Relation_type,
|
||||
},
|
||||
RelationKeyRelationFormatObjectTypes: {
|
||||
|
||||
DataSource: model.Relation_details,
|
||||
|
@ -2043,11 +2066,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: {
|
||||
|
|
|
@ -36,7 +36,9 @@
|
|||
"maxCount": 1,
|
||||
"name": "Creation date",
|
||||
"readonly": true,
|
||||
"source": "derived"
|
||||
"source": "derived",
|
||||
"includeTime": true,
|
||||
"revision": 1
|
||||
},
|
||||
{
|
||||
"description": "Date when the object will be deleted from your device",
|
||||
|
@ -380,7 +382,9 @@
|
|||
"maxCount": 1,
|
||||
"name": "Last modified date",
|
||||
"readonly": true,
|
||||
"source": "derived"
|
||||
"source": "derived",
|
||||
"includeTime": true,
|
||||
"revision": 1
|
||||
},
|
||||
{
|
||||
"description": "List of recommended relations",
|
||||
|
@ -427,7 +431,9 @@
|
|||
"maxCount": 1,
|
||||
"name": "Last opened date",
|
||||
"readonly": true,
|
||||
"source": "account"
|
||||
"source": "account",
|
||||
"includeTime": true,
|
||||
"revision": 1
|
||||
},
|
||||
{
|
||||
"format": "object",
|
||||
|
@ -542,7 +548,9 @@
|
|||
"maxCount": 1,
|
||||
"name": "Added date",
|
||||
"readonly": true,
|
||||
"source": "details"
|
||||
"source": "details",
|
||||
"includeTime": true,
|
||||
"revision": 1
|
||||
},
|
||||
{
|
||||
"description": "Person who is responsible for this task or object",
|
||||
|
@ -1315,7 +1323,8 @@
|
|||
"name": "Last used date",
|
||||
"readonly": true,
|
||||
"source": "local",
|
||||
"revision": 1
|
||||
"revision": 2,
|
||||
"includeTime": true
|
||||
},
|
||||
{
|
||||
"description": "Revision of system object",
|
||||
|
@ -1376,7 +1385,9 @@
|
|||
"maxCount": 1,
|
||||
"name": "Sync date",
|
||||
"readonly": true,
|
||||
"source": "local"
|
||||
"source": "local",
|
||||
"includeTime": true,
|
||||
"revision": 1
|
||||
},
|
||||
{
|
||||
"description": "Object sync error",
|
||||
|
@ -1575,5 +1586,15 @@
|
|||
"name": "API Object Key",
|
||||
"readonly": false,
|
||||
"source": "details"
|
||||
},
|
||||
{
|
||||
"description": "Should time be shown for relation values with date format",
|
||||
"format": "checkbox",
|
||||
"hidden": true,
|
||||
"key": "relationFormatIncludeTime",
|
||||
"maxCount": 0,
|
||||
"name": "IncludeTime",
|
||||
"readonly": true,
|
||||
"source": "details"
|
||||
}
|
||||
]
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -386,10 +386,9 @@ message Block {
|
|||
bool isVisible = 2;
|
||||
int32 width = 3; // the displayed column % calculated based on other visible relations
|
||||
// bool isReadOnly = 4; // deprecated
|
||||
|
||||
bool dateIncludeTime = 5;
|
||||
TimeFormat timeFormat = 6;
|
||||
DateFormat dateFormat = 7;
|
||||
bool dateIncludeTime = 5; // deprecated
|
||||
TimeFormat timeFormat = 6; // deprecated
|
||||
DateFormat dateFormat = 7; // deprecated
|
||||
FormulaType formula = 8;
|
||||
Block.Align align = 9;
|
||||
|
||||
|
@ -854,6 +853,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
|
||||
|
|
|
@ -39,6 +39,7 @@ var (
|
|||
bundle.RelationKeyIconName,
|
||||
bundle.RelationKeyPluralName,
|
||||
bundle.RelationKeyRecommendedLayout,
|
||||
bundle.RelationKeyRelationFormatIncludeTime,
|
||||
}
|
||||
|
||||
customObjectFilterKeys = []domain.RelationKey{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue