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
1d83c68c
Commit
1d83c68c
authored
Mar 21, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update type definitions
parent
861a1e4c
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
14 additions
and
71 deletions
+14
-71
CreateResourceDialog.tsx
web/src/components/CreateResourceDialog.tsx
+8
-6
TagList.tsx
web/src/components/TagList.tsx
+4
-0
storage.ts
web/src/helpers/storage.ts
+0
-2
filter.ts
web/src/store/module/filter.ts
+1
-0
filter.ts
web/src/store/reducer/filter.ts
+1
-0
common.d.ts
web/src/types/common.d.ts
+0
-8
common.d.ts
web/src/types/modules/common.d.ts
+0
-3
resource.d.ts
web/src/types/modules/resource.d.ts
+0
-5
setting.d.ts
web/src/types/modules/setting.d.ts
+0
-42
user.d.ts
web/src/types/modules/user.d.ts
+0
-5
No files found.
web/src/components/CreateResourceDialog.tsx
View file @
1d83c68c
import
{
Autocomplete
,
Button
,
IconButton
,
Input
,
List
,
ListItem
,
Option
,
Select
,
Typography
}
from
"@mui/joy"
;
import
{
Autocomplete
,
Button
,
IconButton
,
Input
,
List
,
ListItem
,
Option
,
Select
,
Typography
}
from
"@mui/joy"
;
import
React
,
{
useRef
,
useState
}
from
"react"
;
import
React
,
{
useRef
,
useState
}
from
"react"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
Resource
}
from
"@/types/proto/api/v2/resource_service"
;
import
{
CreateResourceRequest
,
Resource
}
from
"@/types/proto/api/v2/resource_service"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useResourceStore
}
from
"../store/module"
;
import
{
useResourceStore
}
from
"../store/module"
;
import
{
generateDialog
}
from
"./Dialog"
;
import
{
generateDialog
}
from
"./Dialog"
;
...
@@ -29,11 +29,13 @@ const CreateResourceDialog: React.FC<Props> = (props: Props) => {
...
@@ -29,11 +29,13 @@ const CreateResourceDialog: React.FC<Props> = (props: Props) => {
selectedMode
:
"local-file"
,
selectedMode
:
"local-file"
,
uploadingFlag
:
false
,
uploadingFlag
:
false
,
});
});
const
[
resourceCreate
,
setResourceCreate
]
=
useState
<
ResourceCreate
>
({
const
[
resourceCreate
,
setResourceCreate
]
=
useState
<
CreateResourceRequest
>
(
CreateResourceRequest
.
fromPartial
({
filename
:
""
,
filename
:
""
,
externalLink
:
""
,
externalLink
:
""
,
type
:
""
,
type
:
""
,
});
}),
);
const
[
fileList
,
setFileList
]
=
useState
<
File
[]
>
([]);
const
[
fileList
,
setFileList
]
=
useState
<
File
[]
>
([]);
const
fileInputRef
=
useRef
<
HTMLInputElement
>
(
null
);
const
fileInputRef
=
useRef
<
HTMLInputElement
>
(
null
);
...
...
web/src/components/TagList.tsx
View file @
1d83c68c
...
@@ -9,6 +9,10 @@ import { showCommonDialog } from "./Dialog/CommonDialog";
...
@@ -9,6 +9,10 @@ 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
>
{
[
key
:
string
]:
T
;
}
interface
Tag
{
interface
Tag
{
key
:
string
;
key
:
string
;
text
:
string
;
text
:
string
;
...
...
web/src/helpers/storage.ts
View file @
1d83c68c
...
@@ -6,8 +6,6 @@ interface StorageData {
...
@@ -6,8 +6,6 @@ interface StorageData {
locale
:
Locale
;
locale
:
Locale
;
// appearance
// appearance
appearance
:
Appearance
;
appearance
:
Appearance
;
// local setting
localSetting
:
LocalSetting
;
}
}
type
StorageKey
=
keyof
StorageData
;
type
StorageKey
=
keyof
StorageData
;
...
...
web/src/store/module/filter.ts
View file @
1d83c68c
import
{
Visibility
}
from
"@/types/proto/api/v2/memo_service"
;
import
store
,
{
useAppSelector
}
from
".."
;
import
store
,
{
useAppSelector
}
from
".."
;
import
{
setFilter
}
from
"../reducer/filter"
;
import
{
setFilter
}
from
"../reducer/filter"
;
...
...
web/src/store/reducer/filter.ts
View file @
1d83c68c
import
{
createSlice
,
PayloadAction
}
from
"@reduxjs/toolkit"
;
import
{
createSlice
,
PayloadAction
}
from
"@reduxjs/toolkit"
;
import
{
Visibility
}
from
"@/types/proto/api/v2/memo_service"
;
interface
State
{
interface
State
{
tag
?:
string
;
tag
?:
string
;
...
...
web/src/types/common.d.ts
View file @
1d83c68c
type
BasicType
=
undefined
|
null
|
boolean
|
number
|
string
|
Record
<
string
,
unknown
>
|
Array
<
BasicType
>
;
type
FunctionType
=
(...
args
:
unknown
[])
=>
unknown
;
type
FunctionType
=
(...
args
:
unknown
[])
=>
unknown
;
interface
KVObject
<
T
=
any
>
{
[
key
:
string
]:
T
;
}
type
Option
<
T
>
=
T
|
undefined
;
web/src/types/modules/common.d.ts
deleted
100644 → 0
View file @
861a1e4c
type
RowStatus
=
"NORMAL"
|
"ARCHIVED"
;
type
Visibility
=
"PUBLIC"
|
"PROTECTED"
|
"PRIVATE"
;
web/src/types/modules/resource.d.ts
deleted
100644 → 0
View file @
861a1e4c
interface
ResourceCreate
{
filename
:
string
;
externalLink
:
string
;
type
:
string
;
}
web/src/types/modules/setting.d.ts
View file @
1d83c68c
type
Appearance
=
"system"
|
"light"
|
"dark"
;
type
Appearance
=
"system"
|
"light"
|
"dark"
;
interface
BasicSetting
{
locale
:
Locale
;
appearance
:
Appearance
;
}
interface
Setting
{
locale
:
Locale
;
appearance
:
Appearance
;
memoVisibility
:
Visibility
;
telegramUserId
:
string
;
}
interface
LocalSetting
{
enableDoubleClickEditing
:
boolean
;
}
interface
UserLocaleSetting
{
key
:
"locale"
;
value
:
Locale
;
}
interface
UserAppearanceSetting
{
key
:
"appearance"
;
value
:
Appearance
;
}
interface
UserMemoVisibilitySetting
{
key
:
"memo-visibility"
;
value
:
Visibility
;
}
interface
UserTelegramUserIdSetting
{
key
:
"telegram-user-id"
;
value
:
string
;
}
type
UserSetting
=
UserLocaleSetting
|
UserAppearanceSetting
|
UserMemoVisibilitySetting
|
UserTelegramUserIdSetting
;
interface
UserSettingUpsert
{
key
:
keyof
Setting
;
value
:
string
;
}
web/src/types/modules/user.d.ts
View file @
1d83c68c
...
@@ -5,15 +5,10 @@ interface User {
...
@@ -5,15 +5,10 @@ interface User {
createdTs
:
number
;
createdTs
:
number
;
updatedTs
:
number
;
updatedTs
:
number
;
rowStatus
:
RowStatus
;
username
:
string
;
username
:
string
;
role
:
UserRole
;
role
:
UserRole
;
email
:
string
;
email
:
string
;
nickname
:
string
;
nickname
:
string
;
avatarUrl
:
string
;
avatarUrl
:
string
;
userSettingList
:
UserSetting
[];
setting
:
Setting
;
localSetting
:
LocalSetting
;
}
}
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