Skip to content

Commit

Permalink
[7.2] Fix: Fullscreen sizing on old workpads (elastic#37289) (elastic…
Browse files Browse the repository at this point in the history
…#37292)

* fix: provide css value for workpads

old workpads were missing this value, this fixes scaling in fullscreen mode

* fix: make workpadCss a required prop

this will cause warnings in the future if the value is missing. also remove the unused css prop.
  • Loading branch information
w33ble authored May 28, 2019
1 parent ee5278c commit 11cdfa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions x-pack/plugins/canvas/public/components/workpad/workpad.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ export class Workpad extends React.PureComponent {
isFullscreen: PropTypes.bool.isRequired,
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
workpadCss: PropTypes.string,
workpadCss: PropTypes.string.required,
undoHistory: PropTypes.func.isRequired,
redoHistory: PropTypes.func.isRequired,
nextPage: PropTypes.func.isRequired,
previousPage: PropTypes.func.isRequired,
fetchAllRenderables: PropTypes.func.isRequired,
css: PropTypes.object,
registerLayout: PropTypes.func.isRequired,
unregisterLayout: PropTypes.func.isRequired,
};
Expand Down
8 changes: 6 additions & 2 deletions x-pack/plugins/canvas/public/state/selectors/workpad.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { get, omit } from 'lodash';
import { safeElementFromExpression, fromExpression } from '@kbn/interpreter/common';

import { DEFAULT_WORKPAD_CSS } from '../../../common/lib/constants';
import { append } from '../../lib/modify_path';
import { getAssets } from './assets';

Expand All @@ -19,7 +19,11 @@ const appendAst = element => ({

// workpad getters
export function getWorkpad(state) {
return get(state, workpadRoot);
return {
// shim old workpads with new properties
css: DEFAULT_WORKPAD_CSS,
...get(state, workpadRoot),
};
}

// should we split `workpad.js` to eg. `workpad.js` (full) and `persistentWorkpadStructure.js` (persistent.workpad)?
Expand Down

0 comments on commit 11cdfa1

Please sign in to comment.