Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
54157b19
Commit
54157b19
authored
May 21, 2019
by
Martin Hanzel
Committed by
Kushal Pandya
May 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #11625 - Can't delete related issues if it has more than 3 links
parent
4f4c9b01
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
2 deletions
+49
-2
ee/app/assets/javascripts/related_issues/components/add_issuable_form.vue
...vascripts/related_issues/components/add_issuable_form.vue
+1
-1
ee/app/assets/javascripts/related_issues/stores/related_issues_store.js
...javascripts/related_issues/stores/related_issues_store.js
+3
-1
ee/changelogs/unreleased/61312-cant-delete-related-issues-2.yml
...ngelogs/unreleased/61312-cant-delete-related-issues-2.yml
+5
-0
ee/spec/features/issuables/related_issues_spec.rb
ee/spec/features/issuables/related_issues_spec.rb
+40
-0
No files found.
ee/app/assets/javascripts/related_issues/components/add_issuable_form.vue
View file @
54157b19
...
@@ -143,7 +143,7 @@ export default {
...
@@ -143,7 +143,7 @@ export default {
-->
-->
<li
<li
v-for=
"(reference, index) in pendingReferences"
v-for=
"(reference, index) in pendingReferences"
:key=
"`related-issues-token-$
{
index
}`"
:key=
"`related-issues-token-$
{
reference
}`"
class="js-add-issuable-form-token-list-item add-issuable-form-token-list-item"
class="js-add-issuable-form-token-list-item add-issuable-form-token-list-item"
>
>
<issue-token
<issue-token
...
...
ee/app/assets/javascripts/related_issues/stores/related_issues_store.js
View file @
54157b19
...
@@ -24,7 +24,9 @@ class RelatedIssuesStore {
...
@@ -24,7 +24,9 @@ class RelatedIssuesStore {
}
}
setPendingReferences
(
issues
)
{
setPendingReferences
(
issues
)
{
this
.
state
.
pendingReferences
=
issues
;
// Remove duplicates but retain order.
// If you don't do this, Vue will be confused by duplicates and refuse to delete them all.
this
.
state
.
pendingReferences
=
issues
.
filter
((
ref
,
idx
)
=>
issues
.
indexOf
(
ref
)
===
idx
);
}
}
removePendingRelatedIssue
(
indexToRemove
)
{
removePendingRelatedIssue
(
indexToRemove
)
{
...
...
ee/changelogs/unreleased/61312-cant-delete-related-issues-2.yml
0 → 100644
View file @
54157b19
---
title
:
Fixed a bug where removing related issues could get stuck
merge_request
:
12316
author
:
type
:
fixed
ee/spec/features/issuables/related_issues_spec.rb
View file @
54157b19
...
@@ -295,6 +295,46 @@ describe 'Related issues', :js do
...
@@ -295,6 +295,46 @@ describe 'Related issues', :js do
expect
(
items
[
0
].
text
).
to
eq
(
issue_project_b_a
.
title
)
expect
(
items
[
0
].
text
).
to
eq
(
issue_project_b_a
.
title
)
expect
(
find
(
'.js-related-issues-header-issue-count'
)).
to
have_content
(
'1'
)
expect
(
find
(
'.js-related-issues-header-issue-count'
)).
to
have_content
(
'1'
)
end
end
it
'disallows duplicate entries'
do
find
(
'.js-issue-count-badge-add-button'
).
click
find
(
'.js-add-issuable-form-input'
).
set
'duplicate duplicate duplicate'
items
=
all
(
'.js-add-issuable-form-token-list-item'
)
expect
(
items
.
count
).
to
eq
(
1
)
expect
(
items
[
0
].
text
).
to
eq
(
'duplicate'
)
# Pending issues aren't counted towards the related issue count
expect
(
find
(
'.js-related-issues-header-issue-count'
)).
to
have_content
(
'0'
)
end
it
'allows us to remove pending issues'
do
# Tests against https://gitlab.com/gitlab-org/gitlab-ee/issues/11625
find
(
'.js-issue-count-badge-add-button'
).
click
find
(
'.js-add-issuable-form-input'
).
set
'issue1 issue2 issue3 '
items
=
all
(
'.js-add-issuable-form-token-list-item'
)
expect
(
items
.
count
).
to
eq
(
3
)
expect
(
items
[
0
].
text
).
to
eq
(
'issue1'
)
expect
(
items
[
1
].
text
).
to
eq
(
'issue2'
)
expect
(
items
[
2
].
text
).
to
eq
(
'issue3'
)
# Remove pending issues left to right to make sure none get stuck
items
[
0
].
find
(
'.js-issue-token-remove-button'
).
click
items
=
all
(
'.js-add-issuable-form-token-list-item'
)
expect
(
items
.
count
).
to
eq
(
2
)
expect
(
items
[
0
].
text
).
to
eq
(
'issue2'
)
expect
(
items
[
1
].
text
).
to
eq
(
'issue3'
)
items
[
0
].
find
(
'.js-issue-token-remove-button'
).
click
items
=
all
(
'.js-add-issuable-form-token-list-item'
)
expect
(
items
.
count
).
to
eq
(
1
)
expect
(
items
[
0
].
text
).
to
eq
(
'issue3'
)
items
[
0
].
find
(
'.js-issue-token-remove-button'
).
click
items
=
all
(
'.js-add-issuable-form-token-list-item'
)
expect
(
items
.
count
).
to
eq
(
0
)
end
end
end
context
'with existing related issues'
do
context
'with existing related issues'
do
...
...
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