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
fd948a1d
Commit
fd948a1d
authored
Nov 06, 2020
by
Nicolò Maria Mezzopera
Committed by
Nathan Friend
Nov 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor isDesktop to isMobile for more control
- tag list - tag list row - tests
parent
6c28d848
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
28 deletions
+27
-28
app/assets/javascripts/registry/explorer/components/details_page/tags_list.vue
...s/registry/explorer/components/details_page/tags_list.vue
+4
-4
app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue
...gistry/explorer/components/details_page/tags_list_row.vue
+3
-3
app/assets/javascripts/registry/explorer/pages/details.vue
app/assets/javascripts/registry/explorer/pages/details.vue
+3
-3
changelogs/unreleased/251136-delete-selected-button-in-container-registry-is-not-visible-on-nar.yml
...ed-button-in-container-registry-is-not-visible-on-nar.yml
+5
-0
spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js
...ry/explorer/components/details_page/tags_list_row_spec.js
+2
-2
spec/frontend/registry/explorer/components/details_page/tags_list_spec.js
...gistry/explorer/components/details_page/tags_list_spec.js
+9
-15
spec/frontend/registry/explorer/pages/details_spec.js
spec/frontend/registry/explorer/pages/details_spec.js
+1
-1
No files found.
app/assets/javascripts/registry/explorer/components/details_page/tags_list.vue
View file @
fd948a1d
...
...
@@ -14,9 +14,9 @@ export default {
required
:
false
,
default
:
()
=>
[],
},
is
Desktop
:
{
is
Mobile
:
{
type
:
Boolean
,
default
:
fals
e
,
default
:
tru
e
,
required
:
false
,
},
},
...
...
@@ -34,7 +34,7 @@ export default {
return
this
.
tags
.
some
(
tag
=>
this
.
selectedItems
[
tag
.
name
]);
},
showMultiDeleteButton
()
{
return
this
.
tags
.
some
(
tag
=>
tag
.
destroy_path
)
&&
this
.
isDesktop
;
return
this
.
tags
.
some
(
tag
=>
tag
.
destroy_path
)
&&
!
this
.
isMobile
;
},
},
methods
:
{
...
...
@@ -68,7 +68,7 @@ export default {
:tag=
"tag"
:first=
"index === 0"
:selected=
"selectedItems[tag.name]"
:is-
desktop=
"isDesktop
"
:is-
mobile=
"isMobile
"
@
select=
"updateSelectedItems(tag.name)"
@
delete=
"$emit('delete',
{ [tag.name]: true })"
/>
...
...
app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue
View file @
fd948a1d
...
...
@@ -40,9 +40,9 @@ export default {
type
:
Object
,
required
:
true
,
},
is
Desktop
:
{
is
Mobile
:
{
type
:
Boolean
,
default
:
fals
e
,
default
:
tru
e
,
required
:
false
,
},
selected
:
{
...
...
@@ -69,7 +69,7 @@ export default {
return
this
.
tag
.
layers
?
n__
(
'
%d layer
'
,
'
%d layers
'
,
this
.
tag
.
layers
)
:
''
;
},
mobileClasses
()
{
return
this
.
is
Desktop
?
''
:
'
mw-s
'
;
return
this
.
is
Mobile
?
'
mw-s
'
:
'
'
;
},
shortDigest
()
{
// remove sha256: from the string, and show only the first 7 char
...
...
app/assets/javascripts/registry/explorer/pages/details.vue
View file @
fd948a1d
...
...
@@ -37,7 +37,7 @@ export default {
data
()
{
return
{
itemsToBeDeleted
:
[],
is
Desktop
:
tru
e
,
is
Mobile
:
fals
e
,
deleteAlertType
:
null
,
dismissPartialCleanupWarning
:
false
,
};
...
...
@@ -110,7 +110,7 @@ export default {
}
},
handleResize
()
{
this
.
is
Desktop
=
GlBreakpointInstance
.
isDesktop
()
;
this
.
is
Mobile
=
GlBreakpointInstance
.
getBreakpointSize
()
===
'
xs
'
;
},
},
};
...
...
@@ -137,7 +137,7 @@ export default {
<tags-loader
v-if=
"isLoading"
/>
<template
v-else
>
<empty-tags-state
v-if=
"tags.length === 0"
:no-containers-image=
"config.noContainersImage"
/>
<tags-list
v-else
:tags=
"tags"
:is-
desktop=
"isDesktop
"
@
delete=
"deleteTags"
/>
<tags-list
v-else
:tags=
"tags"
:is-
mobile=
"isMobile
"
@
delete=
"deleteTags"
/>
</
template
>
<gl-pagination
...
...
changelogs/unreleased/251136-delete-selected-button-in-container-registry-is-not-visible-on-nar.yml
0 → 100644
View file @
fd948a1d
---
title
:
'
container
registry:
show
delete
selected
button
on
medium
viewports'
merge_request
:
46699
author
:
type
:
fixed
spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js
View file @
fd948a1d
...
...
@@ -22,7 +22,7 @@ describe('tags list row', () => {
let
wrapper
;
const
[
tag
]
=
[...
tagsListResponse
.
data
];
const
defaultProps
=
{
tag
,
is
Desktop
:
tru
e
,
index
:
0
};
const
defaultProps
=
{
tag
,
is
Mobile
:
fals
e
,
index
:
0
};
const
findCheckbox
=
()
=>
wrapper
.
find
(
GlFormCheckbox
);
const
findName
=
()
=>
wrapper
.
find
(
'
[data-testid="name"]
'
);
...
...
@@ -114,7 +114,7 @@ describe('tags list row', () => {
});
it
(
'
on mobile has mw-s class
'
,
()
=>
{
mountComponent
({
...
defaultProps
,
is
Desktop
:
fals
e
});
mountComponent
({
...
defaultProps
,
is
Mobile
:
tru
e
});
expect
(
findName
().
classes
(
'
mw-s
'
)).
toBe
(
true
);
});
...
...
spec/frontend/registry/explorer/components/details_page/tags_list_spec.js
View file @
fd948a1d
...
...
@@ -14,7 +14,7 @@ describe('Tags List', () => {
const
findDeleteButton
=
()
=>
wrapper
.
find
(
GlButton
);
const
findListTitle
=
()
=>
wrapper
.
find
(
'
[data-testid="list-title"]
'
);
const
mountComponent
=
(
propsData
=
{
tags
,
is
Desktop
:
tru
e
})
=>
{
const
mountComponent
=
(
propsData
=
{
tags
,
is
Mobile
:
fals
e
})
=>
{
wrapper
=
shallowMount
(
component
,
{
propsData
,
});
...
...
@@ -41,15 +41,15 @@ describe('Tags List', () => {
describe
(
'
delete button
'
,
()
=>
{
it
.
each
`
inputTags | is
Desktop
| isVisible
${
tags
}
|
${
true
}
|
${
true
}
${
tags
}
|
${
fals
e
}
|
${
false
}
${
readOnlyTags
}
|
${
true
}
|
${
false
}
${
readOnlyTags
}
|
${
fals
e
}
|
${
false
}
inputTags | is
Mobile
| isVisible
${
tags
}
|
${
false
}
|
${
true
}
${
tags
}
|
${
tru
e
}
|
${
false
}
${
readOnlyTags
}
|
${
false
}
|
${
false
}
${
readOnlyTags
}
|
${
tru
e
}
|
${
false
}
`
(
'
is $isVisible that delete button exists when tags is $inputTags and is
Desktop is $isDesktop
'
,
({
inputTags
,
is
Desktop
,
isVisible
})
=>
{
mountComponent
({
tags
:
inputTags
,
is
Desktop
});
'
is $isVisible that delete button exists when tags is $inputTags and is
Mobile is $isMobile
'
,
({
inputTags
,
is
Mobile
,
isVisible
})
=>
{
mountComponent
({
tags
:
inputTags
,
is
Mobile
});
expect
(
findDeleteButton
().
exists
()).
toBe
(
isVisible
);
},
...
...
@@ -110,12 +110,6 @@ describe('Tags List', () => {
expect
(
rows
.
at
(
0
).
attributes
()).
toMatchObject
({
first
:
'
true
'
,
isdesktop
:
'
true
'
,
});
// The list has only two tags and for some reasons .at(-1) does not work
expect
(
rows
.
at
(
1
).
attributes
()).
toMatchObject
({
isdesktop
:
'
true
'
,
});
});
...
...
spec/frontend/registry/explorer/pages/details_spec.js
View file @
fd948a1d
...
...
@@ -124,7 +124,7 @@ describe('Details Page', () => {
it
(
'
has the correct props bound
'
,
()
=>
{
expect
(
findTagsList
().
props
()).
toMatchObject
({
is
Desktop
:
tru
e
,
is
Mobile
:
fals
e
,
tags
:
store
.
state
.
tags
,
});
});
...
...
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