Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[37939] Pagination style is lost (#9433)

Henriette Darged34b4517d9bf
diff --git a/app/helpers/pagination_helper.rb b/app/helpers/pagination_helper.rb
index dbde874f0c4..fd54bd6b6af 100644
--- a/app/helpers/pagination_helper.rb
+++ b/app/helpers/pagination_helper.rb
@@ -36,9 +36,10 @@ module PaginationHelper
pagination_options = default_options.merge(options)
- content_tag(:div, class: 'pagination') do
- content = content_tag(:nav, pagination_entries(paginator, pagination_options),
- class: 'pagination--pages')
+ content_tag(:div, class: 'op-pagination') do
+ content = content_tag(:nav,
+ pagination_entries(paginator, pagination_options),
+ class: 'op-pagination--pages')
if pagination_options[:per_page_links]
content << pagination_option_links(paginator, pagination_options)
@@ -53,7 +54,7 @@ module PaginationHelper
pagination_options[:params]
.merge(safe_query_params(%w{filters sortBy expand})))
- content_tag(:div, option_links, class: 'pagination--options')
+ content_tag(:div, option_links, class: 'op-pagination--options')
end
##
@@ -63,12 +64,12 @@ module PaginationHelper
page_last = paginator.offset + paginator.length
total = paginator.total_entries
- content_tag(:ul, class: 'pagination--items') do
+ content_tag(:ul, class: 'op-pagination--items op-pagination--items_start') do
# will_paginate will return nil early when no pages available
content = will_paginate(paginator, options) || ''
range = "(#{page_first} - #{page_last}/#{total})"
- content << content_tag(:li, range, class: 'pagination--range', title: range)
+ content << content_tag(:li, range, class: 'op-pagination--range', title: range)
content.html_safe
end
@@ -81,8 +82,8 @@ module PaginationHelper
if links.size > 1
label = I18n.t(:label_per_page)
- content_tag(:ul, class: 'pagination--items') do
- content_tag(:li, label + ':', class: 'pagination--label', title: label) + links
+ content_tag(:ul, class: 'op-pagination--items op-pagination--items_end') do
+ content_tag(:li, label + ':', class: 'op-pagination--label', title: label) + links
end
end
end
@@ -93,10 +94,10 @@ module PaginationHelper
def per_page_links(paginator, options)
Setting.per_page_options_array.inject('') do |html, n|
if n == paginator.per_page
- html + content_tag(:li, n, class: 'pagination--item -current')
+ html + content_tag(:li, n, class: 'op-pagination--item op-pagination--item_current')
else
- link = link_to_content_update(n, options.merge(page: 1, per_page: n))
- html + content_tag(:li, link.html_safe, class: 'pagination--item')
+ link = link_to_content_update(n, options.merge(page: 1, per_page: n), { class: 'op-pagination--item-link' })
+ html + content_tag(:li, link.html_safe, class: 'op-pagination--item')
end
end.html_safe
end
@@ -169,29 +170,31 @@ module PaginationHelper
def page_number(page)
if page == current_page
- tag(:li, page, class: 'pagination--item -current')
+ tag(:li, page, class: 'op-pagination--item op-pagination--item_current')
else
- tag(:li, link(page, page), class: 'pagination--item')
+ tag(:li, link(page, page, { class: 'op-pagination--item-link' }), class: 'op-pagination--item')
end
end
def gap
- tag(:li, '&#x2026;', class: 'pagination--space')
+ tag(:li, '&#x2026;', class: 'op-pagination--space')
end
def previous_page
num = @collection.current_page > 1 && @collection.current_page - 1
- previous_or_next_page(num, I18n.t(:label_previous), '-prev')
+ previous_or_next_page(num, I18n.t(:label_previous), 'prev')
end
def next_page
num = @collection.current_page < total_pages && @collection.current_page + 1
- previous_or_next_page(num, I18n.t(:label_next), '-next')
+ previous_or_next_page(num, I18n.t(:label_next), 'next')
end
- def previous_or_next_page(page, text, classname)
+ def previous_or_next_page(page, text, class_suffix)
if page
- tag(:li, link(text, page), class: 'pagination--item ' + classname)
+ tag(:li,
+ link(text, page, { class: 'op-pagination--item-link op-pagination--item-link_' + class_suffix }),
+ class: 'op-pagination--item op-pagination--item_' + class_suffix)
else
''
end
diff --git a/frontend/src/app/features/work-packages/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts b/frontend/src/app/features/work-packages/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts
index f5f59f4d6ac..82319a10306 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts
+++ b/frontend/src/app/features/work-packages/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts
@@ -58,7 +58,7 @@ function setupMocks(paginationService:PaginationService) {
}
function pageString(element:JQuery) {
- return element.find('.pagination--range').text().trim();
+ return element.find('.op-pagination--range').text().trim();
}
describe('wpTablePagination Directive', () => {
@@ -119,7 +119,7 @@ describe('wpTablePagination Directive', () => {
app.update();
fixture.detectChanges();
- const liWithNextLink = element.find('.pagination--next-link').parent('li');
+ const liWithNextLink = element.find('.op-pagination--item-link_next').parent('li');
const attrHidden = liWithNextLink.attr('hidden');
expect(attrHidden).toBeDefined();
}));
diff --git a/frontend/src/app/shared/components/table-pagination/table-pagination.component.html b/frontend/src/app/shared/components/table-pagination/table-pagination.component.html
index 7b90296d710..487f6590b3f 100644
--- a/frontend/src/app/shared/components/table-pagination/table-pagination.component.html
+++ b/frontend/src/app/shared/components/table-pagination/table-pagination.component.html
@@ -1,14 +1,14 @@
-<div class="pagination" *ngIf="pagination && isVisible && pagination.total">
- <nav class="pagination--pages">
- <ul class="pagination--items">
+<div class="op-pagination" *ngIf="pagination && isVisible && pagination.total">
+ <nav class="op-pagination--pages">
+ <ul class="op-pagination--items op-pagination--items_start">
- <li [hidden]="pagination.page == 1 || !showPageSelections" class="pagination--item">
+ <li [hidden]="pagination.page == 1 || !showPageSelections" class="op-pagination--item">
<button
+ class="op-pagination--item-link op-pagination--item-link_prev"
type="button"
(click)="showPage(pagination.page - 1)"
rel="prev start"
[attr.aria-label]="text.label_previous"
- id="pagination--prev-link"
>
&#60;
</button>
@@ -16,23 +16,25 @@
<ng-container *ngIf="prePageNumbers.length > 0">
<li *ngFor="let pageNumber of prePageNumbers"
- class="pagination--item">
+ class="op-pagination--item">
<button
+ class="op-pagination--item-link"
type="button"
(click)="showPage(pageNumber)"
rel="next"
[textContent]="pageNumber"
></button>
</li>
- <li class="pagination--space">…</li>
+ <li class="op-pagination--space">…</li>
</ng-container>
<ng-container *ngIf="pageNumbers.length > 1">
<li *ngFor="let pageNumber of pageNumbers"
- [ngClass]="{ '-current': pageNumber == pagination.page }"
- class="pagination--item pagination-number">
+ [ngClass]="{ 'op-pagination--item_current': pageNumber == pagination.page }"
+ class="op-pagination--item">
<em *ngIf="pageNumber == pagination.page">{{ pageNumber }}</em>
<button
+ class="op-pagination--item-link"
type="button"
*ngIf="pageNumber != pagination.page"
(click)="showPage(pageNumber)"
@@ -41,12 +43,13 @@
></button>
</li>
- <li *ngIf="postPageNumbers.length" class="pagination--space">…</li>
+ <li *ngIf="postPageNumbers.length" class="op-pagination--space">…</li>
</ng-container>
<ng-container *ngIf="postPageNumbers.length">
- <li *ngFor="let pageNumber of postPageNumbers" class="pagination--item pagination-number">
+ <li *ngFor="let pageNumber of postPageNumbers" class="op-pagination--item">
<button
+ class="op-pagination--item-link"
type="button"
(click)="showPage(pageNumber)"
rel="next"
@@ -56,29 +59,28 @@
</ng-container>
<li [hidden]="!(pagination.total && pagination.page < pageNumbers[pageNumbers.length - 1])"
- class="pagination--item">
+ class="op-pagination--item">
<button
type="button"
(click)="showPage(pagination.page + 1)"
rel="next"
- class="pagination--next-link"
+ class="op-pagination--item-link op-pagination--item-link_next"
[attr.aria-label]="text.label_next"
- id="pagination--next-link"
>
&#62;
</button>
</li>
- <li class="pagination--range">
+ <li class="op-pagination--range">
<span [textContent]="currentRange"></span>
<span *ngIf="pageNumbers.length === 1"
- id="pagination-empty-text"
+ id="op-pagination-empty-text"
tabindex="0"
class="hidden-for-sighted"
[textContent]="text.no_other_page"></span>
</li>
- <li class="pagination--info"
+ <li class="op-pagination--info"
*ngIf="infoText">
<op-icon icon-classes="icon-info1 icon-context"></op-icon>
<span [textContent]="infoText">
@@ -88,17 +90,18 @@
</ul>
</nav>
- <div class="pagination--options"
+ <div class="op-pagination--options"
*ngIf="showPerPageOptions()">
- <ul class="pagination--items">
- <li class="pagination--label" [textContent]="text.per_page" title="{{ text.per_page }}"></li>
+ <ul class="op-pagination--items op-pagination--items_end">
+ <li class="op-pagination--label" [textContent]="text.per_page" title="{{ text.per_page }}"></li>
<li *ngFor="let perPageOption of perPageOptions"
- [ngClass]="{ '-current': perPageOption == pagination.perPage }"
- class="pagination--item">
+ [ngClass]="{ 'op-pagination--item_current': perPageOption == pagination.perPage }"
+ class="op-pagination--item">
<span *ngIf="perPageOption != pagination.perPage">
<button
+ class="op-pagination--item-link"
type="button"
(click)="selectPerPage(perPageOption)"
[textContent]="perPageOption"
diff --git a/frontend/src/global_styles/content/_pagination.lsg b/frontend/src/global_styles/content/_pagination.lsg
index d3be649584f..93d610fa707 100644
--- a/frontend/src/global_styles/content/_pagination.lsg
+++ b/frontend/src/global_styles/content/_pagination.lsg
@@ -1,30 +1,30 @@
# Pagination
```
-<div class="pagination">
- <nav class="pagination--pages">
- <ul class="pagination--items">
- <li class="pagination--item -prev"><a>Previous</a></li>
- <li class="pagination--item"><a>1</a></li>
- <li class="pagination--item"><a>2</a></li>
- <li class="pagination--item -current">3</li>
- <li class="pagination--item"><a>4</a></li>
- <li class="pagination--item"><a>5</a></li>
- <li class="pagination--space">…</span>
- <li class="pagination--item"><a>34</a></li>
- <li class="pagination--item"><a>35</a></li>
- <li class="pagination--item -next"><a>Next</a></li>
- <li class="pagination--range" title="(1 - 50/820)">(1 - 50/820)</li>
+<div class="op-pagination">
+ <nav class="op-pagination--pages">
+ <ul class="op-pagination--items op-pagination--items_start">
+ <li class="op-pagination--item -prev"><a>Previous</a></li>
+ <li class="op-pagination--item"><a>1</a></li>
+ <li class="op-pagination--item"><a>2</a></li>
+ <li class="op-pagination--item -current">3</li>
+ <li class="op-pagination--item"><a>4</a></li>
+ <li class="op-pagination--item"><a>5</a></li>
+ <li class="op-pagination--space">…</span>
+ <li class="op-pagination--item"><a>34</a></li>
+ <li class="op-pagination--item"><a>35</a></li>
+ <li class="op-pagination--item -next"><a>Next</a></li>
+ <li class="op-pagination--range" title="(1 - 50/820)">(1 - 50/820)</li>
</ul>
</nav>
- <div class="pagination--options">
- <ul class="pagination--items">
- <li class="pagination--label" title="Per page:">Per page:</li>
- <li class="pagination--item"><a>10</a></li>
- <li class="pagination--item"><a>20</a></li>
- <li class="pagination--item -current">50</li>
- <li class="pagination--item"><a>100</a></li>
- <li class="pagination--item"><a>200</a></li>
+ <div class="op-pagination--options">
+ <ul class="op-pagination--items op-pagination--items_end">
+ <li class="op-pagination--label" title="Per page:">Per page:</li>
+ <li class="op-pagination--item"><a>10</a></li>
+ <li class="op-pagination--item"><a>20</a></li>
+ <li class="op-pagination--item -current">50</li>
+ <li class="op-pagination--item"><a>100</a></li>
+ <li class="op-pagination--item"><a>200</a></li>
</ul>
</div>
</div>
diff --git a/frontend/src/global_styles/content/_pagination.sass b/frontend/src/global_styles/content/_pagination.sass
index d8e3792b609..9a0bdfcfb15 100644
--- a/frontend/src/global_styles/content/_pagination.sass
+++ b/frontend/src/global_styles/content/_pagination.sass
@@ -28,87 +28,90 @@
$pagination--font-size: 0.8125rem
-.pagination
+.op-pagination
display: flex
justify-content: space-between
width: 100%
min-height: 45px
-.pagination--pages
- flex-grow: 2
- flex-shrink: 2
- margin: 10px 5px 10px 0
+ &--pages
+ flex-grow: 2
+ flex-shrink: 2
+ margin: 10px 5px 10px 0
-.pagination--options
- flex-grow: 1
- flex-shrink: 1
- margin: 10px 0 0 5px
+ &--options
+ flex-grow: 1
+ flex-shrink: 1
+ margin: 10px 0 0 5px
-.pagination--items
- list-style-type: none
- display: flex
- margin: 0
- padding: 0
- font-size: $pagination--font-size
-
- .pagination--pages &
- justify-content: flex-start
+ &--items
+ list-style-type: none
+ display: flex
+ margin: 0
+ padding: 0
+ font-size: $pagination--font-size
- .pagination--options &
- justify-content: flex-end
+ &_start
+ justify-content: flex-start
-.pagination--item
- min-width: 25px
- margin: 0 5px 0 0
- white-space: nowrap
+ &_end
+ justify-content: flex-end
- &.-prev,
- &.-next
+ &--item
min-width: 25px
+ margin: 0 5px 0 0
+ white-space: nowrap
+
+ &_prev,
+ &_next
+ min-width: 25px
+
+ &_current
+ background: #ffffff
+ border: 1px solid #ffffff
+ padding: 3px 3px
+ font-style: italic
+ text-align: center
+
+ &-link
+ margin: 0
+ display: block
+ min-width: 25px
+ text-align: center
+ padding: 3px 3px
+ background: #f8f8f8
+ border-radius: 2px
+ border: 1px solid #cccccc
+ color: var(--body-font-color)
+ font-weight: normal
+ cursor: pointer
+ text-decoration: none
+ &:hover
+ color: var(--body-font-color)
+ text-decoration: none
+ background: #eaeaea
- &.-current
+ &--space
background: #ffffff
border: 1px solid #ffffff
- padding: 3px 3px
font-style: italic
- text-align: center
+ padding: 3px 0
+ margin: 0 5px 0 0
- button
- margin: 0
- display: block
- min-width: 25px
- text-align: center
- padding: 3px 3px
- background: #f8f8f8
- border-radius: 2px
- border: 1px solid #cccccc
- color: var(--body-font-color)
- font-weight: normal
- cursor: pointer
- text-decoration: none
- &:hover
- background: #eaeaea
+ &--label
+ flex: 1
+ padding: 3px 0
+ margin-right: 5px
+ text-align: right
+ @include text-shortener
-.pagination--space
- background: #ffffff
- border: 1px solid #ffffff
- font-style: italic
- padding: 3px 0
- margin: 0 5px 0 0
-
-.pagination--label
- flex: 1
- padding: 3px 0
- margin-right: 5px
- text-align: right
- @include text-shortener
-
-.pagination--range, .pagination--info
- flex: 1
- margin: 0 0 0 5px
- padding: 3px 0
- display: block
- @include text-shortener
+ &--range,
+ &--info
+ flex: 1
+ margin: 0 0 0 5px
+ padding: 3px 0
+ display: block
+ @include text-shortener
-.pagination--info
- flex-basis: auto
+ &--info
+ flex-basis: auto
diff --git a/frontend/src/global_styles/layout/work_packages/_table.sass b/frontend/src/global_styles/layout/work_packages/_table.sass
index db4004993e6..f1bc9c6c0ee 100644
--- a/frontend/src/global_styles/layout/work_packages/_table.sass
+++ b/frontend/src/global_styles/layout/work_packages/_table.sass
@@ -86,15 +86,9 @@
// Footer of the left side
.work-packages-split-view--tabletimeline-footer
- // Only add padding to lower/right corner
- // to override default margins
- .pagination
- margin: 0
- padding: 15px 10px 10px 0
-
- .pagination--pages,
- .pagination--options
- margin: 0
+ // Only add margin to lower/right corner
+ // to avoid that the toolbar sticks directly at the screen border
+ margin-right: 5px
// TABLE half of the tabletimeline flexbox
.work-packages-tabletimeline--table-side
diff --git a/modules/meeting/spec/support/pages/meetings/index.rb b/modules/meeting/spec/support/pages/meetings/index.rb
index aeb3ff45dbf..2b6d834919b 100644
--- a/modules/meeting/spec/support/pages/meetings/index.rb
+++ b/modules/meeting/spec/support/pages/meetings/index.rb
@@ -78,12 +78,12 @@ module Pages::Meetings
def expect_to_be_on_page(number)
expect(page)
- .to have_selector('.pagination--item.-current',
+ .to have_selector('.op-pagination--item_current',
text: number)
end
def to_page(number)
- within '.pagination--pages' do
+ within '.op-pagination--pages' do
click_link number.to_s
end
end
diff --git a/modules/my_page/spec/features/my/assigned_to_me_spec.rb b/modules/my_page/spec/features/my/assigned_to_me_spec.rb
index c9ffccd23f8..0056ad30e3a 100644
--- a/modules/my_page/spec/features/my/assigned_to_me_spec.rb
+++ b/modules/my_page/spec/features/my/assigned_to_me_spec.rb
@@ -182,7 +182,7 @@ describe 'Assigned to me embedded query on my page', type: :feature, js: true do
expect(page)
.not_to have_selector('.subject', text: assigned_work_package_2.subject)
- page.find('.pagination--item button', text: '2').click
+ page.find('.op-pagination--item button', text: '2').click
expect(page)
.not_to have_selector('.subject', text: assigned_work_package.subject)
diff --git a/spec/features/projects/projects_index_spec.rb b/spec/features/projects/projects_index_spec.rb
index 36e8c39e4fb..e3037974c7c 100644
--- a/spec/features/projects/projects_index_spec.rb
+++ b/spec/features/projects/projects_index_spec.rb
@@ -271,9 +271,9 @@ describe 'Projects index page',
# Changing the page size to 5 and back to 1 should not change the filters (which we test later on the second page)
SeleniumHubWaiter.wait
- find('.pagination--options .pagination--item', text: '5').click # click page size '5'
+ find('.op-pagination--options .op-pagination--item', text: '5').click # click page size '5'
SeleniumHubWaiter.wait
- find('.pagination--options .pagination--item', text: '1').click # return back to page size '1'
+ find('.op-pagination--options .op-pagination--item', text: '1').click # return back to page size '1'
SeleniumHubWaiter.wait
click_on '2' # Go to pagination page 2
diff --git a/spec/features/work_packages/pagination_spec.rb b/spec/features/work_packages/pagination_spec.rb
index 150cd6eb9ed..8164887af9e 100644
--- a/spec/features/work_packages/pagination_spec.rb
+++ b/spec/features/work_packages/pagination_spec.rb
@@ -55,8 +55,8 @@ RSpec.feature 'Work package pagination', js: true do
expect(page).to_not have_content(work_package_2.subject)
end
- within('.pagination--pages') do
- find('.pagination--item button', text: '2').click
+ within('.op-pagination--pages') do
+ find('.op-pagination--item button', text: '2').click
end
within('.work-packages-partitioned-query-space--container') do
@@ -64,8 +64,8 @@ RSpec.feature 'Work package pagination', js: true do
expect(page).to_not have_content(work_package_1.subject)
end
- within('.pagination--options') do
- find('.pagination--item button', text: '50').click
+ within('.op-pagination--options') do
+ find('.op-pagination--item button', text: '50').click
end
within('.work-packages-partitioned-query-space--container') do
diff --git a/spec/features/work_packages/table/hierarchy/hierarchy_parent_below_spec.rb b/spec/features/work_packages/table/hierarchy/hierarchy_parent_below_spec.rb
index 28edaaf8d67..2d3d0d56cfd 100644
--- a/spec/features/work_packages/table/hierarchy/hierarchy_parent_below_spec.rb
+++ b/spec/features/work_packages/table/hierarchy/hierarchy_parent_below_spec.rb
@@ -128,7 +128,7 @@ describe 'Work Package table hierarchy parent below', js: true do
wp_table.expect_work_package_listed(child, child2, parent, grandparent)
# Expect pagination to be correct
- expect(page).to have_selector('.pagination--item.-current', text: '3')
+ expect(page).to have_selector('.op-pagination--item_current', text: '3')
# Expect count to be correct (one additional parent shown)
expect(page).to have_selector('.wp--row', count: 4)
diff --git a/spec/features/work_packages/table/queries/filter_pagination_spec.rb b/spec/features/work_packages/table/queries/filter_pagination_spec.rb
index f17777f08d1..bfcc6dd040b 100644
--- a/spec/features/work_packages/table/queries/filter_pagination_spec.rb
+++ b/spec/features/work_packages/table/queries/filter_pagination_spec.rb
@@ -59,18 +59,18 @@ describe 'Filter updates pagination', type: :feature, js: true do
wp_table.ensure_work_package_not_listed! work_package_2
# Expect pagination to be correct
- expect(page).to have_selector('.pagination--item.-current', text: '1')
+ expect(page).to have_selector('.op-pagination--item_current', text: '1')
# Go to second page
- within('.pagination--pages') do
- find('.pagination--item button', text: '2').click
+ within('.op-pagination--pages') do
+ find('.op-pagination--item button', text: '2').click
end
wp_table.expect_work_package_listed work_package_2
wp_table.ensure_work_package_not_listed! work_package_1
# Expect pagination to be correct
- expect(page).to have_selector('.pagination--item.-current', text: '2')
+ expect(page).to have_selector('.op-pagination--item_current', text: '2')
# Change filter to assigned to
filters.expect_filter_count 1
@@ -82,6 +82,6 @@ describe 'Filter updates pagination', type: :feature, js: true do
wp_table.ensure_work_package_not_listed! work_package_2
# Expect pagination to be back to 1
- expect(page).to have_selector('.pagination--range', text: '1 - 1/1')
+ expect(page).to have_selector('.op-pagination--range', text: '1 - 1/1')
end
end
diff --git a/spec/helpers/pagination_helper_spec.rb b/spec/helpers/pagination_helper_spec.rb
index 0ecddb47747..b157e296a39 100644
--- a/spec/helpers/pagination_helper_spec.rb
+++ b/spec/helpers/pagination_helper_spec.rb
@@ -66,15 +66,15 @@ describe PaginationHelper, type: :helper do
end
it "should be inside a 'pagination' div" do
- expect(pagination).to have_selector('div.pagination')
+ expect(pagination).to have_selector('div.op-pagination')
end
it 'should have a next_page reference' do
- expect(pagination).to have_selector('.pagination--item.-next')
+ expect(pagination).to have_selector('.op-pagination--item_next')
end
it 'should not have a previous_page reference' do
- expect(pagination).not_to have_selector('.pagination--item.-prev')
+ expect(pagination).not_to have_selector('.op-pagination--item_prev')
end
it 'should have links to every page except the current one' do
@@ -91,14 +91,14 @@ describe PaginationHelper, type: :helper do
end
it 'should have an element for the current page' do
- expect(pagination).to have_selector('.pagination--item.-current',
+ expect(pagination).to have_selector('.op-pagination--item_current',
text: Regexp.new("^#{current_page}$"))
end
it 'should show the range of the entries displayed' do
range = "(#{(current_page * per_page) - per_page + 1} - " +
"#{current_page * per_page}/#{total_entries})"
- expect(pagination).to have_selector('.pagination--range', text: range)
+ expect(pagination).to have_selector('.op-pagination--range', text: range)
end
it 'should have different urls if the params are specified as options' do
@@ -115,29 +115,29 @@ describe PaginationHelper, type: :helper do
end
end
- it 'should show the available pre page options' do
+ it 'should show the available per page options' do
allow(Setting)
.to receive(:per_page_options)
.and_return("#{per_page},#{per_page * 10}")
- expect(pagination).to have_selector('.pagination--options')
+ expect(pagination).to have_selector('.op-pagination--options')
- expect(pagination).to have_selector('.pagination--options .-current', text: per_page)
+ expect(pagination).to have_selector('.op-pagination--options .op-pagination--item_current', text: per_page)
path = work_packages_path(page: current_page, per_page: Setting.per_page_options_array.last)
- expect(pagination).to have_selector(".pagination--options a[href='#{path}']")
+ expect(pagination).to have_selector(".op-pagination--options a[href='#{path}']")
end
describe 'WHEN the first page is the current' do
let(:current_page) { 1 }
it 'should deactivate the previous page link' do
- expect(pagination).not_to have_selector('.pagination--item.-prev')
+ expect(pagination).not_to have_selector('.op-pagination--item_prev')
end
it 'should have a link to the next page' do
path = work_packages_path(page: current_page + 1)
- expect(pagination).to have_selector(".pagination--item.-next a[href='#{path}']")
+ expect(pagination).to have_selector(".op-pagination--item_next a[href='#{path}']")
end
end
@@ -145,12 +145,12 @@ describe PaginationHelper, type: :helper do
let(:current_page) { total_entries / per_page + 1 }
it 'should deactivate the next page link' do
- expect(pagination).not_to have_selector('.pagination--item.-next')
+ expect(pagination).not_to have_selector('.op-pagination--item_next')
end
it 'should have a link to the previous page' do
path = work_packages_path(page: current_page - 1)
- expect(pagination).to have_selector(".pagination--item.-prev a[href='#{path}']")
+ expect(pagination).to have_selector(".op-pagination--item_prev a[href='#{path}']")
end
end
@@ -158,11 +158,11 @@ describe PaginationHelper, type: :helper do
let(:total_entries) { 0 }
it 'should show no pages' do
- expect(pagination).not_to have_selector('.pagination--items .pagination--item')
+ expect(pagination).not_to have_selector('.op-pagination--items .op-pagination--item')
end
it 'should show no pagination' do
- expect(pagination).not_to have_selector('.pagination')
+ expect(pagination).not_to have_selector('.op-pagination')
end
end
end
diff --git a/spec/support/components/table_pagination.rb b/spec/support/components/table_pagination.rb
index 03e00a589d5..0fa952ea6cc 100644
--- a/spec/support/components/table_pagination.rb
+++ b/spec/support/components/table_pagination.rb
@@ -34,21 +34,21 @@ module Components
def expect_range(from, to, total)
within_pagination do
expect(page)
- .to have_selector('.pagination--range', text: "(#{from} - #{to}/#{total})")
+ .to have_selector('.op-pagination--range', text: "(#{from} - #{to}/#{total})")
end
end
def expect_no_per_page_options
within_pagination do
expect(page)
- .to have_no_selector('.pagination--options')
+ .to have_no_selector('.op-pagination--options')
end
end
protected
def within_pagination(&block)
- within('.pagination', &block)
+ within('.op-pagination', &block)
end
end
end
diff --git a/spec/support/pages/members.rb b/spec/support/pages/members.rb
index 19c498e5a6f..9309fee915e 100644
--- a/spec/support/pages/members.rb
+++ b/spec/support/pages/members.rb
@@ -234,7 +234,7 @@ module Pages
end
def go_to_page!(number)
- find('.pagination--pages a', text: number.to_s).click
+ find('.op-pagination--pages a', text: number.to_s).click
end
end
end