Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Canvas] Remove Angular and unnecessary reporting config from Canvas #54050

Merged
merged 13 commits into from
Jan 27, 2020
8 changes: 0 additions & 8 deletions x-pack/legacy/plugins/canvas/.storybook/storyshots.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ jest.mock('@elastic/eui/packages/react-datepicker', () => {

jest.mock('plugins/interpreter/registries', () => ({}));

// Disabling this test due to https://github.com/elastic/eui/issues/2242
jest.mock(
'../public/components/workpad_header/workpad_export/__examples__/disabled_panel.stories',
() => {
return 'Disabled Panel';
}
);

// Disabling this test due to https://github.com/elastic/eui/issues/2242
jest.mock(
'../public/components/workpad_header/workpad_export/flyout/__examples__/share_website_flyout.stories',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import { i18n } from '@kbn/i18n';
import { CANVAS as canvas } from './constants';

export const AngularStrings = {
CanvasRootController: {
getReadOnlyBadgeText: () =>
export const CapabilitiesStrings = {
ReadOnlyBadge: {
getText: () =>
i18n.translate('xpack.canvas.badge.readOnly.text', {
defaultMessage: 'Read only',
}),
getReadOnlyBadgeTooltip: () =>
getTooltip: () =>
i18n.translate('xpack.canvas.badge.readOnly.tooltip', {
defaultMessage: 'Unable to save {canvas} workpads',
values: {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/canvas/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { i18n } from '@kbn/i18n';

export * from './angular';
export * from './capabilities';
export * from './components';
export * from './constants';
export * from './errors';
Expand Down
8 changes: 0 additions & 8 deletions x-pack/legacy/plugins/canvas/public/angular/config/index.js

This file was deleted.

This file was deleted.

This file was deleted.

54 changes: 0 additions & 54 deletions x-pack/legacy/plugins/canvas/public/angular/controllers/canvas.tsx

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions x-pack/legacy/plugins/canvas/public/angular/services/index.js

This file was deleted.

31 changes: 0 additions & 31 deletions x-pack/legacy/plugins/canvas/public/angular/services/store.js

This file was deleted.

36 changes: 36 additions & 0 deletions x-pack/legacy/plugins/canvas/public/application.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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 from 'react';
import { Store } from 'redux';
import ReactDOM from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { Provider } from 'react-redux';

import { AppMountParameters, CoreStart } from 'kibana/public';

// @ts-ignore Untyped local
import { App } from './components/app';
import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public';

export const renderApp = (
coreStart: CoreStart,
plugins: object,
{ element }: AppMountParameters,
canvasStore: Store
) => {
ReactDOM.render(
<KibanaContextProvider services={{ ...coreStart, ...plugins }}>
<I18nProvider>
<Provider store={canvasStore}>
<App />
</Provider>
</I18nProvider>
</KibanaContextProvider>,
element
);
return () => ReactDOM.unmountComponentAtNode(element);
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,13 @@ import { action } from '@storybook/addon-actions';
import React from 'react';
import { WorkpadExport } from '../workpad_export';

storiesOf('components/Export/WorkpadExport', module)
.add('enabled', () => (
<WorkpadExport
enabled={true}
onCopy={action('onCopy')}
onExport={action('onExport')}
getExportUrl={(type: string) => {
action(`getExportUrl('${type}')`);
return type;
}}
/>
))
.add('disabled', () => (
<WorkpadExport
enabled={false}
onCopy={action('onCopy')}
onExport={action('onExport')}
getExportUrl={(type: string) => {
action(`getExportUrl('${type}')`);
return type;
}}
/>
));
storiesOf('components/Export/WorkpadExport', module).add('enabled', () => (
<WorkpadExport
onCopy={action('onCopy')}
onExport={action('onExport')}
getExportUrl={(type: string) => {
action(`getExportUrl('${type}')`);
return type;
}}
/>
));

This file was deleted.

Loading