Skip to content

Commit

Permalink
Page key should integrate functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Lefévère-Laoide authored and Fred Lefévère-Laoide committed Sep 29, 2024
1 parent 2072dd7 commit d990de4
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 172 deletions.
88 changes: 44 additions & 44 deletions frontend/taipy-gui/package-lock.json

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

16 changes: 4 additions & 12 deletions frontend/taipy-gui/src/components/Taipy/AutoLoadingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
} from "../../context/taipyReducers";
import {
ColumnDesc,
FilterDesc,
getSortByIndex,
Order,
TaipyTableProps,
Expand All @@ -64,6 +65,7 @@ import {
OnRowClick,
DownloadAction,
getFormatFn,
getPageKey,
} from "./tableUtils";
import {
useClassNames,
Expand All @@ -74,7 +76,7 @@ import {
useFormatConfig,
useModule,
} from "../../utils/hooks";
import TableFilter, { FilterDesc } from "./TableFilter";
import TableFilter from "./TableFilter";
import { getSuffixedClassNames, getUpdateVar } from "./utils";
import { emptyArray } from "../../utils";

Expand Down Expand Up @@ -383,19 +385,9 @@ const AutoLoadingTable = (props: TaipyTableProps) => {
page.current.promises[startIndex].reject();
}
return new Promise<void>((resolve, reject) => {
const agg = aggregates.length
? colsOrder.reduce((pv, col, idx) => {
if (aggregates.includes(columns[col].dfid)) {
return pv + "-" + idx;
}
return pv;
}, "-agg")
: "";
const cols = colsOrder.map((col) => columns[col].dfid).filter((c) => c != EDIT_COL);
const afs = appliedFilters.filter((fd) => Object.values(columns).some((cd) => cd.dfid === fd.col));
const key = `Infinite-${cols.join()}-${orderBy}-${order}${agg}${afs.map(
(af) => `${af.col}${af.action}${af.value}`
)}`;
const key = getPageKey(columns, "Infinite", cols, orderBy, order, afs, aggregates, styles, tooltips, formats);
page.current = {
key: key,
promises: { ...page.current.promises, [startIndex]: { resolve: resolve, reject: reject } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ describe("PaginatedTable Component", () => {
end: 199,
id: "table",
orderby: "",
pagekey: "100-199-Entity,Daily hospital occupancy--asc",
pagekey: "100-199-Entity,Daily hospital occupancy-asc",
handlenan: false,
sort: "asc",
start: 100,
Expand Down
Loading

0 comments on commit d990de4

Please sign in to comment.