Skip to content

Commit

Permalink
Add margin of error to test determining panel widths
Browse files Browse the repository at this point in the history
use real kibana version when creating panel data. Will make future conversions easier.

Move default height and width to dashboard_constants so those that need it don't end up including extra stuff like ui/chrome
  • Loading branch information
stacey-gammon committed Sep 19, 2017
1 parent be13668 commit ac601d9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export const DashboardConstants = {
LANDING_PAGE_PATH: '/dashboards',
CREATE_NEW_DASHBOARD_URL: '/dashboard',
};

export const DEFAULT_PANEL_WIDTH = 6;
export const DEFAULT_PANEL_HEIGHT = 3;
export const DASHBOARD_GRID_COLUMN_COUNT = 12;

export function createDashboardEditUrl(id) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PanelUtils } from '../panel_utils';
import { DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from '../panel_state';
import { DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from '../../dashboard_constants';

describe('PanelUtils', function () {
it('convertOldPanelData gives supplies width and height when missing', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
export const DEFAULT_PANEL_WIDTH = 6;
export const DEFAULT_PANEL_HEIGHT = 3;

import { DASHBOARD_GRID_COLUMN_COUNT } from '../dashboard_constants';
import { DASHBOARD_GRID_COLUMN_COUNT, DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from '../dashboard_constants';
import chrome from 'ui/chrome';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from 'plugins/kibana/dashboard/panel/panel_state';
import { DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from 'plugins/kibana/dashboard/dashboard_constants';
import chrome from 'ui/chrome';

import _ from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/dashboard/_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import expect from 'expect.js';

import {
DEFAULT_PANEL_WIDTH,
} from '../../../../src/core_plugins/kibana/public/dashboard/panel/panel_state';
} from '../../../../src/core_plugins/kibana/public/dashboard/dashboard_constants';

import {
VisualizeConstants
Expand Down

0 comments on commit ac601d9

Please sign in to comment.