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

[Dashboard][Collapsable Panels] Fix bug on layout update #202049

Merged
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
4 changes: 2 additions & 2 deletions packages/kbn-grid-layout/grid/grid_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { GridLayoutData, GridSettings } from './types';
import { useGridLayoutEvents } from './use_grid_layout_events';
import { useGridLayoutState } from './use_grid_layout_state';
import { isLayoutEqual } from './utils/equality_checks';
import { compactGridRow } from './utils/resolve_grid_row';
import { resolveGridRow } from './utils/resolve_grid_row';

interface GridLayoutProps {
layout: GridLayoutData;
Expand Down Expand Up @@ -53,7 +53,7 @@ export const GridLayout = ({
* so, we need to loop through each row and ensure it is compacted
*/
newLayout.forEach((row, rowIndex) => {
newLayout[rowIndex] = compactGridRow(row);
newLayout[rowIndex] = resolveGridRow(row);
});
gridLayoutStateManager.gridLayout$.next(newLayout);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-grid-layout/grid/utils/resolve_grid_row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const getKeysInOrder = (rowData: GridRowData, draggedId?: string): string[] => {
});
};

export const compactGridRow = (originalLayout: GridRowData) => {
const compactGridRow = (originalLayout: GridRowData) => {
const nextRowData = { ...originalLayout, panels: { ...originalLayout.panels } };
// compact all vertical space.
const sortedKeysAfterMove = getKeysInOrder(nextRowData);
Expand Down
116 changes: 0 additions & 116 deletions packages/kbn-grid-layout/grid/utils/run_panel_placement.ts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should have been deleted in #200793, but I forgot to 🤦

This file was deleted.