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
0a0e604b
Commit
0a0e604b
authored
Jan 14, 2020
by
Nicolò Maria Mezzopera
Committed by
Phil Hughes
Jan 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update successful delete flash copy
- new copy - interpolate with repo name - unit test - pot file
parent
088aaaa0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
8 deletions
+25
-8
app/assets/javascripts/registry/list/components/collapsible_container.vue
...cripts/registry/list/components/collapsible_container.vue
+7
-2
locale/gitlab.pot
locale/gitlab.pot
+3
-3
spec/frontend/registry/list/components/collapsible_container_spec.js
...nd/registry/list/components/collapsible_container_spec.js
+15
-3
No files found.
app/assets/javascripts/registry/list/components/collapsible_container.vue
View file @
0a0e604b
...
@@ -14,7 +14,7 @@ import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
...
@@ -14,7 +14,7 @@ import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
TableRegistry
from
'
./table_registry.vue
'
;
import
TableRegistry
from
'
./table_registry.vue
'
;
import
{
DELETE_REPO_ERROR_MESSAGE
}
from
'
../constants
'
;
import
{
DELETE_REPO_ERROR_MESSAGE
}
from
'
../constants
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
export
default
{
export
default
{
name
:
'
CollapsibeContainerRegisty
'
,
name
:
'
CollapsibeContainerRegisty
'
,
...
@@ -55,6 +55,11 @@ export default {
...
@@ -55,6 +55,11 @@ export default {
canDeleteRepo
()
{
canDeleteRepo
()
{
return
this
.
repo
.
canDelete
&&
!
this
.
isDeleteDisabled
;
return
this
.
repo
.
canDelete
&&
!
this
.
isDeleteDisabled
;
},
},
deleteImageConfirmationMessage
()
{
return
sprintf
(
__
(
'
Image %{imageName} was scheduled for deletion from the registry.
'
),
{
imageName
:
this
.
repo
.
name
,
});
},
},
},
methods
:
{
methods
:
{
...
mapActions
([
'
fetchRepos
'
,
'
fetchList
'
,
'
deleteItem
'
]),
...
mapActions
([
'
fetchRepos
'
,
'
fetchList
'
,
'
deleteItem
'
]),
...
@@ -69,7 +74,7 @@ export default {
...
@@ -69,7 +74,7 @@ export default {
this
.
track
(
'
confirm_delete
'
);
this
.
track
(
'
confirm_delete
'
);
return
this
.
deleteItem
(
this
.
repo
)
return
this
.
deleteItem
(
this
.
repo
)
.
then
(()
=>
{
.
then
(()
=>
{
createFlash
(
__
(
'
This container registry has been scheduled for deletion.
'
)
,
'
notice
'
);
createFlash
(
this
.
deleteImageConfirmationMessage
,
'
notice
'
);
this
.
fetchRepos
();
this
.
fetchRepos
();
})
})
.
catch
(()
=>
createFlash
(
DELETE_REPO_ERROR_MESSAGE
));
.
catch
(()
=>
createFlash
(
DELETE_REPO_ERROR_MESSAGE
));
...
...
locale/gitlab.pot
View file @
0a0e604b
...
@@ -9760,6 +9760,9 @@ msgstr ""
...
@@ -9760,6 +9760,9 @@ msgstr ""
msgid "Iglu registry URL (optional)"
msgid "Iglu registry URL (optional)"
msgstr ""
msgstr ""
msgid "Image %{imageName} was scheduled for deletion from the registry."
msgstr ""
msgid "ImageDiffViewer|2-up"
msgid "ImageDiffViewer|2-up"
msgstr ""
msgstr ""
...
@@ -18635,9 +18638,6 @@ msgstr ""
...
@@ -18635,9 +18638,6 @@ msgstr ""
msgid "This commit was signed with an <strong>unverified</strong> signature."
msgid "This commit was signed with an <strong>unverified</strong> signature."
msgstr ""
msgstr ""
msgid "This container registry has been scheduled for deletion."
msgstr ""
msgid "This date is after the due date, so this epic won't appear in the roadmap."
msgid "This date is after the due date, so this epic won't appear in the roadmap."
msgstr ""
msgstr ""
...
...
spec/frontend/registry/list/components/collapsible_container_spec.js
View file @
0a0e604b
...
@@ -89,19 +89,31 @@ describe('collapsible registry container', () => {
...
@@ -89,19 +89,31 @@ describe('collapsible registry container', () => {
});
});
describe
(
'
delete repo
'
,
()
=>
{
describe
(
'
delete repo
'
,
()
=>
{
beforeEach
(()
=>
{
const
deleteItem
=
jest
.
fn
().
mockResolvedValue
();
const
fetchRepos
=
jest
.
fn
().
mockResolvedValue
();
wrapper
.
setMethods
({
deleteItem
,
fetchRepos
});
});
it
(
'
should be possible to delete a repo
'
,
()
=>
{
it
(
'
should be possible to delete a repo
'
,
()
=>
{
const
deleteBtn
=
findDeleteBtn
();
const
deleteBtn
=
findDeleteBtn
();
expect
(
deleteBtn
.
exists
()).
toBe
(
true
);
expect
(
deleteBtn
.
exists
()).
toBe
(
true
);
});
});
it
(
'
should call deleteItem when confirming deletion
'
,
()
=>
{
it
(
'
should call deleteItem when confirming deletion
'
,
()
=>
{
const
deleteItem
=
jest
.
fn
().
mockResolvedValue
();
const
fetchRepos
=
jest
.
fn
().
mockResolvedValue
();
wrapper
.
setMethods
({
deleteItem
,
fetchRepos
});
wrapper
.
vm
.
handleDeleteRepository
();
wrapper
.
vm
.
handleDeleteRepository
();
expect
(
wrapper
.
vm
.
deleteItem
).
toHaveBeenCalledWith
(
wrapper
.
vm
.
repo
);
expect
(
wrapper
.
vm
.
deleteItem
).
toHaveBeenCalledWith
(
wrapper
.
vm
.
repo
);
});
});
it
(
'
should show a flash with a success notice
'
,
()
=>
wrapper
.
vm
.
handleDeleteRepository
().
then
(()
=>
{
expect
(
wrapper
.
vm
.
deleteImageConfirmationMessage
).
toContain
(
wrapper
.
vm
.
repo
.
name
);
expect
(
createFlash
).
toHaveBeenCalledWith
(
wrapper
.
vm
.
deleteImageConfirmationMessage
,
'
notice
'
,
);
}));
it
(
'
should show an error when there is API error
'
,
()
=>
{
it
(
'
should show an error when there is API error
'
,
()
=>
{
const
deleteItem
=
jest
.
fn
().
mockRejectedValue
(
'
error
'
);
const
deleteItem
=
jest
.
fn
().
mockRejectedValue
(
'
error
'
);
wrapper
.
setMethods
({
deleteItem
});
wrapper
.
setMethods
({
deleteItem
});
...
...
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