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
babeb468
Commit
babeb468
authored
Jun 21, 2022
by
boojack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update daily dialog style
parent
85ce7228
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
19 deletions
+15
-19
api.ts
web/src/helpers/api.ts
+7
-3
daily-memo-diary-dialog.less
web/src/less/daily-memo-diary-dialog.less
+2
-2
memoService.ts
web/src/services/memoService.ts
+5
-13
shortcutService.ts
web/src/services/shortcutService.ts
+1
-1
No files found.
web/src/helpers/api.ts
View file @
babeb468
...
@@ -48,11 +48,11 @@ export function patchUser(userPatch: UserPatch) {
...
@@ -48,11 +48,11 @@ export function patchUser(userPatch: UserPatch) {
return
axios
.
patch
<
ResponseObject
<
User
>>
(
"/api/user/me"
,
userPatch
);
return
axios
.
patch
<
ResponseObject
<
User
>>
(
"/api/user/me"
,
userPatch
);
}
}
export
function
getM
yMemos
()
{
export
function
getM
emoList
()
{
return
axios
.
get
<
ResponseObject
<
Memo
[]
>>
(
"/api/memo"
);
return
axios
.
get
<
ResponseObject
<
Memo
[]
>>
(
"/api/memo"
);
}
}
export
function
get
MyArchivedMemos
()
{
export
function
get
ArchivedMemoList
()
{
return
axios
.
get
<
ResponseObject
<
Memo
[]
>>
(
"/api/memo?rowStatus=ARCHIVED"
);
return
axios
.
get
<
ResponseObject
<
Memo
[]
>>
(
"/api/memo?rowStatus=ARCHIVED"
);
}
}
...
@@ -80,7 +80,7 @@ export function deleteMemo(memoId: MemoId) {
...
@@ -80,7 +80,7 @@ export function deleteMemo(memoId: MemoId) {
return
axios
.
delete
(
`/api/memo/
${
memoId
}
`
);
return
axios
.
delete
(
`/api/memo/
${
memoId
}
`
);
}
}
export
function
get
MyShortcuts
()
{
export
function
get
ShortcutList
()
{
return
axios
.
get
<
ResponseObject
<
Shortcut
[]
>>
(
"/api/shortcut"
);
return
axios
.
get
<
ResponseObject
<
Shortcut
[]
>>
(
"/api/shortcut"
);
}
}
...
@@ -99,3 +99,7 @@ export function deleteShortcutById(shortcutId: ShortcutId) {
...
@@ -99,3 +99,7 @@ export function deleteShortcutById(shortcutId: ShortcutId) {
export
function
uploadFile
(
formData
:
FormData
)
{
export
function
uploadFile
(
formData
:
FormData
)
{
return
axios
.
post
<
ResponseObject
<
Resource
>>
(
"/api/resource"
,
formData
);
return
axios
.
post
<
ResponseObject
<
Resource
>>
(
"/api/resource"
,
formData
);
}
}
export
function
getTagList
()
{
return
axios
.
get
<
ResponseObject
<
string
[]
>>
(
"/api/tag"
);
}
web/src/less/daily-memo-diary-dialog.less
View file @
babeb468
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
@apply p-0 sm:py-16;
@apply p-0 sm:py-16;
> .dialog-container {
> .dialog-container {
@apply w-112 max-w-full p-0 rounded-none sm:rounded-lg;
@apply w-112 max-w-full
grow sm:grow-0 bg-white
p-0 rounded-none sm:rounded-lg;
> .dialog-header-container {
> .dialog-header-container {
@apply flex flex-row justify-between items-center w-full p-6 pb-0 mb-0;
@apply flex flex-row justify-between items-center w-full p-6 pb-0 mb-0;
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
}
}
> .tip-container {
> .tip-container {
@apply m-auto py-
4
px-0;
@apply m-auto py-
6 pb-12
px-0;
> .tip-text {
> .tip-text {
font-style: italic;
font-style: italic;
...
...
web/src/services/memoService.ts
View file @
babeb468
import
*
as
api
from
"../helpers/api"
;
import
*
as
api
from
"../helpers/api"
;
import
{
TAG_REG
}
from
"../helpers/consts"
;
import
{
createMemo
,
patchMemo
,
setMemos
,
setTags
}
from
"../store/modules/memo"
;
import
{
createMemo
,
patchMemo
,
setMemos
,
setTags
}
from
"../store/modules/memo"
;
import
store
from
"../store"
;
import
store
from
"../store"
;
...
@@ -17,7 +16,7 @@ const memoService = {
...
@@ -17,7 +16,7 @@ const memoService = {
},
},
fetchAllMemos
:
async
()
=>
{
fetchAllMemos
:
async
()
=>
{
const
{
data
}
=
(
await
api
.
getM
yMemos
()).
data
;
const
{
data
}
=
(
await
api
.
getM
emoList
()).
data
;
const
memos
=
data
.
filter
((
m
)
=>
m
.
rowStatus
!==
"ARCHIVED"
).
map
((
m
)
=>
convertResponseModelMemo
(
m
));
const
memos
=
data
.
filter
((
m
)
=>
m
.
rowStatus
!==
"ARCHIVED"
).
map
((
m
)
=>
convertResponseModelMemo
(
m
));
store
.
dispatch
(
setMemos
(
memos
));
store
.
dispatch
(
setMemos
(
memos
));
...
@@ -25,7 +24,7 @@ const memoService = {
...
@@ -25,7 +24,7 @@ const memoService = {
},
},
fetchDeletedMemos
:
async
()
=>
{
fetchDeletedMemos
:
async
()
=>
{
const
{
data
}
=
(
await
api
.
get
MyArchivedMemos
()).
data
;
const
{
data
}
=
(
await
api
.
get
ArchivedMemoList
()).
data
;
const
deletedMemos
=
data
.
map
((
m
)
=>
{
const
deletedMemos
=
data
.
map
((
m
)
=>
{
return
convertResponseModelMemo
(
m
);
return
convertResponseModelMemo
(
m
);
});
});
...
@@ -42,16 +41,9 @@ const memoService = {
...
@@ -42,16 +41,9 @@ const memoService = {
return
null
;
return
null
;
},
},
updateTagsState
:
()
=>
{
updateTagsState
:
async
()
=>
{
const
{
memos
}
=
memoService
.
getState
();
const
{
data
}
=
(
await
api
.
getTagList
()).
data
;
const
tagsSet
=
new
Set
<
string
>
();
store
.
dispatch
(
setTags
(
data
));
for
(
const
m
of
memos
)
{
for
(
const
t
of
Array
.
from
(
m
.
content
.
match
(
TAG_REG
)
??
[]))
{
tagsSet
.
add
(
t
.
replace
(
TAG_REG
,
"$1"
).
trim
());
}
}
store
.
dispatch
(
setTags
(
Array
.
from
(
tagsSet
).
filter
((
t
)
=>
Boolean
(
t
))));
},
},
getLinkedMemos
:
async
(
memoId
:
MemoId
):
Promise
<
Memo
[]
>
=>
{
getLinkedMemos
:
async
(
memoId
:
MemoId
):
Promise
<
Memo
[]
>
=>
{
...
...
web/src/services/shortcutService.ts
View file @
babeb468
...
@@ -16,7 +16,7 @@ const shortcutService = {
...
@@ -16,7 +16,7 @@ const shortcutService = {
},
},
getMyAllShortcuts
:
async
()
=>
{
getMyAllShortcuts
:
async
()
=>
{
const
{
data
}
=
(
await
api
.
get
MyShortcuts
()).
data
;
const
{
data
}
=
(
await
api
.
get
ShortcutList
()).
data
;
const
shortcuts
=
data
.
map
((
s
)
=>
convertResponseModelShortcut
(
s
));
const
shortcuts
=
data
.
map
((
s
)
=>
convertResponseModelShortcut
(
s
));
store
.
dispatch
(
setShortcuts
(
shortcuts
));
store
.
dispatch
(
setShortcuts
(
shortcuts
));
},
},
...
...
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