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
81e8aed6
Commit
81e8aed6
authored
Feb 02, 2025
by
johnnyjoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: move part of memo filter
parent
fafd6d81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
16 deletions
+8
-16
memo_service.go
server/router/api/v1/memo_service.go
+8
-0
memo_service_filter.go
server/router/api/v1/memo_service_filter.go
+0
-16
No files found.
server/router/api/v1/memo_service.go
View file @
81e8aed6
...
@@ -134,6 +134,14 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
...
@@ -134,6 +134,14 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
memoFind
.
VisibilityList
=
[]
store
.
Visibility
{
store
.
Public
,
store
.
Protected
}
memoFind
.
VisibilityList
=
[]
store
.
Visibility
{
store
.
Public
,
store
.
Protected
}
}
}
workspaceMemoRelatedSetting
,
err
:=
s
.
Store
.
GetWorkspaceMemoRelatedSetting
(
ctx
)
if
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to get workspace memo related setting"
)
}
if
workspaceMemoRelatedSetting
.
DisplayWithUpdateTime
{
memoFind
.
OrderByUpdatedTs
=
true
}
var
limit
,
offset
int
var
limit
,
offset
int
if
request
.
PageToken
!=
""
{
if
request
.
PageToken
!=
""
{
var
pageToken
v1pb
.
PageToken
var
pageToken
v1pb
.
PageToken
...
...
server/router/api/v1/memo_service_filter.go
View file @
81e8aed6
...
@@ -52,9 +52,6 @@ func (s *APIV1Service) buildMemoFindWithFilter(ctx context.Context, find *store.
...
@@ -52,9 +52,6 @@ func (s *APIV1Service) buildMemoFindWithFilter(ctx context.Context, find *store.
find
.
CreatedTsBefore
=
filterExpr
.
DisplayTimeBefore
find
.
CreatedTsBefore
=
filterExpr
.
DisplayTimeBefore
}
}
}
}
if
filterExpr
.
IncludeComments
{
find
.
ExcludeComments
=
false
}
if
filterExpr
.
HasLink
{
if
filterExpr
.
HasLink
{
find
.
PayloadFind
.
HasLink
=
true
find
.
PayloadFind
.
HasLink
=
true
}
}
...
@@ -68,14 +65,6 @@ func (s *APIV1Service) buildMemoFindWithFilter(ctx context.Context, find *store.
...
@@ -68,14 +65,6 @@ func (s *APIV1Service) buildMemoFindWithFilter(ctx context.Context, find *store.
find
.
PayloadFind
.
HasIncompleteTasks
=
true
find
.
PayloadFind
.
HasIncompleteTasks
=
true
}
}
}
}
workspaceMemoRelatedSetting
,
err
:=
s
.
Store
.
GetWorkspaceMemoRelatedSetting
(
ctx
)
if
err
!=
nil
{
return
status
.
Errorf
(
codes
.
Internal
,
"failed to get workspace memo related setting"
)
}
if
workspaceMemoRelatedSetting
.
DisplayWithUpdateTime
{
find
.
OrderByUpdatedTs
=
true
}
return
nil
return
nil
}
}
...
@@ -85,7 +74,6 @@ var MemoFilterCELAttributes = []cel.EnvOption{
...
@@ -85,7 +74,6 @@ var MemoFilterCELAttributes = []cel.EnvOption{
cel
.
Variable
(
"tag_search"
,
cel
.
ListType
(
cel
.
StringType
)),
cel
.
Variable
(
"tag_search"
,
cel
.
ListType
(
cel
.
StringType
)),
cel
.
Variable
(
"display_time_before"
,
cel
.
IntType
),
cel
.
Variable
(
"display_time_before"
,
cel
.
IntType
),
cel
.
Variable
(
"display_time_after"
,
cel
.
IntType
),
cel
.
Variable
(
"display_time_after"
,
cel
.
IntType
),
cel
.
Variable
(
"include_comments"
,
cel
.
BoolType
),
cel
.
Variable
(
"has_link"
,
cel
.
BoolType
),
cel
.
Variable
(
"has_link"
,
cel
.
BoolType
),
cel
.
Variable
(
"has_task_list"
,
cel
.
BoolType
),
cel
.
Variable
(
"has_task_list"
,
cel
.
BoolType
),
cel
.
Variable
(
"has_code"
,
cel
.
BoolType
),
cel
.
Variable
(
"has_code"
,
cel
.
BoolType
),
...
@@ -97,7 +85,6 @@ type MemoFilter struct {
...
@@ -97,7 +85,6 @@ type MemoFilter struct {
TagSearch
[]
string
TagSearch
[]
string
DisplayTimeBefore
*
int64
DisplayTimeBefore
*
int64
DisplayTimeAfter
*
int64
DisplayTimeAfter
*
int64
IncludeComments
bool
HasLink
bool
HasLink
bool
HasTaskList
bool
HasTaskList
bool
HasCode
bool
HasCode
bool
...
@@ -147,9 +134,6 @@ func findMemoField(callExpr *exprv1.Expr_Call, filter *MemoFilter) {
...
@@ -147,9 +134,6 @@ func findMemoField(callExpr *exprv1.Expr_Call, filter *MemoFilter) {
}
else
if
idExpr
.
Name
==
"display_time_after"
{
}
else
if
idExpr
.
Name
==
"display_time_after"
{
displayTimeAfter
:=
callExpr
.
Args
[
1
]
.
GetConstExpr
()
.
GetInt64Value
()
displayTimeAfter
:=
callExpr
.
Args
[
1
]
.
GetConstExpr
()
.
GetInt64Value
()
filter
.
DisplayTimeAfter
=
&
displayTimeAfter
filter
.
DisplayTimeAfter
=
&
displayTimeAfter
}
else
if
idExpr
.
Name
==
"include_comments"
{
value
:=
callExpr
.
Args
[
1
]
.
GetConstExpr
()
.
GetBoolValue
()
filter
.
IncludeComments
=
value
}
else
if
idExpr
.
Name
==
"has_link"
{
}
else
if
idExpr
.
Name
==
"has_link"
{
value
:=
callExpr
.
Args
[
1
]
.
GetConstExpr
()
.
GetBoolValue
()
value
:=
callExpr
.
Args
[
1
]
.
GetConstExpr
()
.
GetBoolValue
()
filter
.
HasLink
=
value
filter
.
HasLink
=
value
...
...
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