mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Transforms] Fixing use full data button (#167404)
Fixing bug introduced by a merge clash between https://github.com/elastic/kibana/pull/166622 and https://github.com/elastic/kibana/pull/166651 The `hideFrozenDataTierChoice` prop is no longer available in the `FullTimeRangeSelector` component and so the transforms plugin needs to set `showFrozenDataTierChoice` in the data picker context.
This commit is contained in:
parent
c48cc24617
commit
046718c18f
2 changed files with 23 additions and 11 deletions
|
@ -109,7 +109,9 @@ export const FullTimeRangeSelector: FC<FullTimeRangeSelectorProps> = (props) =>
|
|||
toasts,
|
||||
http,
|
||||
query,
|
||||
showFrozenDataTierChoice ? frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE : false,
|
||||
showFrozenDataTierChoice === false
|
||||
? false
|
||||
: frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE,
|
||||
apiPath
|
||||
);
|
||||
if (typeof callback === 'function' && fullTimeRange !== undefined) {
|
||||
|
@ -192,9 +194,16 @@ export const FullTimeRangeSelector: FC<FullTimeRangeSelectorProps> = (props) =>
|
|||
[sortOptions, frozenDataPreference, setPreference]
|
||||
);
|
||||
|
||||
const buttonTooltip = useMemo(
|
||||
() =>
|
||||
frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE ? (
|
||||
const buttonTooltip = useMemo(() => {
|
||||
if (showFrozenDataTierChoice === false) {
|
||||
return (
|
||||
<FormattedMessage
|
||||
id="xpack.ml.datePicker.fullTimeRangeSelector.useFullData"
|
||||
defaultMessage="Use full range of data."
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
return frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE ? (
|
||||
<FormattedMessage
|
||||
id="xpack.ml.datePicker.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip"
|
||||
defaultMessage="Use full range of data excluding frozen data tier."
|
||||
|
@ -204,9 +213,9 @@ export const FullTimeRangeSelector: FC<FullTimeRangeSelectorProps> = (props) =>
|
|||
id="xpack.ml.datePicker.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip"
|
||||
defaultMessage="Use full range of data including frozen data tier, which might have slower search results."
|
||||
/>
|
||||
),
|
||||
[frozenDataPreference]
|
||||
);
|
||||
);
|
||||
}
|
||||
}, [frozenDataPreference, showFrozenDataTierChoice]);
|
||||
|
||||
return (
|
||||
<EuiFlexGroup responsive={false} gutterSize="xs">
|
||||
|
@ -222,7 +231,7 @@ export const FullTimeRangeSelector: FC<FullTimeRangeSelectorProps> = (props) =>
|
|||
/>
|
||||
</EuiButton>
|
||||
</EuiToolTip>
|
||||
{showFrozenDataTierChoice ? (
|
||||
{showFrozenDataTierChoice === false ? null : (
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiPopover
|
||||
id={'mlFullTimeRangeSelectorOption'}
|
||||
|
@ -248,7 +257,7 @@ export const FullTimeRangeSelector: FC<FullTimeRangeSelectorProps> = (props) =>
|
|||
{popoverContent}
|
||||
</EuiPopover>
|
||||
</EuiFlexItem>
|
||||
) : null}
|
||||
)}
|
||||
</EuiFlexGroup>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -12,7 +12,7 @@ import { EuiSteps, EuiStepStatus } from '@elastic/eui';
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { DataView } from '@kbn/data-views-plugin/public';
|
||||
import { DatePickerContextProvider } from '@kbn/ml-date-picker';
|
||||
import { DatePickerContextProvider, type DatePickerDependencies } from '@kbn/ml-date-picker';
|
||||
import { Storage } from '@kbn/kibana-utils-plugin/public';
|
||||
import { StorageContextProvider } from '@kbn/ml-local-storage';
|
||||
import { UrlStateProvider } from '@kbn/ml-url-state';
|
||||
|
@ -20,6 +20,7 @@ import { UI_SETTINGS } from '@kbn/data-plugin/common';
|
|||
import type { FieldStatsServices } from '@kbn/unified-field-list/src/components/field_stats';
|
||||
import type { RuntimeMappings } from '@kbn/ml-runtime-field-utils';
|
||||
|
||||
import { useEnabledFeatures } from '../../../../serverless_context';
|
||||
import type { TransformConfigUnion } from '../../../../../../common/types/transform';
|
||||
|
||||
import { getCreateTransformRequestBody } from '../../../../common';
|
||||
|
@ -106,6 +107,7 @@ export const CreateTransformWizardContext = createContext<{
|
|||
});
|
||||
|
||||
export const Wizard: FC<WizardProps> = React.memo(({ cloneConfig, searchItems }) => {
|
||||
const { showNodeInfo } = useEnabledFeatures();
|
||||
const appDependencies = useAppDependencies();
|
||||
const {
|
||||
ml: { FieldStatsFlyoutProvider },
|
||||
|
@ -226,9 +228,10 @@ export const Wizard: FC<WizardProps> = React.memo(({ cloneConfig, searchItems })
|
|||
|
||||
const stepsConfig = [stepDefine, stepDetails, stepCreate];
|
||||
|
||||
const datePickerDeps = {
|
||||
const datePickerDeps: DatePickerDependencies = {
|
||||
...pick(appDependencies, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']),
|
||||
uiSettingsKeys: UI_SETTINGS,
|
||||
showFrozenDataTierChoice: showNodeInfo,
|
||||
};
|
||||
|
||||
const fieldStatsServices: FieldStatsServices = useMemo(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue