Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page key should integrate functions #1855

Merged
merged 4 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jest.mock(
children({ height: 600, width: 600 })
);

const valueKey = "Infinite-Entity--asc";
const valueKey = "Infinite-Entity-asc";
const tableValue = {
[valueKey]: {
data: [
Expand Down
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 @@ -21,7 +21,7 @@ import { TaipyContext } from "../../context/taipyContext";
import { TaipyState, INITIAL_STATE } from "../../context/taipyReducers";
import { TableValueType } from "./tableUtils";

const valueKey = "0-99-Entity,Daily hospital occupancy--asc";
const valueKey = "0-99-Entity,Daily hospital occupancy-asc";
const tableValue = {
[valueKey]: {
data: [
Expand Down Expand Up @@ -110,7 +110,7 @@ const changedValue = {
};

const editableValue = {
"0--1-bool,int,float,Code--asc": {
"0--1-bool,int,float,Code-asc": {
data: [
{
bool: true,
Expand All @@ -137,7 +137,7 @@ const editableColumns = JSON.stringify({
});

const buttonImgValue = {
"0--1-bool,int,float,Code--asc": {
"0--1-bool,int,float,Code-asc": {
data: [
{
bool: true,
Expand Down 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
Loading