From a49f87c55f539ac120e3b797066a7cd224e6e09e Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 31 Aug 2024 22:08:57 +0800 Subject: [PATCH] chore: retire private visibility --- frontend/locales/en.json | 4 -- frontend/locales/fr.json | 4 -- frontend/locales/hu.json | 4 -- frontend/locales/ja.json | 4 -- frontend/locales/ru.json | 4 -- frontend/locales/tr.json | 4 -- frontend/locales/zh.json | 4 -- proto/api/v1/common.proto | 13 +--- proto/gen/api/v1/README.md | 19 +----- proto/gen/api/v1/common.pb.go | 118 ++++++++------------------------- proto/gen/apidocs.swagger.yaml | 1 - server/route/api/v1/common.go | 2 +- 12 files changed, 34 insertions(+), 147 deletions(-) diff --git a/frontend/locales/en.json b/frontend/locales/en.json index d4c5e63..133b636 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -36,10 +36,6 @@ "shortcut": { "visits": "{{count}} visits", "visibility": { - "private": { - "self": "Private", - "description": "Only you can access" - }, "workspace": { "self": "Workspace", "description": "Workspace members can access" diff --git a/frontend/locales/fr.json b/frontend/locales/fr.json index b6ca1dd..cbc7923 100644 --- a/frontend/locales/fr.json +++ b/frontend/locales/fr.json @@ -33,10 +33,6 @@ "shortcut": { "visits": "{{count}} visites", "visibility": { - "private": { - "self": "Privé", - "description": "Vous seul pouvez accéder" - }, "workspace": { "self": "Espace de travail", "description": "Les membres de l'espace de travail ont accès" diff --git a/frontend/locales/hu.json b/frontend/locales/hu.json index 73b88c9..1e3b5a0 100644 --- a/frontend/locales/hu.json +++ b/frontend/locales/hu.json @@ -34,10 +34,6 @@ "shortcut": { "visits": "{{count}} látogatás", "visibility": { - "private": { - "self": "Privát", - "description": "Csak Ön férhet hozzá" - }, "workspace": { "self": "Munkaterület", "description": "A munkaterület tagjai hozzáférhetnek" diff --git a/frontend/locales/ja.json b/frontend/locales/ja.json index 096fc31..9a685ca 100644 --- a/frontend/locales/ja.json +++ b/frontend/locales/ja.json @@ -34,10 +34,6 @@ "shortcut": { "visits": "{{count}} 回訪問", "visibility": { - "private": { - "self": "非公開", - "description": "あなただけがアクセスできます" - }, "workspace": { "self": "ワークスペース", "description": "ワークスペースメンバーがアクセスできます" diff --git a/frontend/locales/ru.json b/frontend/locales/ru.json index a23402d..2a6fe6b 100644 --- a/frontend/locales/ru.json +++ b/frontend/locales/ru.json @@ -34,10 +34,6 @@ "shortcut": { "visits": "{{count}} перехода", "visibility": { - "private": { - "self": "Частная", - "description": "Только Вы иммете доступ" - }, "workspace": { "self": "Команда", "description": "Члены команды имеют доступ" diff --git a/frontend/locales/tr.json b/frontend/locales/tr.json index 89f87f1..664f780 100644 --- a/frontend/locales/tr.json +++ b/frontend/locales/tr.json @@ -33,10 +33,6 @@ "shortcut": { "visits": "{{count}} ziyaret", "visibility": { - "private": { - "self": "Özel", - "description": "Yalnızca siz erişebilirsiniz" - }, "workspace": { "self": "Çalışma Alanı", "description": "Çalışma alanı üyeleri erişebilir" diff --git a/frontend/locales/zh.json b/frontend/locales/zh.json index fc2b560..91259dc 100644 --- a/frontend/locales/zh.json +++ b/frontend/locales/zh.json @@ -33,10 +33,6 @@ "shortcut": { "visits": "{{count}} 次访问", "visibility": { - "private": { - "self": "私有的", - "description": "仅您可以访问" - }, "workspace": { "self": "工作区", "description": "工作区成员可以访问" diff --git a/proto/api/v1/common.proto b/proto/api/v1/common.proto index 0507346..ceb237f 100644 --- a/proto/api/v1/common.proto +++ b/proto/api/v1/common.proto @@ -10,19 +10,10 @@ enum State { INACTIVE = 2; } -// deprecated -enum RowStatus { - ROW_STATUS_UNSPECIFIED = 0; - NORMAL = 1; - ARCHIVED = 2; -} - enum Visibility { VISIBILITY_UNSPECIFIED = 0; - PRIVATE = 1 [deprecated = true]; + WORKSPACE = 1; - WORKSPACE = 2; - - PUBLIC = 3; + PUBLIC = 2; } diff --git a/proto/gen/api/v1/README.md b/proto/gen/api/v1/README.md index 42c5c15..16dd8d3 100644 --- a/proto/gen/api/v1/README.md +++ b/proto/gen/api/v1/README.md @@ -4,7 +4,6 @@ ## Table of Contents - [api/v1/common.proto](#api_v1_common-proto) - - [RowStatus](#slash-api-v1-RowStatus) - [State](#slash-api-v1-State) - [Visibility](#slash-api-v1-Visibility) @@ -111,19 +110,6 @@ - - -### RowStatus -deprecated - -| Name | Number | Description | -| ---- | ------ | ----------- | -| ROW_STATUS_UNSPECIFIED | 0 | | -| NORMAL | 1 | | -| ARCHIVED | 2 | | - - - ### State @@ -145,9 +131,8 @@ deprecated | Name | Number | Description | | ---- | ------ | ----------- | | VISIBILITY_UNSPECIFIED | 0 | | -| PRIVATE | 1 | | -| WORKSPACE | 2 | | -| PUBLIC | 3 | | +| WORKSPACE | 1 | | +| PUBLIC | 2 | | diff --git a/proto/gen/api/v1/common.pb.go b/proto/gen/api/v1/common.pb.go index 946ea92..cd5c38f 100644 --- a/proto/gen/api/v1/common.pb.go +++ b/proto/gen/api/v1/common.pb.go @@ -69,79 +69,25 @@ func (State) EnumDescriptor() ([]byte, []int) { return file_api_v1_common_proto_rawDescGZIP(), []int{0} } -// deprecated -type RowStatus int32 - -const ( - RowStatus_ROW_STATUS_UNSPECIFIED RowStatus = 0 - RowStatus_NORMAL RowStatus = 1 - RowStatus_ARCHIVED RowStatus = 2 -) - -// Enum value maps for RowStatus. -var ( - RowStatus_name = map[int32]string{ - 0: "ROW_STATUS_UNSPECIFIED", - 1: "NORMAL", - 2: "ARCHIVED", - } - RowStatus_value = map[string]int32{ - "ROW_STATUS_UNSPECIFIED": 0, - "NORMAL": 1, - "ARCHIVED": 2, - } -) - -func (x RowStatus) Enum() *RowStatus { - p := new(RowStatus) - *p = x - return p -} - -func (x RowStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RowStatus) Descriptor() protoreflect.EnumDescriptor { - return file_api_v1_common_proto_enumTypes[1].Descriptor() -} - -func (RowStatus) Type() protoreflect.EnumType { - return &file_api_v1_common_proto_enumTypes[1] -} - -func (x RowStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RowStatus.Descriptor instead. -func (RowStatus) EnumDescriptor() ([]byte, []int) { - return file_api_v1_common_proto_rawDescGZIP(), []int{1} -} - type Visibility int32 const ( Visibility_VISIBILITY_UNSPECIFIED Visibility = 0 - // Deprecated: Marked as deprecated in api/v1/common.proto. - Visibility_PRIVATE Visibility = 1 - Visibility_WORKSPACE Visibility = 2 - Visibility_PUBLIC Visibility = 3 + Visibility_WORKSPACE Visibility = 1 + Visibility_PUBLIC Visibility = 2 ) // Enum value maps for Visibility. var ( Visibility_name = map[int32]string{ 0: "VISIBILITY_UNSPECIFIED", - 1: "PRIVATE", - 2: "WORKSPACE", - 3: "PUBLIC", + 1: "WORKSPACE", + 2: "PUBLIC", } Visibility_value = map[string]int32{ "VISIBILITY_UNSPECIFIED": 0, - "PRIVATE": 1, - "WORKSPACE": 2, - "PUBLIC": 3, + "WORKSPACE": 1, + "PUBLIC": 2, } ) @@ -156,11 +102,11 @@ func (x Visibility) String() string { } func (Visibility) Descriptor() protoreflect.EnumDescriptor { - return file_api_v1_common_proto_enumTypes[2].Descriptor() + return file_api_v1_common_proto_enumTypes[1].Descriptor() } func (Visibility) Type() protoreflect.EnumType { - return &file_api_v1_common_proto_enumTypes[2] + return &file_api_v1_common_proto_enumTypes[1] } func (x Visibility) Number() protoreflect.EnumNumber { @@ -169,7 +115,7 @@ func (x Visibility) Number() protoreflect.EnumNumber { // Deprecated: Use Visibility.Descriptor instead. func (Visibility) EnumDescriptor() ([]byte, []int) { - return file_api_v1_common_proto_rawDescGZIP(), []int{2} + return file_api_v1_common_proto_rawDescGZIP(), []int{1} } var File_api_v1_common_proto protoreflect.FileDescriptor @@ -180,28 +126,23 @@ var file_api_v1_common_proto_rawDesc = []byte{ 0x2e, 0x76, 0x31, 0x2a, 0x38, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, - 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x2a, 0x41, 0x0a, - 0x09, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x4f, - 0x57, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, - 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x44, 0x10, 0x02, - 0x2a, 0x54, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, - 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x07, 0x50, 0x52, - 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x01, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x57, - 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, - 0x42, 0x4c, 0x49, 0x43, 0x10, 0x03, 0x42, 0xa9, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, - 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, - 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, - 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, - 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, - 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x2a, 0x43, 0x0a, + 0x0a, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, + 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x4f, 0x52, 0x4b, 0x53, + 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, + 0x10, 0x02, 0x42, 0xa9, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, + 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -216,11 +157,10 @@ func file_api_v1_common_proto_rawDescGZIP() []byte { return file_api_v1_common_proto_rawDescData } -var file_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_api_v1_common_proto_goTypes = []any{ (State)(0), // 0: slash.api.v1.State - (RowStatus)(0), // 1: slash.api.v1.RowStatus - (Visibility)(0), // 2: slash.api.v1.Visibility + (Visibility)(0), // 1: slash.api.v1.Visibility } var file_api_v1_common_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -240,7 +180,7 @@ func file_api_v1_common_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_v1_common_proto_rawDesc, - NumEnums: 3, + NumEnums: 2, NumMessages: 0, NumExtensions: 0, NumServices: 0, diff --git a/proto/gen/apidocs.swagger.yaml b/proto/gen/apidocs.swagger.yaml index c332ad5..8a8e8bc 100644 --- a/proto/gen/apidocs.swagger.yaml +++ b/proto/gen/apidocs.swagger.yaml @@ -928,7 +928,6 @@ definitions: type: string enum: - VISIBILITY_UNSPECIFIED - - PRIVATE - WORKSPACE - PUBLIC default: VISIBILITY_UNSPECIFIED diff --git a/server/route/api/v1/common.go b/server/route/api/v1/common.go index d7f130e..8130fff 100644 --- a/server/route/api/v1/common.go +++ b/server/route/api/v1/common.go @@ -58,7 +58,7 @@ func convertVisibilityFromStorepb(visibility storepb.Visibility) v1pb.Visibility func convertVisibilityToStorepb(visibility v1pb.Visibility) storepb.Visibility { switch visibility { - case v1pb.Visibility_PRIVATE, v1pb.Visibility_WORKSPACE: + case v1pb.Visibility_WORKSPACE: return storepb.Visibility_WORKSPACE case v1pb.Visibility_PUBLIC: return storepb.Visibility_PUBLIC