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][tech-debt] Refactor Toolbar (completes Kill Recompose.pure) #73309

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions x-pack/plugins/canvas/i18n/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,13 @@ export const ComponentStrings = {
i18n.translate('xpack.canvas.toolbar.workpadManagerCloseButtonLabel', {
defaultMessage: 'Close',
}),
getErrorMessage: (message: string) =>
i18n.translate('xpack.canvas.toolbar.errorMessage', {
defaultMessage: 'TOOLBAR ERROR: {message}',
values: {
message,
},
}),
},
ToolbarTray: {
getCloseTrayAriaLabel: () =>
Expand Down
16 changes: 0 additions & 16 deletions x-pack/plugins/canvas/public/components/navbar/navbar.js

This file was deleted.

7 changes: 0 additions & 7 deletions x-pack/plugins/canvas/public/components/navbar/navbar.scss

This file was deleted.

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

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

/*
TODO: uncomment and fix this test to address storybook errors as a result of nested component dependencies - https://github.com/elastic/kibana/issues/58289
*/

/*
import { action } from '@storybook/addon-actions';
import { storiesOf } from '@storybook/react';
import React from 'react';
import { Toolbar } from '../toolbar';
import { Toolbar } from '../toolbar.component';

// @ts-expect-error untyped local
import { getDefaultElement } from '../../../state/defaults';

storiesOf('components/Toolbar', module)
.addDecorator(story => (
<div
style={{
width: '200px',
}}
>
{story()}
</div>
))
.add('with null metric', () => (
.add('no element selected', () => (
<Toolbar
setTray={action('setTray')}
nextPage={action('nextPage')}
previousPage={action('previousPage')}
setShowWorkpadManager={action('setShowWorkpadManager')}
isWriteable={true}
selectedPageNumber={1}
totalPages={1}
showWorkpadManager={false}
workpadId={'abc'}
workpadName={'My Canvas Workpad'}
/>
))
.add('element selected', () => (
<Toolbar
isWriteable={true}
selectedElement={getDefaultElement()}
selectedPageNumber={1}
totalPages={1}
workpadId={'abc'}
workpadName={'My Canvas Workpad'}
/>
));
*/
49 changes: 0 additions & 49 deletions x-pack/plugins/canvas/public/components/toolbar/index.js

This file was deleted.

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

import { pure } from 'recompose';
import { Navbar as Component } from './navbar';

export const Navbar = pure(Component);
export { Toolbar } from './toolbar';
export { Toolbar as ToolbarComponent } from './toolbar.component';
Loading