diff --git a/CHANGELOG.md b/CHANGELOG.md index f509933467b4..edc812717b9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [CVE-2022-37603] Bump loader-utils from `2.0.3` to `2.0.4` ([#3031](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3031)). Backwards-compatible fixes included in v2.6.0 and v1.3.7 releases. - [WS-2021-0638] Bump mocha from `7.2.0` to `10.1.0` ([#2711](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2711)) - Bump `joi` to v14 to avoid the possibility of prototype poisoning in a nested dependency ([#3952](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3952)) +- [CVE-2022-25883] Resolve `semver` to `7.5.3` and remove unused package ([#4411](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4411)) ### 📈 Features/Enhancements @@ -22,10 +23,12 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Hide any output from use_node checking for Node compatibility ([#4237](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4237)) - Add category option within groups for context menus ([#4144](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4144)) - [Saved Object Service] Add Repository Factory Provider ([#4149](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4149)) +- [Sample Data] Add visual consistency dashboard to sample logs data ([#4339](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4339)) - [@osd/pm] Fix `file:`-linked dependencies' resolution to improve ability to test with local packages ([#4342](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4342)) - [Multiple DataSource] Backend support for adding sample data ([#4268](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4268)) - Add configurable defaults and overrides to uiSettings ([#4344](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4344)) - Bump OUI to `1.1.2` to make `anomalyDetection` icon available ([#4408](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4408)) +- [Multiple DataSource] Frontend support for adding sample data ([#4412](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4412)) ### 🐛 Bug Fixes @@ -69,6 +72,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Vis Colors] [TSVB] Update default color in `vis_type_timeseries` to use `ouiPaletteColorBlind()[0]`([#4363](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4363)) - [Vis Colors] [Timeline] Replace `vis_type_timeline` colors with `ouiPaletteColorBlind()` ([#4366](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4366)) - [Vis Colors] Update legacy seed colors to use `ouiPaletteColorBlind()` ([#4348](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4348)) +- [Vis colors] Update legacy mapped colors in charts plugin to use `ouiPaletteColorBlind()`, Update default color in legacy visualizations to use `ouiPaletteColorBlind()[0]` ([#4398](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4398)) - [Console] Migrate `/lib/mappings/` module to TypeScript ([#4008](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4008)) ### 🔩 Tests diff --git a/package.json b/package.json index d0774c61cc17..0ba377a55566 100644 --- a/package.json +++ b/package.json @@ -97,6 +97,7 @@ "**/unset-value": "^2.0.1", "**/jest-config": "npm:@amoo-miki/jest-config@27.5.1", "**/jest-jasmine2": "npm:@amoo-miki/jest-jasmine2@27.5.1", + "**/semver": "^7.5.3", "**/set-value": "^4.1.0", "**/xml2js": "^0.5.0", "**/yaml": "^2.2.2" @@ -211,7 +212,7 @@ "require-in-the-middle": "^5.0.2", "rison-node": "1.0.2", "rxjs": "^6.5.5", - "semver": "^5.7.0", + "semver": "^7.5.3", "set-value": "^4.1.0", "source-map-support": "^0.5.19", "symbol-observable": "^1.2.0", @@ -322,7 +323,7 @@ "@types/react-virtualized": "^9.18.7", "@types/recompose": "^0.30.6", "@types/selenium-webdriver": "^4.0.9", - "@types/semver": "^5.5.0", + "@types/semver": "^7.5.0", "@types/sinon": "^7.0.13", "@types/strip-ansi": "^5.2.1", "@types/styled-components": "^5.1.19", diff --git a/packages/osd-pm/package.json b/packages/osd-pm/package.json index 5f50dc858b13..66a529bc7b62 100644 --- a/packages/osd-pm/package.json +++ b/packages/osd-pm/package.json @@ -20,7 +20,6 @@ "@babel/preset-typescript": "^7.16.5", "@node-rs/xxhash": "^1.3.0", "@types/cmd-shim": "^2.0.0", - "@types/cpy": "^5.1.0", "@types/dedent": "^0.7.0", "@types/getopts": "^2.0.1", "@types/glob": "^7.1.3", diff --git a/packages/osd-stylelint-plugin-stylelint/package.json b/packages/osd-stylelint-plugin-stylelint/package.json index 2d2a6e661d5d..49947331fb59 100644 --- a/packages/osd-stylelint-plugin-stylelint/package.json +++ b/packages/osd-stylelint-plugin-stylelint/package.json @@ -13,6 +13,7 @@ "devOnly": true }, "peerDependencies": { + "postcss": "^8.4.12", "stylelint": "^14.5.2" }, "devDependencies": { diff --git a/packages/osd-stylelint-plugin-stylelint/src/rules/no_custom_colors/index.ts b/packages/osd-stylelint-plugin-stylelint/src/rules/no_custom_colors/index.ts index 249b87074949..9a8fab66c509 100644 --- a/packages/osd-stylelint-plugin-stylelint/src/rules/no_custom_colors/index.ts +++ b/packages/osd-stylelint-plugin-stylelint/src/rules/no_custom_colors/index.ts @@ -17,7 +17,7 @@ import { getUntrackedMessage, getNotCompliantMessage, getRulesFromConfig, - isColorProperty, + getColorPropertyParent, isValidOptions, ValueBasedConfig, } from '../../utils'; @@ -32,12 +32,12 @@ const messages = ruleMessages(ruleName, { expected: (message) => `${message}`, }); -const ruleFunction = ( +const ruleFunction: stylelint.Rule = ( primaryOption: Record, secondaryOptionObject: Record, context ) => { - return (postcssRoot: any, postcssResult: any) => { + return (postcssRoot, postcssResult) => { const validOptions = isValidOptions(postcssResult, ruleName, primaryOption); if (!validOptions) { return; @@ -47,15 +47,16 @@ const ruleFunction = ( const isAutoFixing = Boolean(context.fix); - postcssRoot.walkDecls((decl: any) => { - if (!isColorProperty(decl.prop)) { + postcssRoot.walkDecls((decl) => { + const parent = getColorPropertyParent(decl); + if (!parent) { return; } let shouldReport = false; const nodeInfo = { - selector: decl.parent.selector, + selector: parent.selector, prop: decl.prop, value: decl.value, }; diff --git a/packages/osd-stylelint-plugin-stylelint/src/rules/no_modifying_global_selectors/index.ts b/packages/osd-stylelint-plugin-stylelint/src/rules/no_modifying_global_selectors/index.ts index f2b07a7c8d8b..d58e7819688f 100644 --- a/packages/osd-stylelint-plugin-stylelint/src/rules/no_modifying_global_selectors/index.ts +++ b/packages/osd-stylelint-plugin-stylelint/src/rules/no_modifying_global_selectors/index.ts @@ -26,12 +26,12 @@ const messages = ruleMessages(ruleName, { expected: (message) => `${message}`, }); -const ruleFunction = ( +const ruleFunction: stylelint.Rule = ( primaryOption: Record, secondaryOptionObject: Record, context ) => { - return (postcssRoot: any, postcssResult: any) => { + return (postcssRoot, postcssResult) => { const validOptions = isValidOptions(postcssResult, ruleName, primaryOption); if (!validOptions) { return; @@ -41,7 +41,7 @@ const ruleFunction = ( const isAutoFixing = Boolean(context.fix); - postcssRoot.walkRules((rule: any) => { + postcssRoot.walkRules((rule) => { const selectorRule = getRuleFromConfig(rules, rule.selector); if (!selectorRule) { return; @@ -49,7 +49,11 @@ const ruleFunction = ( let shouldReport = false; - const file = postcssRoot.source.input.file; + const file = postcssRoot.source?.input.file; + if (!file) { + return; + } + const approvedFiles = selectorRule.approved; const reportInfo = { diff --git a/packages/osd-stylelint-plugin-stylelint/src/utils/is_color_property.ts b/packages/osd-stylelint-plugin-stylelint/src/utils/is_color_property.ts index d52cb43cfc32..ef7ad9118f81 100644 --- a/packages/osd-stylelint-plugin-stylelint/src/utils/is_color_property.ts +++ b/packages/osd-stylelint-plugin-stylelint/src/utils/is_color_property.ts @@ -9,6 +9,8 @@ * GitHub history for details. */ +import { Rule, Declaration } from 'postcss'; + const COLOR_PROPERTIES = [ 'all', 'animation', @@ -58,3 +60,11 @@ const COLOR_PROPERTIES = [ export const isColorProperty = (prop: string) => { return COLOR_PROPERTIES.includes(prop); }; + +export const getColorPropertyParent = (decl: Declaration) => { + if (!isColorProperty(decl.prop)) { + return undefined; + } + + return decl.parent as Rule; +}; diff --git a/src/plugins/charts/public/services/colors/color_palette.ts b/src/plugins/charts/public/services/colors/color_palette.ts deleted file mode 100644 index d7849ef37d88..000000000000 --- a/src/plugins/charts/public/services/colors/color_palette.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import _ from 'lodash'; - -import { euiPaletteColorBlind } from '@elastic/eui'; - -/** - * Generates an array of hex colors the length of the input number - */ -export function createColorPalette(num: number): string[] { - if (!_.isNumber(num)) { - throw new TypeError('ColorPaletteUtilService expects a number'); - } - - return euiPaletteColorBlind({ rotations: Math.ceil(num / 10), direction: 'both' }).slice(0, num); -} diff --git a/src/plugins/charts/public/services/colors/colors.test.ts b/src/plugins/charts/public/services/colors/colors.test.ts index c189b9dc7bae..d41e6e6be6e7 100644 --- a/src/plugins/charts/public/services/colors/colors.test.ts +++ b/src/plugins/charts/public/services/colors/colors.test.ts @@ -31,6 +31,7 @@ import { coreMock } from '../../../../../core/public/mocks'; import { COLOR_MAPPING_SETTING } from '../../../common'; import { euiPaletteColorBlind } from '@elastic/eui'; + import { ColorsService } from './colors'; // Local state for config diff --git a/src/plugins/charts/public/services/colors/colors_palette.test.ts b/src/plugins/charts/public/services/colors/colors_palette.test.ts deleted file mode 100644 index ecb0a24be856..000000000000 --- a/src/plugins/charts/public/services/colors/colors_palette.test.ts +++ /dev/null @@ -1,117 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { createColorPalette } from './color_palette'; -import { euiPaletteColorBlind } from '@elastic/eui'; - -describe('Color Palette', () => { - const num1 = 45; - const num2 = 72; - const num3 = 90; - const string = 'Welcome'; - const bool = true; - const nullValue = null; - const emptyArr: [] = []; - const emptyObject = {}; - let colorPalette: string[]; - - beforeEach(() => { - colorPalette = createColorPalette(num1); - }); - - function isHexValue(value: string): boolean { - // Check if the hex value is valid. - const regex = /^#[0-9a-fA-F]{3}|[0-9a-fA-F]{6}$/; - return regex.test(value) ? true : false; - } - - it('should throw an error if input is not a number', () => { - expect(() => { - // @ts-expect-error - createColorPalette(string); - }).toThrowError(); - - expect(() => { - // @ts-expect-error - createColorPalette(bool); - }).toThrowError(); - - expect(() => { - // @ts-expect-error - createColorPalette(nullValue); - }).toThrowError(); - - expect(() => { - // @ts-expect-error - createColorPalette(emptyArr); - }).toThrowError(); - - expect(() => { - // @ts-expect-error - createColorPalette(emptyObject); - }).toThrowError(); - - expect(() => { - // @ts-expect-error - createColorPalette(); - }).toThrowError(); - }); - - it('should be a function', () => { - expect(typeof createColorPalette).toBe('function'); - }); - - it('should return an array', () => { - expect(colorPalette).toBeInstanceOf(Array); - }); - - it('should return an array of the same length as the input', () => { - expect(colorPalette.length).toBe(num1); - }); - - it('should return the seed color array when input length is 72', () => { - expect(createColorPalette(num2).length).toBe(num2); - expect(isHexValue(createColorPalette(num2)[71])).toBe(true); - }); - - it('should return an array of the same length as the input when input is greater than 72', () => { - expect(createColorPalette(num3).length).toBe(num3); - }); - - it('should create new darker colors when input is greater than 72', () => { - expect(createColorPalette(num3)[72]).not.toEqual(euiPaletteColorBlind()[0]); - }); - - it('should create new colors and convert them correctly', () => { - expect(createColorPalette(num3).length).toBe(num3); - expect(createColorPalette(num3)[72]).not.toEqual(euiPaletteColorBlind()[9]); - expect(isHexValue(createColorPalette(num3)[89])).toBe(true); - }); -}); diff --git a/src/plugins/charts/public/services/colors/mapped_colors.ts b/src/plugins/charts/public/services/colors/mapped_colors.ts index c4ce91dce1aa..bc8ad8640985 100644 --- a/src/plugins/charts/public/services/colors/mapped_colors.ts +++ b/src/plugins/charts/public/services/colors/mapped_colors.ts @@ -33,8 +33,8 @@ import Color from 'color'; import { CoreSetup } from 'opensearch-dashboards/public'; +import { euiPaletteColorBlind } from '@elastic/eui'; import { COLOR_MAPPING_SETTING } from '../../../common'; -import { createColorPalette } from './color_palette'; const standardizeColor = (color: string) => new Color(color).hex().toLowerCase(); @@ -100,7 +100,11 @@ export class MappedColors { // Generate a color palette big enough that all new keys can have unique color values const allColors = _(this._mapping).values().union(configColors).union(oldColors).value(); - const colorPalette = createColorPalette(allColors.length + keysToMap.length); + const numColors = allColors.length + keysToMap.length; + const colorPalette = euiPaletteColorBlind({ + rotations: Math.ceil(numColors / 10), + direction: 'both', + }).slice(0, numColors); let newColors = _.difference(colorPalette, allColors); while (keysToMap.length > newColors.length) { diff --git a/src/plugins/charts/server/plugin.ts b/src/plugins/charts/server/plugin.ts index 7e733c0120f3..c9059b5f7380 100644 --- a/src/plugins/charts/server/plugin.ts +++ b/src/plugins/charts/server/plugin.ts @@ -41,7 +41,7 @@ export class ChartsServerPlugin implements Plugin { defaultMessage: 'Color mapping', }), value: JSON.stringify({ - Count: '#00A69B', + Count: '#54B399', }), type: 'json', description: i18n.translate('charts.advancedSettings.visualization.colorMappingText', { diff --git a/src/plugins/home/opensearch_dashboards.json b/src/plugins/home/opensearch_dashboards.json index 35a81bc7adb9..40351c0dd83c 100644 --- a/src/plugins/home/opensearch_dashboards.json +++ b/src/plugins/home/opensearch_dashboards.json @@ -6,6 +6,6 @@ "requiredPlugins": ["data", "urlForwarding"], "optionalPlugins": ["usageCollection", "telemetry", "dataSource"], "requiredBundles": [ - "opensearchDashboardsReact" + "opensearchDashboardsReact", "dataSourceManagement" ] } diff --git a/src/plugins/home/public/application/components/sample_data_set_card.js b/src/plugins/home/public/application/components/sample_data_set_card.js index 3ec86826639a..7d8b97a1c982 100644 --- a/src/plugins/home/public/application/components/sample_data_set_card.js +++ b/src/plugins/home/public/application/components/sample_data_set_card.js @@ -57,11 +57,11 @@ export class SampleDataSetCard extends React.Component { }; install = () => { - this.props.onInstall(this.props.id); + this.props.onInstall(this.props.id, this.props.dataSourceId); }; uninstall = () => { - this.props.onUninstall(this.props.id); + this.props.onUninstall(this.props.id, this.props.dataSourceId); }; renderBtn = () => { diff --git a/src/plugins/home/public/application/components/sample_data_set_cards.js b/src/plugins/home/public/application/components/sample_data_set_cards.js index 31735d203dda..0234f5f4a6e0 100644 --- a/src/plugins/home/public/application/components/sample_data_set_cards.js +++ b/src/plugins/home/public/application/components/sample_data_set_cards.js @@ -67,10 +67,21 @@ export class SampleDataSetCards extends React.Component { this.loadSampleDataSets(); } - loadSampleDataSets = async () => { + componentDidUpdate(prevProps) { + if (this.props.isDataSourceEnabled) { + this._isMounted = true; + if (prevProps && prevProps.dataSourceId !== this.props.dataSourceId) { + this.setState({ dataSourceId: this.props.dataSourceId }, () => + this.loadSampleDataSets(this.state.dataSourceId) + ); + } + } + } + + loadSampleDataSets = async (dataSourceId) => { let sampleDataSets; try { - sampleDataSets = await listSampleDataSets(); + sampleDataSets = await listSampleDataSets(dataSourceId); } catch (fetchError) { this.toastNotifications.addDanger({ title: i18n.translate('home.sampleDataSet.unableToLoadListErrorMessage', { @@ -93,7 +104,7 @@ export class SampleDataSetCards extends React.Component { }); }; - install = async (id) => { + install = async (id, dataSourceId) => { const targetSampleDataSet = this.state.sampleDataSets.find((sampleDataSet) => { return sampleDataSet.id === id; }); @@ -103,7 +114,7 @@ export class SampleDataSetCards extends React.Component { })); try { - await installSampleDataSet(id, targetSampleDataSet.defaultIndex); + await installSampleDataSet(id, targetSampleDataSet.defaultIndex, dataSourceId); } catch (fetchError) { if (this._isMounted) { this.setState((prevState) => ({ @@ -141,7 +152,7 @@ export class SampleDataSetCards extends React.Component { }); }; - uninstall = async (id) => { + uninstall = async (id, dataSourceId) => { const targetSampleDataSet = this.state.sampleDataSets.find((sampleDataSet) => { return sampleDataSet.id === id; }); @@ -151,7 +162,7 @@ export class SampleDataSetCards extends React.Component { })); try { - await uninstallSampleDataSet(id, targetSampleDataSet.defaultIndex); + await uninstallSampleDataSet(id, targetSampleDataSet.defaultIndex, dataSourceId); } catch (fetchError) { if (this._isMounted) { this.setState((prevState) => ({ @@ -213,6 +224,7 @@ export class SampleDataSetCards extends React.Component { previewUrl={this.props.addBasePath(this.lightOrDarkImage(sampleDataSet))} onInstall={this.install} onUninstall={this.uninstall} + dataSourceId={this.state.dataSourceId} /> ); diff --git a/src/plugins/home/public/application/components/tutorial_directory.js b/src/plugins/home/public/application/components/tutorial_directory.js index ce9cf071d3a0..0dcdc3ec775f 100644 --- a/src/plugins/home/public/application/components/tutorial_directory.js +++ b/src/plugins/home/public/application/components/tutorial_directory.js @@ -34,9 +34,12 @@ import PropTypes from 'prop-types'; import { Synopsis } from './synopsis'; import { SampleDataSetCards } from './sample_data_set_cards'; import { getServices } from '../opensearch_dashboards_services'; +// eslint-disable-next-line @osd/eslint/no-restricted-paths +import { getDataSources } from '../../../../data_source_management/public/components/utils'; import { EuiPage, + EuiPanel, EuiTabs, EuiTab, EuiFlexItem, @@ -45,10 +48,10 @@ import { EuiSpacer, EuiTitle, EuiPageBody, + EuiComboBox, } from '@elastic/eui'; import { getTutorials } from '../load_tutorials'; - import { injectI18n, FormattedMessage } from '@osd/i18n/react'; import { i18n } from '@osd/i18n'; @@ -59,6 +62,9 @@ const homeTitle = i18n.translate('home.breadcrumbs.homeTitle', { defaultMessage: const addDataTitle = i18n.translate('home.breadcrumbs.addDataTitle', { defaultMessage: 'Add data', }); +const localCluster = i18n.translate('home.dataSource.localCluster', { + defaultMessage: 'Local Cluster', +}); class TutorialDirectoryUi extends React.Component { constructor(props) { @@ -81,6 +87,8 @@ class TutorialDirectoryUi extends React.Component { selectedTabId: openTab, tutorialCards: [], notices: getServices().tutorialService.getDirectoryNotices(), + isDataSourceEnabled: !!getServices().dataSource, + selectedOption: [{ label: localCluster }], }; } @@ -152,6 +160,31 @@ class TutorialDirectoryUi extends React.Component { return a.name.toLowerCase().localeCompare(b.name.toLowerCase()); }); + if (this.state.isDataSourceEnabled) { + getDataSources(getServices().savedObjectsClient) + .then((fetchedDataSources) => { + if (fetchedDataSources?.length) { + const dataSourceOptions = fetchedDataSources.map((dataSource) => ({ + id: dataSource.id, + label: dataSource.title, + })); + + dataSourceOptions.push({ label: localCluster }); + this.setState({ + // eslint-disable-line react/no-did-mount-set-state + dataSources: dataSourceOptions, + }); + } + }) + .catch(() => { + getServices().toastNotifications.addWarning( + i18n.translate('home.dataSource.fetchDataSourceError', { + defaultMessage: 'Unable to fetch existing data sources', + }) + ); + }); + } + this.setState({ // eslint-disable-line react/no-did-mount-set-state tutorialCards: tutorialCards, @@ -164,6 +197,12 @@ class TutorialDirectoryUi extends React.Component { }); }; + onSelectedDataSourceChange = (e) => { + this.setState({ selectedOption: e }); + const dataSourceId = e[0] ? e[0].id : undefined; + this.setState({ selectedDataSourceId: dataSourceId }); + }; + renderTabs = () => { return this.tabs.map((tab, index) => ( { if (this.state.selectedTabId === SAMPLE_DATA_TAB_ID) { - return ; + return ( + + ); } return ( @@ -210,6 +255,30 @@ class TutorialDirectoryUi extends React.Component { ); }; + renderDataSourceSelector = () => { + const { isDataSourceEnabled, dataSources, selectedOption } = this.state; + + return isDataSourceEnabled ? ( +
+ +
+ ) : null; + }; + renderNotices = () => { const notices = getServices().tutorialService.getDirectoryNotices(); return notices.length ? ( @@ -260,17 +329,28 @@ class TutorialDirectoryUi extends React.Component { ); }; - render() { + renderPageBody = () => { return ( - - - {this.renderHeader()} - - {this.renderTabs()} - - {this.renderTabContent()} - - + + {this.renderHeader()} + + {this.renderDataSourceSelector()} + {this.renderTabs()} + + {this.renderTabContent()} + + ); + }; + + render() { + const { isDataSourceEnabled } = this.state; + + return isDataSourceEnabled ? ( + + {this.renderPageBody()} + + ) : ( + {this.renderPageBody()} ); } } diff --git a/src/plugins/home/public/application/opensearch_dashboards_services.ts b/src/plugins/home/public/application/opensearch_dashboards_services.ts index 84d174984fac..60f9e70621ff 100644 --- a/src/plugins/home/public/application/opensearch_dashboards_services.ts +++ b/src/plugins/home/public/application/opensearch_dashboards_services.ts @@ -46,6 +46,7 @@ import { FeatureCatalogueRegistry } from '../services/feature_catalogue'; import { EnvironmentService } from '../services/environment'; import { ConfigSchema } from '../../config'; import { HomePluginBranding } from '..'; +import { DataSourcePluginStart } from '../../../data_source/public'; export interface HomeOpenSearchDashboardsServices { indexPatternService: any; @@ -71,6 +72,7 @@ export interface HomeOpenSearchDashboardsServices { getInjectedVar: (name: string, defaultValue?: any) => unknown; getBranding: () => HomePluginBranding; }; + dataSource?: DataSourcePluginStart; } let services: HomeOpenSearchDashboardsServices | null = null; diff --git a/src/plugins/home/public/plugin.ts b/src/plugins/home/public/plugin.ts index 03823c5da179..1538156a801e 100644 --- a/src/plugins/home/public/plugin.ts +++ b/src/plugins/home/public/plugin.ts @@ -56,11 +56,13 @@ import { UsageCollectionSetup } from '../../usage_collection/public'; import { UrlForwardingSetup, UrlForwardingStart } from '../../url_forwarding/public'; import { AppNavLinkStatus } from '../../../core/public'; import { PLUGIN_ID, HOME_APP_BASE_PATH } from '../common/constants'; +import { DataSourcePluginStart } from '../../data_source/public'; export interface HomePluginStartDependencies { data: DataPublicPluginStart; telemetry?: TelemetryPluginStart; urlForwarding: UrlForwardingStart; + dataSource?: DataSourcePluginStart; } export interface HomePluginSetupDependencies { @@ -96,7 +98,7 @@ export class HomePublicPlugin : () => {}; const [ coreStart, - { telemetry, data, urlForwarding: urlForwardingStart }, + { telemetry, data, urlForwarding: urlForwardingStart, dataSource }, ] = await core.getStartServices(); setServices({ trackUiMetric, @@ -119,6 +121,7 @@ export class HomePublicPlugin tutorialService: this.tutorialService, featureCatalogue: this.featuresCatalogueRegistry, injectedMetadata: coreStart.injectedMetadata, + dataSource, }); coreStart.chrome.docTitle.change( i18n.translate('home.pageTitle', { defaultMessage: 'Home' }) diff --git a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts index e5587b01ad8c..3045bd14c4c6 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts @@ -376,4 +376,453 @@ export const getSavedObjects = (): SavedObject[] => [ }, }, }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: 'Line Charts Header', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"Line Charts Header","type":"markdown","aggs":[],"params":{"fontSize":12,"openLinksInNewTab":false,"markdown":"# Line Charts"}}', + }, + id: 'ce24dd10-eb8a-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T21:21:31.489Z', + version: 'WzcwLDFd', + }, + { + attributes: { + fieldFormatMap: '{"hour_of_day":{}}', + fields: + '[{"name":"@timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","esTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","esTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","esTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","esTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"agent","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"agent.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"agent"}}},{"name":"bytes","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"clientip","type":"ip","esTypes":["ip"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"event.dataset","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"extension","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"extension.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"extension"}}},{"name":"geo.coordinates","type":"geo_point","esTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.dest","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.src","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.srcdest","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"host","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"host.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"host"}}},{"name":"index","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"index.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"index"}}},{"name":"ip","type":"ip","esTypes":["ip"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"machine.os","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"machine.os.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"machine.os"}}},{"name":"machine.ram","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"memory","type":"number","esTypes":["double"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"message","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"message.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"message"}}},{"name":"phpmemory","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"referer","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"request","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"request.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"request"}}},{"name":"response","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"response.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"response"}}},{"name":"tags","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"tags.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"tags"}}},{"name":"timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"url","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"url.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"url"}}},{"name":"utc_time","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"hour_of_day","type":"number","count":0,"scripted":true,"script":"doc[\'timestamp\'].value.getHour()","lang":"painless","searchable":true,"aggregatable":true,"readFromDocValues":false}]', + timeFieldName: 'timestamp', + title: 'opensearch_dashboards_sample_data_logs', + }, + id: '90943e30-9a47-11e8-b64d-95841ca0b247', + migrationVersion: { 'index-pattern': '7.6.0' }, + references: [], + type: 'index-pattern', + updated_at: '2023-05-05T19:26:11.954Z', + version: 'WzQ5LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"","language":"kuery"},"filter":[],"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + title: '[Line] Avg bytes over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"[Line] Avg bytes over time","type":"line","aggs":[{"id":"1","enabled":true,"type":"avg","params":{"field":"bytes"},"schema":"metric"},{"id":"2","enabled":true,"type":"date_histogram","params":{"field":"timestamp","timeRange":{"from":"now-7d","to":"now"},"useNormalizedOpenSearchInterval":true,"scaleMetricValues":false,"interval":"auto","drop_partials":false,"min_doc_count":1,"extended_bounds":{}},"schema":"segment"}],"params":{"type":"line","grid":{"categoryLines":false},"categoryAxes":[{"id":"CategoryAxis-1","type":"category","position":"bottom","show":true,"style":{},"scale":{"type":"linear"},"labels":{"show":true,"filter":true,"truncate":100},"title":{}}],"valueAxes":[{"id":"ValueAxis-1","name":"LeftAxis-1","type":"value","position":"left","show":true,"style":{},"scale":{"type":"linear","mode":"normal"},"labels":{"show":true,"rotate":0,"filter":false,"truncate":100},"title":{"text":"Average bytes"}}],"seriesParams":[{"show":true,"type":"line","mode":"normal","data":{"label":"Average bytes","id":"1"},"valueAxis":"ValueAxis-1","drawLinesBetweenPoints":true,"lineWidth":2,"interpolate":"linear","showCircles":true}],"addTooltip":true,"addLegend":true,"legendPosition":"right","times":[],"addTimeMarker":false,"labels":{},"thresholdLine":{"show":false,"value":10,"width":1,"style":"full","color":"#E7664C"}}}', + }, + id: '39b5bd70-eb7b-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [ + { + id: '90943e30-9a47-11e8-b64d-95841ca0b247', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + type: 'visualization', + updated_at: '2023-05-05T19:30:00.006Z', + version: 'WzUzLDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + styleState: '{"addTooltip":true,"addLegend":true,"legendPosition":"right","type":"line"}', + title: '(VB) Avg bytes over time', + uiState: '{}', + version: 3, + visualizationState: + '{"searchField":"","activeVisualization":{"name":"line","aggConfigParams":[{"id":"1","enabled":true,"type":"date_histogram","params":{"field":"@timestamp","useNormalizedOpenSearchInterval":true,"scaleMetricValues":false,"interval":"auto","drop_partials":false,"min_doc_count":1,"extended_bounds":{}},"schema":"segment"},{"id":"2","enabled":true,"type":"avg","params":{"field":"bytes"},"schema":"metric"}]}}', + }, + id: '64bb61a0-eb7b-11ed-8e00-17d7d50cd7b2', + references: [ + { + id: '90943e30-9a47-11e8-b64d-95841ca0b247', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + type: 'visualization-visbuilder', + updated_at: '2023-05-05T19:31:12.186Z', + version: 'WzU0LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: '(Vega) Avg bytes over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(Vega) Avg bytes over time","type":"vega","aggs":[],"params":{"spec":"{\\n $schema: https://vega.github.io/schema/vega-lite/v5.json\\n data: {\\n url: {\\n %context%: true\\n %timefield%: @timestamp\\n index: opensearch_dashboards_sample_data_logs\\n body: {\\n aggs: {\\n 1: {\\n date_histogram: {\\n field: @timestamp\\n fixed_interval: 3h\\n time_zone: America/Los_Angeles\\n min_doc_count: 1\\n }\\n aggs: {\\n 2: {\\n avg: {\\n field: bytes\\n }\\n }\\n }\\n }\\n }\\n size: 0\\n }\\n }\\n format: {\\n property: aggregations.1.buckets\\n }\\n }\\n transform: [\\n {\\n calculate: datum.key\\n as: timestamp\\n }\\n {\\n calculate: datum[2].value\\n as: bytes\\n }\\n ]\\n layer:[\\n {\\n mark: {\\n type: line\\n }\\n }\\n {\\n mark: {\\n type: circle\\n tooltip: true\\n }\\n }\\n ]\\n \\n encoding: {\\n x: {\\n field: timestamp\\n type: temporal\\n axis: {\\n title: @timestamp\\n }\\n }\\n y: {\\n field: bytes\\n type: quantitative\\n axis: {\\n title: Average bytes\\n }\\n }\\n color: {\\n datum: Average bytes\\n type: nominal\\n }\\n }\\n}"}}', + }, + id: '0aa75ae0-eb7e-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T20:58:04.256Z', + version: 'WzY0LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: '(Timeline) Avg bytes over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(Timeline) Avg bytes over time","type":"timelion","aggs":[],"params":{"expression":".opensearch(opensearch_dashboards_sample_data_logs, metric=avg:bytes, timefield=@timestamp).lines(show=true).points(show=true).yaxis(label=\\"Average bytes\\")","interval":"auto"}}', + }, + id: '2c5a19f0-eb8a-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T21:17:17.270Z', + version: 'WzY5LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: '(TSVB) Avg bytes over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(TSVB) Avg bytes over time","type":"metrics","aggs":[],"params":{"id":"61ca57f0-469d-11e7-af02-69e470af7417","type":"timeseries","series":[{"id":"61ca57f1-469d-11e7-af02-69e470af7417","color":"#68BC00","split_mode":"everything","split_color_mode":"opensearchDashboards","metrics":[{"id":"61ca57f2-469d-11e7-af02-69e470af7417","type":"avg","field":"bytes"}],"separate_axis":0,"axis_position":"right","formatter":"number","chart_type":"line","line_width":1,"point_size":1,"fill":"","stacked":"none","label":"","type":"timeseries"}],"time_field":"timestamp","index_pattern":"opensearch_dashboards_sample_data_logs","interval":"","axis_position":"left","axis_formatter":"number","axis_scale":"normal","show_legend":1,"show_grid":1,"tooltip_mode":"show_all","default_index_pattern":"opensearch_dashboards_sample_data_ecommerce","default_timefield":"order_date","isModelInvalid":false,"drop_last_bucket":0}}', + }, + id: 'fa54ce40-eb7b-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T20:59:28.183Z', + version: 'WzY1LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: 'Area Charts Header', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"Area Charts Header","type":"markdown","aggs":[],"params":{"fontSize":12,"openLinksInNewTab":false,"markdown":"# Area Charts"}}', + }, + id: 'ed89dfc0-eb8f-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T21:58:11.644Z', + version: 'Wzc2LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"","language":"kuery"},"filter":[],"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + title: '(Area) Stacked extensions over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(Area) Stacked extensions over time","type":"area","aggs":[{"id":"1","enabled":true,"type":"count","params":{},"schema":"metric"},{"id":"2","enabled":true,"type":"date_histogram","params":{"field":"timestamp","timeRange":{"from":"now-7d","to":"now"},"useNormalizedOpenSearchInterval":true,"scaleMetricValues":false,"interval":"auto","drop_partials":false,"min_doc_count":1,"extended_bounds":{}},"schema":"segment"},{"id":"3","enabled":true,"type":"terms","params":{"field":"extension.keyword","orderBy":"1","order":"desc","size":5,"otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing"},"schema":"group"}],"params":{"type":"area","grid":{"categoryLines":false},"categoryAxes":[{"id":"CategoryAxis-1","type":"category","position":"bottom","show":true,"style":{},"scale":{"type":"linear"},"labels":{"show":true,"filter":true,"truncate":100},"title":{}}],"valueAxes":[{"id":"ValueAxis-1","name":"LeftAxis-1","type":"value","position":"left","show":true,"style":{},"scale":{"type":"linear","mode":"normal"},"labels":{"show":true,"rotate":0,"filter":false,"truncate":100},"title":{"text":"Count"}}],"seriesParams":[{"show":true,"type":"area","mode":"stacked","data":{"label":"Count","id":"1"},"drawLinesBetweenPoints":true,"lineWidth":2,"showCircles":true,"interpolate":"linear","valueAxis":"ValueAxis-1"}],"addTooltip":true,"addLegend":true,"legendPosition":"right","times":[],"addTimeMarker":false,"thresholdLine":{"show":false,"value":10,"width":1,"style":"full","color":"#E7664C"},"labels":{}}}', + }, + id: 'c0ba29f0-eb8f-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [ + { + id: '90943e30-9a47-11e8-b64d-95841ca0b247', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + type: 'visualization', + updated_at: '2023-05-05T21:57:21.517Z', + version: 'Wzc0LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + styleState: '{"addTooltip":true,"addLegend":true,"legendPosition":"right","type":"area"}', + title: '(VisBuilder) Extensions over time', + uiState: '{}', + version: 3, + visualizationState: + '{"searchField":"","activeVisualization":{"name":"area","aggConfigParams":[{"id":"4","enabled":true,"type":"count","params":{},"schema":"metric"},{"id":"5","enabled":true,"type":"date_histogram","params":{"field":"timestamp","useNormalizedOpenSearchInterval":true,"scaleMetricValues":false,"interval":"auto","drop_partials":false,"min_doc_count":1,"extended_bounds":{}},"schema":"segment"},{"id":"6","enabled":true,"type":"terms","params":{"field":"extension.keyword","order":"desc","size":5,"otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing"},"schema":"group"}]}}', + }, + id: '68fe55f0-eb90-11ed-8e00-17d7d50cd7b2', + references: [ + { + id: '90943e30-9a47-11e8-b64d-95841ca0b247', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + type: 'visualization-visbuilder', + updated_at: '2023-05-05T22:03:19.608Z', + version: 'Wzc5LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: '(Vega) Stacked extensions over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(Vega) Stacked extensions over time","type":"vega","aggs":[],"params":{"spec":"{\\n $schema: https://vega.github.io/schema/vega-lite/v5.json\\n data: {\\n url: {\\n %context%: true\\n %timefield%: @timestamp\\n index: opensearch_dashboards_sample_data_logs\\n body: {\\n aggs: {\\n 1: {\\n date_histogram: {\\n field: @timestamp\\n fixed_interval: 3h\\n time_zone: America/Los_Angeles\\n min_doc_count: 1\\n }\\n aggs: {\\n 2: {\\n terms: {\\n field: extension.keyword\\n order: {\\n _count: desc\\n }\\n size: 5\\n }\\n }\\n }\\n }\\n }\\n size: 0\\n }\\n }\\n format: {\\n property: aggregations.1.buckets\\n }\\n }\\n transform: [\\n {\\n flatten: [\\n 2.buckets\\n ]\\n as: [\\n extension_buckets\\n ]\\n }\\n {\\n calculate: datum.key\\n as: timestamp\\n }\\n {\\n calculate: datum.extension_buckets.doc_count\\n as: count\\n }\\n {\\n calculate: datum.extension_buckets.key\\n as: extension\\n }\\n ]\\n layer: [\\n {\\n mark: {\\n type: area\\n tooltip: true\\n }\\n }\\n ]\\n encoding: {\\n x: {\\n field: timestamp\\n type: temporal\\n axis: {\\n title: timestamp\\n }\\n }\\n y: {\\n field: count\\n type: quantitative\\n axis: {\\n title: Count\\n }\\n }\\n color: {\\n field: extension\\n type: nominal\\n }\\n }\\n}"}}', + }, + id: 'be4dc860-eb90-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T22:42:57.659Z', + version: 'Wzg1LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: '(Timeline) Stacked extensions over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(Timeline) Stacked extensions over time","type":"timelion","aggs":[],"params":{"expression":".opensearch(opensearch_dashboards_sample_data_logs, split=extension.keyword:10, timefield=@timestamp).lines(show=true,stack=true,fill=10).yaxis(label=\\"Count\\")","interval":"auto"}}', + }, + id: '34a5bee0-eb97-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T22:50:17.422Z', + version: 'Wzg4LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: '(TSVB) Stacked extensions over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(TSVB) Stacked extensions over time","type":"metrics","aggs":[],"params":{"id":"61ca57f0-469d-11e7-af02-69e470af7417","type":"timeseries","series":[{"id":"61ca57f1-469d-11e7-af02-69e470af7417","color":"#68BC00","split_mode":"terms","split_color_mode":"opensearchDashboards","metrics":[{"id":"61ca57f2-469d-11e7-af02-69e470af7417","type":"count","field":"bytes"}],"separate_axis":0,"axis_position":"right","formatter":"number","chart_type":"line","line_width":1,"point_size":"0","fill":"1","stacked":"stacked","label":"","type":"timeseries","terms_field":"extension.keyword"}],"time_field":"timestamp","index_pattern":"opensearch_dashboards_sample_data_logs","interval":"","axis_position":"left","axis_formatter":"number","axis_scale":"normal","show_legend":1,"show_grid":1,"tooltip_mode":"show_all","default_index_pattern":"opensearch_dashboards_sample_data_ecommerce","default_timefield":"order_date","isModelInvalid":false,"drop_last_bucket":0}}', + }, + id: '689b7140-eb97-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T22:54:45.899Z', + version: 'WzkxLDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: 'Bar Charts Header', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"Bar Charts Header","type":"markdown","aggs":[],"params":{"fontSize":12,"openLinksInNewTab":false,"markdown":"# Bar Charts"}}', + }, + id: '5e34ac20-eb98-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T22:58:36.642Z', + version: 'Wzk1LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"","language":"kuery"},"filter":[],"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + title: '(Vertical Bar) Stacked responses over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(Vertical Bar) Stacked responses over time","type":"histogram","aggs":[{"id":"1","enabled":true,"type":"count","params":{},"schema":"metric"},{"id":"2","enabled":true,"type":"date_histogram","params":{"field":"timestamp","timeRange":{"from":"now-7d","to":"now"},"useNormalizedOpenSearchInterval":true,"scaleMetricValues":false,"interval":"auto","drop_partials":false,"min_doc_count":1,"extended_bounds":{}},"schema":"segment"},{"id":"3","enabled":true,"type":"terms","params":{"field":"response.keyword","orderBy":"1","order":"desc","size":5,"otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing"},"schema":"group"}],"params":{"type":"histogram","grid":{"categoryLines":false},"categoryAxes":[{"id":"CategoryAxis-1","type":"category","position":"bottom","show":true,"style":{},"scale":{"type":"linear"},"labels":{"show":true,"filter":true,"truncate":100},"title":{}}],"valueAxes":[{"id":"ValueAxis-1","name":"LeftAxis-1","type":"value","position":"left","show":true,"style":{},"scale":{"type":"linear","mode":"normal"},"labels":{"show":true,"rotate":0,"filter":false,"truncate":100},"title":{"text":"Count"}}],"seriesParams":[{"show":true,"type":"histogram","mode":"stacked","data":{"label":"Count","id":"1"},"valueAxis":"ValueAxis-1","drawLinesBetweenPoints":true,"lineWidth":2,"showCircles":true}],"addTooltip":true,"addLegend":true,"legendPosition":"right","times":[],"addTimeMarker":false,"labels":{"show":false},"thresholdLine":{"show":false,"value":10,"width":1,"style":"full","color":"#E7664C"}}}', + }, + id: '23a5de70-eb99-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [ + { + id: '90943e30-9a47-11e8-b64d-95841ca0b247', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + type: 'visualization', + updated_at: '2023-05-05T23:05:00.362Z', + version: 'Wzk3LDFd', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + styleState: + '{"addTooltip":true,"addLegend":true,"legendPosition":"right","type":"histogram"}', + title: '(VisBuilder) Responses over time', + uiState: '{}', + version: 3, + visualizationState: + '{"searchField":"","activeVisualization":{"name":"histogram","aggConfigParams":[{"id":"4","enabled":true,"type":"count","params":{},"schema":"metric"},{"id":"5","enabled":true,"type":"date_histogram","params":{"field":"timestamp","timeRange":{"from":"now-7d","to":"now"},"useNormalizedOpenSearchInterval":true,"scaleMetricValues":false,"interval":"auto","drop_partials":false,"min_doc_count":1,"extended_bounds":{}},"schema":"segment"},{"id":"6","enabled":true,"type":"terms","params":{"field":"response.keyword","order":"desc","size":5,"otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing"},"schema":"group"}]}}', + }, + id: '571745a0-eb99-11ed-8e00-17d7d50cd7b2', + references: [ + { + id: '90943e30-9a47-11e8-b64d-95841ca0b247', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + type: 'visualization-visbuilder', + updated_at: '2023-05-05T23:06:40.304Z', + version: 'WzEwMCwxXQ==', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: '(Vega) Stacked extensions over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(Vega) Stacked extensions over time","type":"vega","aggs":[],"params":{"spec":"{\\n $schema: https://vega.github.io/schema/vega-lite/v5.json\\n data: {\\n url: {\\n %context%: true\\n %timefield%: @timestamp\\n index: opensearch_dashboards_sample_data_logs\\n body: {\\n aggs: {\\n 1: {\\n date_histogram: {\\n field: @timestamp\\n fixed_interval: 3h\\n time_zone: America/Los_Angeles\\n min_doc_count: 1\\n }\\n aggs: {\\n 2: {\\n terms: {\\n field: response.keyword\\n order: {\\n _count: desc\\n }\\n size: 5\\n }\\n }\\n }\\n }\\n }\\n size: 0\\n }\\n }\\n format: {\\n property: aggregations.1.buckets\\n }\\n }\\n transform: [\\n {\\n flatten: [\\n 2.buckets\\n ]\\n as: [\\n response_buckets\\n ]\\n }\\n {\\n calculate: datum.key\\n as: timestamp\\n }\\n {\\n calculate: datum.response_buckets.doc_count\\n as: count\\n }\\n {\\n calculate: datum.response_buckets.key\\n as: extension\\n }\\n ]\\n layer: [\\n {\\n mark: {\\n type: bar\\n tooltip: true\\n width: { band: 1 }\\n }\\n }\\n ]\\n encoding: {\\n x: {\\n field: timestamp\\n type: temporal\\n axis: {\\n title: timestamp\\n }\\n }\\n y: {\\n field: count\\n type: quantitative\\n axis: {\\n title: Count\\n }\\n }\\n color: {\\n field: extension\\n type: nominal\\n }\\n }\\n}"}}', + }, + id: '8b78d930-eb99-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T23:18:23.779Z', + version: 'WzEwNSwxXQ==', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: '(Timeline) Stacked responses over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(Timeline) Stacked responses over time","type":"timelion","aggs":[],"params":{"expression":".opensearch(opensearch_dashboards_sample_data_logs, split=response.keyword:10, timefield=@timestamp).bars(stack=true).yaxis(label=\\"Count\\")","interval":"auto"}}', + }, + id: '5c276fa0-eb9b-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T23:20:40.029Z', + version: 'WzEwNywxXQ==', + }, + { + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"query":"","language":"kuery"},"filter":[]}', + }, + title: '(TSVB) Stacked responses over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"(TSVB) Stacked responses over time","type":"metrics","aggs":[],"params":{"id":"61ca57f0-469d-11e7-af02-69e470af7417","type":"timeseries","series":[{"id":"61ca57f1-469d-11e7-af02-69e470af7417","color":"#68BC00","split_mode":"terms","split_color_mode":"opensearchDashboards","metrics":[{"id":"61ca57f2-469d-11e7-af02-69e470af7417","type":"count","field":"bytes"}],"separate_axis":0,"axis_position":"right","formatter":"number","chart_type":"bar","line_width":1,"point_size":"0","fill":"1","stacked":"stacked","label":"","type":"timeseries","terms_field":"response.keyword"}],"time_field":"timestamp","index_pattern":"opensearch_dashboards_sample_data_logs","interval":"","axis_position":"left","axis_formatter":"number","axis_scale":"normal","show_legend":1,"show_grid":1,"tooltip_mode":"show_all","default_index_pattern":"opensearch_dashboards_sample_data_ecommerce","default_timefield":"order_date","isModelInvalid":false,"drop_last_bucket":0}}', + }, + id: '9482ed20-eb9b-11ed-8e00-17d7d50cd7b2', + migrationVersion: { visualization: '7.10.0' }, + references: [], + type: 'visualization', + updated_at: '2023-05-05T23:22:28.080Z', + version: 'WzEwOSwxXQ==', + }, + { + attributes: { + description: '', + hits: 0, + kibanaSavedObjectMeta: { + searchSourceJSON: '{"query":{"language":"kuery","query":""},"filter":[]}', + }, + optionsJSON: '{"hidePanelTitles":false,"useMargins":true}', + panelsJSON: + '[{"embeddableConfig":{"hidePanelTitles":true},"gridData":{"h":5,"i":"debc95ec-7d43-49ee-84c8-95ad7b0b03ea","w":48,"x":0,"y":0},"panelIndex":"debc95ec-7d43-49ee-84c8-95ad7b0b03ea","version":"3.0.0","panelRefName":"panel_0"},{"embeddableConfig":{},"gridData":{"h":16,"i":"0c23bab6-f9a2-4bb6-b9d7-918b0879f18f","w":16,"x":0,"y":5},"panelIndex":"0c23bab6-f9a2-4bb6-b9d7-918b0879f18f","version":"3.0.0","panelRefName":"panel_1"},{"embeddableConfig":{"uiState":{}},"gridData":{"h":16,"i":"5eb89f9b-4086-4508-b469-dc8a85aa9a1f","w":16,"x":16,"y":5},"panelIndex":"5eb89f9b-4086-4508-b469-dc8a85aa9a1f","version":"3.0.0","panelRefName":"panel_2"},{"embeddableConfig":{},"gridData":{"h":16,"i":"8402a6cc-8219-412e-9232-50d0e5a91735","w":16,"x":32,"y":5},"panelIndex":"8402a6cc-8219-412e-9232-50d0e5a91735","version":"3.0.0","panelRefName":"panel_3"},{"embeddableConfig":{},"gridData":{"h":16,"i":"ea9035e7-1163-4662-a645-5aee8a3201ed","w":16,"x":0,"y":21},"panelIndex":"ea9035e7-1163-4662-a645-5aee8a3201ed","version":"3.0.0","panelRefName":"panel_4"},{"embeddableConfig":{},"gridData":{"h":16,"i":"1fb33b9c-7ea3-4113-84cc-4799d4398798","w":16,"x":16,"y":21},"panelIndex":"1fb33b9c-7ea3-4113-84cc-4799d4398798","version":"3.0.0","panelRefName":"panel_5"},{"embeddableConfig":{"hidePanelTitles":true},"gridData":{"h":5,"i":"eba90567-b720-43dc-9065-9097282c668e","w":48,"x":0,"y":37},"panelIndex":"eba90567-b720-43dc-9065-9097282c668e","version":"3.0.0","panelRefName":"panel_6"},{"embeddableConfig":{"table":null,"vis":{"legendOpen":true}},"gridData":{"h":16,"i":"f816a6c6-8fdd-405c-826e-58d0958d5f33","w":16,"x":0,"y":42},"panelIndex":"f816a6c6-8fdd-405c-826e-58d0958d5f33","version":"3.0.0","panelRefName":"panel_7"},{"embeddableConfig":{"uiState":{}},"gridData":{"h":16,"i":"f49be7f3-7913-4c24-b98a-cdd7e8e3f893","w":16,"x":16,"y":42},"panelIndex":"f49be7f3-7913-4c24-b98a-cdd7e8e3f893","version":"3.0.0","panelRefName":"panel_8"},{"embeddableConfig":{},"gridData":{"h":16,"i":"cc261ebe-d39a-46d0-8de4-d3602889f8f6","w":16,"x":32,"y":42},"panelIndex":"cc261ebe-d39a-46d0-8de4-d3602889f8f6","version":"3.0.0","panelRefName":"panel_9"},{"embeddableConfig":{},"gridData":{"h":16,"i":"f1e579ac-2aff-4449-87db-21f1643e379d","w":16,"x":0,"y":58},"panelIndex":"f1e579ac-2aff-4449-87db-21f1643e379d","version":"3.0.0","panelRefName":"panel_10"},{"embeddableConfig":{},"gridData":{"h":16,"i":"9b57f39e-7fe2-47d1-ae25-afbbe1179525","w":16,"x":16,"y":58},"panelIndex":"9b57f39e-7fe2-47d1-ae25-afbbe1179525","version":"3.0.0","panelRefName":"panel_11"},{"embeddableConfig":{"hidePanelTitles":true},"gridData":{"h":5,"i":"06c8b217-3d11-431f-8591-b811046a6a16","w":48,"x":0,"y":74},"panelIndex":"06c8b217-3d11-431f-8591-b811046a6a16","version":"3.0.0","panelRefName":"panel_12"},{"embeddableConfig":{},"gridData":{"h":16,"i":"ab20d005-854e-4bf6-91ff-aedf5fc2712a","w":16,"x":0,"y":79},"panelIndex":"ab20d005-854e-4bf6-91ff-aedf5fc2712a","version":"3.0.0","panelRefName":"panel_13"},{"embeddableConfig":{"uiState":{}},"gridData":{"h":16,"i":"0ab357d5-9918-442e-8a27-a6e3d61abb98","w":16,"x":16,"y":79},"panelIndex":"0ab357d5-9918-442e-8a27-a6e3d61abb98","version":"3.0.0","panelRefName":"panel_14"},{"embeddableConfig":{},"gridData":{"h":16,"i":"b60e8845-daf9-488a-9d7c-2e6c41d46ab4","w":16,"x":32,"y":79},"panelIndex":"b60e8845-daf9-488a-9d7c-2e6c41d46ab4","version":"3.0.0","panelRefName":"panel_15"},{"embeddableConfig":{},"gridData":{"h":16,"i":"ea71d48b-a9b1-4822-b997-b5da294c7012","w":16,"x":0,"y":95},"panelIndex":"ea71d48b-a9b1-4822-b997-b5da294c7012","version":"3.0.0","panelRefName":"panel_16"},{"embeddableConfig":{},"gridData":{"h":16,"i":"6617b4f6-3227-4264-b87d-53f70fba6d79","w":16,"x":16,"y":95},"panelIndex":"6617b4f6-3227-4264-b87d-53f70fba6d79","version":"3.0.0","panelRefName":"panel_17"}]', + timeRestore: false, + title: 'Visual Consistency Dashboard', + version: 1, + }, + id: 'c39012d0-eb7a-11ed-8e00-17d7d50cd7b2', + migrationVersion: { dashboard: '7.9.3' }, + references: [ + { id: 'ce24dd10-eb8a-11ed-8e00-17d7d50cd7b2', name: 'panel_0', type: 'visualization' }, + { id: '39b5bd70-eb7b-11ed-8e00-17d7d50cd7b2', name: 'panel_1', type: 'visualization' }, + { + id: '64bb61a0-eb7b-11ed-8e00-17d7d50cd7b2', + name: 'panel_2', + type: 'visualization-visbuilder', + }, + { id: '0aa75ae0-eb7e-11ed-8e00-17d7d50cd7b2', name: 'panel_3', type: 'visualization' }, + { id: '2c5a19f0-eb8a-11ed-8e00-17d7d50cd7b2', name: 'panel_4', type: 'visualization' }, + { id: 'fa54ce40-eb7b-11ed-8e00-17d7d50cd7b2', name: 'panel_5', type: 'visualization' }, + { id: 'ed89dfc0-eb8f-11ed-8e00-17d7d50cd7b2', name: 'panel_6', type: 'visualization' }, + { id: 'c0ba29f0-eb8f-11ed-8e00-17d7d50cd7b2', name: 'panel_7', type: 'visualization' }, + { + id: '68fe55f0-eb90-11ed-8e00-17d7d50cd7b2', + name: 'panel_8', + type: 'visualization-visbuilder', + }, + { id: 'be4dc860-eb90-11ed-8e00-17d7d50cd7b2', name: 'panel_9', type: 'visualization' }, + { id: '34a5bee0-eb97-11ed-8e00-17d7d50cd7b2', name: 'panel_10', type: 'visualization' }, + { id: '689b7140-eb97-11ed-8e00-17d7d50cd7b2', name: 'panel_11', type: 'visualization' }, + { id: '5e34ac20-eb98-11ed-8e00-17d7d50cd7b2', name: 'panel_12', type: 'visualization' }, + { id: '23a5de70-eb99-11ed-8e00-17d7d50cd7b2', name: 'panel_13', type: 'visualization' }, + { + id: '571745a0-eb99-11ed-8e00-17d7d50cd7b2', + name: 'panel_14', + type: 'visualization-visbuilder', + }, + { id: '8b78d930-eb99-11ed-8e00-17d7d50cd7b2', name: 'panel_15', type: 'visualization' }, + { id: '5c276fa0-eb9b-11ed-8e00-17d7d50cd7b2', name: 'panel_16', type: 'visualization' }, + { id: '9482ed20-eb9b-11ed-8e00-17d7d50cd7b2', name: 'panel_17', type: 'visualization' }, + ], + type: 'dashboard', + updated_at: '2023-05-05T23:38:33.904Z', + version: 'WzExMSwxXQ==', + }, ]; diff --git a/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud_visualization.test.js.snap b/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud_visualization.test.js.snap index d7707f64d8a4..4f4e2eeab4be 100644 --- a/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud_visualization.test.js.snap +++ b/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud_visualization.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`TagCloudVisualizationTest TagCloudVisualization - basics simple draw 1`] = `"CNINUSDEBR"`; +exports[`TagCloudVisualizationTest TagCloudVisualization - basics simple draw 1`] = `"CNINUSDEBR"`; -exports[`TagCloudVisualizationTest TagCloudVisualization - basics with param change 1`] = `"CNINUSDEBR"`; +exports[`TagCloudVisualizationTest TagCloudVisualization - basics with param change 1`] = `"CNINUSDEBR"`; -exports[`TagCloudVisualizationTest TagCloudVisualization - basics with resize 1`] = `"CNINUSDEBR"`; +exports[`TagCloudVisualizationTest TagCloudVisualization - basics with resize 1`] = `"CNINUSDEBR"`; diff --git a/src/plugins/vis_type_tagcloud/public/components/tag_cloud_visualization.test.js b/src/plugins/vis_type_tagcloud/public/components/tag_cloud_visualization.test.js index a75644667e73..56f528356e83 100644 --- a/src/plugins/vis_type_tagcloud/public/components/tag_cloud_visualization.test.js +++ b/src/plugins/vis_type_tagcloud/public/components/tag_cloud_visualization.test.js @@ -34,8 +34,9 @@ import { TagCloudVisualization } from './tag_cloud_visualization'; import { setFormatService } from '../services'; import { dataPluginMock } from '../../../data/public/mocks'; import { setHTMLElementOffset, setSVGElementGetBBox } from '../../../../test_utils/public'; +import { euiPaletteColorBlind } from '@elastic/eui'; -const seedColors = ['#00a69b', '#57c17b', '#6f87d8', '#663db8', '#bc52bc', '#9e3533', '#daa05d']; +const seedColors = euiPaletteColorBlind(); describe('TagCloudVisualizationTest', () => { let domNode; diff --git a/yarn.lock b/yarn.lock index 491037a81168..6966b1f83da0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2967,21 +2967,6 @@ resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.2.tgz#66ad9331f63fe8a3d3d9d8c6e3906dd10f6446e8" integrity sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog== -"@types/cp-file@*": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@types/cp-file/-/cp-file-6.1.2.tgz#3c579201715ca6177d34f3e14f2b29861c470c4c" - integrity sha512-wvqCNhHt+GMfEglZ83cQ+8dEv5Oh8DwEq6IBBBL7+hWISR+82l/bSmssCo5zGHg7HpW6+kjZwDby9zGkCStN5w== - dependencies: - cp-file "*" - -"@types/cpy@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/cpy/-/cpy-5.1.0.tgz#ced20cbae8528031ae5478f1d0fe4bca2518eda7" - integrity sha512-NU7IrYOZx+K2YCo7muReOj6FIxEWdWXCN7hgRhQ+h2lgpeLy27si9ZzdDwWCW+Q1RP9B1lDTJ368FPFSOp1ZqA== - dependencies: - "@types/cp-file" "*" - "@types/glob" "*" - "@types/d3@^3.5.43": version "3.5.47" resolved "https://registry.yarnpkg.com/@types/d3/-/d3-3.5.47.tgz#b81042fcb0195c583fc037bc857d161469a7d175" @@ -3686,10 +3671,10 @@ resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.0.9.tgz#12621e55b2ef8f6c98bd17fe23fa720c6cba16bd" integrity sha512-HopIwBE7GUXsscmt/J0DhnFXLSmO04AfxT6b8HAprknwka7pqEWquWDMXxCjd+NUHK9MkCe1SDKKsMiNmCItbQ== -"@types/semver@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" - integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ== +"@types/semver@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" + integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== "@types/sinon@^7.0.13": version "7.5.2" @@ -6303,16 +6288,6 @@ cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: path-type "^4.0.0" yaml "^1.10.0" -cp-file@*: - version "9.1.0" - resolved "https://registry.yarnpkg.com/cp-file/-/cp-file-9.1.0.tgz#e98e30db72d57d47b5b1d444deb70d05e5684921" - integrity sha512-3scnzFj/94eb7y4wyXRWwvzLFaQp87yyfTnChIjlfYrVqp5lVO3E2hIJMeQIltUT0K2ZAB3An1qXcBmwGyvuwA== - dependencies: - graceful-fs "^4.1.2" - make-dir "^3.0.0" - nested-error-stacks "^2.0.0" - p-event "^4.1.0" - cp-file@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/cp-file/-/cp-file-7.0.0.tgz#b9454cfd07fe3b974ab9ea0e5f29655791a9b8cd" @@ -15677,30 +15652,10 @@ selenium-webdriver@^4.0.0-alpha.7: rimraf "^2.7.1" tmp "0.0.30" -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" - integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== - -semver@7.3.2: - version "7.3.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" - integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== - -semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.8, semver@~7.3.0: - version "7.3.8" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" - integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== +"semver@2 || 3 || 4 || 5", semver@7.0.0, semver@7.3.2, semver@^5.3.0, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1, semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.8, semver@^7.5.3, semver@~7.3.0: + version "7.5.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" + integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== dependencies: lru-cache "^6.0.0"