diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/create_index_pattern_wizard.tsx b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/create_index_pattern_wizard.tsx index 633906feb785b4a..9ff26decc1c6e3f 100644 --- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/create_index_pattern_wizard.tsx +++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/create_index_pattern_wizard.tsx @@ -57,11 +57,10 @@ export class CreateIndexPatternWizard extends Component< context.services.setBreadcrumbs(getCreateBreadcrumbs()); const type = new URLSearchParams(props.location.search).get('type') || undefined; - const indexPattern = new URLSearchParams(props.location.search).get('name') || ''; this.state = { step: 1, - indexPattern, + indexPattern: '', allIndices: [], remoteClustersExist: false, isInitiallyLoadingIndices: true, diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx index 36aa76977c2a439..533fc14e595c5a8 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx @@ -46,7 +46,7 @@ export const ComboBoxSelect = ({ disabled, value, placeholder, - allowSwitchUseKibanaIndexesMode, + allowSwitchMode, 'data-test-subj': dataTestSubj, }: SelectIndexComponentProps) => { const [availableIndexes, setAvailableIndexes] = useState([]); @@ -75,7 +75,7 @@ export const ComboBoxSelect = ({ isDisabled={disabled} placeholder={placeholder} data-test-subj={dataTestSubj} - {...(allowSwitchUseKibanaIndexesMode && { + {...(allowSwitchMode && { append: ( ), diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/field_text_select.tsx b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/field_text_select.tsx index 39724e31b4f467b..9871f7c7351a187 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/field_text_select.tsx +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/field_text_select.tsx @@ -7,7 +7,7 @@ */ import React, { useCallback } from 'react'; -import { EuiFieldText, EuiFieldTextProps } from '@elastic/eui'; +import { EuiFieldText, EuiFieldTextProps, EuiTourStep, EuiText } from '@elastic/eui'; import { SwitchModePopover } from './switch_mode_popover'; import { convertIndexPatternObjectToStringRepresentation } from '../../../../../common/index_patterns_utils'; @@ -19,7 +19,7 @@ export const FieldTextSelect = ({ value, placeholder, onModeChange, - allowSwitchUseKibanaIndexesMode, + allowSwitchMode, 'data-test-subj': dataTestSubj, }: SelectIndexComponentProps) => { const textualValue = convertIndexPatternObjectToStringRepresentation(value); @@ -32,17 +32,33 @@ export const FieldTextSelect = ({ ); return ( - - ), - })} - /> + +

The tour step content.

+ + } + isStepOpen={false} + minWidth={300} + onFinish={() => true} + step={1} + stepsTotal={1} + title="Title of the current step" + subtitle="Title of the full tour" + anchorPosition="rightUp" + > + + ), + })} + /> +
); }; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx index 86e26e6f700def9..ea6135fe7da3372 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx @@ -21,7 +21,7 @@ interface IndexPatternSelectProps { defaultIndexPattern: string; onChange: Function; disabled?: boolean; - allowSwitchUseKibanaIndexesMode?: boolean; + allowSwitchMode?: boolean; } export const IndexPatternSelect = ({ @@ -30,7 +30,7 @@ export const IndexPatternSelect = ({ onChange, disabled, defaultIndexPattern, - allowSwitchUseKibanaIndexesMode, + allowSwitchMode, }: IndexPatternSelectProps) => { const panelModel = useContext(PanelModelContext); const useKibanaIndices = Boolean(panelModel?.[USE_KIBANA_INDEXES_KEY]); @@ -67,7 +67,7 @@ export const IndexPatternSelect = ({ placeholder={defaultIndexPattern} onIndexChange={setInputValue} onModeChange={onModeChange} - allowSwitchUseKibanaIndexesMode={allowSwitchUseKibanaIndexesMode} + allowSwitchMode={allowSwitchMode} /> ); }; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/migration_callout.tsx b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/migration_callout.tsx deleted file mode 100644 index 2cd9713bafe8a08..000000000000000 --- a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/migration_callout.tsx +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { useCallback } from 'react'; -import { EuiTextColor, EuiButton, EuiCallOut, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; -import { getCoreStart } from '../../../../services'; -import type { IndexPatternObject } from '../../../../../common/types'; - -interface LegacyModePopoverProps { - switchMode: () => void; - value: string; - matchedIndex?: IndexPatternObject; -} - -const getReadyToMigrateCallOut = ( - value: LegacyModePopoverProps['value'], - onModeChange: LegacyModePopoverProps['switchMode'] -) => ( - - {value}, - }} - /> - - - - -); - -const getNoMatchedIndicesCallOut = ( - value: LegacyModePopoverProps['value'], - onCreateIndexClick: () => void -) => ( - - {value}, - }} - /> - - - - -); - -export const MigrationCallout = ({ value, switchMode, matchedIndex }: LegacyModePopoverProps) => { - const navigateToCreateIndexPatterns = useCallback(() => { - getCoreStart().application.navigateToApp('management', { - path: `/kibana/indexPatterns/create?name=${value}`, - }); - }, [value]); - - return ( - <> - - {matchedIndex && getReadyToMigrateCallOut(value, switchMode)} - {!matchedIndex && getNoMatchedIndicesCallOut(value, navigateToCreateIndexPatterns)} - - ); -}; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/switch_mode_popover.tsx b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/switch_mode_popover.tsx index 89eb0eed5423598..7ebea5aaba3b66e 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/switch_mode_popover.tsx +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/switch_mode_popover.tsx @@ -19,7 +19,6 @@ import { i18n } from '@kbn/i18n'; import { Assign } from '@kbn/utility-types'; import { FormattedMessage } from '@kbn/i18n/react'; import { SelectIndexComponentProps } from './types'; -import { MigrationCallout } from './migration_callout'; import { isStringTypeIndexPattern } from '../../../../../common/index_patterns_utils'; import { IndexPatternObject } from '../../../../../common/types'; import { getDataStart } from '../../../../services'; @@ -99,7 +98,6 @@ export const SwitchModePopover = ({ - {value && isStringTypeIndexPattern(value) && ( - - )} ); diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/types.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/types.ts index d109d6ee5056ff4..0a0e434ee1b771c 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/types.ts +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/types.ts @@ -14,5 +14,5 @@ export interface SelectIndexComponentProps { 'data-test-subj': string; placeholder?: string; disabled?: boolean; - allowSwitchUseKibanaIndexesMode?: boolean; + allowSwitchMode?: boolean; }