Skip to content

Commit

Permalink
adapt non-ts calls
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Oct 29, 2019
1 parent a49de40 commit 71f530b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/legacy/ui/public/vis/map/map_messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
EuiSpacer,
EuiButtonEmpty
} from '@elastic/eui';
import { reactMount } from '../../../../../plugins/kibana_react/public';

export const createZoomWarningMsg = (function () {
let disableZoomMsg = false;
Expand Down Expand Up @@ -107,7 +108,7 @@ export const createZoomWarningMsg = (function () {

const zoomToast = ({
title: 'No additional zoom levels',
text: <ZoomWarning onChange={setZoomMsg}/>,
text: reactMount(<ZoomWarning onChange={setZoomMsg}/>),
'data-test-subj': 'maxZoomWarning',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { EuiMonitoringTable } from 'plugins/monitoring/components/table';
import { AlertsIndicator } from 'plugins/monitoring/components/cluster/listing/alerts_indicator';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { reactMount } from '../../../../../../../../src/plugins/kibana_react/public';
import { STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../../common/constants';

const IsClusterSupported = ({ isSupported, children }) => {
Expand Down Expand Up @@ -271,14 +272,14 @@ const licenseWarning = (scope, { title, text }) => {

const handleClickIncompatibleLicense = (scope, clusterName) => {
licenseWarning(scope, {
title: (
title: reactMount(
<FormattedMessage
id="xpack.monitoring.cluster.listing.incompatibleLicense.warningMessageTitle"
defaultMessage="You can't view the {clusterName} cluster"
values={{ clusterName: '"' + clusterName + '"' }}
/>
),
text: (
text: reactMount(
<Fragment>
<p>
<FormattedMessage
Expand Down Expand Up @@ -311,14 +312,14 @@ const handleClickInvalidLicense = (scope, clusterName) => {
const licensingPath = `${chrome.getBasePath()}/app/kibana#/management/elasticsearch/license_management/home`;

licenseWarning(scope, {
title: (
title: reactMount(
<FormattedMessage
id="xpack.monitoring.cluster.listing.invalidLicense.warningMessageTitle"
defaultMessage="You can't view the {clusterName} cluster"
values={{ clusterName: '"' + clusterName + '"' }}
/>
),
text: (
text: reactMount(
<Fragment>
<p>
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
EuiText,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { reactMount } from '../../../../../../src/plugins/kibana_react/public';

export function formatMonitoringError(err) {
// TODO: We should stop using Boom for errors and instead write a custom handler to return richer error objects
Expand Down Expand Up @@ -47,12 +48,12 @@ export function ajaxErrorHandlersProvider($injector) {
kbnUrl.redirect('access-denied');
} else if (err.status === 404 && !contains(window.location.hash, 'no-data')) { // pass through if this is a 404 and we're already on the no-data page
toastNotifications.addDanger({
title: (
title: reactMount(
<FormattedMessage
id="xpack.monitoring.ajaxErrorHandler.requestFailedNotificationTitle"
defaultMessage="Monitoring Request Failed"
/>),
text: (
text: reactMount(
<div>
{ formatMonitoringError(err) }
<EuiSpacer />
Expand All @@ -71,12 +72,12 @@ export function ajaxErrorHandlersProvider($injector) {
});
} else {
toastNotifications.addDanger({
title: (
title: reactMount(
<FormattedMessage
id="xpack.monitoring.ajaxErrorHandler.requestErrorNotificationTitle"
defaultMessage="Monitoring Request Error"
/>),
text: formatMonitoringError(err)
text: reactMount(formatMonitoringError(err))
});
}

Expand Down

0 comments on commit 71f530b

Please sign in to comment.