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
06a79a2e
Unverified
Commit
06a79a2e
authored
Apr 20, 2024
by
刘明野
Committed by
GitHub
Apr 20, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: tag dependencies (#3251)
fix: 修改tag名称后重新请求数据
parent
330cc3dc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
TagsSection.tsx
web/src/components/HomeSidebar/TagsSection.tsx
+2
-9
RenameTagDialog.tsx
web/src/components/RenameTagDialog.tsx
+3
-0
No files found.
web/src/components/HomeSidebar/TagsSection.tsx
View file @
06a79a2e
...
@@ -56,14 +56,7 @@ const TagsSection = () => {
...
@@ -56,14 +56,7 @@ const TagsSection = () => {
tagText
+=
"/"
+
key
;
tagText
+=
"/"
+
key
;
}
}
let
obj
=
null
;
let
obj
=
tempObj
.
subTags
.
find
((
t
:
Tag
)
=>
t
.
text
===
tagText
);
for
(
const
t
of
tempObj
.
subTags
)
{
if
(
t
.
text
===
tagText
)
{
obj
=
t
;
break
;
}
}
if
(
!
obj
)
{
if
(
!
obj
)
{
obj
=
{
obj
=
{
...
@@ -79,7 +72,7 @@ const TagsSection = () => {
...
@@ -79,7 +72,7 @@ const TagsSection = () => {
}
}
setTags
(
root
.
subTags
as
Tag
[]);
setTags
(
root
.
subTags
as
Tag
[]);
},
[
tagsText
]);
},
[
tagsText
.
join
(
","
)
]);
return
(
return
(
<
div
className=
"flex flex-col justify-start items-start w-full mt-3 px-1 h-auto shrink-0 flex-nowrap hide-scrollbar"
>
<
div
className=
"flex flex-col justify-start items-start w-full mt-3 px-1 h-auto shrink-0 flex-nowrap hide-scrollbar"
>
...
...
web/src/components/RenameTagDialog.tsx
View file @
06a79a2e
...
@@ -5,6 +5,7 @@ import { tagServiceClient } from "@/grpcweb";
...
@@ -5,6 +5,7 @@ import { tagServiceClient } from "@/grpcweb";
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useLoading
from
"@/hooks/useLoading"
;
import
useLoading
from
"@/hooks/useLoading"
;
import
{
useFilterStore
}
from
"@/store/module"
;
import
{
useFilterStore
}
from
"@/store/module"
;
import
{
useTagStore
}
from
"@/store/v1"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
generateDialog
}
from
"./Dialog"
;
import
{
generateDialog
}
from
"./Dialog"
;
import
Icon
from
"./Icon"
;
import
Icon
from
"./Icon"
;
...
@@ -16,6 +17,7 @@ interface Props extends DialogProps {
...
@@ -16,6 +17,7 @@ interface Props extends DialogProps {
const
RenameTagDialog
:
React
.
FC
<
Props
>
=
(
props
:
Props
)
=>
{
const
RenameTagDialog
:
React
.
FC
<
Props
>
=
(
props
:
Props
)
=>
{
const
{
tag
,
destroy
}
=
props
;
const
{
tag
,
destroy
}
=
props
;
const
t
=
useTranslate
();
const
t
=
useTranslate
();
const
tagStore
=
useTagStore
();
const
filterStore
=
useFilterStore
();
const
filterStore
=
useFilterStore
();
const
currentUser
=
useCurrentUser
();
const
currentUser
=
useCurrentUser
();
const
[
newName
,
setNewName
]
=
useState
(
tag
);
const
[
newName
,
setNewName
]
=
useState
(
tag
);
...
@@ -43,6 +45,7 @@ const RenameTagDialog: React.FC<Props> = (props: Props) => {
...
@@ -43,6 +45,7 @@ const RenameTagDialog: React.FC<Props> = (props: Props) => {
});
});
toast
.
success
(
"Rename tag successfully"
);
toast
.
success
(
"Rename tag successfully"
);
filterStore
.
setTagFilter
(
newName
);
filterStore
.
setTagFilter
(
newName
);
tagStore
.
fetchTags
({
skipCache
:
true
});
}
catch
(
error
:
any
)
{
}
catch
(
error
:
any
)
{
console
.
error
(
error
);
console
.
error
(
error
);
toast
.
error
(
error
.
details
);
toast
.
error
(
error
.
details
);
...
...
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