Skip to content

Commit

Permalink
adapt some calls to new signature
Browse files Browse the repository at this point in the history
Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>
  • Loading branch information
pgayvallet committed Oct 24, 2019
1 parent 595633d commit 38417f8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
createAction,
IncompatibleActionError,
} from '../../../../../../plugins/ui_actions/public';
import { mountForComponent } from '../../../../../../plugins/kibana_react/public';
import { changeTimeFilter, extractTimeFilter, FilterManager } from '../filter_manager';
import { TimefilterContract } from '../../timefilter';
import { applyFiltersPopover } from '../apply_filters/apply_filters_popover';
Expand Down Expand Up @@ -74,17 +75,19 @@ export function createFilterAction(

const filterSelectionPromise: Promise<Filter[]> = new Promise(resolve => {
const overlay = npStart.core.overlays.openModal(
applyFiltersPopover(
filters,
indexPatterns,
() => {
overlay.close();
resolve([]);
},
(filterSelection: Filter[]) => {
overlay.close();
resolve(filterSelection);
}
mountForComponent(
applyFiltersPopover(
filters,
indexPatterns,
() => {
overlay.close();
resolve([]);
},
(filterSelection: Filter[]) => {
overlay.close();
resolve(filterSelection);
}
)
),
{
'data-test-subj': 'test',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
import { i18n } from '@kbn/i18n';

import { npStart } from 'ui/new_platform';
import { mountForComponent } from '../../../../../../../src/plugins/kibana_react/public';

const MAX_SIMPLE_MESSAGE_LENGTH = 140;

Expand All @@ -43,27 +44,29 @@ export const ToastNotificationText: FC<{ text: any }> = ({ text }) => {

const openModal = () => {
const modal = npStart.core.overlays.openModal(
<EuiModal onClose={() => modal.close()}>
<EuiModalHeader>
<EuiModalHeaderTitle>
{i18n.translate('xpack.transform.toastText.modalTitle', {
defaultMessage: 'Error details',
})}
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<EuiCodeBlock language="json" fontSize="m" paddingSize="s" isCopyable>
{formattedText}
</EuiCodeBlock>
</EuiModalBody>
<EuiModalFooter>
<EuiButtonEmpty onClick={() => modal.close()}>
{i18n.translate('xpack.transform.toastText.closeModalButtonText', {
defaultMessage: 'Close',
})}
</EuiButtonEmpty>
</EuiModalFooter>
</EuiModal>
mountForComponent(
<EuiModal onClose={() => modal.close()}>
<EuiModalHeader>
<EuiModalHeaderTitle>
{i18n.translate('xpack.transform.toastText.modalTitle', {
defaultMessage: 'Error details',
})}
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<EuiCodeBlock language="json" fontSize="m" paddingSize="s" isCopyable>
{formattedText}
</EuiCodeBlock>
</EuiModalBody>
<EuiModalFooter>
<EuiButtonEmpty onClick={() => modal.close()}>
{i18n.translate('xpack.transform.toastText.closeModalButtonText', {
defaultMessage: 'Close',
})}
</EuiButtonEmpty>
</EuiModalFooter>
</EuiModal>
)
);
};

Expand Down

0 comments on commit 38417f8

Please sign in to comment.