Skip to content

Commit

Permalink
Merge branch 'finos:main' into issue-989-ignite-maven-build-update
Browse files Browse the repository at this point in the history
  • Loading branch information
rumakt committed Feb 16, 2024
2 parents 45e12f9 + 4825379 commit f4b08df
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ export const DataSourceStats = ({
const [size, setSize] = useState(dataSource.size);
useEffect(() => {
setSize(dataSource.size);

dataSource.on("resize", setSize);
dataSource.on("range", setRange);
return () => {
dataSource.removeListener("resize", setSize);
dataSource.removeListener("range", setRange);
};
}, [dataSource]);

const className = cx(classBase, classNameProp);
Expand Down
2 changes: 1 addition & 1 deletion vuu-ui/packages/vuu-table/src/useDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const useDataSource = ({
// TODO do we ever need to worry about missing updates here ?
forceUpdate({});
} else {
console.log(`ignore update as we're not mounted`);
// do nothing
}
},
[dataWindow]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export const useFilterTable = ({ tableSchema }: FilterTableFeatureProps) => {
onAvailableColumnsChange: handleAvailableColumnsChange,
onConfigChange: handleTableConfigChange,
onFeatureInvocation: handleVuuFeatureInvoked,
renderBufferSize: 10,
renderBufferSize: 20,
};

// It is important that these values are not assigned in advance. They
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
DataSourceConfig,
TableSchema,
} from "@finos/vuu-data-types";
import { configChanged } from "@finos/vuu-utils";
import { configChanged, resetRange } from "@finos/vuu-utils";
import { useViewContext } from "@finos/vuu-layout";
import { useCallback, useMemo } from "react";

Expand Down Expand Up @@ -43,7 +43,7 @@ export const useSessionDataSource = ({
let ds = loadSession?.(dataSourceSessionKey) as VuuDataSource;
if (ds) {
console.log(
"%useSessionDataSource DATA SOURCE IN SESSION STATE",
"%cuseSessionDataSource DATA SOURCE IN SESSION STATE",
"color:red;font-weight:bold;"
);

Expand All @@ -60,6 +60,11 @@ export const useSessionDataSource = ({
ds.applyConfig(dataSourceConfigFromState);
}

if (ds.range.from > 0) {
// UI does not currently restore scroll position, so always reset to top of dataset
ds.range = resetRange(ds.range);
}

return ds;
}

Expand All @@ -68,8 +73,7 @@ export const useSessionDataSource = ({
tableSchema.columns.map((col) => col.name);

ds = new VuuDataSource({
bufferSize: 0,
// bufferSize: 200,
// bufferSize: 0,
viewport: id,
table: tableSchema.table,
...dataSourceConfigFromState,
Expand Down

0 comments on commit f4b08df

Please sign in to comment.