-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: pagination not working correctly (#460)
Fixes pagination not working correctly on some pages. Adds the logic for persisting the pagination offset in the URL so reloading reloads the page the user was on. Fixes #441. Signed-off-by: Philipp Rudloff <[email protected]>
- Loading branch information
Philipp Rudloff
authored
Nov 18, 2022
1 parent
e357675
commit 50cf90d
Showing
9 changed files
with
138 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,5 +98,5 @@ | |
} | ||
} | ||
], | ||
"next": null | ||
"next": "http://localhost:5681/meshes/default/circuit-breakers?offset=1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { LocationQueryValue } from 'vue-router' | ||
|
||
export function getLastNumberParameter(param: LocationQueryValue | LocationQueryValue[], defaultValue: number = 0): number { | ||
const lastParam = getLastParameter(param) | ||
return lastParam !== undefined ? parseInt(lastParam) : defaultValue | ||
} | ||
|
||
export function getLastParameter(param: LocationQueryValue | LocationQueryValue[]): string | undefined { | ||
const paramList = Array.isArray(param) ? param : [param] | ||
return paramList[paramList.length - 1] ?? undefined | ||
} |
Oops, something went wrong.