Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
b8763905
Commit
b8763905
authored
May 13, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak naming
parent
62705fed
Changes
35
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
460 additions
and
483 deletions
+460
-483
apidocs.swagger.yaml
docs/apidocs.swagger.yaml
+8
-8
inbox_service.proto
proto/api/v1/inbox_service.proto
+2
-2
workspace_setting_service.proto
proto/api/v1/workspace_setting_service.proto
+6
-6
inbox_service.pb.go
proto/gen/api/v1/inbox_service.pb.go
+66
-67
workspace_setting_service.pb.go
proto/gen/api/v1/workspace_setting_service.pb.go
+70
-73
inbox.pb.go
proto/gen/store/inbox.pb.go
+24
-25
user_setting.pb.go
proto/gen/store/user_setting.pb.go
+31
-34
workspace_setting.pb.go
proto/gen/store/workspace_setting.pb.go
+49
-56
inbox.proto
proto/store/inbox.proto
+2
-2
user_setting.proto
proto/store/user_setting.proto
+4
-4
workspace_setting.proto
proto/store/workspace_setting.proto
+11
-11
memo_service.go
server/router/api/v1/memo_service.go
+1
-1
resource_service.go
server/router/api/v1/resource_service.go
+2
-2
user_service.go
server/router/api/v1/user_service.go
+8
-8
workspace_setting_service.go
server/router/api/v1/workspace_setting_service.go
+7
-7
server.go
server/server.go
+1
-1
version_checker.go
server/service/version_checker/version_checker.go
+1
-1
user_setting.go
store/user_setting.go
+10
-10
workspace_setting.go
store/workspace_setting.go
+21
-21
inbox_test.go
test/store/inbox_test.go
+1
-1
user_setting_test.go
test/store/user_setting_test.go
+1
-1
workspace_setting_test.go
test/store/workspace_setting_test.go
+1
-1
package.json
web/package.json
+4
-4
pnpm-lock.yaml
web/pnpm-lock.yaml
+104
-104
App.tsx
web/src/App.tsx
+1
-2
DisablePasswordLoginDialog.tsx
web/src/components/DisablePasswordLoginDialog.tsx
+2
-3
index.tsx
web/src/components/MemoEditor/index.tsx
+1
-1
StorageSection.tsx
web/src/components/Settings/StorageSection.tsx
+3
-5
WorkspaceSection.tsx
web/src/components/Settings/WorkspaceSection.tsx
+10
-12
UpdateCustomizedProfileDialog.tsx
web/src/components/UpdateCustomizedProfileDialog.tsx
+2
-2
CommonContextProvider.tsx
web/src/layouts/CommonContextProvider.tsx
+2
-2
Setting.tsx
web/src/pages/Setting.tsx
+1
-1
SignIn.tsx
web/src/pages/SignIn.tsx
+1
-2
SignUp.tsx
web/src/pages/SignUp.tsx
+1
-2
Timeline.tsx
web/src/pages/Timeline.tsx
+1
-1
No files found.
docs/apidocs.swagger.yaml
View file @
b8763905
...
...
@@ -2072,14 +2072,14 @@ definitions:
type
:
string
enum
:
-
STORAGE_TYPE_UNSPECIFIED
-
STORAGE_TYPE_
DATABASE
-
STORAGE_TYPE_
LOCAL
-
S
TORAGE_TYPE_S
3
-
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.
- S
TORAGE_TYPE_S3: STORAGE_TYPE_
S3 is the S3 storage type.
-
DATABASE:
DATABASE is the database storage type.
-
LOCAL:
LOCAL is the local storage type.
- S
3:
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
...
...
proto/api/v1/inbox_service.proto
View file @
b8763905
...
...
@@ -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
;
...
...
proto/api/v1/workspace_setting_service.proto
View file @
b8763905
...
...
@@ -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
;
// S
TORAGE_TYPE_S
3 is the S3 storage type.
S
TORAGE_TYPE_S
3
=
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
;
...
...
proto/gen/api/v1/inbox_service.pb.go
View file @
b8763905
This diff is collapsed.
Click to expand it.
proto/gen/api/v1/workspace_setting_service.pb.go
View file @
b8763905
This diff is collapsed.
Click to expand it.
proto/gen/store/inbox.pb.go
View file @
b8763905
...
...
@@ -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
,
0x
c6
,
0x01
,
0x0a
,
0x0c
,
0x49
,
0x6e
,
0x62
,
0x6f
,
0x78
,
0x4d
,
0x65
,
0x73
,
0x73
,
0x61
,
0x67
,
0x22
,
0x
bc
,
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
,
0x4
c
,
0x0a
,
0x04
,
0x54
,
0x74
,
0x69
,
0x76
,
0x69
,
0x74
,
0x79
,
0x49
,
0x64
,
0x88
,
0x01
,
0x01
,
0x22
,
0x4
2
,
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
(
...
...
proto/gen/store/user_setting.pb.go
View file @
b8763905
...
...
@@ -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
(
...
...
proto/gen/store/workspace_setting.pb.go
View file @
b8763905
...
...
@@ -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_S
TORAGE_TYPE_S
3
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
:
"S
TORAGE_TYPE_S
3"
,
1
:
"DATABASE"
,
2
:
"LOCAL"
,
3
:
"S3"
,
}
WorkspaceStorageSetting_StorageType_value
=
map
[
string
]
int32
{
"STORAGE_TYPE_UNSPECIFIED"
:
0
,
"
STORAGE_TYPE_DATABASE"
:
1
,
"
STORAGE_TYPE_LOCAL"
:
2
,
"S
TORAGE_TYPE_S3"
:
3
,
"
DATABASE"
:
1
,
"
LOCAL"
:
2
,
"S
3"
:
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
,
0x
b6
,
0x04
,
0x0a
,
0x17
,
0x0a
,
0x61
,
0x70
,
0x70
,
0x65
,
0x61
,
0x72
,
0x61
,
0x6e
,
0x63
,
0x65
,
0x22
,
0x
8f
,
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
,
0x
73
,
0x0a
,
0x0b
,
0x53
,
0x74
,
0x6f
,
0x72
,
0x61
,
0x67
,
0x65
,
0x54
,
0x79
,
0x70
,
0x65
,
0x12
,
0x1c
,
0x
4c
,
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
,
...
...
proto/store/inbox.proto
View file @
b8763905
...
...
@@ -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
;
...
...
proto/store/user_setting.proto
View file @
b8763905
...
...
@@ -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
{
...
...
proto/store/workspace_setting.proto
View file @
b8763905
...
...
@@ -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.
S
TORAGE_TYPE_S
3
=
3
;
S3
=
3
;
}
// storage_type is the storage type.
StorageType
storage_type
=
1
;
...
...
server/router/api/v1/memo_service.go
View file @
b8763905
...
...
@@ -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
{
...
...
server/router/api/v1/resource_service.go
View file @
b8763905
...
...
@@ -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_S
TORAGE_TYPE_S
3
{
}
else
if
workspaceStorageSetting
.
StorageType
==
storepb
.
WorkspaceStorageSetting_S3
{
s3Config
:=
workspaceStorageSetting
.
S3Config
if
s3Config
==
nil
{
return
errors
.
Errorf
(
"No actived external storage found"
)
...
...
server/router/api/v1/user_service.go
View file @
b8763905
...
...
@@ -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
,
...
...
server/router/api/v1/workspace_setting_service.go
View file @
b8763905
...
...
@@ -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
()),
}
...
...
server/server.go
View file @
b8763905
...
...
@@ -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
{
...
...
server/service/version_checker/version_checker.go
View file @
b8763905
...
...
@@ -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
{
...
...
store/user_setting.go
View file @
b8763905
...
...
@@ -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
)
...
...
store/workspace_setting.go
View file @
b8763905
...
...
@@ -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
...
...
test/store/inbox_test.go
View file @
b8763905
...
...
@@ -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
)
...
...
test/store/user_setting_test.go
View file @
b8763905
...
...
@@ -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
)
...
...
test/store/workspace_setting_test.go
View file @
b8763905
...
...
@@ -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
,
...
...
web/package.json
View file @
b8763905
...
...
@@ -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"
}
...
...
web/pnpm-lock.yaml
View file @
b8763905
This diff is collapsed.
Click to expand it.
web/src/App.tsx
View file @
b8763905
...
...
@@ -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
(()
=>
{
...
...
web/src/components/DisablePasswordLoginDialog.tsx
View file @
b8763905
...
...
@@ -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
,
...
...
web/src/components/MemoEditor/index.tsx
View file @
b8763905
...
...
@@ -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
(()
=>
{
...
...
web/src/components/Settings/StorageSection.tsx
View file @
b8763905
...
...
@@ -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"
);
...
...
web/src/components/Settings/WorkspaceSection.tsx
View file @
b8763905
...
...
@@ -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
,
});
};
...
...
web/src/components/UpdateCustomizedProfileDialog.tsx
View file @
b8763905
...
...
@@ -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
,
...
...
web/src/layouts/CommonContextProvider.tsx
View file @
b8763905
...
...
@@ -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"
,
...
...
web/src/pages/Setting.tsx
View file @
b8763905
...
...
@@ -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
);
});
})();
...
...
web/src/pages/SignIn.tsx
View file @
b8763905
...
...
@@ -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
()
=>
{
...
...
web/src/pages/SignUp.tsx
View file @
b8763905
...
...
@@ -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
;
...
...
web/src/pages/Timeline.tsx
View file @
b8763905
...
...
@@ -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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment