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
edc3f1d9
Commit
edc3f1d9
authored
Jan 16, 2025
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: retire unused memo view
parent
14745834
Changes
28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
420 additions
and
602 deletions
+420
-602
memo_service.proto
proto/api/v1/memo_service.proto
+0
-13
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
+351
-422
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
+12
-35
user_service.pb.gw.go
proto/gen/api/v1/user_service.pb.gw.go
+0
-28
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
+1
-1
apidocs.swagger.yaml
proto/gen/apidocs.swagger.yaml
+0
-39
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
+1
-1
memo_service.go
server/router/api/v1/memo_service.go
+7
-10
memo_service_converter.go
server/router/api/v1/memo_service_converter.go
+29
-32
AddMemoRelationPopover.tsx
...onents/MemoEditor/ActionButton/AddMemoRelationPopover.tsx
+1
-2
memo.ts
web/src/store/v1/memo.ts
+1
-2
No files found.
proto/api/v1/memo_service.proto
View file @
edc3f1d9
...
...
@@ -203,16 +203,6 @@ message CreateMemoRequest {
optional
Location
location
=
5
;
}
enum
MemoView
{
MEMO_VIEW_UNSPECIFIED
=
0
;
// The full view of the memo. Includes all fields.
MEMO_VIEW_FULL
=
1
;
// The metadata only view of the memo. Excludes the content/snippet fields.
MEMO_VIEW_METADATA_ONLY
=
2
;
}
message
ListMemosRequest
{
// The maximum number of memos to return.
int32
page_size
=
1
;
...
...
@@ -224,9 +214,6 @@ message ListMemosRequest {
// Filter is used to filter memos returned in the list.
// Format: "creator == 'users/{user}' && visibilities == ['PUBLIC', 'PROTECTED']"
string
filter
=
3
;
// The view of the memo.
MemoView
view
=
4
;
}
message
ListMemosResponse
{
...
...
proto/gen/api/v1/activity_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/activity_service.proto
...
...
proto/gen/api/v1/auth_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/auth_service.proto
...
...
proto/gen/api/v1/common.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/common.proto
...
...
proto/gen/api/v1/idp_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/idp_service.proto
...
...
proto/gen/api/v1/inbox_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/inbox_service.proto
...
...
proto/gen/api/v1/markdown_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/markdown_service.proto
...
...
proto/gen/api/v1/memo_relation_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/memo_relation_service.proto
...
...
proto/gen/api/v1/memo_service.pb.go
View file @
edc3f1d9
This diff is collapsed.
Click to expand it.
proto/gen/api/v1/reaction_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/reaction_service.proto
...
...
proto/gen/api/v1/resource_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/resource_service.proto
...
...
proto/gen/api/v1/user_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/user_service.proto
...
...
@@ -692,10 +692,7 @@ func (x *UserStats) GetTagCount() map[string]int32 {
}
type
ListAllUserStatsRequest
struct
{
state
protoimpl
.
MessageState
`protogen:"open.v1"`
// Filter is used to filter memos to calculate stats.
// Same as `ListMemosRequest.filter`.
Filter
string
`protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
state
protoimpl
.
MessageState
`protogen:"open.v1"`
unknownFields
protoimpl
.
UnknownFields
sizeCache
protoimpl
.
SizeCache
}
...
...
@@ -730,13 +727,6 @@ func (*ListAllUserStatsRequest) Descriptor() ([]byte, []int) {
return
file_api_v1_user_service_proto_rawDescGZIP
(),
[]
int
{
11
}
}
func
(
x
*
ListAllUserStatsRequest
)
GetFilter
()
string
{
if
x
!=
nil
{
return
x
.
Filter
}
return
""
}
type
ListAllUserStatsResponse
struct
{
state
protoimpl
.
MessageState
`protogen:"open.v1"`
UserStats
[]
*
UserStats
`protobuf:"bytes,1,rep,name=user_stats,json=userStats,proto3" json:"user_stats,omitempty"`
...
...
@@ -785,10 +775,7 @@ type GetUserStatsRequest struct {
state
protoimpl
.
MessageState
`protogen:"open.v1"`
// The name of the user.
// Format: users/{user}.
Name
string
`protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Filter is used to filter memos to calculate stats.
// Same as `ListMemosRequest.filter`.
Filter
string
`protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"`
Name
string
`protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
unknownFields
protoimpl
.
UnknownFields
sizeCache
protoimpl
.
SizeCache
}
...
...
@@ -830,13 +817,6 @@ func (x *GetUserStatsRequest) GetName() string {
return
""
}
func
(
x
*
GetUserStatsRequest
)
GetFilter
()
string
{
if
x
!=
nil
{
return
x
.
Filter
}
return
""
}
type
UserSetting
struct
{
state
protoimpl
.
MessageState
`protogen:"open.v1"`
// The name of the user.
...
...
@@ -1465,19 +1445,16 @@ var file_api_v1_user_service_proto_rawDesc = []byte{
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x09
,
0x74
,
0x6f
,
0x64
,
0x6f
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x12
,
0x1d
,
0x0a
,
0x0a
,
0x75
,
0x6e
,
0x64
,
0x6f
,
0x5f
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x04
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x09
,
0x75
,
0x6e
,
0x64
,
0x6f
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x22
,
0x
31
,
0x0a
,
0x17
,
0x4c
,
0x69
,
0x73
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x22
,
0x
19
,
0x0a
,
0x17
,
0x4c
,
0x69
,
0x73
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x55
,
0x73
,
0x65
,
0x72
,
0x53
,
0x74
,
0x61
,
0x74
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x66
,
0x69
,
0x6c
,
0x74
,
0x65
,
0x72
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x66
,
0x69
,
0x6c
,
0x74
,
0x65
,
0x72
,
0x22
,
0x52
,
0x0a
,
0x18
,
0x4c
,
0x69
,
0x73
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x55
,
0x73
,
0x65
,
0x72
,
0x53
,
0x74
,
0x61
,
0x74
,
0x73
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x12
,
0x36
,
0x0a
,
0x0a
,
0x75
,
0x73
,
0x65
,
0x72
,
0x5f
,
0x73
,
0x74
,
0x61
,
0x74
,
0x73
,
0x18
,
0x01
,
0x20
,
0x03
,
0x28
,
0x0b
,
0x32
,
0x17
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x55
,
0x73
,
0x65
,
0x72
,
0x53
,
0x74
,
0x61
,
0x74
,
0x73
,
0x52
,
0x09
,
0x75
,
0x73
,
0x65
,
0x72
,
0x53
,
0x74
,
0x61
,
0x74
,
0x73
,
0x22
,
0x41
,
0x0a
,
0x13
,
0x47
,
0x65
,
0x74
,
0x55
,
0x73
,
0x65
,
0x72
,
0x53
,
0x74
,
0x61
,
0x74
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x12
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x66
,
0x69
,
0x6c
,
0x74
,
0x65
,
0x72
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x66
,
0x69
,
0x6c
,
0x74
,
0x65
,
0x72
,
0x22
,
0x22
,
0x52
,
0x0a
,
0x18
,
0x4c
,
0x69
,
0x73
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x55
,
0x73
,
0x65
,
0x72
,
0x53
,
0x74
,
0x61
,
0x74
,
0x73
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x12
,
0x36
,
0x0a
,
0x0a
,
0x75
,
0x73
,
0x65
,
0x72
,
0x5f
,
0x73
,
0x74
,
0x61
,
0x74
,
0x73
,
0x18
,
0x01
,
0x20
,
0x03
,
0x28
,
0x0b
,
0x32
,
0x17
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x55
,
0x73
,
0x65
,
0x72
,
0x53
,
0x74
,
0x61
,
0x74
,
0x73
,
0x52
,
0x09
,
0x75
,
0x73
,
0x65
,
0x72
,
0x53
,
0x74
,
0x61
,
0x74
,
0x73
,
0x22
,
0x29
,
0x0a
,
0x13
,
0x47
,
0x65
,
0x74
,
0x55
,
0x73
,
0x65
,
0x72
,
0x53
,
0x74
,
0x61
,
0x74
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x12
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x22
,
0x82
,
0x01
,
0x0a
,
0x0b
,
0x55
,
0x73
,
0x65
,
0x72
,
0x53
,
0x65
,
0x74
,
0x74
,
0x69
,
0x6e
,
0x67
,
0x12
,
0x12
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x6c
,
0x6f
,
0x63
,
0x61
,
0x6c
,
0x65
,
0x18
,
0x02
,
0x20
,
...
...
proto/gen/api/v1/user_service.pb.gw.go
View file @
edc3f1d9
...
...
@@ -309,19 +309,11 @@ func local_request_UserService_DeleteUser_0(ctx context.Context, marshaler runti
return
msg
,
metadata
,
err
}
var
filter_UserService_ListAllUserStats_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{},
Base
:
[]
int
(
nil
),
Check
:
[]
int
(
nil
)}
func
request_UserService_ListAllUserStats_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
UserServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
(
protoReq
ListAllUserStatsRequest
metadata
runtime
.
ServerMetadata
)
if
err
:=
req
.
ParseForm
();
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
if
err
:=
runtime
.
PopulateQueryParameters
(
&
protoReq
,
req
.
Form
,
filter_UserService_ListAllUserStats_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
client
.
ListAllUserStats
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
...
...
@@ -331,18 +323,10 @@ func local_request_UserService_ListAllUserStats_0(ctx context.Context, marshaler
protoReq
ListAllUserStatsRequest
metadata
runtime
.
ServerMetadata
)
if
err
:=
req
.
ParseForm
();
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
if
err
:=
runtime
.
PopulateQueryParameters
(
&
protoReq
,
req
.
Form
,
filter_UserService_ListAllUserStats_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
server
.
ListAllUserStats
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
var
filter_UserService_GetUserStats_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"name"
:
0
},
Base
:
[]
int
{
1
,
1
,
0
},
Check
:
[]
int
{
0
,
1
,
2
}}
func
request_UserService_GetUserStats_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
UserServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
(
protoReq
GetUserStatsRequest
...
...
@@ -357,12 +341,6 @@ func request_UserService_GetUserStats_0(ctx context.Context, marshaler runtime.M
if
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"type mismatch, parameter: %s, error: %v"
,
"name"
,
err
)
}
if
err
:=
req
.
ParseForm
();
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
if
err
:=
runtime
.
PopulateQueryParameters
(
&
protoReq
,
req
.
Form
,
filter_UserService_GetUserStats_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
client
.
GetUserStats
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
...
...
@@ -381,12 +359,6 @@ func local_request_UserService_GetUserStats_0(ctx context.Context, marshaler run
if
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"type mismatch, parameter: %s, error: %v"
,
"name"
,
err
)
}
if
err
:=
req
.
ParseForm
();
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
if
err
:=
runtime
.
PopulateQueryParameters
(
&
protoReq
,
req
.
Form
,
filter_UserService_GetUserStats_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
server
.
GetUserStats
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
...
...
proto/gen/api/v1/webhook_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/webhook_service.proto
...
...
proto/gen/api/v1/workspace_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/workspace_service.proto
...
...
proto/gen/api/v1/workspace_setting_service.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: api/v1/workspace_setting_service.proto
...
...
proto/gen/apidocs.swagger.yaml
View file @
edc3f1d9
...
...
@@ -324,20 +324,6 @@ paths:
in: query
required: false
type: string
-
name
:
view
description
:
|-
The view of the memo.
- MEMO_VIEW_FULL: The full view of the memo. Includes all fields.
- MEMO_VIEW_METADATA_ONLY: The metadata only view of the memo. Excludes the content/snippet fields.
in: query
required: false
type: string
enum:
- MEMO_VIEW_UNSPECIFIED
- MEMO_VIEW_FULL
- MEMO_VIEW_METADATA_ONLY
default: MEMO_VIEW_UNSPECIFIED
tags
:
-
MemoService
post
:
...
...
@@ -507,14 +493,6 @@ paths:
description
:
An unexpected error response.
schema
:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
filter
description
:
|-
Filter is used to filter memos to calculate stats.
Same as `ListMemosRequest.filter`.
in: query
required: false
type: string
tags
:
-
UserService
/api/v1/users:search
:
...
...
@@ -1509,13 +1487,6 @@ paths:
required: true
type: string
pattern: users/[^/]+
-
name
:
filter
description
:
|-
Filter is used to filter memos to calculate stats.
Same as `ListMemosRequest.filter`.
in: query
required: false
type: string
tags
:
-
UserService
/api/v1/{parent}/tags/{tag}
:
...
...
@@ -2785,16 +2756,6 @@ definitions:
-
REFERENCE
-
COMMENT
default
:
TYPE_UNSPECIFIED
v1MemoView
:
type
:
string
enum
:
-
MEMO_VIEW_UNSPECIFIED
-
MEMO_VIEW_FULL
-
MEMO_VIEW_METADATA_ONLY
default
:
MEMO_VIEW_UNSPECIFIED
description
:
|2-
- MEMO_VIEW_FULL: The full view of the memo. Includes all fields.
- MEMO_VIEW_METADATA_ONLY: The metadata only view of the memo. Excludes the content/snippet fields.
v1Node
:
type
:
object
properties
:
...
...
proto/gen/store/activity.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: store/activity.proto
...
...
proto/gen/store/idp.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: store/idp.proto
...
...
proto/gen/store/inbox.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: store/inbox.proto
...
...
proto/gen/store/memo.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: store/memo.proto
...
...
proto/gen/store/resource.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: store/resource.proto
...
...
proto/gen/store/user_setting.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: store/user_setting.proto
...
...
proto/gen/store/workspace_setting.pb.go
View file @
edc3f1d9
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.
2
// protoc-gen-go v1.36.
3
// protoc (unknown)
// source: store/workspace_setting.proto
...
...
server/router/api/v1/memo_service.go
View file @
edc3f1d9
...
...
@@ -82,7 +82,7 @@ func (s *APIV1Service) CreateMemo(ctx context.Context, request *v1pb.CreateMemoR
}
}
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
,
v1pb
.
MemoView_MEMO_VIEW_FULL
)
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to convert memo"
)
}
...
...
@@ -120,9 +120,6 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
limitPlusOne
:=
limit
+
1
memoFind
.
Limit
=
&
limitPlusOne
memoFind
.
Offset
=
&
offset
if
request
.
View
==
v1pb
.
MemoView_MEMO_VIEW_METADATA_ONLY
{
memoFind
.
ExcludeContent
=
true
}
memos
,
err
:=
s
.
Store
.
ListMemos
(
ctx
,
memoFind
)
if
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to list memos: %v"
,
err
)
...
...
@@ -138,7 +135,7 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
}
}
for
_
,
memo
:=
range
memos
{
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
,
request
.
View
)
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to convert memo"
)
}
...
...
@@ -179,7 +176,7 @@ func (s *APIV1Service) GetMemo(ctx context.Context, request *v1pb.GetMemoRequest
}
}
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
,
v1pb
.
MemoView_MEMO_VIEW_FULL
)
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to convert memo"
)
}
...
...
@@ -210,7 +207,7 @@ func (s *APIV1Service) GetMemoByUid(ctx context.Context, request *v1pb.GetMemoBy
}
}
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
,
v1pb
.
MemoView_MEMO_VIEW_FULL
)
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to convert memo"
)
}
...
...
@@ -335,7 +332,7 @@ func (s *APIV1Service) UpdateMemo(ctx context.Context, request *v1pb.UpdateMemoR
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to get memo"
)
}
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
,
v1pb
.
MemoView_MEMO_VIEW_FULL
)
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to convert memo"
)
}
...
...
@@ -371,7 +368,7 @@ func (s *APIV1Service) DeleteMemo(ctx context.Context, request *v1pb.DeleteMemoR
return
nil
,
status
.
Errorf
(
codes
.
PermissionDenied
,
"permission denied"
)
}
if
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
,
v1pb
.
MemoView_MEMO_VIEW_METADATA_ONLY
);
err
==
nil
{
if
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
);
err
==
nil
{
// Try to dispatch webhook when memo is deleted.
if
err
:=
s
.
DispatchMemoDeletedWebhook
(
ctx
,
memoMessage
);
err
!=
nil
{
slog
.
Warn
(
"Failed to dispatch memo deleted webhook"
,
slog
.
Any
(
"err"
,
err
))
...
...
@@ -506,7 +503,7 @@ func (s *APIV1Service) ListMemoComments(ctx context.Context, request *v1pb.ListM
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to get memo"
)
}
if
memo
!=
nil
{
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
,
v1pb
.
MemoView_MEMO_VIEW_FULL
)
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memo
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to convert memo"
)
}
...
...
server/router/api/v1/memo_service_converter.go
View file @
edc3f1d9
...
...
@@ -16,7 +16,7 @@ import (
"github.com/usememos/memos/store"
)
func
(
s
*
APIV1Service
)
convertMemoFromStore
(
ctx
context
.
Context
,
memo
*
store
.
Memo
,
view
v1pb
.
MemoView
)
(
*
v1pb
.
Memo
,
error
)
{
func
(
s
*
APIV1Service
)
convertMemoFromStore
(
ctx
context
.
Context
,
memo
*
store
.
Memo
)
(
*
v1pb
.
Memo
,
error
)
{
displayTs
:=
memo
.
CreatedTs
workspaceMemoRelatedSetting
,
err
:=
s
.
Store
.
GetWorkspaceMemoRelatedSetting
(
ctx
)
if
err
!=
nil
{
...
...
@@ -49,38 +49,35 @@ func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Mem
memoMessage
.
Parent
=
&
parent
}
// Fill content when view is MEMO_VIEW_FULL.
if
view
==
v1pb
.
MemoView_MEMO_VIEW_FULL
{
listMemoRelationsResponse
,
err
:=
s
.
ListMemoRelations
(
ctx
,
&
v1pb
.
ListMemoRelationsRequest
{
Name
:
name
})
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to list memo relations"
)
}
memoMessage
.
Relations
=
listMemoRelationsResponse
.
Relations
listMemoResourcesResponse
,
err
:=
s
.
ListMemoResources
(
ctx
,
&
v1pb
.
ListMemoResourcesRequest
{
Name
:
name
})
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to list memo resources"
)
}
memoMessage
.
Resources
=
listMemoResourcesResponse
.
Resources
listMemoReactionsResponse
,
err
:=
s
.
ListMemoReactions
(
ctx
,
&
v1pb
.
ListMemoReactionsRequest
{
Name
:
name
})
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to list memo reactions"
)
}
memoMessage
.
Reactions
=
listMemoReactionsResponse
.
Reactions
nodes
,
err
:=
parser
.
Parse
(
tokenizer
.
Tokenize
(
memo
.
Content
))
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to parse content"
)
}
memoMessage
.
Nodes
=
convertFromASTNodes
(
nodes
)
snippet
,
err
:=
getMemoContentSnippet
(
memo
.
Content
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to get memo content snippet"
)
}
memoMessage
.
Snippet
=
snippet
listMemoRelationsResponse
,
err
:=
s
.
ListMemoRelations
(
ctx
,
&
v1pb
.
ListMemoRelationsRequest
{
Name
:
name
})
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to list memo relations"
)
}
memoMessage
.
Relations
=
listMemoRelationsResponse
.
Relations
listMemoResourcesResponse
,
err
:=
s
.
ListMemoResources
(
ctx
,
&
v1pb
.
ListMemoResourcesRequest
{
Name
:
name
})
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to list memo resources"
)
}
memoMessage
.
Resources
=
listMemoResourcesResponse
.
Resources
listMemoReactionsResponse
,
err
:=
s
.
ListMemoReactions
(
ctx
,
&
v1pb
.
ListMemoReactionsRequest
{
Name
:
name
})
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to list memo reactions"
)
}
memoMessage
.
Reactions
=
listMemoReactionsResponse
.
Reactions
nodes
,
err
:=
parser
.
Parse
(
tokenizer
.
Tokenize
(
memo
.
Content
))
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to parse content"
)
}
memoMessage
.
Nodes
=
convertFromASTNodes
(
nodes
)
snippet
,
err
:=
getMemoContentSnippet
(
memo
.
Content
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to get memo content snippet"
)
}
memoMessage
.
Snippet
=
snippet
return
memoMessage
,
nil
}
...
...
web/src/components/MemoEditor/ActionButton/AddMemoRelationPopover.tsx
View file @
edc3f1d9
...
...
@@ -10,7 +10,7 @@ import { memoServiceClient } from "@/grpcweb";
import
{
DEFAULT_LIST_MEMOS_PAGE_SIZE
}
from
"@/helpers/consts"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
{
MemoRelation_Memo
,
MemoRelation_Type
}
from
"@/types/proto/api/v1/memo_relation_service"
;
import
{
Memo
,
MemoView
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
EditorRefActions
}
from
"../Editor"
;
import
{
MemoEditorContext
}
from
"../types"
;
...
...
@@ -51,7 +51,6 @@ const AddMemoRelationPopover = (props: Props) => {
const
{
memos
}
=
await
memoServiceClient
.
listMemos
({
pageSize
:
DEFAULT_LIST_MEMOS_PAGE_SIZE
,
filter
:
filters
.
length
>
0
?
filters
.
join
(
" && "
)
:
undefined
,
view
:
MemoView
.
MEMO_VIEW_FULL
,
});
setFetchedMemos
(
memos
);
}
catch
(
error
:
any
)
{
...
...
web/src/store/v1/memo.ts
View file @
edc3f1d9
...
...
@@ -2,7 +2,7 @@ import { uniqueId } from "lodash-es";
import
{
create
}
from
"zustand"
;
import
{
combine
}
from
"zustand/middleware"
;
import
{
memoServiceClient
}
from
"@/grpcweb"
;
import
{
CreateMemoRequest
,
ListMemosRequest
,
Memo
,
MemoView
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
CreateMemoRequest
,
ListMemosRequest
,
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
interface
State
{
// stateId is used to identify the store instance state.
...
...
@@ -36,7 +36,6 @@ export const useMemoStore = create(
const
{
memos
,
nextPageToken
}
=
await
memoServiceClient
.
listMemos
(
{
...
request
,
view
:
MemoView
.
MEMO_VIEW_FULL
,
},
{
signal
:
controller
.
signal
},
);
...
...
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