mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
parent
5746d01ae0
commit
46d781e616
2 changed files with 6 additions and 7 deletions
|
@ -9,6 +9,7 @@ import {
|
|||
API_ROUTE_WORKPAD,
|
||||
API_ROUTE_WORKPAD_ASSETS,
|
||||
API_ROUTE_WORKPAD_STRUCTURES,
|
||||
DEFAULT_WORKPAD_CSS,
|
||||
} from '../../common/lib/constants';
|
||||
import { fetch } from '../../common/lib/fetch';
|
||||
|
||||
|
@ -22,7 +23,10 @@ export function create(workpad) {
|
|||
}
|
||||
|
||||
export function get(workpadId) {
|
||||
return fetch.get(`${apiPath}/${workpadId}`).then(({ data: workpad }) => workpad);
|
||||
return fetch.get(`${apiPath}/${workpadId}`).then(({ data: workpad }) => {
|
||||
// shim old workpads with new properties
|
||||
return { css: DEFAULT_WORKPAD_CSS, ...workpad };
|
||||
});
|
||||
}
|
||||
|
||||
export function update(id, workpad) {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
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';
|
||||
|
||||
|
@ -19,11 +18,7 @@ const appendAst = element => ({
|
|||
|
||||
// workpad getters
|
||||
export function getWorkpad(state) {
|
||||
return {
|
||||
// shim old workpads with new properties
|
||||
css: DEFAULT_WORKPAD_CSS,
|
||||
...get(state, workpadRoot),
|
||||
};
|
||||
return get(state, workpadRoot);
|
||||
}
|
||||
|
||||
// should we split `workpad.js` to eg. `workpad.js` (full) and `persistentWorkpadStructure.js` (persistent.workpad)?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue