BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e1f5c2b1
Unverified
Commit
e1f5c2b1
authored
Dec 18, 2017
by
Mario de la Ossa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not show Vue pagination if only one page
parent
f7a9ced2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
table_pagination.vue
...ts/javascripts/vue_shared/components/table_pagination.vue
+7
-1
33609-hide-pagination.yml
changelogs/unreleased/33609-hide-pagination.yml
+5
-0
table_pagination_spec.js
...avascripts/vue_shared/components/table_pagination_spec.js
+16
-0
No files found.
app/assets/javascripts/vue_shared/components/table_pagination.vue
View file @
e1f5c2b1
...
...
@@ -122,11 +122,17 @@ export default {
return
items
;
},
showPagination
()
{
return
this
.
pageInfo
.
totalPages
>
1
;
},
},
};
</
script
>
<
template
>
<div
class=
"gl-pagination"
>
<div
v-if=
"showPagination"
class=
"gl-pagination"
>
<ul
class=
"pagination clearfix"
>
<li
v-for=
"item in getItems"
...
...
changelogs/unreleased/33609-hide-pagination.yml
0 → 100644
View file @
e1f5c2b1
---
title
:
Disable Vue pagination when only one page of content is available
merge_request
:
15999
author
:
Mario de la Ossa
type
:
fixed
spec/javascripts/vue_shared/components/table_pagination_spec.js
View file @
e1f5c2b1
...
...
@@ -19,6 +19,22 @@ describe('Pagination component', () => {
});
describe
(
'render'
,
()
=>
{
it
(
'should not render anything'
,
()
=>
{
component
=
mountComponet
({
pageInfo
:
{
nextPage
:
1
,
page
:
1
,
perPage
:
20
,
previousPage
:
null
,
total
:
15
,
totalPages
:
1
,
},
change
:
spy
,
});
expect
(
component
.
$el
.
innerHTML
).
not
.
toBeDefined
();
});
describe
(
'prev button'
,
()
=>
{
it
(
'should be disabled and non clickable'
,
()
=>
{
component
=
mountComponet
({
...
...
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