Skip to content

Commit

Permalink
[patch][16.21.9] Toniq Pagination Always Include First Page (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
ponnexcodev authored Oct 17, 2024
1 parent 61cb074 commit 53ee4dc
Show file tree
Hide file tree
Showing 8 changed files with 662 additions and 462 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/tagged-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install npm@latest
run: npm install --global npm@latest
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: run test
run: |
npm ci
npx playwright install --with-deps
npm run test:all
run: npm run test:all
- name: pack and set vars
id: vars
run: |
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install npm@latest
run: npm install --global npm@latest
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: run test
run: |
npm ci
npx playwright install --with-deps
npm run test:all
run: npm run test:all
1,060 changes: 627 additions & 433 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system-root",
"version": "16.21.8",
"version": "16.21.9",
"private": true,
"description": "Root design system mono-repo package.",
"homepage": "https://github.com/Toniq-Labs/toniq-labs-design-system",
Expand Down
8 changes: 4 additions & 4 deletions packages/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system",
"version": "16.21.8",
"version": "16.21.9",
"private": false,
"description": "Design system elements for Toniq Labs",
"keywords": [
Expand Down Expand Up @@ -55,7 +55,7 @@
"devDependencies": {
"@augment-vir/browser": "^23.3.4",
"@augment-vir/browser-testing": "^23.3.4",
"@augment-vir/node-js": "^26.4.0",
"@augment-vir/node-js": "^23.3.4",
"@open-wc/testing": "^4.0.0",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
Expand All @@ -65,14 +65,14 @@
"@web/test-runner-playwright": "^0.11.0",
"@web/test-runner-visual-regression": "^0.9.0",
"element-book": "^20.0.9",
"esbuild": "^0.20.2",
"esbuild": "^0.20.1",
"istanbul-smart-text-reporter": "^1.1.4",
"npm-check-updates": "~16.12.3",
"ts-node": "^10.9.2",
"type-fest": "^4.10.2",
"typescript": "5.3.3",
"vite": "^4.5.0",
"vite-tsconfig-paths": "^4.3.2"
"vite-tsconfig-paths": "^4.3.1"
},
"peerDependencies": {
"element-vir": ">=17"
Expand Down
28 changes: 14 additions & 14 deletions packages/design-system/src/augments/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function pagination(
range.start += 1;
range.end += 1;
}
const pages: number[] =
let pages: (string | number)[] =
currentPage > pageCount - boundaryPagesShown && pageCount > pagesShown
? getRange(pageCount - delta, pageCount)
: currentPage > delta
Expand All @@ -51,23 +51,23 @@ export function pagination(
}
const lastPage = pages[pages.length - 1];

if (lastPage && lastPage < pageCount) {
const dots = withDots(pageCount, [
threeDots,
pageCount,
]);
return [
...pages,
...dots,
];
} else if (pages[0] !== 1) {
return withDots(1, [
if (pages[0] !== 1) {
pages = withDots(1, [
1,
threeDots,
]).concat(pages);
} else {
return pages;
}

if (typeof lastPage === 'number' && lastPage < pageCount) {
pages = pages.concat(
withDots(pageCount, [
threeDots,
pageCount,
]),
);
}

return pages;
}

/** Creates an array of numbers progressing from start up to end. */
Expand Down
2 changes: 1 addition & 1 deletion packages/native-elements-test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system-native-elements-test",
"version": "16.21.8",
"version": "16.21.9",
"private": true,
"scripts": {
"compile": "virmator compile",
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system-scripts",
"version": "16.21.8",
"version": "16.21.9",
"private": true,
"scripts": {
"compile": "virmator compile",
Expand Down

0 comments on commit 53ee4dc

Please sign in to comment.