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
12f4d3a1
Commit
12f4d3a1
authored
Feb 29, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak default page size
parent
00788bd8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
20 deletions
+18
-20
CreateMemoRelationDialog.tsx
web/src/components/CreateMemoRelationDialog.tsx
+2
-2
consts.ts
web/src/helpers/consts.ts
+6
-8
Archived.tsx
web/src/pages/Archived.tsx
+2
-2
Explore.tsx
web/src/pages/Explore.tsx
+2
-2
Home.tsx
web/src/pages/Home.tsx
+2
-2
Timeline.tsx
web/src/pages/Timeline.tsx
+2
-2
UserProfile.tsx
web/src/pages/UserProfile.tsx
+2
-2
No files found.
web/src/components/CreateMemoRelationDialog.tsx
View file @
12f4d3a1
...
@@ -3,7 +3,7 @@ import React, { useState } from "react";
...
@@ -3,7 +3,7 @@ import React, { useState } from "react";
import
{
toast
}
from
"react-hot-toast"
;
import
{
toast
}
from
"react-hot-toast"
;
import
useDebounce
from
"react-use/lib/useDebounce"
;
import
useDebounce
from
"react-use/lib/useDebounce"
;
import
{
memoServiceClient
}
from
"@/grpcweb"
;
import
{
memoServiceClient
}
from
"@/grpcweb"
;
import
{
DEFAULT_
MEMO_LIMIT
}
from
"@/helpers/consts"
;
import
{
DEFAULT_
LIST_MEMOS_PAGE_SIZE
}
from
"@/helpers/consts"
;
import
{
getDateTimeString
}
from
"@/helpers/datetime"
;
import
{
getDateTimeString
}
from
"@/helpers/datetime"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
{
Memo
}
from
"@/types/proto/api/v2/memo_service"
;
import
{
Memo
}
from
"@/types/proto/api/v2/memo_service"
;
...
@@ -35,7 +35,7 @@ const CreateMemoRelationDialog: React.FC<Props> = (props: Props) => {
...
@@ -35,7 +35,7 @@ const CreateMemoRelationDialog: React.FC<Props> = (props: Props) => {
filters
.
push
(
`content_search == [
${
JSON
.
stringify
(
searchText
)}
]`
);
filters
.
push
(
`content_search == [
${
JSON
.
stringify
(
searchText
)}
]`
);
}
}
const
{
memos
}
=
await
memoServiceClient
.
listMemos
({
const
{
memos
}
=
await
memoServiceClient
.
listMemos
({
pageSize
:
DEFAULT_
MEMO_LIMIT
,
pageSize
:
DEFAULT_
LIST_MEMOS_PAGE_SIZE
,
filter
:
filters
.
length
>
0
?
filters
.
join
(
" && "
)
:
undefined
,
filter
:
filters
.
length
>
0
?
filters
.
join
(
" && "
)
:
undefined
,
});
});
setFetchedMemos
(
memos
);
setFetchedMemos
(
memos
);
...
...
web/src/helpers/consts.ts
View file @
12f4d3a1
// UNKNOWN_ID is the symbol for unknown id
// UNKNOWN_ID is the symbol for unknown id
.
export
const
UNKNOWN_ID
=
-
1
;
export
const
UNKNOWN_ID
=
-
1
;
//
default animation duration
//
ANIMATION_DURATION is the duration of animation in milliseconds.
export
const
ANIMATION_DURATION
=
200
;
export
const
ANIMATION_DURATION
=
200
;
//
millisecond in a day
//
DAILY_TIMESTAMP is the timestamp for a day.
export
const
DAILY_TIMESTAMP
=
3600
*
24
*
1000
;
export
const
DAILY_TIMESTAMP
=
3600
*
24
*
1000
;
//
space width for tab action in editor
//
TAB_SPACE_WIDTH is the default tab space width.
export
const
TAB_SPACE_WIDTH
=
2
;
export
const
TAB_SPACE_WIDTH
=
2
;
// default fetch memo amount
// DEFAULT_LIST_MEMOS_PAGE_SIZE is the default page size for list memos request.
export
const
DEFAULT_MEMO_LIMIT
=
10
;
export
const
DEFAULT_LIST_MEMOS_PAGE_SIZE
=
16
;
export
const
DEFAULT_LIST_MEMOS_PAGE_SIZE
=
10
;
web/src/pages/Archived.tsx
View file @
12f4d3a1
...
@@ -9,7 +9,7 @@ import MemoContent from "@/components/MemoContent";
...
@@ -9,7 +9,7 @@ import MemoContent from "@/components/MemoContent";
import
MemoFilter
from
"@/components/MemoFilter"
;
import
MemoFilter
from
"@/components/MemoFilter"
;
import
MobileHeader
from
"@/components/MobileHeader"
;
import
MobileHeader
from
"@/components/MobileHeader"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
{
DEFAULT_
MEMO_LIMIT
}
from
"@/helpers/consts"
;
import
{
DEFAULT_
LIST_MEMOS_PAGE_SIZE
}
from
"@/helpers/consts"
;
import
{
getTimeStampByDate
}
from
"@/helpers/datetime"
;
import
{
getTimeStampByDate
}
from
"@/helpers/datetime"
;
import
{
getDateTimeString
}
from
"@/helpers/datetime"
;
import
{
getDateTimeString
}
from
"@/helpers/datetime"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
...
@@ -51,7 +51,7 @@ const Archived = () => {
...
@@ -51,7 +51,7 @@ const Archived = () => {
}
}
setIsRequesting
(
true
);
setIsRequesting
(
true
);
const
data
=
await
memoStore
.
fetchMemos
({
const
data
=
await
memoStore
.
fetchMemos
({
pageSize
:
DEFAULT_
MEMO_LIMIT
,
pageSize
:
DEFAULT_
LIST_MEMOS_PAGE_SIZE
,
filter
:
filters
.
join
(
" && "
),
filter
:
filters
.
join
(
" && "
),
pageToken
:
nextPageTokenRef
.
current
,
pageToken
:
nextPageTokenRef
.
current
,
});
});
...
...
web/src/pages/Explore.tsx
View file @
12f4d3a1
...
@@ -5,7 +5,7 @@ import Icon from "@/components/Icon";
...
@@ -5,7 +5,7 @@ import Icon from "@/components/Icon";
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
{
DEFAULT_
MEMO_LIMIT
}
from
"@/helpers/consts"
;
import
{
DEFAULT_
LIST_MEMOS_PAGE_SIZE
}
from
"@/helpers/consts"
;
import
{
getTimeStampByDate
}
from
"@/helpers/datetime"
;
import
{
getTimeStampByDate
}
from
"@/helpers/datetime"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useFilterWithUrlParams
from
"@/hooks/useFilterWithUrlParams"
;
import
useFilterWithUrlParams
from
"@/hooks/useFilterWithUrlParams"
;
...
@@ -42,7 +42,7 @@ const Explore = () => {
...
@@ -42,7 +42,7 @@ const Explore = () => {
}
}
setIsRequesting
(
true
);
setIsRequesting
(
true
);
const
data
=
await
memoStore
.
fetchMemos
({
const
data
=
await
memoStore
.
fetchMemos
({
pageSize
:
DEFAULT_
MEMO_LIMIT
,
pageSize
:
DEFAULT_
LIST_MEMOS_PAGE_SIZE
,
filter
:
filters
.
join
(
" && "
),
filter
:
filters
.
join
(
" && "
),
pageToken
:
nextPageTokenRef
.
current
,
pageToken
:
nextPageTokenRef
.
current
,
});
});
...
...
web/src/pages/Home.tsx
View file @
12f4d3a1
...
@@ -9,7 +9,7 @@ import MemoEditor from "@/components/MemoEditor";
...
@@ -9,7 +9,7 @@ import MemoEditor from "@/components/MemoEditor";
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
{
DEFAULT_
MEMO_LIMIT
}
from
"@/helpers/consts"
;
import
{
DEFAULT_
LIST_MEMOS_PAGE_SIZE
}
from
"@/helpers/consts"
;
import
{
getTimeStampByDate
}
from
"@/helpers/datetime"
;
import
{
getTimeStampByDate
}
from
"@/helpers/datetime"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useFilterWithUrlParams
from
"@/hooks/useFilterWithUrlParams"
;
import
useFilterWithUrlParams
from
"@/hooks/useFilterWithUrlParams"
;
...
@@ -52,7 +52,7 @@ const Home = () => {
...
@@ -52,7 +52,7 @@ const Home = () => {
}
}
setIsRequesting
(
true
);
setIsRequesting
(
true
);
const
data
=
await
memoStore
.
fetchMemos
({
const
data
=
await
memoStore
.
fetchMemos
({
pageSize
:
DEFAULT_
MEMO_LIMIT
,
pageSize
:
DEFAULT_
LIST_MEMOS_PAGE_SIZE
,
filter
:
filters
.
join
(
" && "
),
filter
:
filters
.
join
(
" && "
),
pageToken
:
nextPageTokenRef
.
current
,
pageToken
:
nextPageTokenRef
.
current
,
});
});
...
...
web/src/pages/Timeline.tsx
View file @
12f4d3a1
...
@@ -11,7 +11,7 @@ import MobileHeader from "@/components/MobileHeader";
...
@@ -11,7 +11,7 @@ import MobileHeader from "@/components/MobileHeader";
import
TimelineSidebar
from
"@/components/TimelineSidebar"
;
import
TimelineSidebar
from
"@/components/TimelineSidebar"
;
import
TimelineSidebarDrawer
from
"@/components/TimelineSidebarDrawer"
;
import
TimelineSidebarDrawer
from
"@/components/TimelineSidebarDrawer"
;
import
{
memoServiceClient
}
from
"@/grpcweb"
;
import
{
memoServiceClient
}
from
"@/grpcweb"
;
import
{
DAILY_TIMESTAMP
,
DEFAULT_
MEMO_LIMIT
}
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"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useFilterWithUrlParams
from
"@/hooks/useFilterWithUrlParams"
;
import
useFilterWithUrlParams
from
"@/hooks/useFilterWithUrlParams"
;
...
@@ -107,7 +107,7 @@ const Timeline = () => {
...
@@ -107,7 +107,7 @@ const Timeline = () => {
}
}
setIsRequesting
(
true
);
setIsRequesting
(
true
);
const
data
=
await
memoStore
.
fetchMemos
({
const
data
=
await
memoStore
.
fetchMemos
({
pageSize
:
DEFAULT_
MEMO_LIMIT
,
pageSize
:
DEFAULT_
LIST_MEMOS_PAGE_SIZE
,
filter
:
filters
.
join
(
" && "
),
filter
:
filters
.
join
(
" && "
),
pageToken
:
nextPageTokenRef
.
current
,
pageToken
:
nextPageTokenRef
.
current
,
});
});
...
...
web/src/pages/UserProfile.tsx
View file @
12f4d3a1
...
@@ -8,7 +8,7 @@ import MemoFilter from "@/components/MemoFilter";
...
@@ -8,7 +8,7 @@ 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
UserAvatar
from
"@/components/UserAvatar"
;
import
UserAvatar
from
"@/components/UserAvatar"
;
import
{
DEFAULT_
MEMO_LIMIT
}
from
"@/helpers/consts"
;
import
{
DEFAULT_
LIST_MEMOS_PAGE_SIZE
}
from
"@/helpers/consts"
;
import
{
getTimeStampByDate
}
from
"@/helpers/datetime"
;
import
{
getTimeStampByDate
}
from
"@/helpers/datetime"
;
import
useFilterWithUrlParams
from
"@/hooks/useFilterWithUrlParams"
;
import
useFilterWithUrlParams
from
"@/hooks/useFilterWithUrlParams"
;
import
useLoading
from
"@/hooks/useLoading"
;
import
useLoading
from
"@/hooks/useLoading"
;
...
@@ -77,7 +77,7 @@ const UserProfile = () => {
...
@@ -77,7 +77,7 @@ const UserProfile = () => {
}
}
setIsRequesting
(
true
);
setIsRequesting
(
true
);
const
data
=
await
memoStore
.
fetchMemos
({
const
data
=
await
memoStore
.
fetchMemos
({
pageSize
:
DEFAULT_
MEMO_LIMIT
,
pageSize
:
DEFAULT_
LIST_MEMOS_PAGE_SIZE
,
filter
:
filters
.
join
(
" && "
),
filter
:
filters
.
join
(
" && "
),
pageToken
:
nextPageTokenRef
.
current
,
pageToken
:
nextPageTokenRef
.
current
,
});
});
...
...
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