Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Martin Giger
funkwhale
Commits
263e29df
Commit
263e29df
authored
Apr 24, 2021
by
Martin Giger
Committed by
Georg Krause
Jun 17, 2021
Browse files
Only suggest existing tag once
parent
e11f7edf
Pipeline
#14710
passed with stages
in 8 minutes and 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
changes/changelog.d/1427.bugfix
0 → 100644
View file @
263e29df
Only suggest typed tag once if it already exists
front/src/components/library/TagsSelector.vue
View file @
263e29df
...
...
@@ -52,7 +52,16 @@ export default {
...
response
,
}
if
(
currentSearch
)
{
response
.
results
=
[{
name
:
currentSearch
},
...
response
.
results
]
let
existingTag
=
response
.
results
.
find
((
result
)
=>
result
.
name
===
currentSearch
)
if
(
existingTag
)
{
if
(
response
.
results
.
indexOf
(
existingTag
)
!==
0
)
{
response
.
results
=
[
existingTag
,
...
response
.
results
]
response
.
results
.
splice
(
response
.
results
.
indexOf
(
existingTag
)
+
1
,
1
)
}
}
else
{
response
.
results
=
[{
name
:
currentSearch
},
...
response
.
results
]
}
}
return
response
}
...
...
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