Commit b8763905 authored by Steven's avatar Steven

chore: tweak naming

parent 62705fed
......@@ -2072,14 +2072,14 @@ definitions:
type: string
enum:
- STORAGE_TYPE_UNSPECIFIED
- STORAGE_TYPE_DATABASE
- STORAGE_TYPE_LOCAL
- STORAGE_TYPE_S3
- DATABASE
- LOCAL
- S3
default: STORAGE_TYPE_UNSPECIFIED
description: |2-
- STORAGE_TYPE_DATABASE: STORAGE_TYPE_DATABASE is the database storage type.
- STORAGE_TYPE_LOCAL: STORAGE_TYPE_LOCAL is the local storage type.
- STORAGE_TYPE_S3: STORAGE_TYPE_S3 is the S3 storage type.
- DATABASE: DATABASE is the database storage type.
- LOCAL: LOCAL is the local storage type.
- S3: S3 is the S3 storage type.
googlerpcStatus:
type: object
properties:
......@@ -2394,8 +2394,8 @@ definitions:
type: string
enum:
- TYPE_UNSPECIFIED
- TYPE_MEMO_COMMENT
- TYPE_VERSION_UPDATE
- MEMO_COMMENT
- VERSION_UPDATE
default: TYPE_UNSPECIFIED
v1ItalicNode:
type: object
......
......@@ -50,8 +50,8 @@ message Inbox {
enum Type {
TYPE_UNSPECIFIED = 0;
TYPE_MEMO_COMMENT = 1;
TYPE_VERSION_UPDATE = 2;
MEMO_COMMENT = 1;
VERSION_UPDATE = 2;
}
Type type = 6;
......
......@@ -61,12 +61,12 @@ message WorkspaceCustomProfile {
message WorkspaceStorageSetting {
enum StorageType {
STORAGE_TYPE_UNSPECIFIED = 0;
// STORAGE_TYPE_DATABASE is the database storage type.
STORAGE_TYPE_DATABASE = 1;
// STORAGE_TYPE_LOCAL is the local storage type.
STORAGE_TYPE_LOCAL = 2;
// STORAGE_TYPE_S3 is the S3 storage type.
STORAGE_TYPE_S3 = 3;
// DATABASE is the database storage type.
DATABASE = 1;
// LOCAL is the local storage type.
LOCAL = 2;
// S3 is the S3 storage type.
S3 = 3;
}
// storage_type is the storage type.
StorageType storage_type = 1;
......
This diff is collapsed.
......@@ -23,22 +23,22 @@ const (
type InboxMessage_Type int32
const (
InboxMessage_TYPE_UNSPECIFIED InboxMessage_Type = 0
InboxMessage_TYPE_MEMO_COMMENT InboxMessage_Type = 1
InboxMessage_TYPE_VERSION_UPDATE InboxMessage_Type = 2
InboxMessage_TYPE_UNSPECIFIED InboxMessage_Type = 0
InboxMessage_MEMO_COMMENT InboxMessage_Type = 1
InboxMessage_VERSION_UPDATE InboxMessage_Type = 2
)
// Enum value maps for InboxMessage_Type.
var (
InboxMessage_Type_name = map[int32]string{
0: "TYPE_UNSPECIFIED",
1: "TYPE_MEMO_COMMENT",
2: "TYPE_VERSION_UPDATE",
1: "MEMO_COMMENT",
2: "VERSION_UPDATE",
}
InboxMessage_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
"TYPE_MEMO_COMMENT": 1,
"TYPE_VERSION_UPDATE": 2,
"TYPE_UNSPECIFIED": 0,
"MEMO_COMMENT": 1,
"VERSION_UPDATE": 2,
}
)
......@@ -129,29 +129,28 @@ var File_store_inbox_proto protoreflect.FileDescriptor
var file_store_inbox_proto_rawDesc = []byte{
0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
0x22, 0xc6, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x22, 0xbc, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e,
0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52,
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x63,
0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x88, 0x01, 0x01, 0x22, 0x4c, 0x0a, 0x04, 0x54,
0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x88, 0x01, 0x01, 0x22, 0x42, 0x0a, 0x04, 0x54,
0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50,
0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x01,
0x12, 0x17, 0x0a, 0x13, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e,
0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x02, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x61, 0x63,
0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x42, 0x95, 0x01, 0x0a, 0x0f, 0x63, 0x6f,
0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x0a, 0x49,
0x6e, 0x62, 0x6f, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e,
0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x4d, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x4d,
0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x4d, 0x65, 0x6d,
0x6f, 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x4d, 0x65, 0x6d, 0x6f, 0x73,
0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72,
0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x4d, 0x45, 0x4d,
0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x56,
0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x02, 0x42,
0x0e, 0x0a, 0x0c, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x42,
0x95, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74,
0x6f, 0x72, 0x65, 0x42, 0x0a, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73,
0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x4d,
0x53, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65,
0xca, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02,
0x17, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73,
0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
......
......@@ -25,30 +25,30 @@ type UserSettingKey int32
const (
UserSettingKey_USER_SETTING_KEY_UNSPECIFIED UserSettingKey = 0
// Access tokens for the user.
UserSettingKey_USER_SETTING_ACCESS_TOKENS UserSettingKey = 1
UserSettingKey_ACCESS_TOKENS UserSettingKey = 1
// The locale of the user.
UserSettingKey_USER_SETTING_LOCALE UserSettingKey = 2
UserSettingKey_LOCALE UserSettingKey = 2
// The appearance of the user.
UserSettingKey_USER_SETTING_APPEARANCE UserSettingKey = 3
UserSettingKey_APPEARANCE UserSettingKey = 3
// The visibility of the memo.
UserSettingKey_USER_SETTING_MEMO_VISIBILITY UserSettingKey = 4
UserSettingKey_MEMO_VISIBILITY UserSettingKey = 4
)
// Enum value maps for UserSettingKey.
var (
UserSettingKey_name = map[int32]string{
0: "USER_SETTING_KEY_UNSPECIFIED",
1: "USER_SETTING_ACCESS_TOKENS",
2: "USER_SETTING_LOCALE",
3: "USER_SETTING_APPEARANCE",
4: "USER_SETTING_MEMO_VISIBILITY",
1: "ACCESS_TOKENS",
2: "LOCALE",
3: "APPEARANCE",
4: "MEMO_VISIBILITY",
}
UserSettingKey_value = map[string]int32{
"USER_SETTING_KEY_UNSPECIFIED": 0,
"USER_SETTING_ACCESS_TOKENS": 1,
"USER_SETTING_LOCALE": 2,
"USER_SETTING_APPEARANCE": 3,
"USER_SETTING_MEMO_VISIBILITY": 4,
"ACCESS_TOKENS": 1,
"LOCALE": 2,
"APPEARANCE": 3,
"MEMO_VISIBILITY": 4,
}
)
......@@ -344,28 +344,25 @@ var file_store_user_setting_proto_rawDesc = []byte{
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x2a, 0xaa, 0x01, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74,
0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x1c, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53,
0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x55, 0x53, 0x45, 0x52,
0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f,
0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x53, 0x45, 0x52,
0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x10,
0x02, 0x12, 0x1b, 0x0a, 0x17, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e,
0x47, 0x5f, 0x41, 0x50, 0x50, 0x45, 0x41, 0x52, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x12, 0x20,
0x0a, 0x1c, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4d,
0x45, 0x4d, 0x4f, 0x5f, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x10, 0x04,
0x42, 0x9b, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73,
0x74, 0x6f, 0x72, 0x65, 0x42, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65,
0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x74,
0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x4d, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f,
0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c,
0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74,
0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x6f, 0x6e, 0x2a, 0x76, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x1c, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45,
0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, 0x53,
0x53, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f,
0x43, 0x41, 0x4c, 0x45, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x50, 0x50, 0x45, 0x41, 0x52,
0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x4d, 0x45, 0x4d, 0x4f, 0x5f, 0x56,
0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x10, 0x04, 0x42, 0x9b, 0x01, 0x0a, 0x0f,
0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42,
0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02,
0x03, 0x4d, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x6f,
0x72, 0x65, 0xca, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65,
0xe2, 0x02, 0x17, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47,
0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x65, 0x6d,
0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
......
......@@ -24,31 +24,31 @@ type WorkspaceSettingKey int32
const (
WorkspaceSettingKey_WORKSPACE_SETTING_KEY_UNSPECIFIED WorkspaceSettingKey = 0
// WORKSPACE_SETTING_BASIC is the key for basic settings.
WorkspaceSettingKey_WORKSPACE_SETTING_BASIC WorkspaceSettingKey = 1
// WORKSPACE_SETTING_GENERAL is the key for general settings.
WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL WorkspaceSettingKey = 2
// WORKSPACE_SETTING_STORAGE is the key for storage settings.
WorkspaceSettingKey_WORKSPACE_SETTING_STORAGE WorkspaceSettingKey = 3
// WORKSPACE_SETTING_MEMO_RELATED is the key for memo related settings.
WorkspaceSettingKey_WORKSPACE_SETTING_MEMO_RELATED WorkspaceSettingKey = 4
// BASIC is the key for basic settings.
WorkspaceSettingKey_BASIC WorkspaceSettingKey = 1
// GENERAL is the key for general settings.
WorkspaceSettingKey_GENERAL WorkspaceSettingKey = 2
// STORAGE is the key for storage settings.
WorkspaceSettingKey_STORAGE WorkspaceSettingKey = 3
// MEMO_RELATED is the key for memo related settings.
WorkspaceSettingKey_MEMO_RELATED WorkspaceSettingKey = 4
)
// Enum value maps for WorkspaceSettingKey.
var (
WorkspaceSettingKey_name = map[int32]string{
0: "WORKSPACE_SETTING_KEY_UNSPECIFIED",
1: "WORKSPACE_SETTING_BASIC",
2: "WORKSPACE_SETTING_GENERAL",
3: "WORKSPACE_SETTING_STORAGE",
4: "WORKSPACE_SETTING_MEMO_RELATED",
1: "BASIC",
2: "GENERAL",
3: "STORAGE",
4: "MEMO_RELATED",
}
WorkspaceSettingKey_value = map[string]int32{
"WORKSPACE_SETTING_KEY_UNSPECIFIED": 0,
"WORKSPACE_SETTING_BASIC": 1,
"WORKSPACE_SETTING_GENERAL": 2,
"WORKSPACE_SETTING_STORAGE": 3,
"WORKSPACE_SETTING_MEMO_RELATED": 4,
"BASIC": 1,
"GENERAL": 2,
"STORAGE": 3,
"MEMO_RELATED": 4,
}
)
......@@ -84,26 +84,26 @@ type WorkspaceStorageSetting_StorageType int32
const (
WorkspaceStorageSetting_STORAGE_TYPE_UNSPECIFIED WorkspaceStorageSetting_StorageType = 0
// STORAGE_TYPE_DATABASE is the database storage type.
WorkspaceStorageSetting_STORAGE_TYPE_DATABASE WorkspaceStorageSetting_StorageType = 1
WorkspaceStorageSetting_DATABASE WorkspaceStorageSetting_StorageType = 1
// STORAGE_TYPE_LOCAL is the local storage type.
WorkspaceStorageSetting_STORAGE_TYPE_LOCAL WorkspaceStorageSetting_StorageType = 2
WorkspaceStorageSetting_LOCAL WorkspaceStorageSetting_StorageType = 2
// STORAGE_TYPE_S3 is the S3 storage type.
WorkspaceStorageSetting_STORAGE_TYPE_S3 WorkspaceStorageSetting_StorageType = 3
WorkspaceStorageSetting_S3 WorkspaceStorageSetting_StorageType = 3
)
// Enum value maps for WorkspaceStorageSetting_StorageType.
var (
WorkspaceStorageSetting_StorageType_name = map[int32]string{
0: "STORAGE_TYPE_UNSPECIFIED",
1: "STORAGE_TYPE_DATABASE",
2: "STORAGE_TYPE_LOCAL",
3: "STORAGE_TYPE_S3",
1: "DATABASE",
2: "LOCAL",
3: "S3",
}
WorkspaceStorageSetting_StorageType_value = map[string]int32{
"STORAGE_TYPE_UNSPECIFIED": 0,
"STORAGE_TYPE_DATABASE": 1,
"STORAGE_TYPE_LOCAL": 2,
"STORAGE_TYPE_S3": 3,
"DATABASE": 1,
"LOCAL": 2,
"S3": 3,
}
)
......@@ -757,7 +757,7 @@ var file_store_workspace_setting_proto_rawDesc = []byte{
0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61,
0x70, 0x70, 0x65, 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0a, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xb6, 0x04, 0x0a, 0x17,
0x0a, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x8f, 0x04, 0x0a, 0x17,
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65,
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x53, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61,
0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e,
......@@ -786,37 +786,30 @@ var file_store_workspace_setting_proto_rawDesc = []byte{
0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65,
0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22,
0x73, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c,
0x4c, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c,
0x0a, 0x18, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55,
0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15,
0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x41, 0x54,
0x41, 0x42, 0x41, 0x53, 0x45, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x4f, 0x52, 0x41,
0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, 0x02, 0x12,
0x13, 0x0a, 0x0f, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x53, 0x33, 0x10, 0x03, 0x22, 0xc0, 0x01, 0x0a, 0x1b, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
0x63, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x74,
0x74, 0x69, 0x6e, 0x67, 0x12, 0x36, 0x0a, 0x17, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77,
0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x50,
0x75, 0x62, 0x6c, 0x69, 0x63, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x18,
0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x75, 0x70, 0x64,
0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15,
0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x57, 0x69, 0x74, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e, 0x67,
0x74, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x2a, 0xbb, 0x01, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b,
0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12,
0x25, 0x0a, 0x21, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54,
0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50,
0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x42, 0x41, 0x53, 0x49,
0x43, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45,
0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x4c,
0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f,
0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x10,
0x03, 0x12, 0x22, 0x0a, 0x1e, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53,
0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4d, 0x45, 0x4d, 0x4f, 0x5f, 0x52, 0x45, 0x4c, 0x41,
0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08,
0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4c, 0x4f,
0x43, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x53, 0x33, 0x10, 0x03, 0x22, 0xc0, 0x01,
0x0a, 0x1b, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52,
0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x36, 0x0a,
0x17, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15,
0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x56, 0x69,
0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79,
0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79,
0x57, 0x69, 0x74, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x30,
0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74,
0x2a, 0x73, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74,
0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x21, 0x57, 0x4f, 0x52, 0x4b, 0x53,
0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4b, 0x45, 0x59,
0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09,
0x0a, 0x05, 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x45, 0x4e,
0x45, 0x52, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47,
0x45, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x4d, 0x45, 0x4d, 0x4f, 0x5f, 0x52, 0x45, 0x4c, 0x41,
0x54, 0x45, 0x44, 0x10, 0x04, 0x42, 0xa0, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65,
0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x73,
0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f,
......
......@@ -7,8 +7,8 @@ option go_package = "gen/store";
message InboxMessage {
enum Type {
TYPE_UNSPECIFIED = 0;
TYPE_MEMO_COMMENT = 1;
TYPE_VERSION_UPDATE = 2;
MEMO_COMMENT = 1;
VERSION_UPDATE = 2;
}
Type type = 1;
optional int32 activity_id = 2;
......
......@@ -7,13 +7,13 @@ option go_package = "gen/store";
enum UserSettingKey {
USER_SETTING_KEY_UNSPECIFIED = 0;
// Access tokens for the user.
USER_SETTING_ACCESS_TOKENS = 1;
ACCESS_TOKENS = 1;
// The locale of the user.
USER_SETTING_LOCALE = 2;
LOCALE = 2;
// The appearance of the user.
USER_SETTING_APPEARANCE = 3;
APPEARANCE = 3;
// The visibility of the memo.
USER_SETTING_MEMO_VISIBILITY = 4;
MEMO_VISIBILITY = 4;
}
message UserSetting {
......
......@@ -6,14 +6,14 @@ option go_package = "gen/store";
enum WorkspaceSettingKey {
WORKSPACE_SETTING_KEY_UNSPECIFIED = 0;
// WORKSPACE_SETTING_BASIC is the key for basic settings.
WORKSPACE_SETTING_BASIC = 1;
// WORKSPACE_SETTING_GENERAL is the key for general settings.
WORKSPACE_SETTING_GENERAL = 2;
// WORKSPACE_SETTING_STORAGE is the key for storage settings.
WORKSPACE_SETTING_STORAGE = 3;
// WORKSPACE_SETTING_MEMO_RELATED is the key for memo related settings.
WORKSPACE_SETTING_MEMO_RELATED = 4;
// BASIC is the key for basic settings.
BASIC = 1;
// GENERAL is the key for general settings.
GENERAL = 2;
// STORAGE is the key for storage settings.
STORAGE = 3;
// MEMO_RELATED is the key for memo related settings.
MEMO_RELATED = 4;
}
message WorkspaceSetting {
......@@ -57,11 +57,11 @@ message WorkspaceStorageSetting {
enum StorageType {
STORAGE_TYPE_UNSPECIFIED = 0;
// STORAGE_TYPE_DATABASE is the database storage type.
STORAGE_TYPE_DATABASE = 1;
DATABASE = 1;
// STORAGE_TYPE_LOCAL is the local storage type.
STORAGE_TYPE_LOCAL = 2;
LOCAL = 2;
// STORAGE_TYPE_S3 is the S3 storage type.
STORAGE_TYPE_S3 = 3;
S3 = 3;
}
// storage_type is the storage type.
StorageType storage_type = 1;
......
......@@ -403,7 +403,7 @@ func (s *APIV1Service) CreateMemoComment(ctx context.Context, request *v1pb.Crea
ReceiverID: relatedMemo.CreatorID,
Status: store.UNREAD,
Message: &storepb.InboxMessage{
Type: storepb.InboxMessage_TYPE_MEMO_COMMENT,
Type: storepb.InboxMessage_MEMO_COMMENT,
ActivityId: &activity.ID,
},
}); err != nil {
......
......@@ -308,7 +308,7 @@ func SaveResourceBlob(ctx context.Context, s *store.Store, create *store.Resourc
return errors.Wrap(err, "Failed to find workspace storage setting")
}
if workspaceStorageSetting.StorageType == storepb.WorkspaceStorageSetting_STORAGE_TYPE_LOCAL {
if workspaceStorageSetting.StorageType == storepb.WorkspaceStorageSetting_LOCAL {
filepathTemplate := "assets/{timestamp}_{filename}"
if workspaceStorageSetting.FilepathTemplate != "" {
filepathTemplate = workspaceStorageSetting.FilepathTemplate
......@@ -343,7 +343,7 @@ func SaveResourceBlob(ctx context.Context, s *store.Store, create *store.Resourc
create.Reference = internalPath
create.Blob = nil
create.StorageType = storepb.ResourceStorageType_LOCAL
} else if workspaceStorageSetting.StorageType == storepb.WorkspaceStorageSetting_STORAGE_TYPE_S3 {
} else if workspaceStorageSetting.StorageType == storepb.WorkspaceStorageSetting_S3 {
s3Config := workspaceStorageSetting.S3Config
if s3Config == nil {
return errors.Errorf("No actived external storage found")
......
......@@ -286,11 +286,11 @@ func (s *APIV1Service) GetUserSetting(ctx context.Context, _ *v1pb.GetUserSettin
}
userSettingMessage := getDefaultUserSetting()
for _, setting := range userSettings {
if setting.Key == storepb.UserSettingKey_USER_SETTING_LOCALE {
if setting.Key == storepb.UserSettingKey_LOCALE {
userSettingMessage.Locale = setting.GetLocale()
} else if setting.Key == storepb.UserSettingKey_USER_SETTING_APPEARANCE {
} else if setting.Key == storepb.UserSettingKey_APPEARANCE {
userSettingMessage.Appearance = setting.GetAppearance()
} else if setting.Key == storepb.UserSettingKey_USER_SETTING_MEMO_VISIBILITY {
} else if setting.Key == storepb.UserSettingKey_MEMO_VISIBILITY {
userSettingMessage.MemoVisibility = setting.GetMemoVisibility()
}
}
......@@ -311,7 +311,7 @@ func (s *APIV1Service) UpdateUserSetting(ctx context.Context, request *v1pb.Upda
if field == "locale" {
if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: user.ID,
Key: storepb.UserSettingKey_USER_SETTING_LOCALE,
Key: storepb.UserSettingKey_LOCALE,
Value: &storepb.UserSetting_Locale{
Locale: request.Setting.Locale,
},
......@@ -321,7 +321,7 @@ func (s *APIV1Service) UpdateUserSetting(ctx context.Context, request *v1pb.Upda
} else if field == "appearance" {
if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: user.ID,
Key: storepb.UserSettingKey_USER_SETTING_APPEARANCE,
Key: storepb.UserSettingKey_APPEARANCE,
Value: &storepb.UserSetting_Appearance{
Appearance: request.Setting.Appearance,
},
......@@ -331,7 +331,7 @@ func (s *APIV1Service) UpdateUserSetting(ctx context.Context, request *v1pb.Upda
} else if field == "memo_visibility" {
if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: user.ID,
Key: storepb.UserSettingKey_USER_SETTING_MEMO_VISIBILITY,
Key: storepb.UserSettingKey_MEMO_VISIBILITY,
Value: &storepb.UserSetting_MemoVisibility{
MemoVisibility: request.Setting.MemoVisibility,
},
......@@ -467,7 +467,7 @@ func (s *APIV1Service) DeleteUserAccessToken(ctx context.Context, request *v1pb.
}
if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: user.ID,
Key: storepb.UserSettingKey_USER_SETTING_ACCESS_TOKENS,
Key: storepb.UserSettingKey_ACCESS_TOKENS,
Value: &storepb.UserSetting_AccessTokens{
AccessTokens: &storepb.AccessTokensUserSetting{
AccessTokens: updatedUserAccessTokens,
......@@ -492,7 +492,7 @@ func (s *APIV1Service) UpsertAccessTokenToStore(ctx context.Context, user *store
userAccessTokens = append(userAccessTokens, &userAccessToken)
if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: user.ID,
Key: storepb.UserSettingKey_USER_SETTING_ACCESS_TOKENS,
Key: storepb.UserSettingKey_ACCESS_TOKENS,
Value: &storepb.UserSetting_AccessTokens{
AccessTokens: &storepb.AccessTokensUserSetting{
AccessTokens: userAccessTokens,
......
......@@ -21,13 +21,13 @@ func (s *APIV1Service) GetWorkspaceSetting(ctx context.Context, request *v1pb.Ge
workspaceSettingKey := storepb.WorkspaceSettingKey(storepb.WorkspaceSettingKey_value[workspaceSettingKeyString])
// Get workspace setting from store with default value.
switch workspaceSettingKey {
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_BASIC:
case storepb.WorkspaceSettingKey_BASIC:
_, err = s.Store.GetWorkspaceBasicSetting(ctx)
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL:
case storepb.WorkspaceSettingKey_GENERAL:
_, err = s.Store.GetWorkspaceGeneralSetting(ctx)
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_MEMO_RELATED:
case storepb.WorkspaceSettingKey_MEMO_RELATED:
_, err = s.Store.GetWorkspaceMemoRelatedSetting(ctx)
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_STORAGE:
case storepb.WorkspaceSettingKey_STORAGE:
_, err = s.Store.GetWorkspaceStorageSetting(ctx)
default:
return nil, status.Errorf(codes.InvalidArgument, "unsupported workspace setting key: %v", workspaceSettingKey)
......@@ -100,15 +100,15 @@ func convertWorkspaceSettingToStore(setting *v1pb.WorkspaceSetting) *storepb.Wor
},
}
switch workspaceSetting.Key {
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL:
case storepb.WorkspaceSettingKey_GENERAL:
workspaceSetting.Value = &storepb.WorkspaceSetting_GeneralSetting{
GeneralSetting: convertWorkspaceGeneralSettingToStore(setting.GetGeneralSetting()),
}
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_STORAGE:
case storepb.WorkspaceSettingKey_STORAGE:
workspaceSetting.Value = &storepb.WorkspaceSetting_StorageSetting{
StorageSetting: convertWorkspaceStorageSettingToStore(setting.GetStorageSetting()),
}
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_MEMO_RELATED:
case storepb.WorkspaceSettingKey_MEMO_RELATED:
workspaceSetting.Value = &storepb.WorkspaceSetting_MemoRelatedSetting{
MemoRelatedSetting: convertWorkspaceMemoRelatedSettingToStore(setting.GetMemoRelatedSetting()),
}
......
......@@ -152,7 +152,7 @@ func (s *Server) getOrUpsertWorkspaceBasicSetting(ctx context.Context) (*storepb
}
if modified {
workspaceSetting, err := s.Store.UpsertWorkspaceSetting(ctx, &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_BASIC,
Key: storepb.WorkspaceSettingKey_BASIC,
Value: &storepb.WorkspaceSetting_BasicSetting{BasicSetting: workspaceBasicSetting},
})
if err != nil {
......
......@@ -110,7 +110,7 @@ func (c *VersionChecker) Check(ctx context.Context) {
ReceiverID: hostUser.ID,
Status: store.UNREAD,
Message: &storepb.InboxMessage{
Type: storepb.InboxMessage_TYPE_VERSION_UPDATE,
Type: storepb.InboxMessage_VERSION_UPDATE,
ActivityId: &activity.ID,
},
}); err != nil {
......
......@@ -92,7 +92,7 @@ func (s *Store) GetUserSetting(ctx context.Context, find *FindUserSetting) (*sto
func (s *Store) GetUserAccessTokens(ctx context.Context, userID int32) ([]*storepb.AccessTokensUserSetting_AccessToken, error) {
userSetting, err := s.GetUserSetting(ctx, &FindUserSetting{
UserID: &userID,
Key: storepb.UserSettingKey_USER_SETTING_ACCESS_TOKENS,
Key: storepb.UserSettingKey_ACCESS_TOKENS,
})
if err != nil {
return nil, err
......@@ -121,7 +121,7 @@ func (s *Store) RemoveUserAccessToken(ctx context.Context, userID int32, token s
_, err = s.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: userID,
Key: storepb.UserSettingKey_USER_SETTING_ACCESS_TOKENS,
Key: storepb.UserSettingKey_ACCESS_TOKENS,
Value: &storepb.UserSetting_AccessTokens{
AccessTokens: &storepb.AccessTokensUserSetting{
AccessTokens: newAccessTokens,
......@@ -139,17 +139,17 @@ func convertUserSettingFromRaw(raw *UserSetting) (*storepb.UserSetting, error) {
}
switch raw.Key {
case storepb.UserSettingKey_USER_SETTING_ACCESS_TOKENS:
case storepb.UserSettingKey_ACCESS_TOKENS:
accessTokensUserSetting := &storepb.AccessTokensUserSetting{}
if err := protojsonUnmarshaler.Unmarshal([]byte(raw.Value), accessTokensUserSetting); err != nil {
return nil, err
}
userSetting.Value = &storepb.UserSetting_AccessTokens{AccessTokens: accessTokensUserSetting}
case storepb.UserSettingKey_USER_SETTING_LOCALE:
case storepb.UserSettingKey_LOCALE:
userSetting.Value = &storepb.UserSetting_Locale{Locale: raw.Value}
case storepb.UserSettingKey_USER_SETTING_APPEARANCE:
case storepb.UserSettingKey_APPEARANCE:
userSetting.Value = &storepb.UserSetting_Appearance{Appearance: raw.Value}
case storepb.UserSettingKey_USER_SETTING_MEMO_VISIBILITY:
case storepb.UserSettingKey_MEMO_VISIBILITY:
userSetting.Value = &storepb.UserSetting_MemoVisibility{MemoVisibility: raw.Value}
default:
return nil, nil
......@@ -164,18 +164,18 @@ func convertUserSettingToRaw(userSetting *storepb.UserSetting) (*UserSetting, er
}
switch userSetting.Key {
case storepb.UserSettingKey_USER_SETTING_ACCESS_TOKENS:
case storepb.UserSettingKey_ACCESS_TOKENS:
accessTokensUserSetting := userSetting.GetAccessTokens()
value, err := protojson.Marshal(accessTokensUserSetting)
if err != nil {
return nil, err
}
raw.Value = string(value)
case storepb.UserSettingKey_USER_SETTING_LOCALE:
case storepb.UserSettingKey_LOCALE:
raw.Value = userSetting.GetLocale()
case storepb.UserSettingKey_USER_SETTING_APPEARANCE:
case storepb.UserSettingKey_APPEARANCE:
raw.Value = userSetting.GetAppearance()
case storepb.UserSettingKey_USER_SETTING_MEMO_VISIBILITY:
case storepb.UserSettingKey_MEMO_VISIBILITY:
raw.Value = userSetting.GetMemoVisibility()
default:
return nil, errors.Errorf("unsupported user setting key: %v", userSetting.Key)
......
......@@ -29,13 +29,13 @@ func (s *Store) UpsertWorkspaceSetting(ctx context.Context, upsert *storepb.Work
}
var valueBytes []byte
var err error
if upsert.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_BASIC {
if upsert.Key == storepb.WorkspaceSettingKey_BASIC {
valueBytes, err = protojson.Marshal(upsert.GetBasicSetting())
} else if upsert.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL {
} else if upsert.Key == storepb.WorkspaceSettingKey_GENERAL {
valueBytes, err = protojson.Marshal(upsert.GetGeneralSetting())
} else if upsert.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_STORAGE {
} else if upsert.Key == storepb.WorkspaceSettingKey_STORAGE {
valueBytes, err = protojson.Marshal(upsert.GetStorageSetting())
} else if upsert.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_MEMO_RELATED {
} else if upsert.Key == storepb.WorkspaceSettingKey_MEMO_RELATED {
valueBytes, err = protojson.Marshal(upsert.GetMemoRelatedSetting())
} else {
return nil, errors.Errorf("unsupported workspace setting key: %v", upsert.Key)
......@@ -101,7 +101,7 @@ func (s *Store) GetWorkspaceSetting(ctx context.Context, find *FindWorkspaceSett
func (s *Store) GetWorkspaceBasicSetting(ctx context.Context) (*storepb.WorkspaceBasicSetting, error) {
workspaceSetting, err := s.GetWorkspaceSetting(ctx, &FindWorkspaceSetting{
Name: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_BASIC.String(),
Name: storepb.WorkspaceSettingKey_BASIC.String(),
})
if err != nil {
return nil, errors.Wrap(err, "failed to get workspace basic setting")
......@@ -111,8 +111,8 @@ func (s *Store) GetWorkspaceBasicSetting(ctx context.Context) (*storepb.Workspac
if workspaceSetting != nil {
workspaceBasicSetting = workspaceSetting.GetBasicSetting()
}
s.workspaceSettingCache.Store(storepb.WorkspaceSettingKey_WORKSPACE_SETTING_BASIC.String(), &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_BASIC,
s.workspaceSettingCache.Store(storepb.WorkspaceSettingKey_BASIC.String(), &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_BASIC,
Value: &storepb.WorkspaceSetting_BasicSetting{BasicSetting: workspaceBasicSetting},
})
return workspaceBasicSetting, nil
......@@ -120,7 +120,7 @@ func (s *Store) GetWorkspaceBasicSetting(ctx context.Context) (*storepb.Workspac
func (s *Store) GetWorkspaceGeneralSetting(ctx context.Context) (*storepb.WorkspaceGeneralSetting, error) {
workspaceSetting, err := s.GetWorkspaceSetting(ctx, &FindWorkspaceSetting{
Name: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL.String(),
Name: storepb.WorkspaceSettingKey_GENERAL.String(),
})
if err != nil {
return nil, errors.Wrap(err, "failed to get workspace general setting")
......@@ -130,8 +130,8 @@ func (s *Store) GetWorkspaceGeneralSetting(ctx context.Context) (*storepb.Worksp
if workspaceSetting != nil {
workspaceGeneralSetting = workspaceSetting.GetGeneralSetting()
}
s.workspaceSettingCache.Store(storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL.String(), &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL,
s.workspaceSettingCache.Store(storepb.WorkspaceSettingKey_GENERAL.String(), &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_GENERAL,
Value: &storepb.WorkspaceSetting_GeneralSetting{GeneralSetting: workspaceGeneralSetting},
})
return workspaceGeneralSetting, nil
......@@ -144,7 +144,7 @@ const (
func (s *Store) GetWorkspaceMemoRelatedSetting(ctx context.Context) (*storepb.WorkspaceMemoRelatedSetting, error) {
workspaceSetting, err := s.GetWorkspaceSetting(ctx, &FindWorkspaceSetting{
Name: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_MEMO_RELATED.String(),
Name: storepb.WorkspaceSettingKey_MEMO_RELATED.String(),
})
if err != nil {
return nil, errors.Wrap(err, "failed to get workspace general setting")
......@@ -157,22 +157,22 @@ func (s *Store) GetWorkspaceMemoRelatedSetting(ctx context.Context) (*storepb.Wo
if workspaceMemoRelatedSetting.ContentLengthLimit < DefaultContentLengthLimit {
workspaceMemoRelatedSetting.ContentLengthLimit = DefaultContentLengthLimit
}
s.workspaceSettingCache.Store(storepb.WorkspaceSettingKey_WORKSPACE_SETTING_MEMO_RELATED.String(), &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_MEMO_RELATED,
s.workspaceSettingCache.Store(storepb.WorkspaceSettingKey_MEMO_RELATED.String(), &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_MEMO_RELATED,
Value: &storepb.WorkspaceSetting_MemoRelatedSetting{MemoRelatedSetting: workspaceMemoRelatedSetting},
})
return workspaceMemoRelatedSetting, nil
}
const (
defaultWorkspaceStorageType = storepb.WorkspaceStorageSetting_STORAGE_TYPE_DATABASE
defaultWorkspaceStorageType = storepb.WorkspaceStorageSetting_DATABASE
defaultWorkspaceUploadSizeLimitMb = 30
defaultWorkspaceFilepathTemplate = "assets/{timestamp}_{filename}"
)
func (s *Store) GetWorkspaceStorageSetting(ctx context.Context) (*storepb.WorkspaceStorageSetting, error) {
workspaceSetting, err := s.GetWorkspaceSetting(ctx, &FindWorkspaceSetting{
Name: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_STORAGE.String(),
Name: storepb.WorkspaceSettingKey_STORAGE.String(),
})
if err != nil {
return nil, errors.Wrap(err, "failed to get workspace storage setting")
......@@ -191,8 +191,8 @@ func (s *Store) GetWorkspaceStorageSetting(ctx context.Context) (*storepb.Worksp
if workspaceStorageSetting.FilepathTemplate == "" {
workspaceStorageSetting.FilepathTemplate = defaultWorkspaceFilepathTemplate
}
s.workspaceSettingCache.Store(storepb.WorkspaceSettingKey_WORKSPACE_SETTING_STORAGE.String(), &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_STORAGE,
s.workspaceSettingCache.Store(storepb.WorkspaceSettingKey_STORAGE.String(), &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_STORAGE,
Value: &storepb.WorkspaceSetting_StorageSetting{StorageSetting: workspaceStorageSetting},
})
return workspaceStorageSetting, nil
......@@ -203,25 +203,25 @@ func convertWorkspaceSettingFromRaw(workspaceSettingRaw *WorkspaceSetting) (*sto
Key: storepb.WorkspaceSettingKey(storepb.WorkspaceSettingKey_value[workspaceSettingRaw.Name]),
}
switch workspaceSettingRaw.Name {
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_BASIC.String():
case storepb.WorkspaceSettingKey_BASIC.String():
basicSetting := &storepb.WorkspaceBasicSetting{}
if err := protojsonUnmarshaler.Unmarshal([]byte(workspaceSettingRaw.Value), basicSetting); err != nil {
return nil, err
}
workspaceSetting.Value = &storepb.WorkspaceSetting_BasicSetting{BasicSetting: basicSetting}
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL.String():
case storepb.WorkspaceSettingKey_GENERAL.String():
generalSetting := &storepb.WorkspaceGeneralSetting{}
if err := protojsonUnmarshaler.Unmarshal([]byte(workspaceSettingRaw.Value), generalSetting); err != nil {
return nil, err
}
workspaceSetting.Value = &storepb.WorkspaceSetting_GeneralSetting{GeneralSetting: generalSetting}
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_STORAGE.String():
case storepb.WorkspaceSettingKey_STORAGE.String():
storageSetting := &storepb.WorkspaceStorageSetting{}
if err := protojsonUnmarshaler.Unmarshal([]byte(workspaceSettingRaw.Value), storageSetting); err != nil {
return nil, err
}
workspaceSetting.Value = &storepb.WorkspaceSetting_StorageSetting{StorageSetting: storageSetting}
case storepb.WorkspaceSettingKey_WORKSPACE_SETTING_MEMO_RELATED.String():
case storepb.WorkspaceSettingKey_MEMO_RELATED.String():
memoRelatedSetting := &storepb.WorkspaceMemoRelatedSetting{}
if err := protojsonUnmarshaler.Unmarshal([]byte(workspaceSettingRaw.Value), memoRelatedSetting); err != nil {
return nil, err
......
......@@ -21,7 +21,7 @@ func TestInboxStore(t *testing.T) {
ReceiverID: user.ID,
Status: store.UNREAD,
Message: &storepb.InboxMessage{
Type: storepb.InboxMessage_TYPE_MEMO_COMMENT,
Type: storepb.InboxMessage_MEMO_COMMENT,
},
}
inbox, err := ts.CreateInbox(ctx, create)
......
......@@ -17,7 +17,7 @@ func TestUserSettingStore(t *testing.T) {
require.NoError(t, err)
_, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: user.ID,
Key: storepb.UserSettingKey_USER_SETTING_LOCALE,
Key: storepb.UserSettingKey_LOCALE,
Value: &storepb.UserSetting_Locale{Locale: "en"},
})
require.NoError(t, err)
......
......@@ -14,7 +14,7 @@ func TestWorkspaceSettingV1Store(t *testing.T) {
ctx := context.Background()
ts := NewTestingStore(ctx, t)
workspaceSetting, err := ts.UpsertWorkspaceSetting(ctx, &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL,
Key: storepb.WorkspaceSettingKey_GENERAL,
Value: &storepb.WorkspaceSetting_GeneralSetting{
GeneralSetting: &storepb.WorkspaceGeneralSetting{
DisallowSignup: true,
......
......@@ -22,7 +22,7 @@
"dayjs": "^1.11.11",
"fuse.js": "^7.0.0",
"highlight.js": "^11.9.0",
"i18next": "^23.11.3",
"i18next": "^23.11.4",
"katex": "^0.16.10",
"lodash-es": "^4.17.21",
"lucide-react": "^0.378.0",
......@@ -32,7 +32,7 @@
"react-hot-toast": "^2.4.1",
"react-i18next": "^14.1.1",
"react-redux": "^9.1.2",
"react-router-dom": "^6.23.0",
"react-router-dom": "^6.23.1",
"react-use": "^17.5.0",
"tailwindcss": "^3.4.3",
"textarea-caret": "^3.1.0",
......@@ -48,7 +48,7 @@
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.12.11",
"@types/qs": "^6.9.15",
"@types/react": "^18.3.1",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
"@types/textarea-caret": "^3.0.3",
"@types/uuid": "^9.0.8",
......@@ -65,7 +65,7 @@
"nice-grpc-web": "^3.3.3",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"protobufjs": "^7.2.6",
"protobufjs": "^7.3.0",
"typescript": "^5.4.5",
"vite": "^5.2.11"
}
......
This diff is collapsed.
......@@ -22,8 +22,7 @@ const App = () => {
const userSetting = userStore.userSetting;
const workspaceGeneralSetting =
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting ||
WorkspaceGeneralSetting.fromPartial({});
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting || WorkspaceGeneralSetting.fromPartial({});
// Redirect to sign up page if no instance owner.
useEffect(() => {
......
......@@ -18,8 +18,7 @@ const DisablePasswordLoginDialog: React.FC<Props> = ({ destroy }: Props) => {
const t = useTranslate();
const workspaceSettingStore = useWorkspaceSettingStore();
const workspaceGeneralSetting =
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting ||
WorkspaceGeneralSetting.fromPartial({});
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting || WorkspaceGeneralSetting.fromPartial({});
const [state, setState] = useState<State>({
disablePasswordLogin: workspaceGeneralSetting.disallowPasswordLogin,
});
......@@ -41,7 +40,7 @@ const DisablePasswordLoginDialog: React.FC<Props> = ({ destroy }: Props) => {
setState({ ...state, disablePasswordLogin: true });
try {
await workspaceSettingStore.setWorkspaceSetting({
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.GENERAL}`,
generalSetting: {
...workspaceGeneralSetting,
disallowPasswordLogin: true,
......
......@@ -77,7 +77,7 @@ const MemoEditor = (props: Props) => {
)
: state.relationList.filter((relation) => relation.type === MemoRelation_Type.REFERENCE);
const workspaceMemoRelatedSetting =
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_MEMO_RELATED)?.memoRelatedSetting ||
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.MEMO_RELATED)?.memoRelatedSetting ||
WorkspaceMemoRelatedSetting.fromPartial({});
useEffect(() => {
......
......@@ -17,9 +17,7 @@ const StorageSection = () => {
const t = useTranslate();
const workspaceSettingStore = useWorkspaceSettingStore();
const [workspaceStorageSetting, setWorkspaceStorageSetting] = useState<WorkspaceStorageSetting>(
WorkspaceStorageSetting.fromPartial(
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_STORAGE)?.storageSetting || {},
),
WorkspaceStorageSetting.fromPartial(workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.STORAGE)?.storageSetting || {}),
);
const allowSaveStorageSetting = useMemo(() => {
......@@ -28,7 +26,7 @@ const StorageSection = () => {
}
const origin = WorkspaceStorageSetting.fromPartial(
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_STORAGE)?.storageSetting || {},
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.STORAGE)?.storageSetting || {},
);
if (workspaceStorageSetting.storageType === WorkspaceStorageSetting_StorageType.STORAGE_TYPE_LOCAL) {
if (workspaceStorageSetting.filepathTemplate.length === 0) {
......@@ -109,7 +107,7 @@ const StorageSection = () => {
const saveWorkspaceStorageSetting = async () => {
await workspaceSettingStore.setWorkspaceSetting({
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_STORAGE}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.STORAGE}`,
storageSetting: workspaceStorageSetting,
});
toast.success("Updated");
......
......@@ -15,13 +15,11 @@ const WorkspaceSection = () => {
const t = useTranslate();
const workspaceSettingStore = useWorkspaceSettingStore();
const [workspaceGeneralSetting, setWorkspaceGeneralSetting] = useState<WorkspaceGeneralSetting>(
WorkspaceGeneralSetting.fromPartial(
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL)?.generalSetting || {},
),
WorkspaceGeneralSetting.fromPartial(workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL)?.generalSetting || {}),
);
const [workspaceMemoRelatedSetting, setWorkspaceMemoRelatedSetting] = useState<WorkspaceMemoRelatedSetting>(
WorkspaceMemoRelatedSetting.fromPartial(
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_MEMO_RELATED)?.memoRelatedSetting || {},
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.MEMO_RELATED)?.memoRelatedSetting || {},
),
);
......@@ -29,7 +27,7 @@ const WorkspaceSection = () => {
const setting = { ...workspaceGeneralSetting, disallowSignup: !value };
await workspaceSettingServiceClient.setWorkspaceSetting({
setting: {
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.GENERAL}`,
generalSetting: setting,
},
});
......@@ -41,7 +39,7 @@ const WorkspaceSection = () => {
const setting = { ...workspaceGeneralSetting, disallowPasswordLogin: value };
await workspaceSettingServiceClient.setWorkspaceSetting({
setting: {
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.GENERAL}`,
generalSetting: setting,
},
});
......@@ -74,7 +72,7 @@ const WorkspaceSection = () => {
try {
await workspaceSettingServiceClient.setWorkspaceSetting({
setting: {
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.GENERAL}`,
generalSetting: workspaceGeneralSetting,
},
});
......@@ -94,7 +92,7 @@ const WorkspaceSection = () => {
try {
await workspaceSettingServiceClient.setWorkspaceSetting({
setting: {
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.GENERAL}`,
generalSetting: workspaceGeneralSetting,
},
});
......@@ -114,7 +112,7 @@ const WorkspaceSection = () => {
try {
await workspaceSettingServiceClient.setWorkspaceSetting({
setting: {
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.GENERAL}`,
generalSetting: workspaceGeneralSetting,
},
});
......@@ -130,7 +128,7 @@ const WorkspaceSection = () => {
const update: WorkspaceMemoRelatedSetting = { ...workspaceMemoRelatedSetting, disallowPublicVisible: value };
setWorkspaceMemoRelatedSetting(update);
await workspaceSettingStore.setWorkspaceSetting({
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_MEMO_RELATED}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.MEMO_RELATED}`,
memoRelatedSetting: update,
});
};
......@@ -139,7 +137,7 @@ const WorkspaceSection = () => {
const update: WorkspaceMemoRelatedSetting = { ...workspaceMemoRelatedSetting, displayWithUpdateTime: value };
setWorkspaceMemoRelatedSetting(update);
await workspaceSettingStore.setWorkspaceSetting({
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_MEMO_RELATED}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.MEMO_RELATED}`,
memoRelatedSetting: update,
});
};
......@@ -153,7 +151,7 @@ const WorkspaceSection = () => {
const update: WorkspaceMemoRelatedSetting = { ...workspaceMemoRelatedSetting, contentLengthLimit: value };
setWorkspaceMemoRelatedSetting(update);
await workspaceSettingStore.setWorkspaceSetting({
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_MEMO_RELATED}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.MEMO_RELATED}`,
memoRelatedSetting: update,
});
};
......
......@@ -17,7 +17,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
const t = useTranslate();
const workspaceSettingStore = useWorkspaceSettingStore();
const workspaceGeneralSetting = WorkspaceGeneralSetting.fromPartial(
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL)?.generalSetting || {},
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL)?.generalSetting || {},
);
const [customProfile, setCustomProfile] = useState<WorkspaceCustomProfile>(
WorkspaceCustomProfile.fromPartial(workspaceGeneralSetting.customProfile || {}),
......@@ -84,7 +84,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
try {
await workspaceSettingStore.setWorkspaceSetting({
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`,
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.GENERAL}`,
generalSetting: {
...workspaceGeneralSetting,
customProfile: customProfile,
......
......@@ -36,10 +36,10 @@ const CommonContextProvider = ({ children }: { children: React.ReactNode }) => {
useEffect(() => {
const initialWorkspace = async () => {
const workspaceProfile = await workspaceServiceClient.getWorkspaceProfile({});
await workspaceSettingStore.fetchWorkspaceSetting(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL);
await workspaceSettingStore.fetchWorkspaceSetting(WorkspaceSettingKey.GENERAL);
const workspaceGeneralSetting =
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting ||
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting ||
WorkspaceGeneralSetting.fromPartial({});
setCommonContext({
locale: locale || workspaceGeneralSetting.customProfile?.locale || "en",
......
......@@ -59,7 +59,7 @@ const Setting = () => {
// Initial fetch for workspace settings.
(async () => {
[WorkspaceSettingKey.WORKSPACE_SETTING_MEMO_RELATED, WorkspaceSettingKey.WORKSPACE_SETTING_STORAGE].forEach(async (key) => {
[WorkspaceSettingKey.MEMO_RELATED, WorkspaceSettingKey.STORAGE].forEach(async (key) => {
await workspaceSettingStore.fetchWorkspaceSetting(key);
});
})();
......
......@@ -28,8 +28,7 @@ const SignIn = () => {
const [remember, setRemember] = useState(true);
const [identityProviderList, setIdentityProviderList] = useState<IdentityProvider[]>([]);
const workspaceGeneralSetting =
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting ||
WorkspaceGeneralSetting.fromPartial({});
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting || WorkspaceGeneralSetting.fromPartial({});
useEffect(() => {
const fetchIdentityProviderList = async () => {
......
......@@ -24,8 +24,7 @@ const SignUp = () => {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const workspaceGeneralSetting =
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting ||
WorkspaceGeneralSetting.fromPartial({});
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting || WorkspaceGeneralSetting.fromPartial({});
const handleUsernameInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
const text = e.target.value as string;
......
......@@ -149,7 +149,7 @@ const Timeline = () => {
type="date"
max={dayjs().format("YYYY-MM-DD")}
value={dayjs(selectedDateString).format("YYYY-MM-DD")}
onFocus={(e) => e.target.showPicker()}
onFocus={(e: any) => e.target.showPicker()}
onChange={(e) => handleSelectedDataChange(e.target.value)}
/>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment