Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+12
@@ -12,6 +12,18 @@ export function getPaginationFromCurrentUrl(urlSearchParams: URLSearchParams): {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Total page count for a paginated result set, safe against the two inputs that
|
||||
* otherwise reach the UI as "1/NAN": a missing page size (`0/0` → `NaN`) and an
|
||||
* absent total (upstream provider returned nothing). There is always at least
|
||||
* one page, because an empty list still renders as page 1 of 1.
|
||||
*/
|
||||
export function getTotalPages(totalItems: number | null | undefined, pageSize: number | null | undefined): number {
|
||||
const total = Number.isFinite(totalItems) ? Number(totalItems) : 0;
|
||||
const size = Number.isFinite(pageSize) && Number(pageSize) > 0 ? Number(pageSize) : Constants.DEFAULT_PAGE_SIZE;
|
||||
return Math.max(1, Math.ceil(total / size));
|
||||
}
|
||||
|
||||
export function getFiltersFromCurrentUrl(request: Request, properties: FilterablePropertyDto[]): FiltersDto {
|
||||
const url = new URL(request.url);
|
||||
properties.forEach((property) => {
|
||||
|
||||
Reference in new issue
Block a user