Skip to content

Commit

Permalink
Merge branch 'master' into feat/aggs-server
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Aug 7, 2020
2 parents 5399ef3 + c6c300e commit 461845c
Show file tree
Hide file tree
Showing 135 changed files with 3,475 additions and 2,114 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@
]
},
"dependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
"@babel/register": "^7.10.1",
"@babel/core": "^7.11.1",
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
"@babel/register": "^7.10.5",
"@elastic/apm-rum": "^5.2.0",
"@elastic/charts": "19.8.1",
"@elastic/datemath": "5.0.3",
Expand Down Expand Up @@ -289,8 +289,8 @@
"yauzl": "2.10.0"
},
"devDependencies": {
"@babel/parser": "^7.10.2",
"@babel/types": "^7.10.2",
"@babel/parser": "^7.11.2",
"@babel/types": "^7.11.0",
"@elastic/eslint-config-kibana": "0.15.0",
"@elastic/eslint-plugin-eui": "0.0.2",
"@elastic/github-checks-reporter": "0.0.20b3",
Expand Down
4 changes: 2 additions & 2 deletions packages/elastic-datemath/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"kbn:watch": "yarn build --watch"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/cli": "^7.10.5",
"@babel/preset-env": "^7.11.0",
"babel-plugin-add-module-exports": "^1.0.2",
"moment": "^2.24.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"kbn:watch": "node scripts/build --source-maps --watch"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/cli": "^7.10.5",
"@kbn/dev-utils": "1.0.0",
"@kbn/babel-preset": "1.0.0",
"typescript": "3.9.5"
Expand Down
16 changes: 8 additions & 8 deletions packages/kbn-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"version": "1.0.0",
"license": "Apache-2.0",
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-proposal-export-namespace-from": "^7.10.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
"@babel/plugin-proposal-optional-chaining": "^7.10.1",
"@babel/plugin-proposal-private-methods": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"@babel/preset-typescript": "^7.10.1",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-export-namespace-from": "^7.10.4",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
"@babel/plugin-proposal-private-methods": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-react": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-filter-imports": "^3.0.0",
"babel-plugin-styled-components": "^1.10.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"kbn:watch": "node scripts/build --watch --source-maps"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/core": "^7.10.2",
"@babel/cli": "^7.10.5",
"@babel/core": "^7.11.1",
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"@types/intl-relativeformat": "^2.1.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/kbn-interpreter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
"kbn:watch": "node scripts/build --dev --watch"
},
"dependencies": {
"@babel/runtime": "^7.10.2",
"@babel/runtime": "^7.11.2",
"@kbn/i18n": "1.0.0",
"lodash": "^4.17.15",
"uuid": "3.3.2"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/core": "^7.10.2",
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
"@babel/plugin-transform-runtime": "^7.10.1",
"@babel/cli": "^7.10.5",
"@babel/core": "^7.11.1",
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.11.0",
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"babel-loader": "^8.0.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"@babel/cli": "^7.10.1",
"@babel/cli": "^7.10.5",
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"@kbn/ui-shared-deps": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-plugin-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"plugin-helpers": "bin/plugin-helpers.js"
},
"dependencies": {
"@babel/core": "^7.10.2",
"@babel/core": "^7.11.1",
"argv-split": "^2.0.1",
"commander": "^3.0.0",
"del": "^5.1.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/kbn-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"prettier": "prettier --write './src/**/*.ts'"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-proposal-object-rest-spread": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/preset-typescript": "^7.10.1",
"@babel/core": "^7.11.1",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.10.4",
"@types/cmd-shim": "^2.0.0",
"@types/cpy": "^5.1.0",
"@types/dedent": "^0.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"kbn:watch": "yarn build --watch"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/cli": "^7.10.5",
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"@types/joi": "^13.4.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"enzyme-adapter-react-16": "^1.9.1"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/core": "^7.11.1",
"@elastic/eui": "0.0.55",
"@kbn/babel-preset": "1.0.0",
"@kbn/optimizer": "1.0.0",
Expand Down
6 changes: 3 additions & 3 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@
"yargs": "4.8.1"
},
"dependencies": {
"@babel/core": "^7.10.2",
"@babel/register": "^7.10.1",
"@babel/runtime": "^7.10.2",
"@babel/core": "^7.11.1",
"@babel/register": "^7.10.5",
"@babel/runtime": "^7.11.2",
"@elastic/apm-rum-react": "^1.1.2",
"@elastic/datemath": "5.0.3",
"@elastic/ems-client": "7.9.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import React from 'react';
import { mount } from 'enzyme';
// @ts-expect-error untyped local
import { ExportApp } from '../export_app';
import { ExportApp } from '../export_app.component';
import { CanvasWorkpad } from '../../../../../types';

jest.mock('style-it', () => ({
it: (css: string, Component: any) => Component,
Expand All @@ -23,7 +23,7 @@ jest.mock('../../../../components/link', () => ({

describe('<ExportApp />', () => {
test('renders as expected', () => {
const sampleWorkpad = {
const sampleWorkpad = ({
id: 'my-workpad-abcd',
css: '',
pages: [
Expand All @@ -34,7 +34,7 @@ describe('<ExportApp />', () => {
elements: [3, 4, 5, 6],
},
],
};
} as any) as CanvasWorkpad;

const page1 = mount(
<ExportApp workpad={sampleWorkpad} selectedPageIndex={0} initializeWorkpad={() => {}} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FC, useEffect } from 'react';
import PropTypes from 'prop-types';
// @ts-expect-error untyped library
import Style from 'style-it';
// @ts-expect-error untyped local
import { WorkpadPage } from '../../../components/workpad_page';
import { Link } from '../../../components/link';
import { CanvasWorkpad } from '../../../../types';

interface Props {
workpad: CanvasWorkpad;
selectedPageIndex: number;
initializeWorkpad: () => void;
}

export const ExportApp: FC<Props> = ({ workpad, selectedPageIndex, initializeWorkpad }) => {
const { id, pages, height, width } = workpad;
const activePage = pages[selectedPageIndex];
const pageElementCount = activePage.elements.length;

useEffect(() => initializeWorkpad());

return (
<div className="canvasExport" data-shared-page={selectedPageIndex + 1}>
<div className="canvasExport__stage">
<div className="canvasLayout__stageHeader">
<Link name="loadWorkpad" params={{ id }}>
Edit Workpad
</Link>
</div>
{Style.it(
workpad.css,
<div className="canvasExport__stageContent" data-shared-items-count={pageElementCount}>
<WorkpadPage
isSelected
key={activePage.id}
pageId={activePage.id}
height={height}
width={width}
registerLayout={() => {}}
unregisterLayout={() => {}}
/>
</div>
)}
</div>
</div>
);
};

ExportApp.propTypes = {
workpad: PropTypes.shape({
id: PropTypes.string.isRequired,
pages: PropTypes.array.isRequired,
}).isRequired,
selectedPageIndex: PropTypes.number.isRequired,
initializeWorkpad: PropTypes.func.isRequired,
};
59 changes: 0 additions & 59 deletions x-pack/plugins/canvas/public/apps/export/export/export_app.js

This file was deleted.

21 changes: 21 additions & 0 deletions x-pack/plugins/canvas/public/apps/export/export/export_app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { connect } from 'react-redux';
import { initializeWorkpad } from '../../../state/actions/workpad';
import { getWorkpad, getSelectedPageIndex } from '../../../state/selectors/workpad';
import { ExportApp as Component } from './export_app.component';
import { State } from '../../../../types';

export const ExportApp = connect(
(state: State) => ({
workpad: getWorkpad(state),
selectedPageIndex: getSelectedPageIndex(state),
}),
(dispatch) => ({
initializeWorkpad: () => dispatch(initializeWorkpad()),
})
)(Component);
30 changes: 0 additions & 30 deletions x-pack/plugins/canvas/public/apps/export/export/index.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';

export const LoadWorkpad = () => <div>Load a workpad...</div>;
export { ExportApp } from './export_app';
export { ExportApp as ExportAppComponent } from './export_app.component';
Loading

0 comments on commit 461845c

Please sign in to comment.