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
786133d3
Commit
786133d3
authored
Jul 19, 2019
by
Nick Kipling
Committed by
Nathan Friend
Jul 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated select all to be more explicit
parent
237f434c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
app/assets/javascripts/registry/components/table_registry.vue
...assets/javascripts/registry/components/table_registry.vue
+13
-7
spec/javascripts/registry/components/table_registry_spec.js
spec/javascripts/registry/components/table_registry_spec.js
+8
-11
No files found.
app/assets/javascripts/registry/components/table_registry.vue
View file @
786133d3
...
...
@@ -126,15 +126,21 @@ export default {
showError
(
message
)
{
createFlash
(
errorMessages
[
message
]);
},
selectAll
()
{
if
(
!
this
.
selectAllChecked
)
{
this
.
itemsToBeDeleted
=
this
.
repo
.
list
.
map
((
x
,
idx
)
=>
idx
);
this
.
selectAllChecked
=
true
;
onSelectAllChange
()
{
if
(
this
.
selectAllChecked
)
{
this
.
deselectAll
();
}
else
{
this
.
itemsToBeDeleted
=
[];
this
.
selectAllChecked
=
false
;
this
.
selectAll
();
}
},
selectAll
()
{
this
.
itemsToBeDeleted
=
this
.
repo
.
list
.
map
((
x
,
idx
)
=>
idx
);
this
.
selectAllChecked
=
true
;
},
deselectAll
()
{
this
.
itemsToBeDeleted
=
[];
this
.
selectAllChecked
=
false
;
},
updateItemsToBeDeleted
(
idx
)
{
const
delIdx
=
this
.
itemsToBeDeleted
.
findIndex
(
x
=>
x
===
idx
);
...
...
@@ -162,7 +168,7 @@ export default {
v-if=
"repo.canDelete"
class=
"js-select-all-checkbox"
:checked=
"selectAllChecked"
@
change=
"
selectAll
"
@
change=
"
onSelectAllChange
"
/>
</th>
<th>
{{
s__
(
'
ContainerRegistry|Tag
'
)
}}
</th>
...
...
spec/javascripts/registry/components/table_registry_spec.js
View file @
786133d3
...
...
@@ -27,7 +27,8 @@ describe('table registry', () => {
});
};
const
toggleSelectAll
=
()
=>
vm
.
selectAll
();
const
selectAllCheckboxes
=
()
=>
vm
.
selectAll
();
const
deselectAllCheckboxes
=
()
=>
vm
.
deselectAll
();
beforeEach
(()
=>
{
createComponent
();
...
...
@@ -58,7 +59,7 @@ describe('table registry', () => {
describe
(
'
multi select
'
,
()
=>
{
it
(
'
should support multiselect and selecting a row should enable delete button
'
,
done
=>
{
findSelectAllCheckbox
().
click
();
toggleSelectAll
();
selectAllCheckboxes
();
expect
(
findSelectAllCheckbox
().
checked
).
toBe
(
true
);
...
...
@@ -69,8 +70,7 @@ describe('table registry', () => {
});
it
(
'
selecting all checkbox should select all rows and enable delete button
'
,
done
=>
{
findSelectAllCheckbox
().
click
();
toggleSelectAll
();
selectAllCheckboxes
();
Vue
.
nextTick
(()
=>
{
const
checkedValues
=
findAllRowCheckboxes
().
filter
(
x
=>
x
.
checked
);
...
...
@@ -81,9 +81,8 @@ describe('table registry', () => {
});
it
(
'
deselecting select all checkbox should deselect all rows and disable delete button
'
,
done
=>
{
findSelectAllCheckbox
().
click
();
toggleSelectAll
();
// Select them all on
toggleSelectAll
();
// Select them all off
selectAllCheckboxes
();
deselectAllCheckboxes
();
Vue
.
nextTick
(()
=>
{
const
checkedValues
=
findAllRowCheckboxes
().
filter
(
x
=>
x
.
checked
);
...
...
@@ -94,8 +93,7 @@ describe('table registry', () => {
});
it
(
'
should delete multiple items when multiple items are selected
'
,
done
=>
{
findSelectAllCheckbox
().
click
();
toggleSelectAll
();
selectAllCheckboxes
();
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
itemsToBeDeleted
).
toEqual
([
0
,
1
]);
...
...
@@ -177,8 +175,7 @@ describe('table registry', () => {
});
it
(
'
should show the plural title and image count when deleting more than one image
'
,
done
=>
{
findSelectAllCheckbox
().
click
();
toggleSelectAll
();
selectAllCheckboxes
();
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
modalTitle
).
toBe
(
'
Remove images
'
);
...
...
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