Skip to content

Commit

Permalink
[Canvas] Move workpad api routes to New Platform (#51116)
Browse files Browse the repository at this point in the history
* Move workpad api routes to New Platform

* Cleanup

* Clean up/Pr Feedback

* Adding missing dependency to tests

* Fix typecheck

* Loosen workpad schema restrictions
  • Loading branch information
Corey Robertson committed Nov 26, 2019
1 parent 3b6e51b commit f529629
Show file tree
Hide file tree
Showing 23 changed files with 1,201 additions and 718 deletions.
13 changes: 13 additions & 0 deletions x-pack/legacy/plugins/canvas/__tests__/fixtures/workpads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,16 @@ export const elements: CanvasElement[] = [
{ ...BaseElement, expression: 'filters | demodata | pointseries | pie | render' },
{ ...BaseElement, expression: 'image | render' },
];

export const workpadWithGroupAsElement: CanvasWorkpad = {
...BaseWorkpad,
pages: [
{
...BasePage,
elements: [
{ ...BaseElement, expression: 'image | render' },
{ ...BaseElement, id: 'group-1234' },
],
},
],
};
1 change: 1 addition & 0 deletions x-pack/legacy/plugins/canvas/public/lib/workpad_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function get(workpadId) {
});
}

// TODO: I think this function is never used. Look into and remove the corresponding route as well
export function update(id, workpad) {
return fetch.put(`${apiPath}/${id}`, workpad);
}
Expand Down
2 changes: 0 additions & 2 deletions x-pack/legacy/plugins/canvas/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { workpad } from './workpad';
import { esFields } from './es_fields';
import { customElements } from './custom_elements';
import { shareableWorkpads } from './shareables';
Expand All @@ -13,6 +12,5 @@ import { CoreSetup } from '../shim';
export function routes(setup: CoreSetup): void {
customElements(setup.http.route, setup.elasticsearch);
esFields(setup.http.route, setup.elasticsearch);
workpad(setup.http.route, setup.elasticsearch);
shareableWorkpads(setup.http.route);
}
Loading

0 comments on commit f529629

Please sign in to comment.