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
ea662806
Commit
ea662806
authored
Mar 29, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update sidebar components
parent
526f4680
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
32 deletions
+26
-32
tag_service.go
server/route/api/v2/tag_service.go
+3
-12
ExploreSidebar.tsx
web/src/components/ExploreSidebar/ExploreSidebar.tsx
+2
-2
UsersSection.tsx
web/src/components/ExploreSidebar/UsersSection.tsx
+4
-4
HomeSidebar.tsx
web/src/components/HomeSidebar/HomeSidebar.tsx
+2
-2
TagsSection.tsx
web/src/components/HomeSidebar/TagsSection.tsx
+6
-6
TimelineSidebar.tsx
web/src/components/TimelineSidebar/TimelineSidebar.tsx
+3
-3
TimelineSidebarDrawer.tsx
web/src/components/TimelineSidebar/TimelineSidebarDrawer.tsx
+1
-1
index.ts
web/src/components/TimelineSidebar/index.ts
+4
-0
Timeline.tsx
web/src/pages/Timeline.tsx
+1
-2
No files found.
server/route/api/v2/tag_service.go
View file @
ea662806
...
@@ -51,22 +51,13 @@ func (s *APIV2Service) BatchUpsertTag(ctx context.Context, request *apiv2pb.Batc
...
@@ -51,22 +51,13 @@ func (s *APIV2Service) BatchUpsertTag(ctx context.Context, request *apiv2pb.Batc
}
}
func
(
s
*
APIV2Service
)
ListTags
(
ctx
context
.
Context
,
request
*
apiv2pb
.
ListTagsRequest
)
(
*
apiv2pb
.
ListTagsResponse
,
error
)
{
func
(
s
*
APIV2Service
)
ListTags
(
ctx
context
.
Context
,
request
*
apiv2pb
.
ListTagsRequest
)
(
*
apiv2pb
.
ListTagsResponse
,
error
)
{
tagFind
:=
&
store
.
FindTag
{}
userID
,
err
:=
ExtractUserIDFromName
(
request
.
User
)
userID
,
err
:=
ExtractUserIDFromName
(
request
.
User
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"invalid user name: %v"
,
err
)
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"invalid user name: %v"
,
err
)
}
}
user
,
err
:=
s
.
Store
.
GetUser
(
ctx
,
&
store
.
FindUser
{
tagFind
.
CreatorID
=
userID
ID
:
&
userID
,
tags
,
err
:=
s
.
Store
.
ListTags
(
ctx
,
tagFind
)
})
if
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to get user: %v"
,
err
)
}
if
user
==
nil
{
return
nil
,
status
.
Errorf
(
codes
.
NotFound
,
"user not found"
)
}
tags
,
err
:=
s
.
Store
.
ListTags
(
ctx
,
&
store
.
FindTag
{
CreatorID
:
user
.
ID
,
})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to list tags: %v"
,
err
)
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to list tags: %v"
,
err
)
}
}
...
...
web/src/components/ExploreSidebar/ExploreSidebar.tsx
View file @
ea662806
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
User
List
from
"../UserList
"
;
import
User
sSection
from
"./UsersSection
"
;
interface
Props
{
interface
Props
{
className
?:
string
;
className
?:
string
;
...
@@ -15,7 +15,7 @@ const ExploreSidebar = (props: Props) => {
...
@@ -15,7 +15,7 @@ const ExploreSidebar = (props: Props) => {
)
}
)
}
>
>
<
SearchBar
/>
<
SearchBar
/>
<
User
List
/>
<
User
sSection
/>
</
aside
>
</
aside
>
);
);
};
};
...
...
web/src/components/
UserList
.tsx
→
web/src/components/
ExploreSidebar/UsersSection
.tsx
View file @
ea662806
...
@@ -3,10 +3,10 @@ import { useEffect, useState } from "react";
...
@@ -3,10 +3,10 @@ import { useEffect, useState } from "react";
import
{
Link
}
from
"react-router-dom"
;
import
{
Link
}
from
"react-router-dom"
;
import
{
useUserStore
}
from
"@/store/v1"
;
import
{
useUserStore
}
from
"@/store/v1"
;
import
{
User
}
from
"@/types/proto/api/v2/user_service"
;
import
{
User
}
from
"@/types/proto/api/v2/user_service"
;
import
Icon
from
"./Icon"
;
import
Icon
from
".
.
/Icon"
;
import
UserAvatar
from
"./UserAvatar"
;
import
UserAvatar
from
".
.
/UserAvatar"
;
const
User
List
=
()
=>
{
const
User
sSection
=
()
=>
{
const
userStore
=
useUserStore
();
const
userStore
=
useUserStore
();
const
[
users
,
setUsers
]
=
useState
<
User
[]
>
([]);
const
[
users
,
setUsers
]
=
useState
<
User
[]
>
([]);
...
@@ -48,4 +48,4 @@ const UserList = () => {
...
@@ -48,4 +48,4 @@ const UserList = () => {
);
);
};
};
export
default
User
List
;
export
default
User
sSection
;
web/src/components/HomeSidebar/HomeSidebar.tsx
View file @
ea662806
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
import
PersonalStatistics
from
"@/components/PersonalStatistics"
;
import
PersonalStatistics
from
"@/components/PersonalStatistics"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
TagList
from
"@/components/TagList"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
TagsSection
from
"./TagsSection"
;
interface
Props
{
interface
Props
{
className
?:
string
;
className
?:
string
;
...
@@ -20,7 +20,7 @@ const HomeSidebar = (props: Props) => {
...
@@ -20,7 +20,7 @@ const HomeSidebar = (props: Props) => {
>
>
<
SearchBar
/>
<
SearchBar
/>
<
PersonalStatistics
user=
{
currentUser
}
/>
<
PersonalStatistics
user=
{
currentUser
}
/>
<
Tag
List
/>
<
Tag
sSection
/>
</
aside
>
</
aside
>
);
);
};
};
...
...
web/src/components/
TagList
.tsx
→
web/src/components/
HomeSidebar/TagsSection
.tsx
View file @
ea662806
...
@@ -4,10 +4,10 @@ import useToggle from "react-use/lib/useToggle";
...
@@ -4,10 +4,10 @@ import useToggle from "react-use/lib/useToggle";
import
{
useFilterStore
,
useTagStore
}
from
"@/store/module"
;
import
{
useFilterStore
,
useTagStore
}
from
"@/store/module"
;
import
{
useMemoList
}
from
"@/store/v1"
;
import
{
useMemoList
}
from
"@/store/v1"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
showCreateTagDialog
from
"./CreateTagDialog"
;
import
showCreateTagDialog
from
".
.
/CreateTagDialog"
;
import
{
showCommonDialog
}
from
"./Dialog/CommonDialog"
;
import
{
showCommonDialog
}
from
".
.
/Dialog/CommonDialog"
;
import
Icon
from
"./Icon"
;
import
Icon
from
".
.
/Icon"
;
import
showRenameTagDialog
from
"./RenameTagDialog"
;
import
showRenameTagDialog
from
".
.
/RenameTagDialog"
;
interface
KVObject
<
T
=
any
>
{
interface
KVObject
<
T
=
any
>
{
[
key
:
string
]:
T
;
[
key
:
string
]:
T
;
...
@@ -19,7 +19,7 @@ interface Tag {
...
@@ -19,7 +19,7 @@ interface Tag {
subTags
:
Tag
[];
subTags
:
Tag
[];
}
}
const
Tag
List
=
()
=>
{
const
Tag
sSection
=
()
=>
{
const
t
=
useTranslate
();
const
t
=
useTranslate
();
const
filterStore
=
useFilterStore
();
const
filterStore
=
useFilterStore
();
const
tagStore
=
useTagStore
();
const
tagStore
=
useTagStore
();
...
@@ -195,4 +195,4 @@ const TagItemContainer: React.FC<TagItemContainerProps> = (props: TagItemContain
...
@@ -195,4 +195,4 @@ const TagItemContainer: React.FC<TagItemContainerProps> = (props: TagItemContain
);
);
};
};
export
default
Tag
List
;
export
default
Tag
sSection
;
web/src/components/TimelineSidebar.tsx
→
web/src/components/TimelineSidebar
/TimelineSidebar
.tsx
View file @
ea662806
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
import
SearchBar
from
"./SearchBar
"
;
import
TagsSection
from
"../HomeSidebar/TagsSection
"
;
import
TagList
from
"./TagList
"
;
import
SearchBar
from
"../SearchBar
"
;
interface
Props
{
interface
Props
{
className
?:
string
;
className
?:
string
;
...
@@ -15,7 +15,7 @@ const TimelineSidebar = (props: Props) => {
...
@@ -15,7 +15,7 @@ const TimelineSidebar = (props: Props) => {
)
}
)
}
>
>
<
SearchBar
/>
<
SearchBar
/>
<
Tag
List
/>
<
Tag
sSection
/>
</
aside
>
</
aside
>
);
);
};
};
...
...
web/src/components/TimelineSidebarDrawer.tsx
→
web/src/components/TimelineSidebar
/TimelineSidebar
Drawer.tsx
View file @
ea662806
import
{
Drawer
,
IconButton
}
from
"@mui/joy"
;
import
{
Drawer
,
IconButton
}
from
"@mui/joy"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
useLocation
}
from
"react-router-dom"
;
import
{
useLocation
}
from
"react-router-dom"
;
import
Icon
from
"./Icon"
;
import
Icon
from
".
.
/Icon"
;
import
TimelineSidebar
from
"./TimelineSidebar"
;
import
TimelineSidebar
from
"./TimelineSidebar"
;
const
TimelineSidebarDrawer
=
()
=>
{
const
TimelineSidebarDrawer
=
()
=>
{
...
...
web/src/components/TimelineSidebar/index.ts
0 → 100644
View file @
ea662806
import
TimelineSidebar
from
"./TimelineSidebar"
;
import
TimelineSidebarDrawer
from
"./TimelineSidebarDrawer"
;
export
{
TimelineSidebar
,
TimelineSidebarDrawer
};
web/src/pages/Timeline.tsx
View file @
ea662806
...
@@ -8,8 +8,7 @@ import showMemoEditorDialog from "@/components/MemoEditor/MemoEditorDialog";
...
@@ -8,8 +8,7 @@ import showMemoEditorDialog from "@/components/MemoEditor/MemoEditorDialog";
import
MemoFilter
from
"@/components/MemoFilter"
;
import
MemoFilter
from
"@/components/MemoFilter"
;
import
MemoView
from
"@/components/MemoView"
;
import
MemoView
from
"@/components/MemoView"
;
import
MobileHeader
from
"@/components/MobileHeader"
;
import
MobileHeader
from
"@/components/MobileHeader"
;
import
TimelineSidebar
from
"@/components/TimelineSidebar"
;
import
{
TimelineSidebar
,
TimelineSidebarDrawer
}
from
"@/components/TimelineSidebar"
;
import
TimelineSidebarDrawer
from
"@/components/TimelineSidebarDrawer"
;
import
{
memoServiceClient
}
from
"@/grpcweb"
;
import
{
memoServiceClient
}
from
"@/grpcweb"
;
import
{
DAILY_TIMESTAMP
,
DEFAULT_LIST_MEMOS_PAGE_SIZE
}
from
"@/helpers/consts"
;
import
{
DAILY_TIMESTAMP
,
DEFAULT_LIST_MEMOS_PAGE_SIZE
}
from
"@/helpers/consts"
;
import
{
getNormalizedTimeString
,
getTimeStampByDate
}
from
"@/helpers/datetime"
;
import
{
getNormalizedTimeString
,
getTimeStampByDate
}
from
"@/helpers/datetime"
;
...
...
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