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
13f6fa7b
Commit
13f6fa7b
authored
Feb 08, 2025
by
johnnyjoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: remove default visibility in workspace setting
parent
9957f8e2
Changes
27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
100 additions
and
165 deletions
+100
-165
workspace_setting_service.proto
proto/api/v1/workspace_setting_service.proto
+0
-2
activity_service.pb.go
proto/gen/api/v1/activity_service.pb.go
+1
-1
auth_service.pb.go
proto/gen/api/v1/auth_service.pb.go
+1
-1
common.pb.go
proto/gen/api/v1/common.pb.go
+1
-1
idp_service.pb.go
proto/gen/api/v1/idp_service.pb.go
+1
-1
inbox_service.pb.go
proto/gen/api/v1/inbox_service.pb.go
+1
-1
markdown_service.pb.go
proto/gen/api/v1/markdown_service.pb.go
+1
-1
memo_relation_service.pb.go
proto/gen/api/v1/memo_relation_service.pb.go
+1
-1
memo_service.pb.go
proto/gen/api/v1/memo_service.pb.go
+1
-1
reaction_service.pb.go
proto/gen/api/v1/reaction_service.pb.go
+1
-1
resource_service.pb.go
proto/gen/api/v1/resource_service.pb.go
+1
-1
user_service.pb.go
proto/gen/api/v1/user_service.pb.go
+1
-1
webhook_service.pb.go
proto/gen/api/v1/webhook_service.pb.go
+1
-1
workspace_service.pb.go
proto/gen/api/v1/workspace_service.pb.go
+1
-1
workspace_setting_service.pb.go
proto/gen/api/v1/workspace_setting_service.pb.go
+50
-62
apidocs.swagger.yaml
proto/gen/apidocs.swagger.yaml
+0
-3
activity.pb.go
proto/gen/store/activity.pb.go
+1
-1
idp.pb.go
proto/gen/store/idp.pb.go
+1
-1
inbox.pb.go
proto/gen/store/inbox.pb.go
+1
-1
memo.pb.go
proto/gen/store/memo.pb.go
+1
-1
resource.pb.go
proto/gen/store/resource.pb.go
+1
-1
user_setting.pb.go
proto/gen/store/user_setting.pb.go
+1
-1
workspace_setting.pb.go
proto/gen/store/workspace_setting.pb.go
+27
-39
workspace_setting.proto
proto/store/workspace_setting.proto
+0
-2
user_service.go
server/router/api/v1/user_service.go
+3
-13
workspace_setting_service.go
server/router/api/v1/workspace_setting_service.go
+0
-2
MemoRelatedSettings.tsx
web/src/components/Settings/MemoRelatedSettings.tsx
+1
-23
No files found.
proto/api/v1/workspace_setting_service.proto
View file @
13f6fa7b
...
...
@@ -112,8 +112,6 @@ message WorkspaceMemoRelatedSetting {
bool
enable_comment
=
7
;
// enable_location enables setting location for memo.
bool
enable_location
=
8
;
// default_visibility set the global memos default visibility.
string
default_visibility
=
9
;
// reactions is the list of reactions.
repeated
string
reactions
=
10
;
// disable_markdown_shortcuts disallow the registration of markdown shortcuts.
...
...
proto/gen/api/v1/activity_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/activity_service.proto
...
...
proto/gen/api/v1/auth_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/auth_service.proto
...
...
proto/gen/api/v1/common.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/common.proto
...
...
proto/gen/api/v1/idp_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/idp_service.proto
...
...
proto/gen/api/v1/inbox_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/inbox_service.proto
...
...
proto/gen/api/v1/markdown_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/markdown_service.proto
...
...
proto/gen/api/v1/memo_relation_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/memo_relation_service.proto
...
...
proto/gen/api/v1/memo_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/memo_service.proto
...
...
proto/gen/api/v1/reaction_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/reaction_service.proto
...
...
proto/gen/api/v1/resource_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/resource_service.proto
...
...
proto/gen/api/v1/user_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/user_service.proto
...
...
proto/gen/api/v1/webhook_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/webhook_service.proto
...
...
proto/gen/api/v1/workspace_service.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: api/v1/workspace_service.proto
...
...
proto/gen/api/v1/workspace_setting_service.pb.go
View file @
13f6fa7b
This diff is collapsed.
Click to expand it.
proto/gen/apidocs.swagger.yaml
View file @
13f6fa7b
...
...
@@ -2284,9 +2284,6 @@ definitions:
enableLocation
:
type
:
boolean
description
:
enable_location enables setting location for memo.
defaultVisibility
:
type
:
string
description
:
default_visibility set the global memos default visibility.
reactions
:
type
:
array
items
:
...
...
proto/gen/store/activity.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: store/activity.proto
...
...
proto/gen/store/idp.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: store/idp.proto
...
...
proto/gen/store/inbox.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: store/inbox.proto
...
...
proto/gen/store/memo.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: store/memo.proto
...
...
proto/gen/store/resource.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: store/resource.proto
...
...
proto/gen/store/user_setting.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: store/user_setting.proto
...
...
proto/gen/store/workspace_setting.pb.go
View file @
13f6fa7b
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
4
// protoc-gen-go v1.36.
5
// protoc (unknown)
// source: store/workspace_setting.proto
...
...
@@ -673,8 +673,6 @@ type WorkspaceMemoRelatedSetting struct {
EnableComment
bool
`protobuf:"varint,7,opt,name=enable_comment,json=enableComment,proto3" json:"enable_comment,omitempty"`
// enable_location enables setting location for memo.
EnableLocation
bool
`protobuf:"varint,8,opt,name=enable_location,json=enableLocation,proto3" json:"enable_location,omitempty"`
// default_visibility set the global memos default visibility.
DefaultVisibility
string
`protobuf:"bytes,9,opt,name=default_visibility,json=defaultVisibility,proto3" json:"default_visibility,omitempty"`
// reactions is the list of reactions.
Reactions
[]
string
`protobuf:"bytes,10,rep,name=reactions,proto3" json:"reactions,omitempty"`
// disable markdown shortcuts
...
...
@@ -769,13 +767,6 @@ func (x *WorkspaceMemoRelatedSetting) GetEnableLocation() bool {
return
false
}
func
(
x
*
WorkspaceMemoRelatedSetting
)
GetDefaultVisibility
()
string
{
if
x
!=
nil
{
return
x
.
DefaultVisibility
}
return
""
}
func
(
x
*
WorkspaceMemoRelatedSetting
)
GetReactions
()
[]
string
{
if
x
!=
nil
{
return
x
.
Reactions
...
...
@@ -902,7 +893,7 @@ var file_store_workspace_setting_proto_rawDesc = string([]byte{
0x6b
,
0x65
,
0x74
,
0x18
,
0x05
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x62
,
0x75
,
0x63
,
0x6b
,
0x65
,
0x74
,
0x12
,
0x24
,
0x0a
,
0x0e
,
0x75
,
0x73
,
0x65
,
0x5f
,
0x70
,
0x61
,
0x74
,
0x68
,
0x5f
,
0x73
,
0x74
,
0x79
,
0x6c
,
0x65
,
0x18
,
0x06
,
0x20
,
0x01
,
0x28
,
0x08
,
0x52
,
0x0c
,
0x75
,
0x73
,
0x65
,
0x50
,
0x61
,
0x74
,
0x68
,
0x53
,
0x74
,
0x79
,
0x6c
,
0x65
,
0x22
,
0x
ba
,
0x04
,
0x0a
,
0x1b
,
0x57
,
0x6f
,
0x72
,
0x6b
,
0x74
,
0x68
,
0x53
,
0x74
,
0x79
,
0x6c
,
0x65
,
0x22
,
0x
8b
,
0x04
,
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
,
0x3c
,
0x0a
,
0x1a
,
0x64
,
0x69
,
0x73
,
0x61
,
0x6c
,
0x6c
,
0x6f
,
0x77
,
0x5f
,
0x70
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x5f
,
0x76
,
0x69
,
0x73
,
0x69
,
0x62
,
...
...
@@ -929,34 +920,31 @@ var file_store_workspace_setting_proto_rawDesc = string([]byte{
0x08
,
0x52
,
0x0d
,
0x65
,
0x6e
,
0x61
,
0x62
,
0x6c
,
0x65
,
0x43
,
0x6f
,
0x6d
,
0x6d
,
0x65
,
0x6e
,
0x74
,
0x12
,
0x27
,
0x0a
,
0x0f
,
0x65
,
0x6e
,
0x61
,
0x62
,
0x6c
,
0x65
,
0x5f
,
0x6c
,
0x6f
,
0x63
,
0x61
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x08
,
0x20
,
0x01
,
0x28
,
0x08
,
0x52
,
0x0e
,
0x65
,
0x6e
,
0x61
,
0x62
,
0x6c
,
0x65
,
0x4c
,
0x6f
,
0x63
,
0x61
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x2d
,
0x0a
,
0x12
,
0x64
,
0x65
,
0x66
,
0x61
,
0x75
,
0x6c
,
0x74
,
0x5f
,
0x76
,
0x69
,
0x73
,
0x69
,
0x62
,
0x69
,
0x6c
,
0x69
,
0x74
,
0x79
,
0x18
,
0x09
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x11
,
0x64
,
0x65
,
0x66
,
0x61
,
0x75
,
0x6c
,
0x74
,
0x56
,
0x69
,
0x73
,
0x69
,
0x62
,
0x69
,
0x6c
,
0x69
,
0x74
,
0x79
,
0x12
,
0x1c
,
0x0a
,
0x09
,
0x72
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x18
,
0x0a
,
0x20
,
0x03
,
0x28
,
0x09
,
0x52
,
0x09
,
0x72
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x12
,
0x3c
,
0x0a
,
0x1a
,
0x64
,
0x69
,
0x73
,
0x61
,
0x62
,
0x6c
,
0x65
,
0x5f
,
0x6d
,
0x61
,
0x72
,
0x6b
,
0x64
,
0x6f
,
0x77
,
0x6e
,
0x5f
,
0x73
,
0x68
,
0x6f
,
0x72
,
0x74
,
0x63
,
0x75
,
0x74
,
0x73
,
0x18
,
0x0b
,
0x20
,
0x01
,
0x28
,
0x08
,
0x52
,
0x18
,
0x64
,
0x69
,
0x73
,
0x61
,
0x62
,
0x6c
,
0x65
,
0x4d
,
0x61
,
0x72
,
0x6b
,
0x64
,
0x6f
,
0x77
,
0x6e
,
0x53
,
0x68
,
0x6f
,
0x72
,
0x74
,
0x63
,
0x75
,
0x74
,
0x73
,
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
,
0x50
,
0x01
,
0x5a
,
0x29
,
0x67
,
0x69
,
0x74
,
0x68
,
0x75
,
0x62
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x2f
,
0x75
,
0x73
,
0x65
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
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
,
0x64
,
0x6f
,
0x77
,
0x6e
,
0x5f
,
0x73
,
0x68
,
0x6f
,
0x72
,
0x74
,
0x63
,
0x75
,
0x74
,
0x73
,
0x18
,
0x0b
,
0x20
,
0x01
,
0x28
,
0x08
,
0x52
,
0x18
,
0x64
,
0x69
,
0x73
,
0x61
,
0x62
,
0x6c
,
0x65
,
0x4d
,
0x61
,
0x72
,
0x6b
,
0x64
,
0x6f
,
0x77
,
0x6e
,
0x53
,
0x68
,
0x6f
,
0x72
,
0x74
,
0x63
,
0x75
,
0x74
,
0x73
,
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
,
0x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6f
,
0x72
,
0x65
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
})
var
(
...
...
proto/store/workspace_setting.proto
View file @
13f6fa7b
...
...
@@ -111,8 +111,6 @@ message WorkspaceMemoRelatedSetting {
bool
enable_comment
=
7
;
// enable_location enables setting location for memo.
bool
enable_location
=
8
;
// default_visibility set the global memos default visibility.
string
default_visibility
=
9
;
// reactions is the list of reactions.
repeated
string
reactions
=
10
;
// disable markdown shortcuts
...
...
server/router/api/v1/user_service.go
View file @
13f6fa7b
...
...
@@ -254,15 +254,11 @@ func (s *APIV1Service) DeleteUser(ctx context.Context, request *v1pb.DeleteUserR
return
&
emptypb
.
Empty
{},
nil
}
func
getDefaultUserSetting
(
workspaceMemoRelatedSetting
*
storepb
.
WorkspaceMemoRelatedSetting
)
*
v1pb
.
UserSetting
{
defaultVisibility
:=
"PRIVATE"
if
workspaceMemoRelatedSetting
.
DefaultVisibility
!=
""
{
defaultVisibility
=
workspaceMemoRelatedSetting
.
DefaultVisibility
}
func
getDefaultUserSetting
()
*
v1pb
.
UserSetting
{
return
&
v1pb
.
UserSetting
{
Locale
:
"en"
,
Appearance
:
"system"
,
MemoVisibility
:
defaultVisibility
,
MemoVisibility
:
"PRIVATE"
,
}
}
...
...
@@ -272,19 +268,13 @@ func (s *APIV1Service) GetUserSetting(ctx context.Context, _ *v1pb.GetUserSettin
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to get current user: %v"
,
err
)
}
workspaceMemoRelatedSetting
,
err
:=
s
.
Store
.
GetWorkspaceMemoRelatedSetting
(
ctx
)
if
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to get workspace general setting: %v"
,
err
)
}
userSettings
,
err
:=
s
.
Store
.
ListUserSettings
(
ctx
,
&
store
.
FindUserSetting
{
UserID
:
&
user
.
ID
,
})
if
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to list user settings: %v"
,
err
)
}
// getDefaultUserSetting By workspaceSetting
userSettingMessage
:=
getDefaultUserSetting
(
workspaceMemoRelatedSetting
)
userSettingMessage
:=
getDefaultUserSetting
()
for
_
,
setting
:=
range
userSettings
{
if
setting
.
Key
==
storepb
.
UserSettingKey_LOCALE
{
userSettingMessage
.
Locale
=
setting
.
GetLocale
()
...
...
server/router/api/v1/workspace_setting_service.go
View file @
13f6fa7b
...
...
@@ -237,7 +237,6 @@ func convertWorkspaceMemoRelatedSettingFromStore(setting *storepb.WorkspaceMemoR
EnableLinkPreview
:
setting
.
EnableLinkPreview
,
EnableComment
:
setting
.
EnableComment
,
EnableLocation
:
setting
.
EnableLocation
,
DefaultVisibility
:
setting
.
DefaultVisibility
,
Reactions
:
setting
.
Reactions
,
DisableMarkdownShortcuts
:
setting
.
DisableMarkdownShortcuts
,
}
...
...
@@ -256,7 +255,6 @@ func convertWorkspaceMemoRelatedSettingToStore(setting *v1pb.WorkspaceMemoRelate
EnableLinkPreview
:
setting
.
EnableLinkPreview
,
EnableComment
:
setting
.
EnableComment
,
EnableLocation
:
setting
.
EnableLocation
,
DefaultVisibility
:
setting
.
DefaultVisibility
,
Reactions
:
setting
.
Reactions
,
DisableMarkdownShortcuts
:
setting
.
DisableMarkdownShortcuts
,
}
...
...
web/src/components/Settings/MemoRelatedSettings.tsx
View file @
13f6fa7b
import
{
Switch
,
Select
,
Option
,
Chip
,
ChipDelete
}
from
"@mui/joy"
;
import
{
Switch
,
Chip
,
ChipDelete
}
from
"@mui/joy"
;
import
{
Button
,
Input
}
from
"@usememos/mui"
;
import
{
isEqual
,
uniq
}
from
"lodash-es"
;
import
{
CheckIcon
}
from
"lucide-react"
;
import
{
useState
}
from
"react"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
workspaceSettingNamePrefix
,
useWorkspaceSettingStore
}
from
"@/store/v1"
;
import
{
Visibility
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
WorkspaceMemoRelatedSetting
}
from
"@/types/proto/api/v1/workspace_setting_service"
;
import
{
WorkspaceSettingKey
}
from
"@/types/proto/store/workspace_setting"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
convertVisibilityFromString
,
convertVisibilityToString
}
from
"@/utils/memo"
;
import
VisibilityIcon
from
"../VisibilityIcon"
;
const
MemoRelatedSettings
=
()
=>
{
const
t
=
useTranslate
();
...
...
@@ -125,25 +122,6 @@ const MemoRelatedSettings = () => {
onBlur=
{
(
event
)
=>
updatePartialSetting
({
contentLengthLimit
:
Number
(
event
.
target
.
value
)
})
}
/>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"truncate"
>
{
t
(
"setting.preference-section.default-memo-visibility"
)
}
</
span
>
<
Select
className=
"!min-w-fit"
value=
{
memoRelatedSetting
.
defaultVisibility
}
startDecorator=
{
<
VisibilityIcon
visibility=
{
convertVisibilityFromString
(
memoRelatedSetting
.
defaultVisibility
)
}
/>
}
onChange=
{
(
_
,
visibility
)
=>
{
updatePartialSetting
({
defaultVisibility
:
visibility
||
Visibility
.
PRIVATE
});
}
}
>
{
[
Visibility
.
PRIVATE
,
Visibility
.
PROTECTED
,
Visibility
.
PUBLIC
]
.
map
((
v
)
=>
convertVisibilityToString
(
v
))
.
map
((
item
)
=>
(
<
Option
key=
{
item
}
value=
{
item
}
className=
"whitespace-nowrap"
>
{
t
(
`memo.visibility.${item.toLowerCase() as Lowercase<typeof item>}`
)
}
</
Option
>
))
}
</
Select
>
</
div
>
<
div
className=
"w-full"
>
<
span
className=
"truncate"
>
{
t
(
"setting.memo-related-settings.reactions"
)
}
</
span
>
<
div
className=
"mt-2 w-full flex flex-row flex-wrap gap-1"
>
...
...
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