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
2fe6d606
Unverified
Commit
2fe6d606
authored
Mar 30, 2024
by
The Anh Nguyen
Committed by
GitHub
Mar 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: handle restore memo when is in archived memo detail page (#3165)
parent
c8baeb86
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
13 deletions
+26
-13
MemoActionMenu.tsx
web/src/components/MemoActionMenu.tsx
+24
-13
en.json
web/src/locales/en.json
+1
-0
vi.json
web/src/locales/vi.json
+1
-0
No files found.
web/src/components/MemoActionMenu.tsx
View file @
2fe6d606
...
...
@@ -57,24 +57,35 @@ const MemoActionMenu = (props: Props) => {
});
};
const
handle
ArchiveMemo
Click
=
async
()
=>
{
const
handle
ToggleMemoStatus
Click
=
async
()
=>
{
try
{
await
memoStore
.
updateMemo
(
{
name
:
memo
.
name
,
rowStatus
:
RowStatus
.
ARCHIVED
,
},
[
"row_status"
],
);
if
(
memo
.
rowStatus
===
RowStatus
.
ARCHIVED
)
{
await
memoStore
.
updateMemo
(
{
name
:
memo
.
name
,
rowStatus
:
RowStatus
.
ACTIVE
,
},
[
"row_status"
],
);
toast
(
t
(
"message.restored-successfully"
));
}
else
{
await
memoStore
.
updateMemo
(
{
name
:
memo
.
name
,
rowStatus
:
RowStatus
.
ARCHIVED
,
},
[
"row_status"
],
);
toast
.
success
(
t
(
"message.archived-successfully"
));
}
}
catch
(
error
:
any
)
{
console
.
error
(
error
);
toast
.
error
(
error
.
response
.
data
.
message
);
return
;
}
toast
.
success
(
"Archived successfully"
);
if
(
isInMemoDetailPage
)
{
navigateTo
(
"/archived"
);
memo
.
rowStatus
===
RowStatus
.
ARCHIVED
?
navigateTo
(
"/"
)
:
navigateTo
(
"/archived"
);
}
};
...
...
@@ -120,9 +131,9 @@ const MemoActionMenu = (props: Props) => {
{
t
(
"common.share"
)
}
</
MenuItem
>
)
}
<
MenuItem
color=
"warning"
onClick=
{
handle
ArchiveMemo
Click
}
>
<
Icon
.
Archive
className=
"w-4 h-auto"
/>
{
t
(
"common.archive"
)
}
<
MenuItem
color=
"warning"
onClick=
{
handle
ToggleMemoStatus
Click
}
>
{
memo
.
rowStatus
===
RowStatus
.
ARCHIVED
?
<
Icon
.
ArchiveRestore
className=
"w-4 h-auto"
/>
:
<
Icon
.
Archive
className=
"w-4 h-auto"
/>
}
{
memo
.
rowStatus
===
RowStatus
.
ARCHIVED
?
t
(
"common.restore"
)
:
t
(
"common.archive"
)
}
</
MenuItem
>
<
MenuItem
color=
"danger"
onClick=
{
handleDeleteMemoClick
}
>
<
Icon
.
Trash
className=
"w-4 h-auto"
/>
...
...
web/src/locales/en.json
View file @
2fe6d606
...
...
@@ -312,6 +312,7 @@
"no-data"
:
"No data found."
,
"memos-ready"
:
"all memos are ready"
,
"resource-ready"
:
"all resource are ready"
,
"archived-successfully"
:
"Archived successfully"
,
"restored-successfully"
:
"Restored successfully"
,
"memo-updated-datetime"
:
"Memo created datetime changed."
,
"invalid-created-datetime"
:
"Invalid created datetime."
,
...
...
web/src/locales/vi.json
View file @
2fe6d606
...
...
@@ -126,6 +126,7 @@
"private-only"
:
"Bản ghi chú này là riêng tư"
,
"resource-filename-updated"
:
"Tên tệp tài nguyên đã được cập nhật."
,
"resource-ready"
:
"tất cả tài nguyên đã sẵn sàng"
,
"archived-successfully"
:
"Lưu trữ thành công"
,
"restored-successfully"
:
"Khôi phục thành công"
,
"signup-failed"
:
"Đăng ký thất bại"
,
"succeed-copy-code"
:
"Mã đã được sao chép thành công."
,
...
...
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