Skip to content

Commit

Permalink
fix: DH-15864: Scroll position StuckToBottom shouldn't trigger sharin…
Browse files Browse the repository at this point in the history
…g dot (#1617)

Reset `isStuckToBottom` and `isStuckToRight` in `dropLayoutMinorChange`.

The flags are still stored in the shared layout, but don't trigger the
sharing dot.

Testing:

- Open a new dashboard, add a table with more rows than fits on the
screen
- Share the dashboard layout with the table scrolled up,
`isStuckToBottom` is `false`
- Scroll the table to the bottom, confirm the Sharing dot doesn't appear
even though the `isStuckToBottom` flag is now set to `true`
- Click on the Sharing button, confirm the dialog shows the "Share
updated state" message allowing to share the new `isStuckToBottom` state
- Scroll the table up a few rows to get it un-stuck, confirm the blue
dot still doesn't show up. Open the Sharing dialog, confirm the "Share
update state" message disappeared since the current `isStuckToBottom`
state matches the shared state
- Scroll the table all the way down, discard the layout changes via the
Sharing dialog, don't close the dialog. Confirm the table after discard
is scrolled up (initial shared `isStuckToBottom: false` state restored).
  • Loading branch information
vbabich authored Nov 2, 2023
1 parent 806a6b6 commit 3d4499b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/dashboard/src/layout/LayoutUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ class LayoutUtils {
* 1. sorts in grid
* 2. quick filters in grid
* 3. active item
* 4. isStuckToBottom/isStuckToRight
*
* item id is also removed
*/
Expand All @@ -360,6 +361,8 @@ class LayoutUtils {
delete itemConfig.id;
itemConfig.props.panelState.irisGridState.sorts = [];
itemConfig.props.panelState.irisGridState.quickFilters = [];
itemConfig.props.panelState.gridState.isStuckToBottom = false;
itemConfig.props.panelState.gridState.isStuckToRight = false;
}
}
}
Expand Down

0 comments on commit 3d4499b

Please sign in to comment.