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
Show 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 {
...
@@ -14,9 +14,9 @@ export default {
required
:
false
,
required
:
false
,
default
:
()
=>
[],
default
:
()
=>
[],
},
},
is
Desktop
:
{
is
Mobile
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
fals
e
,
default
:
tru
e
,
required
:
false
,
required
:
false
,
},
},
},
},
...
@@ -34,7 +34,7 @@ export default {
...
@@ -34,7 +34,7 @@ export default {
return
this
.
tags
.
some
(
tag
=>
this
.
selectedItems
[
tag
.
name
]);
return
this
.
tags
.
some
(
tag
=>
this
.
selectedItems
[
tag
.
name
]);
},
},
showMultiDeleteButton
()
{
showMultiDeleteButton
()
{
return
this
.
tags
.
some
(
tag
=>
tag
.
destroy_path
)
&&
this
.
isDesktop
;
return
this
.
tags
.
some
(
tag
=>
tag
.
destroy_path
)
&&
!
this
.
isMobile
;
},
},
},
},
methods
:
{
methods
:
{
...
@@ -68,7 +68,7 @@ export default {
...
@@ -68,7 +68,7 @@ export default {
:tag=
"tag"
:tag=
"tag"
:first=
"index === 0"
:first=
"index === 0"
:selected=
"selectedItems[tag.name]"
:selected=
"selectedItems[tag.name]"
:is-
desktop=
"isDesktop
"
:is-
mobile=
"isMobile
"
@
select=
"updateSelectedItems(tag.name)"
@
select=
"updateSelectedItems(tag.name)"
@
delete=
"$emit('delete',
{ [tag.name]: true })"
@
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 {
...
@@ -40,9 +40,9 @@ export default {
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
is
Desktop
:
{
is
Mobile
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
fals
e
,
default
:
tru
e
,
required
:
false
,
required
:
false
,
},
},
selected
:
{
selected
:
{
...
@@ -69,7 +69,7 @@ export default {
...
@@ -69,7 +69,7 @@ export default {
return
this
.
tag
.
layers
?
n__
(
'
%d layer
'
,
'
%d layers
'
,
this
.
tag
.
layers
)
:
''
;
return
this
.
tag
.
layers
?
n__
(
'
%d layer
'
,
'
%d layers
'
,
this
.
tag
.
layers
)
:
''
;
},
},
mobileClasses
()
{
mobileClasses
()
{
return
this
.
is
Desktop
?
''
:
'
mw-s
'
;
return
this
.
is
Mobile
?
'
mw-s
'
:
'
'
;
},
},
shortDigest
()
{
shortDigest
()
{
// remove sha256: from the string, and show only the first 7 char
// 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 {
...
@@ -37,7 +37,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
itemsToBeDeleted
:
[],
itemsToBeDeleted
:
[],
is
Desktop
:
tru
e
,
is
Mobile
:
fals
e
,
deleteAlertType
:
null
,
deleteAlertType
:
null
,
dismissPartialCleanupWarning
:
false
,
dismissPartialCleanupWarning
:
false
,
};
};
...
@@ -110,7 +110,7 @@ export default {
...
@@ -110,7 +110,7 @@ export default {
}
}
},
},
handleResize
()
{
handleResize
()
{
this
.
is
Desktop
=
GlBreakpointInstance
.
isDesktop
()
;
this
.
is
Mobile
=
GlBreakpointInstance
.
getBreakpointSize
()
===
'
xs
'
;
},
},
},
},
};
};
...
@@ -137,7 +137,7 @@ export default {
...
@@ -137,7 +137,7 @@ export default {
<tags-loader
v-if=
"isLoading"
/>
<tags-loader
v-if=
"isLoading"
/>
<template
v-else
>
<template
v-else
>
<empty-tags-state
v-if=
"tags.length === 0"
:no-containers-image=
"config.noContainersImage"
/>
<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
>
</
template
>
<gl-pagination
<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', () => {
...
@@ -22,7 +22,7 @@ describe('tags list row', () => {
let
wrapper
;
let
wrapper
;
const
[
tag
]
=
[...
tagsListResponse
.
data
];
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
findCheckbox
=
()
=>
wrapper
.
find
(
GlFormCheckbox
);
const
findName
=
()
=>
wrapper
.
find
(
'
[data-testid="name"]
'
);
const
findName
=
()
=>
wrapper
.
find
(
'
[data-testid="name"]
'
);
...
@@ -114,7 +114,7 @@ describe('tags list row', () => {
...
@@ -114,7 +114,7 @@ describe('tags list row', () => {
});
});
it
(
'
on mobile has mw-s class
'
,
()
=>
{
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
);
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', () => {
...
@@ -14,7 +14,7 @@ describe('Tags List', () => {
const
findDeleteButton
=
()
=>
wrapper
.
find
(
GlButton
);
const
findDeleteButton
=
()
=>
wrapper
.
find
(
GlButton
);
const
findListTitle
=
()
=>
wrapper
.
find
(
'
[data-testid="list-title"]
'
);
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
,
{
wrapper
=
shallowMount
(
component
,
{
propsData
,
propsData
,
});
});
...
@@ -41,15 +41,15 @@ describe('Tags List', () => {
...
@@ -41,15 +41,15 @@ describe('Tags List', () => {
describe
(
'
delete button
'
,
()
=>
{
describe
(
'
delete button
'
,
()
=>
{
it
.
each
`
it
.
each
`
inputTags | isDesktop | isVisible
inputTags | isMobile | isVisible
${
tags
}
|
${
true
}
|
${
true
}
${
tags
}
|
${
false
}
|
${
true
}
${
tags
}
|
${
false
}
|
${
false
}
${
tags
}
|
${
true
}
|
${
false
}
${
readOnlyTags
}
|
${
true
}
|
${
false
}
${
readOnlyTags
}
|
${
false
}
|
${
false
}
${
readOnlyTags
}
|
${
false
}
|
${
false
}
${
readOnlyTags
}
|
${
true
}
|
${
false
}
`
(
`
(
'
is $isVisible that delete button exists when tags is $inputTags and is
Desktop is $isDesktop
'
,
'
is $isVisible that delete button exists when tags is $inputTags and is
Mobile is $isMobile
'
,
({
inputTags
,
is
Desktop
,
isVisible
})
=>
{
({
inputTags
,
is
Mobile
,
isVisible
})
=>
{
mountComponent
({
tags
:
inputTags
,
is
Desktop
});
mountComponent
({
tags
:
inputTags
,
is
Mobile
});
expect
(
findDeleteButton
().
exists
()).
toBe
(
isVisible
);
expect
(
findDeleteButton
().
exists
()).
toBe
(
isVisible
);
},
},
...
@@ -110,12 +110,6 @@ describe('Tags List', () => {
...
@@ -110,12 +110,6 @@ describe('Tags List', () => {
expect
(
rows
.
at
(
0
).
attributes
()).
toMatchObject
({
expect
(
rows
.
at
(
0
).
attributes
()).
toMatchObject
({
first
:
'
true
'
,
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', () => {
...
@@ -124,7 +124,7 @@ describe('Details Page', () => {
it
(
'
has the correct props bound
'
,
()
=>
{
it
(
'
has the correct props bound
'
,
()
=>
{
expect
(
findTagsList
().
props
()).
toMatchObject
({
expect
(
findTagsList
().
props
()).
toMatchObject
({
is
Desktop
:
tru
e
,
is
Mobile
:
fals
e
,
tags
:
store
.
state
.
tags
,
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