Skip to content

Commit

Permalink
Move table-list-view to kibana-react (elastic#50046)
Browse files Browse the repository at this point in the history
* Move table-list-view to kibana-react

* Pass ui/* import as props

* Update i18n message ids

* Fix TS

* Fix unit tests
  • Loading branch information
maryia-lapata committed Nov 12, 2019
1 parent b9a43a1 commit 3a8e65a
Show file tree
Hide file tree
Showing 10 changed files with 229 additions and 154 deletions.

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 @@ -23,8 +23,9 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

import { EuiLink, EuiButton, EuiEmptyPrompt } from '@elastic/eui';
import { npStart } from 'ui/new_platform';

import { TableListView } from './../../table_list_view';
import { TableListView } from '../../../../../../../src/plugins/kibana_react/public';

export const EMPTY_FILTER = '';

Expand Down Expand Up @@ -58,6 +59,8 @@ export class DashboardListing extends React.Component {
tableListTitle={i18n.translate('kbn.dashboard.listing.dashboardsTitle', {
defaultMessage: 'Dashboards',
})}
toastNotifications={npStart.core.notifications.toasts}
uiSettings={npStart.core.uiSettings}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ jest.mock(
{ virtual: true }
);

jest.mock('ui/new_platform', () => {
return {
npStart: {
core: {
notifications: { toasts: { } },
uiSettings: { get: jest.fn(() => 10) },
},
},
};
});

import React from 'react';
import { shallow } from 'enzyme';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { TableListView } from './../../table_list_view';
import { TableListView } from '../../../../../../../src/plugins/kibana_react/public';

import { EuiIcon, EuiBetaBadge, EuiLink, EuiButton, EuiEmptyPrompt } from '@elastic/eui';

import { getServices } from '../kibana_services';

const { capabilities } = getServices();
const { capabilities, toastNotifications, uiSettings } = getServices();

class VisualizeListingTable extends Component {
constructor(props) {
Expand Down Expand Up @@ -57,6 +57,8 @@ class VisualizeListingTable extends Component {
tableListTitle={i18n.translate('kbn.visualize.listing.table.listTitle', {
defaultMessage: 'Visualizations',
})}
toastNotifications={toastNotifications}
uiSettings={uiSettings}
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/plugins/kibana_react/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ export * from './context';
export * from './overlays';
export * from './ui_settings';
export * from './field_icon';
export * from './table_list_view';
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@
* specific language governing permissions and limitations
* under the License.
*/

export { TableListView } from './table_list_view';

export * from './table_list_view';
Loading

0 comments on commit 3a8e65a

Please sign in to comment.