Skip to content

Commit

Permalink
Fix typings and add app context where needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Nov 11, 2019
1 parent 35c3ad7 commit c0d123a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 0 additions & 2 deletions x-pack/legacy/plugins/upgrade_assistant/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Legacy } from 'kibana';
import { SavedObject, SavedObjectAttributes } from 'src/core/server';
import { ServerShim } from '../server/np_ready/types';

export enum ReindexStep {
// Enum values are spaced out by 10 to give us room to insert steps in between.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { ReindexButton } from './reindex';
import { AppContext } from '../../../../app_context';

interface DeprecationCellProps {
items?: Array<{ title?: string; body: string }>;
Expand Down Expand Up @@ -77,7 +78,11 @@ export const DeprecationCell: StatelessComponent<DeprecationCellProps> = ({

{reindexIndexName && (
<EuiFlexItem grow={false}>
<ReindexButton indexName={reindexIndexName} />
<AppContext.Consumer>
{({ http, XSRF }) => (
<ReindexButton indexName={reindexIndexName} http={http} xsrf={XSRF} />
)}
</AppContext.Consumer>
</EuiFlexItem>
)}
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import React from 'react';
import { EuiBasicTable } from '@elastic/eui';
import { injectI18n } from '@kbn/i18n/react';
import { ReindexButton } from './reindex';
import { AppContext } from '../../../../app_context';

const PAGE_SIZES = [10, 25, 50, 100, 250, 500, 1000];

Expand Down Expand Up @@ -143,7 +144,13 @@ export class IndexDeprecationTableUI extends React.Component<
actions: [
{
render(indexDep: IndexDeprecationDetails) {
return <ReindexButton indexName={indexDep.index!} />;
return (
<AppContext.Consumer>
{({ XSRF, http }) => (
<ReindexButton indexName={indexDep.index!} http={http} xsrf={XSRF} />
)}
</AppContext.Consumer>
);
},
},
],
Expand Down

0 comments on commit c0d123a

Please sign in to comment.