Skip to content
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ To reduce the time for info panel data to appear, data can be prefetched.
| `infoPanel[*].prefetchObjects` | Number | yes | `0` | `2` | Number of next rows to prefetch when browsing sequential rows. For example, `2` means the next 2 rows will be fetched in advance. |
| `infoPanel[*].prefetchStale` | Number | yes | `0` | `10` | Duration in seconds after which prefetched data is discarded as stale. |

Prefetching is particularly useful when navigating through lists of objects. To optimize performance and avoid unnecessary data loading, prefetching is triggered only after the user has moved through 3 consecutive rows using the keyboard down-arrow key.
Prefetching is particularly useful when navigating through lists of objects. To optimize performance and avoid unnecessary data loading, prefetching is triggered only after the user has moved through 3 consecutive rows using the keyboard down-arrow key or by mouse click.

### Freeze Columns

Expand Down
18 changes: 1 addition & 17 deletions src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,6 @@ export default class BrowserCell extends Component {
current,
onEditChange,
setCopyableValue,
selectedObjectId,
setSelectedObjectId,
callCloudFunction,
isPanelVisible,
onPointerCmdClick,
row,
col,
Expand All @@ -580,7 +576,6 @@ export default class BrowserCell extends Component {
markRequiredFieldRow,
handleCellClick,
selectedCells,
setShowAggregatedData,
} = this.props;

const classes = [...this.state.classes];
Expand Down Expand Up @@ -653,18 +648,7 @@ export default class BrowserCell extends Component {
onPointerCmdClick(value);
} else {
setCopyableValue(hidden ? undefined : this.copyableValue);
if (selectedObjectId !== this.props.objectId) {
setShowAggregatedData(true);
setSelectedObjectId(this.props.objectId);
if (
this.props.objectId &&
isPanelVisible &&
((e.shiftKey && !this.props.firstSelectedCell) || !e.shiftKey)
) {
callCloudFunction(this.props.objectId, this.props.className, this.props.appId);
}
}
handleCellClick(e, row, col);
handleCellClick(e, row, col, this.props.objectId);
}
}}
onDoubleClick={() => {
Expand Down
18 changes: 17 additions & 1 deletion src/dashboard/Data/Browser/DataBrowser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,26 @@ export default class DataBrowser extends React.Component {
});
}

handleCellClick(event, row, col) {
handleCellClick(event, row, col, objectId) {
const { firstSelectedCell } = this.state;
const clickedCellKey = `${row}-${col}`;

if (this.state.selectedObjectId !== objectId) {
this.setShowAggregatedData(true);
this.setSelectedObjectId(objectId);
if (
objectId &&
this.state.isPanelVisible &&
((event.shiftKey && !firstSelectedCell) || !event.shiftKey)
) {
this.handleCallCloudFunction(
objectId,
this.props.className,
this.props.app.applicationId
);
}
}

if (event.shiftKey && firstSelectedCell) {
const [firstRow, firstCol] = firstSelectedCell.split('-').map(Number);
const [lastRow, lastCol] = clickedCellKey.split('-').map(Number);
Expand Down
Loading