From 4f79c8f05d0c02268279f95564571c2d8a1ada64 Mon Sep 17 00:00:00 2001 From: kirillston Date: Fri, 4 Apr 2025 22:11:45 +0300 Subject: [PATCH 1/3] GO-5338 Rm description for types WIP --- pkg/lib/bundle/types.gen.go | 110 +++++++++--------- pkg/lib/bundle/types.json | 83 +++++-------- .../systemobjectreviser.go | 1 + 3 files changed, 83 insertions(+), 111 deletions(-) diff --git a/pkg/lib/bundle/types.gen.go b/pkg/lib/bundle/types.gen.go index e5bf897e8..bafb219fe 100644 --- a/pkg/lib/bundle/types.gen.go +++ b/pkg/lib/bundle/types.gen.go @@ -9,7 +9,7 @@ import ( "github.com/anyproto/anytype-heart/pkg/lib/pb/model" ) -const TypeChecksum = "f2672b9f52915f228e335b78ed94ce1b6c7b195ceb1cba9a44b25a870a3b2ac0" +const TypeChecksum = "4c26441b1e7a99b4344c736f8237e70b122fd4b0923015c8fcb375dc5804cb55" const ( TypePrefix = "_ot" ) @@ -49,7 +49,7 @@ var ( types = map[domain.TypeKey]*model.ObjectType{ TypeKeyAudio: { - Description: "Sound when recorded, with ability to reproduce", + Description: "", IconColor: 5, IconName: "musical-notes", Layout: model.ObjectType_file, @@ -58,13 +58,13 @@ var ( Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyOrigin), MustGetRelationLink(RelationKeyFileExt), MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeyArtist), MustGetRelationLink(RelationKeyAudioAlbum), MustGetRelationLink(RelationKeyAudioGenre), MustGetRelationLink(RelationKeyReleasedYear), MustGetRelationLink(RelationKeyAudioAlbumTrackNumber), MustGetRelationLink(RelationKeyAudioLyrics)}, RestrictObjectCreation: true, - Revision: 4, + Revision: 5, Types: []model.SmartBlockType{model.SmartBlockType_File}, Url: TypePrefix + "audio", }, TypeKeyBook: { - Description: "A book is a medium for recording information in the form of writing or images, typically composed of many pages bound together and protected by a cover", + Description: "", IconColor: 3, IconName: "book", Layout: model.ObjectType_basic, @@ -72,13 +72,13 @@ var ( PluralName: "Books", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyAuthor), MustGetRelationLink(RelationKeyStarred), MustGetRelationLink(RelationKeyStatus), MustGetRelationLink(RelationKeyUrl)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "book", }, TypeKeyBookmark: { - Description: "URL that is stored as Object and may be categorised and linked with objects", + Description: "", IconColor: 4, IconName: "bookmark", Layout: model.ObjectType_bookmark, @@ -86,13 +86,13 @@ var ( PluralName: "Bookmarks", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyPicture), MustGetRelationLink(RelationKeySource)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "bookmark", }, TypeKeyChat: { - Description: "A chat [deprecated]", + Description: "", Hidden: true, IconColor: 7, IconName: "chatbubble", @@ -106,7 +106,7 @@ var ( }, TypeKeyChatDerived: { - Description: "A chat derived object", + Description: "", Hidden: true, IconColor: 7, IconName: "chatbubble", @@ -115,13 +115,13 @@ var ( PluralName: "Chat Derived Objects", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag)}, - Revision: 3, + Revision: 4, Types: []model.SmartBlockType{model.SmartBlockType_ChatDerivedObject}, Url: TypePrefix + "chatDerived", }, TypeKeyCollection: { - Description: "Collect objects in one place, use different views to organize them", + Description: "", IconColor: 7, IconName: "layers", Layout: model.ObjectType_collection, @@ -129,13 +129,13 @@ var ( PluralName: "Collections", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "collection", }, TypeKeyContact: { - Description: "Information to make action of communicating or meeting with Human or Company", + Description: "", IconColor: 8, IconName: "id-card", Layout: model.ObjectType_profile, @@ -143,13 +143,13 @@ var ( PluralName: "Contacts", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyCompany), MustGetRelationLink(RelationKeyEmail), MustGetRelationLink(RelationKeyPhone)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "contact", }, TypeKeyDashboard: { - Description: "Internal home dashboard with favourite objects", + Description: "", Hidden: true, IconColor: 0, Layout: model.ObjectType_dashboard, @@ -161,7 +161,7 @@ var ( }, TypeKeyDate: { - Description: "Gregorian calendar date", + Description: "", Hidden: true, IconColor: 9, IconName: "calendar", @@ -175,7 +175,7 @@ var ( }, TypeKeyDiaryEntry: { - Description: "Record of events and experiences", + Description: "", IconColor: 2, IconName: "reader", Layout: model.ObjectType_basic, @@ -183,13 +183,13 @@ var ( PluralName: "Diary Entries", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyMood)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "diaryEntry", }, TypeKeyFile: { - Description: "Computer resource for recording data in a computer storage device", + Description: "", IconColor: 7, IconName: "attach", Layout: model.ObjectType_file, @@ -198,13 +198,13 @@ var ( Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyOrigin), MustGetRelationLink(RelationKeyFileExt), MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyFileMimeType)}, RestrictObjectCreation: true, - Revision: 4, + Revision: 5, Types: []model.SmartBlockType{model.SmartBlockType_File}, Url: TypePrefix + "file", }, TypeKeyGoal: { - Description: "The object of a person's ambition or effort; an aim or desired result", + Description: "", IconColor: 4, IconName: "flag", Layout: model.ObjectType_todo, @@ -212,13 +212,13 @@ var ( PluralName: "Goals", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyDueDate), MustGetRelationLink(RelationKeyProgress), MustGetRelationLink(RelationKeyStatus), MustGetRelationLink(RelationKeyTasks)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "goal", }, TypeKeyImage: { - Description: "A representation of the external form of a person or thing in art", + Description: "", IconColor: 10, IconName: "image", Layout: model.ObjectType_image, @@ -227,13 +227,13 @@ var ( Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyOrigin), MustGetRelationLink(RelationKeyFileExt), MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyHeightInPixels), MustGetRelationLink(RelationKeyWidthInPixels), MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeyCamera), MustGetRelationLink(RelationKeyCameraIso), MustGetRelationLink(RelationKeyAperture), MustGetRelationLink(RelationKeyExposure), MustGetRelationLink(RelationKeyFocalRatio)}, RestrictObjectCreation: true, - Revision: 4, + Revision: 5, Types: []model.SmartBlockType{model.SmartBlockType_File}, Url: TypePrefix + "image", }, TypeKeyMovie: { - Description: "Motion picture or Moving picture, is a work of visual art used to simulate experiences that communicate ideas, stories, perceptions, feelings, beauty, or atmosphere through the use of moving images", + Description: "", IconColor: 5, IconName: "film", Layout: model.ObjectType_basic, @@ -241,13 +241,13 @@ var ( PluralName: "Movies", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyGenre), MustGetRelationLink(RelationKeyStatus)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "movie", }, TypeKeyNote: { - Description: "Blank canvas with no Title. A brief record of points written down as an aid to memory", + Description: "", IconColor: 2, IconName: "create", Layout: model.ObjectType_note, @@ -255,13 +255,13 @@ var ( PluralName: "Notes", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "note", }, TypeKeyObjectType: { - Description: "Object that contains a definition of some object type", + Description: "", IconColor: 9, IconName: "extension-puzzle", Layout: model.ObjectType_objectType, @@ -269,13 +269,13 @@ var ( PluralName: "Types", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyRecommendedRelations), MustGetRelationLink(RelationKeyRecommendedLayout)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_SubObject, model.SmartBlockType_BundledObjectType}, Url: TypePrefix + "objectType", }, TypeKeyPage: { - Description: "Blank canvas with Title", + Description: "", IconColor: 8, IconName: "document", Layout: model.ObjectType_basic, @@ -283,13 +283,13 @@ var ( PluralName: "Pages", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "page", }, TypeKeyParticipant: { - Description: "Anytype identity as a space participant", + Description: "", IconColor: 3, IconName: "person", Layout: model.ObjectType_participant, @@ -298,13 +298,13 @@ var ( Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag)}, RestrictObjectCreation: true, - Revision: 3, + Revision: 4, Types: []model.SmartBlockType{model.SmartBlockType_Participant}, Url: TypePrefix + "participant", }, TypeKeyProfile: { - Description: "Homo sapiens", + Description: "", Hidden: true, IconColor: 3, IconName: "man", @@ -313,13 +313,13 @@ var ( PluralName: "Humans", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page, model.SmartBlockType_ProfilePage}, Url: TypePrefix + "profile", }, TypeKeyProject: { - Description: "An individual or collaborative enterprise that is carefully planned to achieve a particular aim", + Description: "", IconColor: 3, IconName: "hammer", Layout: model.ObjectType_basic, @@ -327,13 +327,13 @@ var ( PluralName: "Projects", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyTasks)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "project", }, TypeKeyRecipe: { - Description: "A recipe is a set of instructions that describes how to prepare or make something, especially a dish of prepared food", + Description: "", IconColor: 4, IconName: "pizza", Layout: model.ObjectType_basic, @@ -341,13 +341,13 @@ var ( PluralName: "Recipes", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyIngredients), MustGetRelationLink(RelationKeyTime)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "recipe", }, TypeKeyRelation: { - Description: "Meaningful connection between objects", + Description: "", Hidden: true, IconColor: 7, IconName: "share-social", @@ -356,13 +356,13 @@ var ( PluralName: "Relation", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyRelationFormat), MustGetRelationLink(RelationKeyRelationMaxCount), MustGetRelationLink(RelationKeyRelationDefaultValue), MustGetRelationLink(RelationKeyRelationFormatObjectTypes)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_SubObject, model.SmartBlockType_BundledRelation}, Url: TypePrefix + "relation", }, TypeKeyRelationOption: { - Description: "Object that contains a relation option", + Description: "", Hidden: true, IconColor: 0, Layout: model.ObjectType_relationOption, @@ -373,7 +373,7 @@ var ( }, TypeKeySet: { - Description: "Query all objects in your space based on types and relations", + Description: "", IconColor: 6, IconName: "search", Layout: model.ObjectType_set, @@ -381,13 +381,13 @@ var ( PluralName: "Queries", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeySetOf)}, - Revision: 3, + Revision: 4, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "set", }, TypeKeySpace: { - Description: "Workspace", + Description: "", Hidden: true, IconColor: 10, IconName: "folder", @@ -397,13 +397,13 @@ var ( Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag)}, RestrictObjectCreation: true, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Workspace}, Url: TypePrefix + "space", }, TypeKeySpaceView: { - Description: "Space", + Description: "", Hidden: true, IconColor: 10, IconName: "folder", @@ -413,13 +413,13 @@ var ( Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag)}, RestrictObjectCreation: true, - Revision: 1, + Revision: 2, Types: []model.SmartBlockType{model.SmartBlockType_SpaceView}, Url: TypePrefix + "spaceView", }, TypeKeyTask: { - Description: "A piece of work to be done or undertaken", + Description: "", IconColor: 10, IconName: "checkbox", Layout: model.ObjectType_todo, @@ -427,13 +427,13 @@ var ( PluralName: "Tasks", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyAssignee), MustGetRelationLink(RelationKeyDone), MustGetRelationLink(RelationKeyDueDate), MustGetRelationLink(RelationKeyLinkedProjects), MustGetRelationLink(RelationKeyStatus)}, - Revision: 2, + Revision: 3, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "task", }, TypeKeyTemplate: { - Description: "Sample object that has already some details in place and used to create objects from", + Description: "", IconColor: 8, IconName: "copy", Layout: model.ObjectType_basic, @@ -441,13 +441,13 @@ var ( PluralName: "Templates", Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTargetObjectType), MustGetRelationLink(RelationKeyTemplateIsBundled)}, - Revision: 3, + Revision: 4, Types: []model.SmartBlockType{model.SmartBlockType_Template}, Url: TypePrefix + "template", }, TypeKeyVideo: { - Description: "The recording of moving visual images", + Description: "", IconColor: 6, IconName: "videocam", Layout: model.ObjectType_file, @@ -456,7 +456,7 @@ var ( Readonly: true, RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyOrigin), MustGetRelationLink(RelationKeyFileExt), MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyHeightInPixels), MustGetRelationLink(RelationKeyWidthInPixels), MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeyCamera), MustGetRelationLink(RelationKeyCameraIso), MustGetRelationLink(RelationKeyAperture), MustGetRelationLink(RelationKeyExposure)}, RestrictObjectCreation: true, - Revision: 4, + Revision: 5, Types: []model.SmartBlockType{model.SmartBlockType_File}, Url: TypePrefix + "video", }, diff --git a/pkg/lib/bundle/types.json b/pkg/lib/bundle/types.json index 9d9bccac6..e963fddf7 100644 --- a/pkg/lib/bundle/types.json +++ b/pkg/lib/bundle/types.json @@ -15,8 +15,7 @@ "ingredients", "time" ], - "description": "A recipe is a set of instructions that describes how to prepare or make something, especially a dish of prepared food", - "revision": 2 + "revision": 3 }, { "id": "note", @@ -32,8 +31,7 @@ "relations": [ "tag" ], - "description": "Blank canvas with no Title. A brief record of points written down as an aid to memory", - "revision": 2 + "revision": 3 }, { "id": "contact", @@ -52,8 +50,7 @@ "email", "phone" ], - "description": "Information to make action of communicating or meeting with Human or Company", - "revision": 2 + "revision": 3 }, { "id": "bookmark", @@ -71,8 +68,7 @@ "picture", "source" ], - "description": "URL that is stored as Object and may be categorised and linked with objects", - "revision": 2 + "revision": 3 }, { "id": "date", @@ -87,8 +83,7 @@ "layout": "date", "relations": [ "tag" - ], - "description": "Gregorian calendar date" + ] }, { "id": "task", @@ -109,8 +104,7 @@ "linkedProjects", "status" ], - "description": "A piece of work to be done or undertaken", - "revision": 2 + "revision": 3 }, { "id": "relation", @@ -130,8 +124,7 @@ "relationDefaultValue", "relationFormatObjectTypes" ], - "description": "Meaningful connection between objects", - "revision": 2 + "revision": 3 }, { "id": "book", @@ -151,8 +144,7 @@ "status", "url" ], - "description": "A book is a medium for recording information in the form of writing or images, typically composed of many pages bound together and protected by a cover", - "revision": 2 + "revision": 3 }, { "id": "video", @@ -178,9 +170,8 @@ "aperture", "exposure" ], - "description": "The recording of moving visual images", "restrictObjectCreation": true, - "revision": 4 + "revision": 5 }, { "id": "dashboard", @@ -192,7 +183,6 @@ "hidden": true, "layout": "dashboard", "relations": [], - "description": "Internal home dashboard with favourite objects", "restrictObjectCreation": true }, { @@ -211,8 +201,7 @@ "genre", "status" ], - "description": "Motion picture or Moving picture, is a work of visual art used to simulate experiences that communicate ideas, stories, perceptions, feelings, beauty, or atmosphere through the use of moving images", - "revision": 2 + "revision": 3 }, { "id": "objectType", @@ -230,8 +219,7 @@ "recommendedRelations", "recommendedLayout" ], - "description": "Object that contains a definition of some object type", - "revision": 2 + "revision": 3 }, { "id": "relationOption", @@ -241,8 +229,7 @@ ], "hidden": true, "layout": "relationOption", - "relations": [], - "description": "Object that contains a relation option" + "relations": [] }, { "id": "space", @@ -258,9 +245,8 @@ "relations": [ "tag" ], - "description": "Workspace", "restrictObjectCreation": true, - "revision": 2 + "revision": 3 }, { "id": "spaceView", @@ -276,9 +262,8 @@ "relations": [ "tag" ], - "description": "Space", "restrictObjectCreation": true, - "revision": 1 + "revision": 2 }, { "id": "participant", @@ -294,9 +279,8 @@ "relations": [ "tag" ], - "description": "Anytype identity as a space participant", "restrictObjectCreation": true, - "revision": 3 + "revision": 4 }, { "id": "template", @@ -313,8 +297,7 @@ "targetObjectType", "templateIsBundled" ], - "description": "Sample object that has already some details in place and used to create objects from", - "revision": 3 + "revision": 4 }, { "id": "set", @@ -331,8 +314,7 @@ "tag", "setOf" ], - "description": "Query all objects in your space based on types and relations", - "revision": 3 + "revision": 4 }, { "id": "collection", @@ -348,8 +330,7 @@ "relations": [ "tag" ], - "description": "Collect objects in one place, use different views to organize them", - "revision": 2 + "revision": 3 }, { "id": "diaryEntry", @@ -366,8 +347,7 @@ "tag", "mood" ], - "description": "Record of events and experiences", - "revision": 2 + "revision": 3 }, { "id": "page", @@ -383,8 +363,7 @@ "relations": [ "tag" ], - "description": "Blank canvas with Title", - "revision": 2 + "revision": 3 }, { "id": "image", @@ -411,9 +390,8 @@ "exposure", "focalRatio" ], - "description": "A representation of the external form of a person or thing in art", "restrictObjectCreation": true, - "revision": 4 + "revision": 5 }, { "id": "profile", @@ -430,8 +408,7 @@ "relations": [ "tag" ], - "description": "Homo sapiens", - "revision": 2 + "revision": 3 }, { "id": "audio", @@ -457,9 +434,8 @@ "audioAlbumTrackNumber", "audioLyrics" ], - "description": "Sound when recorded, with ability to reproduce", "restrictObjectCreation": true, - "revision": 4 + "revision": 5 }, { "id": "goal", @@ -479,8 +455,7 @@ "status", "tasks" ], - "description": "The object of a person's ambition or effort; an aim or desired result", - "revision": 2 + "revision": 3 }, { "id": "file", @@ -500,9 +475,8 @@ "sizeInBytes", "fileMimeType" ], - "description": "Computer resource for recording data in a computer storage device", "restrictObjectCreation": true, - "revision": 4 + "revision": 5 }, { "id": "project", @@ -519,8 +493,7 @@ "tag", "tasks" ], - "description": "An individual or collaborative enterprise that is carefully planned to achieve a particular aim", - "revision": 2 + "revision": 3 }, { "id": "chat", @@ -535,7 +508,6 @@ "relations": [ "tag" ], - "description": "A chat [deprecated]", "revision": 1 }, { @@ -552,7 +524,6 @@ "relations": [ "tag" ], - "description": "A chat derived object", - "revision": 3 + "revision": 4 } ] diff --git a/space/internal/components/migration/systemobjectreviser/systemobjectreviser.go b/space/internal/components/migration/systemobjectreviser/systemobjectreviser.go index 0adb666f4..3dc8d4da2 100644 --- a/space/internal/components/migration/systemobjectreviser/systemobjectreviser.go +++ b/space/internal/components/migration/systemobjectreviser/systemobjectreviser.go @@ -46,6 +46,7 @@ var ( bundle.RelationKeyIconOption, bundle.RelationKeyIconName, bundle.RelationKeyPluralName, + bundle.RelationKeyDescription, } ) From 5b050ad6c3a51c404b08e033a9095831c7a6c63e Mon Sep 17 00:00:00 2001 From: kirillston Date: Mon, 7 Apr 2025 13:55:49 +0300 Subject: [PATCH 2/3] GO-5338 Revert revision update --- pkg/lib/bundle/types.json | 50 +++++++++---------- .../systemobjectreviser.go | 2 - 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/pkg/lib/bundle/types.json b/pkg/lib/bundle/types.json index e963fddf7..f89199789 100644 --- a/pkg/lib/bundle/types.json +++ b/pkg/lib/bundle/types.json @@ -15,7 +15,7 @@ "ingredients", "time" ], - "revision": 3 + "revision": 2 }, { "id": "note", @@ -31,7 +31,7 @@ "relations": [ "tag" ], - "revision": 3 + "revision": 2 }, { "id": "contact", @@ -50,7 +50,7 @@ "email", "phone" ], - "revision": 3 + "revision": 2 }, { "id": "bookmark", @@ -68,7 +68,7 @@ "picture", "source" ], - "revision": 3 + "revision": 2 }, { "id": "date", @@ -104,7 +104,7 @@ "linkedProjects", "status" ], - "revision": 3 + "revision": 2 }, { "id": "relation", @@ -124,7 +124,7 @@ "relationDefaultValue", "relationFormatObjectTypes" ], - "revision": 3 + "revision": 2 }, { "id": "book", @@ -144,7 +144,7 @@ "status", "url" ], - "revision": 3 + "revision": 2 }, { "id": "video", @@ -171,7 +171,7 @@ "exposure" ], "restrictObjectCreation": true, - "revision": 5 + "revision": 4 }, { "id": "dashboard", @@ -201,7 +201,7 @@ "genre", "status" ], - "revision": 3 + "revision": 2 }, { "id": "objectType", @@ -219,7 +219,7 @@ "recommendedRelations", "recommendedLayout" ], - "revision": 3 + "revision": 2 }, { "id": "relationOption", @@ -246,7 +246,7 @@ "tag" ], "restrictObjectCreation": true, - "revision": 3 + "revision": 2 }, { "id": "spaceView", @@ -263,7 +263,7 @@ "tag" ], "restrictObjectCreation": true, - "revision": 2 + "revision": 1 }, { "id": "participant", @@ -280,7 +280,7 @@ "tag" ], "restrictObjectCreation": true, - "revision": 4 + "revision": 3 }, { "id": "template", @@ -297,7 +297,7 @@ "targetObjectType", "templateIsBundled" ], - "revision": 4 + "revision": 3 }, { "id": "set", @@ -314,7 +314,7 @@ "tag", "setOf" ], - "revision": 4 + "revision": 3 }, { "id": "collection", @@ -330,7 +330,7 @@ "relations": [ "tag" ], - "revision": 3 + "revision": 2 }, { "id": "diaryEntry", @@ -347,7 +347,7 @@ "tag", "mood" ], - "revision": 3 + "revision": 2 }, { "id": "page", @@ -363,7 +363,7 @@ "relations": [ "tag" ], - "revision": 3 + "revision": 2 }, { "id": "image", @@ -391,7 +391,7 @@ "focalRatio" ], "restrictObjectCreation": true, - "revision": 5 + "revision": 4 }, { "id": "profile", @@ -408,7 +408,7 @@ "relations": [ "tag" ], - "revision": 3 + "revision": 2 }, { "id": "audio", @@ -435,7 +435,7 @@ "audioLyrics" ], "restrictObjectCreation": true, - "revision": 5 + "revision": 4 }, { "id": "goal", @@ -455,7 +455,7 @@ "status", "tasks" ], - "revision": 3 + "revision": 2 }, { "id": "file", @@ -476,7 +476,7 @@ "fileMimeType" ], "restrictObjectCreation": true, - "revision": 5 + "revision": 4 }, { "id": "project", @@ -493,7 +493,7 @@ "tag", "tasks" ], - "revision": 3 + "revision": 2 }, { "id": "chat", @@ -524,6 +524,6 @@ "relations": [ "tag" ], - "revision": 4 + "revision": 3 } ] diff --git a/space/internal/components/migration/systemobjectreviser/systemobjectreviser.go b/space/internal/components/migration/systemobjectreviser/systemobjectreviser.go index 3dc8d4da2..c091e70b5 100644 --- a/space/internal/components/migration/systemobjectreviser/systemobjectreviser.go +++ b/space/internal/components/migration/systemobjectreviser/systemobjectreviser.go @@ -29,7 +29,6 @@ const revisionKey = bundle.RelationKeyRevision var ( systemObjectFilterKeys = []domain.RelationKey{ bundle.RelationKeyName, - bundle.RelationKeyDescription, bundle.RelationKeyIsReadonly, bundle.RelationKeyIsHidden, bundle.RelationKeyRevision, @@ -46,7 +45,6 @@ var ( bundle.RelationKeyIconOption, bundle.RelationKeyIconName, bundle.RelationKeyPluralName, - bundle.RelationKeyDescription, } ) From 9471078acec429d1667c086f4fb1b4a6597a8869 Mon Sep 17 00:00:00 2001 From: kirillston Date: Mon, 7 Apr 2025 15:56:33 +0300 Subject: [PATCH 3/3] GO-5338 Fix tests --- .../systemobjectreviser_test.go | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/space/internal/components/migration/systemobjectreviser/systemobjectreviser_test.go b/space/internal/components/migration/systemobjectreviser/systemobjectreviser_test.go index fbdc13160..461c57909 100644 --- a/space/internal/components/migration/systemobjectreviser/systemobjectreviser_test.go +++ b/space/internal/components/migration/systemobjectreviser/systemobjectreviser_test.go @@ -56,15 +56,6 @@ func TestMigration_Run(t *testing.T) { func TestReviseSystemObject(t *testing.T) { ctx := context.Background() log := logger.NewNamed("test") - marketObjects := map[string]*domain.Details{ - "_otnote": domain.NewDetailsFromMap(map[domain.RelationKey]domain.Value{revisionKey: domain.Int64(3)}), - "_otpage": domain.NewDetailsFromMap(map[domain.RelationKey]domain.Value{revisionKey: domain.Int64(2)}), - "_otcontact": domain.NewDetailsFromMap(map[domain.RelationKey]domain.Value{revisionKey: domain.Int64(1)}), - "_brid": domain.NewDetailsFromMap(map[domain.RelationKey]domain.Value{revisionKey: domain.Int64(1)}), - "_brdescription": domain.NewDetailsFromMap(map[domain.RelationKey]domain.Value{revisionKey: domain.Int64(2)}), - "_brlyrics": domain.NewDetailsFromMap(map[domain.RelationKey]domain.Value{revisionKey: domain.Int64(1)}), - "_brisReadonly": domain.NewDetailsFromMap(map[domain.RelationKey]domain.Value{revisionKey: domain.Int64(3)}), - } t.Run("system object type is updated if revision is higher", func(t *testing.T) { // given @@ -300,28 +291,6 @@ func TestReviseSystemObject(t *testing.T) { assert.True(t, toRevise) }) - t.Run("recommendedRelations list is updated by not system relations", func(t *testing.T) { - // given - rel := domain.NewDetailsFromMap(map[domain.RelationKey]domain.Value{ - bundle.RelationKeyRevision: domain.Int64(2), - bundle.RelationKeySourceObject: domain.String("_otpage"), - bundle.RelationKeyUniqueKey: domain.String("ot-page"), - bundle.RelationKeyRecommendedRelations: domain.StringList([]string{"rel-name"}), - }) - space := mock_space.NewMockSpace(t) - space.EXPECT().DeriveObjectID(mock.Anything, mock.Anything).RunAndReturn(func(_ context.Context, key domain.UniqueKey) (string, error) { - return addr.ObjectTypeKeyToIdPrefix + key.InternalKey(), nil - }).Maybe() - - // when - marketObjects["_otpage"].SetStringList("recommendedRelations", []string{"_brname", "_brtag"}) - toRevise, err := reviseObject(ctx, log, space, rel) - - // then - assert.NoError(t, err) - assert.False(t, toRevise) - }) - t.Run("relationFormatObjectTypes list is updated", func(t *testing.T) { // given rel := domain.NewDetailsFromMap(map[domain.RelationKey]domain.Value{