-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* change panel height from 100 to 20 * scale default height * change number of grid columns to 48 so there is better control of panel width * remove input controls resize test since its using EUI components and no longer needs to be functionally tested * fix dashboard_grid_container test * clean up rebase artifacts * scale x and y in panel_state test * make DASHBOARD_GRID_HEIGHT a constant
- Loading branch information
Showing
8 changed files
with
109 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
src/core_plugins/kibana/public/dashboard/panel/__tests__/panel_utils.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/core_plugins/kibana/public/dashboard/panel/panel_utils.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
jest.mock('ui/chrome', | ||
() => ({ | ||
getKibanaVersion: () => '6.3.0', | ||
}), { virtual: true }); | ||
|
||
import { PanelUtils } from './panel_utils'; | ||
import { DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from '../dashboard_constants'; | ||
|
||
test('parseVersion', () => { | ||
const { major, minor } = PanelUtils.parseVersion('6.2.0'); | ||
expect(major).toBe(6); | ||
expect(minor).toBe(2); | ||
}); | ||
|
||
test('convertPanelDataPre_6_1 gives supplies width and height when missing', () => { | ||
const panelData = [ | ||
{ col: 3, id: 'foo1', row: 1, type: 'visualization', panelIndex: 1 }, | ||
{ col: 3, id: 'foo2', row: 1, size_x: 3, size_y: 2, type: 'visualization', panelIndex: 2 } | ||
]; | ||
panelData.forEach(oldPanel => PanelUtils.convertPanelDataPre_6_1(oldPanel)); | ||
expect(panelData[0].gridData.w).toBe(DEFAULT_PANEL_WIDTH); | ||
expect(panelData[0].gridData.h).toBe(DEFAULT_PANEL_HEIGHT); | ||
expect(panelData[0].version).toBe('6.3.0'); | ||
|
||
expect(panelData[1].gridData.w).toBe(3); | ||
expect(panelData[1].gridData.h).toBe(2); | ||
expect(panelData[1].version).toBe('6.3.0'); | ||
}); | ||
|
||
test('convertPanelDataPre_6_3 scales panel dimensions', () => { | ||
const oldPanel = { | ||
gridData: { | ||
h: 3, | ||
w: 7, | ||
x: 2, | ||
y: 5, | ||
}, | ||
version: '6.2.0' | ||
}; | ||
const updatedPanel = PanelUtils.convertPanelDataPre_6_3(oldPanel); | ||
expect(updatedPanel.gridData.w).toBe(28); | ||
expect(updatedPanel.gridData.h).toBe(15); | ||
expect(updatedPanel.gridData.x).toBe(8); | ||
expect(updatedPanel.gridData.y).toBe(25); | ||
expect(updatedPanel.version).toBe('6.3.0'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters