Skip to content

Commit

Permalink
Merge pull request #61 from rdai10/dev
Browse files Browse the repository at this point in the history
2.5.5
  • Loading branch information
rdai10 authored Mar 14, 2019
2 parents 881e2fd + 2711d2b commit 0c9317d
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js

node_js:
- "node"
- "11.10.1"

before_install:
- cd theme
Expand Down
6 changes: 3 additions & 3 deletions theme/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@
"test": "jest",
"zip": "zip -r Liferay-Help-Center.zip dist -x *.zat*"
},
"version": "2.5.4"
"version": "2.5.5"
}
2 changes: 1 addition & 1 deletion theme/src/css/_zendesk-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $color-primary-hover: #0053F0 !default;
$color-success: #287D3C !default;
$color-warning: #B95000 !default;

$color-grey: #F7F8F9 !default;
$color-grey: #F5F7FA !default;
$color-grey-focus: #F0F1F2 !default;
$color-grey-hover: #F2F4F5 !default;
$color-white: #FFF !default;
Expand Down
6 changes: 2 additions & 4 deletions theme/src/js/components/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Pagination extends preact.Component {
const {total} = this.props;
const {currentPage} = this.state;

let nextPageBuffer = PAGE_BUFFER;
let nextPageBuffer = total - currentPage >= PAGE_BUFFER ? PAGE_BUFFER : total - currentPage;
let prevPageBuffer = 0;

if (currentPage > 1) {
Expand All @@ -133,9 +133,6 @@ class Pagination extends preact.Component {
nextPageBuffer = 0;
}
}
else {
nextPageBuffer = total - currentPage >= PAGE_BUFFER ? PAGE_BUFFER : total - currentPage;
}

return {
nextPageBuffer,
Expand All @@ -150,6 +147,7 @@ class Pagination extends preact.Component {
{this.getPages().map(
page => (
<PaginationItem
key={page.label}
active={this.state.currentPage === page.number}
label={page.label}
number={page.number}
Expand Down
38 changes: 33 additions & 5 deletions theme/src/js/components/__tests__/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const setup = () => {

return {
firstPage,
handleClick,
lastPage,
nextPage,
prevPage,
Expand Down Expand Up @@ -62,9 +63,7 @@ describe('Pagination', () => {

fireEvent.click(lastPage);

const page100 = getByText('100');

expect(page100).toBeTruthy();
expect(getByText('100')).toBeTruthy();
});

it('renders only first and prev page controls on last page', () => {
Expand Down Expand Up @@ -106,10 +105,39 @@ describe('Pagination', () => {
it('renders a maximum of five pages previous to and after the current page', () => {
debounceRenderingOff();

const {container, queryByText} = setup();
const {container, getByText} = setup();

fireEvent.click(queryByText('6'));
fireEvent.click(getByText('6'));

expect(getByText('1')).toBeTruthy();
expect(getByText('5')).toBeTruthy();
expect(getByText('7')).toBeTruthy();
expect(getByText('11')).toBeTruthy();
expect(container).toMatchSnapshot();
});

it('should not render page numbers exceeding the total page count on initial load', () => {
debounceRenderingOff();

const {handleClick} = setup();

const {queryByText} = render(
<Pagination onClick={handleClick} perPage={10} total={5} />
);

expect(queryByText('5')).toBeTruthy();
expect(queryByText('6')).toBeFalsy();
});

it('should not render page numbers exceeding the total page count after interaction', () => {
debounceRenderingOff();

const {getByText, lastPage, queryByText} = setup();

fireEvent.click(lastPage);
fireEvent.click(getByText('98'));

expect(getByText('100')).toBeTruthy();
expect(queryByText('101')).toBeFalsy();
});
});
2 changes: 1 addition & 1 deletion theme/src/resources/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Liferay Help Center Theme",
"author": "Liferay",
"version": "2.5.4",
"version": "2.5.5",
"api_version": 1,
"default_locale": "en-us",
"settings": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
description: '{{dc 'commerce-latest_release_card_description'}}',
name: '{{dc '7_1-latest_release_card'}}',
svgId: '#latest-release',
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_mvcRenderCommandName=%2Fview&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_journalArticleResourcePrimKey=118250141'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_mvcRenderCommandName=%2Fview&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_journalArticleResourcePrimKey=118356144'
},
{
description: '{{dc 'commerce-compatibility_matrix_card_description'}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
description: '{{dc '7_0-service_packs_archive_card_description'}}',
name: '{{dc '7_1-service_packs_archive_card'}}',
svgId: '#service-pack-archive',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1541608573640&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=dxp_70&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=product'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191009&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191044'
},
{
description: '{{dc '7_1-security_advisories_card_description'}}',
Expand All @@ -110,7 +110,7 @@
description: '{{dc '7_0-patching_tool_card_description'}}',
name: '{{dc '7_1-patching_tool_card'}}',
svgId: '#patching-tool',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1541608612830&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=patchingTool&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=product'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191019&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191066'
}
],
tabAccess: 'kb'
Expand Down
12 changes: 6 additions & 6 deletions theme/src/resources/templates/category_pages/liferay_dxp_7_1.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
description: '{{dc '7_1-fix_packs_card_description'}}',
name: '{{dc '7_1-fix_packs_card'}}',
svgId: '#fixpack',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1541544150388&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=dxp_71&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=fixPacks'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191011&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191054'
},
{
description: '{{dc '7_1-activation_keys_card_description'}}',
Expand Down Expand Up @@ -92,25 +92,25 @@
description: '{{dc '7_1-fix_packs_card_description'}}',
name: '{{dc '7_1-fix_packs_card'}}',
svgId: '#fixpack',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1541544150388&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=dxp_71&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=fixPacks'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191011&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191054'
},
{
description: '{{dc '7_1-service_packs_archive_card_description'}}',
name: '{{dc '7_1-service_packs_archive_card'}}',
svgId: '#service-pack-archive',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1541544915133&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=dxp_71&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=product'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191011&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191052'
},
{
description: '{{dc '7_1-security_advisories_card_description'}}',
name: '{{dc 'mega_menu-security_advisories'}}',
svgId: '#security-advisories',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1543617205105&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=dxp_71&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=security'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191011&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191056'
},
{
description: '{{dc '7_1-patching_tool_card_description'}}',
name: '{{dc '7_1-patching_tool_card'}}',
svgId: '#patching-tool',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1541544924558&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=patchingTool&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=product'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191019&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191066'
}
],
tabAccess: 'kb'
Expand Down Expand Up @@ -252,4 +252,4 @@
document.getElementById('dxp71ProductPage')
);
});
</script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
description: '{{dc '6_1-latest_release_card_description'}}',
name: '{{dc '7_1-latest_release_card'}}',
svgId: '#latest-release',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1542818284844&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=portal_61&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=product'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191025&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191086'
},
{
description: '{{dc '6_1-compatibility_matrix_card_description'}}',
Expand All @@ -56,7 +56,7 @@
description: '{{dc '7_1-fix_packs_card_description'}}',
name: '{{dc '7_1-fix_packs_card'}}',
svgId: '#fixpack',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1541609184146&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=portal_61&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=fixPacks'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191025&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191088'
},
{
description: '{{dc '6_2-activation_keys_card_description'}}',
Expand Down Expand Up @@ -86,25 +86,25 @@
description: '{{dc '6_1-latest_release_card_description'}}',
name: '{{dc '7_1-latest_release_card'}}',
svgId: '#latest-release',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1543427162569&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=portal_61&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=product'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191025&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191086'
},
{
description: '{{dc '7_1-fix_packs_card_description'}}',
name: '{{dc '7_1-fix_packs_card'}}',
svgId: '#fixpack',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1541609184146&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=portal_61&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=fixPacks'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191025&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191088'
},
{
description: '{{dc '6_1-service_packs_archive_card_description'}}',
name: '{{dc '7_1-service_packs_archive_card'}}',
svgId: '#service-pack-archive',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1541609083193&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=portal_61&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=product'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191025&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191086'
},
{
description: '{{dc '6_2-security_advisories_card_description'}}',
name: '{{dc 'mega_menu-security_advisories'}}',
svgId: '#security-advisories',
url: 'https://customer.liferay.com/downloads?_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_formDate=1543617409908&p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_product=portal_61&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileType=security'
url: 'https://customer.liferay.com/downloads?p_p_id=com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_productAssetCategoryId=118191025&_com_liferay_osb_customer_downloads_display_web_DownloadsDisplayPortlet_fileTypeAssetCategoryId=118191093'
},
{
description: '{{dc '6_1-patching_tool_card_description'}}',
Expand Down
Loading

0 comments on commit 0c9317d

Please sign in to comment.