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
a076d1d8
Commit
a076d1d8
authored
Jul 09, 2019
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set unique modal IDs
parent
6e106f66
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
15 deletions
+13
-15
app/assets/javascripts/registry/components/collapsible_container.vue
...javascripts/registry/components/collapsible_container.vue
+3
-7
app/assets/javascripts/registry/components/table_registry.vue
...assets/javascripts/registry/components/table_registry.vue
+3
-6
changelogs/unreleased/registry-fix-multi-delete-modal.yml
changelogs/unreleased/registry-fix-multi-delete-modal.yml
+5
-0
spec/javascripts/registry/components/collapsible_container_spec.js
...scripts/registry/components/collapsible_container_spec.js
+1
-1
spec/javascripts/registry/components/table_registry_spec.js
spec/javascripts/registry/components/table_registry_spec.js
+1
-1
No files found.
app/assets/javascripts/registry/components/collapsible_container.vue
View file @
a076d1d8
...
...
@@ -31,6 +31,7 @@ export default {
data
()
{
return
{
isOpen
:
false
,
modalId
:
`confirm-repo-deletion-modal-
${
this
.
repo
.
id
}
`
,
};
},
computed
:
{
...
...
@@ -80,7 +81,7 @@ export default {
<gl-button
v-if=
"repo.canDelete"
v-gl-tooltip
v-gl-modal=
"
'confirm-repo-deletion-modal'
"
v-gl-modal=
"
modalId
"
:title=
"s__('ContainerRegistry|Remove repository')"
:aria-label=
"s__('ContainerRegistry|Remove repository')"
class=
"js-remove-repo"
...
...
@@ -100,12 +101,7 @@ export default {
{{
s__
(
'
ContainerRegistry|No tags in Container Registry for this container image.
'
)
}}
</div>
</div>
<gl-modal
modal-id=
"confirm-repo-deletion-modal"
ok-variant=
"danger"
@
ok=
"handleDeleteRepository"
>
<gl-modal
:modal-id=
"modalId"
ok-variant=
"danger"
@
ok=
"handleDeleteRepository"
>
<template
v-slot:modal-title
>
{{
s__
(
'
ContainerRegistry|Remove repository
'
)
}}
</
template
>
<p
v-html=
"
...
...
app/assets/javascripts/registry/components/table_registry.vue
View file @
a076d1d8
...
...
@@ -32,6 +32,7 @@ export default {
data
()
{
return
{
itemToBeDeleted
:
null
,
modalId
:
`confirm-image-deletion-modal-
${
this
.
repo
.
id
}
`
,
};
},
computed
:
{
...
...
@@ -114,7 +115,7 @@ export default {
<gl-button
v-if=
"item.canDelete"
v-gl-tooltip
v-gl-modal=
"
'confirm-image-deletion-modal'
"
v-gl-modal=
"
modalId
"
:title=
"s__('ContainerRegistry|Remove image')"
:aria-label=
"s__('ContainerRegistry|Remove image')"
variant=
"danger"
...
...
@@ -134,11 +135,7 @@ export default {
:page-info=
"repo.pagination"
/>
<gl-modal
modal-id=
"confirm-image-deletion-modal"
ok-variant=
"danger"
@
ok=
"handleDeleteRegistry"
>
<gl-modal
:modal-id=
"modalId"
ok-variant=
"danger"
@
ok=
"handleDeleteRegistry"
>
<
template
v-slot:modal-title
>
{{
s__
(
'
ContainerRegistry|Remove image
'
)
}}
</
template
>
<
template
v-slot:modal-ok
>
{{
s__
(
'
ContainerRegistry|Remove image and tags
'
)
}}
</
template
>
<p
...
...
changelogs/unreleased/registry-fix-multi-delete-modal.yml
0 → 100644
View file @
a076d1d8
---
title
:
Prevent multiple confirmation modals from opening when deleting a repository
merge_request
:
30532
author
:
type
:
fixed
spec/javascripts/registry/components/collapsible_container_spec.js
View file @
a076d1d8
...
...
@@ -77,7 +77,7 @@ describe('collapsible registry container', () => {
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
Vue
.
nextTick
(()
=>
{
document
.
querySelector
(
'
#confirm-repo-deletion-modal .btn-danger
'
).
click
();
document
.
querySelector
(
`#
${
vm
.
modalId
}
.btn-danger`
).
click
();
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
vm
.
repo
);
done
();
...
...
spec/javascripts/registry/components/table_registry_spec.js
View file @
a076d1d8
...
...
@@ -51,7 +51,7 @@ describe('table registry', () => {
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
Vue
.
nextTick
(()
=>
{
document
.
querySelector
(
'
#confirm-image-deletion-modal .btn-danger
'
).
click
();
document
.
querySelector
(
`#
${
vm
.
modalId
}
.btn-danger`
).
click
();
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
firstImage
);
expect
(
vm
.
itemToBeDeleted
).
toBeNull
();
...
...
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