mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Maps] Fix issue preventing TMS from rendering correctly (#71946)
* Ensure getColors selector modifies and returns the same object * Call onSourceConfigChange on CreateSourceEditor mount * Back out selector update Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
78b39e8b9f
commit
63e6666b13
1 changed files with 8 additions and 6 deletions
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { EuiFieldText, EuiFormRow, EuiPanel } from '@elastic/eui';
|
||||
|
||||
|
@ -13,10 +13,12 @@ import { i18n } from '@kbn/i18n';
|
|||
|
||||
export function CreateSourceEditor({ onSourceConfigChange }) {
|
||||
const tilemap = getKibanaTileMap();
|
||||
|
||||
if (tilemap.url) {
|
||||
onSourceConfigChange();
|
||||
}
|
||||
useEffect(() => {
|
||||
if (tilemap.url) {
|
||||
onSourceConfigChange();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<EuiPanel>
|
||||
|
@ -33,7 +35,7 @@ export function CreateSourceEditor({ onSourceConfigChange }) {
|
|||
})
|
||||
}
|
||||
>
|
||||
<EuiFieldText readOnly value={tilemap.url} />
|
||||
<EuiFieldText readOnly value={tilemap.url ? tilemap.url : ''} />
|
||||
</EuiFormRow>
|
||||
</EuiPanel>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue