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
df56c7e2
Commit
df56c7e2
authored
Jul 09, 2020
by
Nicolò Maria Mezzopera
Committed by
Phil Hughes
Jul 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide delete button when no tag can be deleted
- update source - update tests
parent
2118ea43
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
13 deletions
+23
-13
app/assets/javascripts/registry/explorer/components/details_page/tags_list.vue
...s/registry/explorer/components/details_page/tags_list.vue
+4
-1
app/assets/javascripts/registry/explorer/constants/details.js
...assets/javascripts/registry/explorer/constants/details.js
+1
-1
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/registry/explorer/components/details_page/tags_list_spec.js
...gistry/explorer/components/details_page/tags_list_spec.js
+15
-11
No files found.
app/assets/javascripts/registry/explorer/components/details_page/tags_list.vue
View file @
df56c7e2
...
...
@@ -33,6 +33,9 @@ export default {
hasSelectedItems
()
{
return
this
.
tags
.
some
(
tag
=>
this
.
selectedItems
[
tag
.
name
]);
},
showMultiDeleteButton
()
{
return
this
.
tags
.
some
(
tag
=>
tag
.
destroy_path
)
&&
this
.
isDesktop
;
},
},
methods
:
{
updateSelectedItems
(
name
)
{
...
...
@@ -50,7 +53,7 @@ export default {
</h5>
<gl-button
v-if=
"
isDesktop
"
v-if=
"
showMultiDeleteButton
"
:disabled=
"!hasSelectedItems"
category=
"secondary"
variant=
"danger"
...
...
app/assets/javascripts/registry/explorer/constants/details.js
View file @
df56c7e2
...
...
@@ -45,7 +45,7 @@ export const ADMIN_GARBAGE_COLLECTION_TIP = s__(
);
export
const
REMOVE_TAG_BUTTON_DISABLE_TOOLTIP
=
s__
(
'
ContainerRegistry|
Missing or insufficient permission, delete button disabled
'
,
'
ContainerRegistry|
Deletion disabled due to missing or insufficient permissions.
'
,
);
// Parameters
...
...
locale/gitlab.pot
View file @
df56c7e2
...
...
@@ -6276,6 +6276,9 @@ msgstr ""
msgid "ContainerRegistry|Delete selected"
msgstr ""
msgid "ContainerRegistry|Deletion disabled due to missing or insufficient permissions."
msgstr ""
msgid "ContainerRegistry|Digest: %{imageId}"
msgstr ""
...
...
spec/frontend/registry/explorer/components/details_page/tags_list_spec.js
View file @
df56c7e2
...
...
@@ -8,6 +8,7 @@ import { tagsListResponse } from '../../mock_data';
describe
(
'
Tags List
'
,
()
=>
{
let
wrapper
;
const
tags
=
[...
tagsListResponse
.
data
];
const
readOnlyTags
=
tags
.
map
(
t
=>
({
...
t
,
destroy_path
:
undefined
}));
const
findTagsListRow
=
()
=>
wrapper
.
findAll
(
TagsListRow
);
const
findDeleteButton
=
()
=>
wrapper
.
find
(
GlButton
);
...
...
@@ -39,17 +40,20 @@ describe('Tags List', () => {
});
describe
(
'
delete button
'
,
()
=>
{
it
(
'
is not shown on mobile view
'
,
()
=>
{
mountComponent
({
tags
,
isDesktop
:
false
});
expect
(
findDeleteButton
().
exists
()).
toBe
(
false
);
});
it
(
'
is shown on desktop view
'
,
()
=>
{
mountComponent
();
expect
(
findDeleteButton
().
exists
()).
toBe
(
true
);
});
it
.
each
`
inputTags | isDesktop | isVisible
${
tags
}
|
${
true
}
|
${
true
}
${
tags
}
|
${
false
}
|
${
false
}
${
readOnlyTags
}
|
${
true
}
|
${
false
}
${
readOnlyTags
}
|
${
false
}
|
${
false
}
`
(
'
is $isVisible that delete button exists when tags is $inputTags and isDesktop is $isDesktop
'
,
({
inputTags
,
isDesktop
,
isVisible
})
=>
{
mountComponent
({
tags
:
inputTags
,
isDesktop
});
expect
(
findDeleteButton
().
exists
()).
toBe
(
isVisible
);
},
);
it
(
'
has the correct text
'
,
()
=>
{
mountComponent
();
...
...
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