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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
5b3fb0d4
Commit
5b3fb0d4
authored
May 10, 2017
by
Filipa Lacerda
Committed by
Phil Hughes
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use vue file for table pagination component
parent
f222d81c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
31 deletions
+34
-31
app/assets/javascripts/environments/components/environment.vue
...ssets/javascripts/environments/components/environment.vue
+4
-4
app/assets/javascripts/environments/folder/environments_folder_view.vue
...ascripts/environments/folder/environments_folder_view.vue
+4
-4
app/assets/javascripts/pipelines/pipelines.js
app/assets/javascripts/pipelines/pipelines.js
+5
-4
app/assets/javascripts/vue_shared/components/table_pagination.vue
...ts/javascripts/vue_shared/components/table_pagination.vue
+20
-18
spec/javascripts/vue_shared/components/table_pagination_spec.js
...avascripts/vue_shared/components/table_pagination_spec.js
+1
-1
No files found.
app/assets/javascripts/environments/components/environment.vue
View file @
5b3fb0d4
<
script
>
<
script
>
/* global Flash */
/* global Flash */
import
EnvironmentsService
from
'
../services/environments_service
'
;
import
EnvironmentsService
from
'
../services/environments_service
'
;
import
E
nvironmentTable
from
'
./environments_table.vue
'
;
import
e
nvironmentTable
from
'
./environments_table.vue
'
;
import
EnvironmentsStore
from
'
../stores/environments_store
'
;
import
EnvironmentsStore
from
'
../stores/environments_store
'
;
import
TablePaginationComponent
from
'
../../vue_shared/components/table_pagination
'
;
import
tablePagination
from
'
../../vue_shared/components/table_pagination.vue
'
;
import
'
../../lib/utils/common_utils
'
;
import
'
../../lib/utils/common_utils
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
export
default
{
components
:
{
components
:
{
'
environment-table
'
:
E
nvironmentTable
,
e
nvironmentTable
,
'
table-pagination
'
:
TablePaginationComponent
,
tablePagination
,
},
},
data
()
{
data
()
{
...
...
app/assets/javascripts/environments/folder/environments_folder_view.vue
View file @
5b3fb0d4
<
script
>
<
script
>
/* global Flash */
/* global Flash */
import
EnvironmentsService
from
'
../services/environments_service
'
;
import
EnvironmentsService
from
'
../services/environments_service
'
;
import
E
nvironmentTable
from
'
../components/environments_table.vue
'
;
import
e
nvironmentTable
from
'
../components/environments_table.vue
'
;
import
EnvironmentsStore
from
'
../stores/environments_store
'
;
import
EnvironmentsStore
from
'
../stores/environments_store
'
;
import
TablePaginationComponent
from
'
../../vue_shared/components/table_pagination
'
;
import
tablePagination
from
'
../../vue_shared/components/table_pagination.vue
'
;
import
'
../../lib/utils/common_utils
'
;
import
'
../../lib/utils/common_utils
'
;
import
'
../../vue_shared/vue_resource_interceptor
'
;
import
'
../../vue_shared/vue_resource_interceptor
'
;
export
default
{
export
default
{
components
:
{
components
:
{
'
environment-table
'
:
E
nvironmentTable
,
e
nvironmentTable
,
'
table-pagination
'
:
TablePaginationComponent
,
tablePagination
,
},
},
data
()
{
data
()
{
...
...
app/assets/javascripts/pipelines/pipelines.js
View file @
5b3fb0d4
...
@@ -2,7 +2,7 @@ import Visibility from 'visibilityjs';
...
@@ -2,7 +2,7 @@ import Visibility from 'visibilityjs';
import
PipelinesService
from
'
./services/pipelines_service
'
;
import
PipelinesService
from
'
./services/pipelines_service
'
;
import
eventHub
from
'
./event_hub
'
;
import
eventHub
from
'
./event_hub
'
;
import
PipelinesTableComponent
from
'
../vue_shared/components/pipelines_table
'
;
import
PipelinesTableComponent
from
'
../vue_shared/components/pipelines_table
'
;
import
TablePaginationComponent
from
'
../vue_shared/components/table_pagination
'
;
import
tablePagination
from
'
../vue_shared/components/table_pagination.vue
'
;
import
EmptyState
from
'
./components/empty_state.vue
'
;
import
EmptyState
from
'
./components/empty_state.vue
'
;
import
ErrorState
from
'
./components/error_state.vue
'
;
import
ErrorState
from
'
./components/error_state.vue
'
;
import
NavigationTabs
from
'
./components/navigation_tabs
'
;
import
NavigationTabs
from
'
./components/navigation_tabs
'
;
...
@@ -18,7 +18,7 @@ export default {
...
@@ -18,7 +18,7 @@ export default {
},
},
components
:
{
components
:
{
'
gl-pagination
'
:
TablePaginationComponent
,
tablePagination
,
'
pipelines-table-component
'
:
PipelinesTableComponent
,
'
pipelines-table-component
'
:
PipelinesTableComponent
,
'
empty-state
'
:
EmptyState
,
'
empty-state
'
:
EmptyState
,
'
error-state
'
:
ErrorState
,
'
error-state
'
:
ErrorState
,
...
@@ -275,12 +275,13 @@ export default {
...
@@ -275,12 +275,13 @@ export default {
/>
/>
</div>
</div>
<
gl
-pagination
<
table
-pagination
v-if="shouldRenderPagination"
v-if="shouldRenderPagination"
:pagenum="pagenum"
:pagenum="pagenum"
:change="change"
:change="change"
:count="state.count.all"
:count="state.count.all"
:pageInfo="state.pageInfo"/>
:pageInfo="state.pageInfo"
/>
</div>
</div>
</div>
</div>
`
,
`
,
...
...
app/assets/javascripts/vue_shared/components/table_pagination.
js
→
app/assets/javascripts/vue_shared/components/table_pagination.
vue
View file @
5b3fb0d4
<
script
>
const
PAGINATION_UI_BUTTON_LIMIT
=
4
;
const
PAGINATION_UI_BUTTON_LIMIT
=
4
;
const
UI_LIMIT
=
6
;
const
UI_LIMIT
=
6
;
const
SPREAD
=
'
...
'
;
const
SPREAD
=
'
...
'
;
...
@@ -114,22 +115,23 @@ export default {
...
@@ -114,22 +115,23 @@ export default {
return
items
;
return
items
;
},
},
},
},
template
:
`
<div class="gl-pagination">
<ul class="pagination clearfix">
<li v-for='item in getItems'
:class='{
page: item.page,
prev: item.prev,
next: item.next,
separator: item.separator,
active: item.active,
disabled: item.disabled
}'
>
<a @click="changePage($event)">{{item.title}}</a>
</li>
</ul>
</div>
`
,
};
};
</
script
>
<
template
>
<div
class=
"gl-pagination"
>
<ul
class=
"pagination clearfix"
>
<li
v-for=
"item in getItems"
:class=
"
{
page: item.page,
prev: item.prev,
next: item.next,
separator: item.separator,
active: item.active,
disabled: item.disabled
}">
<a
@
click=
"changePage($event)"
>
{{
item
.
title
}}
</a>
</li>
</ul>
</div>
</
template
>
spec/javascripts/vue_shared/components/table_pagination_spec.js
View file @
5b3fb0d4
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
paginationComp
from
'
~/vue_shared/components/table_pagination
'
;
import
paginationComp
from
'
~/vue_shared/components/table_pagination
.vue
'
;
import
'
~/lib/utils/common_utils
'
;
import
'
~/lib/utils/common_utils
'
;
describe
(
'
Pagination component
'
,
()
=>
{
describe
(
'
Pagination component
'
,
()
=>
{
...
...
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