Skip to content

Commit

Permalink
[Maps] fix custom icon palettes UI not being displayed (#71482)
Browse files Browse the repository at this point in the history
* [Maps] fix custom icon palettes UI not being displayed

* cleanup test

* remove uneeded change to vector style defaults

* fix jest tests

* review feedback

* fix jest tests
  • Loading branch information
nreese authored Jul 14, 2020
1 parent 0c87aa5 commit 34c54ed
Show file tree
Hide file tree
Showing 23 changed files with 428 additions and 278 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export type ColorStylePropertyDescriptor =
| ColorDynamicStylePropertyDescriptor;

export type IconDynamicOptions = {
iconPaletteId?: string;
iconPaletteId: string | null;
customIconStops?: IconStop[];
useCustomIconMap?: boolean;
field?: StylePropertyField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
*/

jest.mock('../../../../kibana_services', () => {
const mockUiSettings = {
get: () => {
return undefined;
},
};
return {
getUiSettings: () => {
return mockUiSettings;
getIsDarkMode() {
return false;
},
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
*/

jest.mock('../../../../kibana_services', () => {
const mockUiSettings = {
get: () => {
return undefined;
},
};
return {
getUiSettings: () => {
return mockUiSettings;
getIsDarkMode() {
return false;
},
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ import sinon from 'sinon';

jest.mock('../../../kibana_services', () => {
return {
getUiSettings() {
return {
get() {
return false;
},
};
getIsDarkMode() {
return false;
},
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { UpdateSourceEditor } from './update_source_editor';
import { i18n } from '@kbn/i18n';
import { getDataSourceLabel } from '../../../../common/i18n_getters';
import { SOURCE_TYPES } from '../../../../common/constants';
import { getEmsTileLayerId, getUiSettings } from '../../../kibana_services';
import { getEmsTileLayerId, getIsDarkMode } from '../../../kibana_services';
import { registerSource } from '../source_registry';

export const sourceTitle = i18n.translate('xpack.maps.source.emsTileTitle', {
Expand Down Expand Up @@ -122,9 +122,8 @@ export class EMSTMSSource extends AbstractTMSSource {
return this._descriptor.id;
}

const isDarkMode = getUiSettings().get('theme:darkMode', false);
const emsTileLayerId = getEmsTileLayerId();
return isDarkMode ? emsTileLayerId.dark : emsTileLayerId.bright;
return getIsDarkMode() ? emsTileLayerId.dark : emsTileLayerId.bright;
}
}

Expand Down

This file was deleted.

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 @@ -12,11 +12,9 @@ import { IconMapSelect } from './icon_map_select';

export function DynamicIconForm({
fields,
isDarkMode,
onDynamicStyleChange,
staticDynamicSelect,
styleProperty,
symbolOptions,
}) {
const styleOptions = styleProperty.getOptions();

Expand Down Expand Up @@ -44,11 +42,8 @@ export function DynamicIconForm({
return (
<IconMapSelect
{...styleOptions}
useCustomIconMap={_.get(styleOptions, 'useCustomColorRamp', false)}
styleProperty={styleProperty}
onChange={onIconMapChange}
isDarkMode={isDarkMode}
symbolOptions={symbolOptions}
isCustomOnly={!field.supportsAutoDomain()}
/>
);
Expand Down

This file was deleted.

Loading

0 comments on commit 34c54ed

Please sign in to comment.