Skip to content

Commit

Permalink
[7.x] [Canvas][tech-debt] Refactor Toolbar (completes Kill Recompose.…
Browse files Browse the repository at this point in the history
…pure) (#73309) (#74048)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
clintandrewhall and elasticmachine committed Aug 1, 2020
1 parent 37a7310 commit 3fcff1d
Show file tree
Hide file tree
Showing 14 changed files with 372 additions and 180 deletions.
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

0 comments on commit 3fcff1d

Please sign in to comment.