Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b680cc3
[ML] Removing global isServerless flag
jgowdyelastic Sep 18, 2023
1d31fb5
fixing types
jgowdyelastic Sep 18, 2023
e9f0cfb
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 18, 2023
bce8342
tiny refactor
jgowdyelastic Sep 18, 2023
2c17bac
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 19, 2023
9b2d916
Merge branch 'removing-global-isServerless-flag' of github.com:jgowdy…
jgowdyelastic Sep 19, 2023
85d1856
update comment
jgowdyelastic Sep 19, 2023
d356520
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 20, 2023
0fb8f32
using config flags client side
jgowdyelastic Sep 20, 2023
cb99113
removing showFrozenDataTierChoice flag
jgowdyelastic Sep 20, 2023
3f7315d
enabling memory usage
jgowdyelastic Sep 20, 2023
524e1e3
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 21, 2023
6cdac4e
updating management page with new context
jgowdyelastic Sep 21, 2023
fd32536
missing nlp check
jgowdyelastic Sep 21, 2023
a84f60c
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 21, 2023
13bf9a1
Merge branch 'removing-global-isServerless-flag' of github.com:jgowdy…
jgowdyelastic Sep 21, 2023
c07b228
Merge remote-tracking branch 'origin/main' into removing-global-isSer…
jgowdyelastic Sep 21, 2023
7968892
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 21, 2023
e2a25c5
fixing types
jgowdyelastic Sep 21, 2023
35dc3d5
testing bundle size
jgowdyelastic Sep 21, 2023
6c6493f
reverting test
jgowdyelastic Sep 21, 2023
917067e
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 21, 2023
04a4d37
Merge branch 'removing-global-isServerless-flag' of github.com:jgowdy…
jgowdyelastic Sep 21, 2023
3ffb0b8
moving initEnabledFeatures
jgowdyelastic Sep 21, 2023
6d38c2b
changing import
jgowdyelastic Sep 21, 2023
d033f43
Merge branch 'main' into removing-global-isServerless-flag
kibanamachine Sep 21, 2023
4b95c28
Merge branch 'removing-global-isServerless-flag' of github.com:jgowdy…
jgowdyelastic Sep 21, 2023
8939e5c
moving code about
jgowdyelastic Sep 21, 2023
ff69722
fixing types
jgowdyelastic Sep 21, 2023
a19db05
updating exposed config items test
jgowdyelastic Sep 22, 2023
0cc0471
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 22, 2023
38b04bf
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 22, 2023
b07bcae
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 25, 2023
c6ff29f
using disabled rather than hidden for nav links
jgowdyelastic Sep 25, 2023
5288875
reverting nav links change
jgowdyelastic Sep 25, 2023
32a833f
removing frozen tier prop
jgowdyelastic Sep 25, 2023
c90fc76
Merge remote-tracking branch 'origin/main' into removing-global-isSer…
jgowdyelastic Sep 25, 2023
0c7bcaa
fixing types after merge with main
jgowdyelastic Sep 25, 2023
696f61c
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 26, 2023
bc8753a
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 26, 2023
20ddadd
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 26, 2023
14e1f50
moving model management route creation
jgowdyelastic Sep 26, 2023
9c215b8
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 26, 2023
2138e76
Merge branch 'main' into removing-global-isServerless-flag
jgowdyelastic Sep 26, 2023
85fa7cd
Merge remote-tracking branch 'origin/main' into removing-global-isSer…
jgowdyelastic Sep 27, 2023
41cc353
Merge remote-tracking branch 'origin/main' into removing-global-isSer…
jgowdyelastic Sep 27, 2023
542ffb3
Merge branch 'removing-global-isServerless-flag' of github.com:jgowdy…
jgowdyelastic Sep 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/plugin_functional/test_suites/core_plugins/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
'xpack.license_management.ui.enabled (boolean)',
'xpack.maps.preserveDrawingBuffer (boolean)',
'xpack.maps.showMapsInspectorAdapter (boolean)',
'xpack.ml.ad.enabled (boolean)',
'xpack.ml.dfa.enabled (boolean)',
'xpack.ml.nlp.enabled (boolean)',
'xpack.osquery.actionEnabled (boolean)',
'xpack.remote_clusters.ui.enabled (boolean)',
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ export interface FullTimeRangeSelectorProps {
* @param value - The time field range response.
*/
apiPath?: SetFullTimeRangeApiPath;
/**
* Optional flag to disable the frozen data tier choice.
*/
hideFrozenDataTierChoice?: boolean;
}

/**
Expand All @@ -96,13 +92,12 @@ export const FullTimeRangeSelector: FC<FullTimeRangeSelectorProps> = (props) =>
disabled,
callback,
apiPath,
hideFrozenDataTierChoice = false,
} = props;

const {
http,
notifications: { toasts },
isServerless,
showFrozenDataTierChoice,
} = useDatePickerContext();

// wrapper around setFullTimeRange to allow for the calling of the optional callBack prop
Expand All @@ -114,9 +109,7 @@ export const FullTimeRangeSelector: FC<FullTimeRangeSelectorProps> = (props) =>
toasts,
http,
query,
isServerless || hideFrozenDataTierChoice
? false
: frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE,
showFrozenDataTierChoice ? frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE : false,
apiPath
);
if (typeof callback === 'function' && fullTimeRange !== undefined) {
Expand All @@ -138,8 +131,7 @@ export const FullTimeRangeSelector: FC<FullTimeRangeSelectorProps> = (props) =>
toasts,
http,
query,
isServerless,
hideFrozenDataTierChoice,
showFrozenDataTierChoice,
frozenDataPreference,
apiPath,
callback,
Expand Down Expand Up @@ -230,7 +222,7 @@ export const FullTimeRangeSelector: FC<FullTimeRangeSelectorProps> = (props) =>
/>
</EuiButton>
</EuiToolTip>
{isServerless || hideFrozenDataTierChoice ? null : (
{showFrozenDataTierChoice ? (
<EuiFlexItem grow={false}>
<EuiPopover
id={'mlFullTimeRangeSelectorOption'}
Expand All @@ -256,7 +248,7 @@ export const FullTimeRangeSelector: FC<FullTimeRangeSelectorProps> = (props) =>
{popoverContent}
</EuiPopover>
</EuiFlexItem>
)}
) : null}
</EuiFlexGroup>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export interface DatePickerDependencies {
*/
i18n: I18nStart;
/**
* Optional flag to indicate whether kibana is running in serverless
* Optional flag to disable the frozen data tier choice.
*/
isServerless?: boolean;
showFrozenDataTierChoice?: boolean;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ export interface ChangePointDetectionAppStateProps {
/** App dependencies */
appDependencies: AiopsAppDependencies;
/** Optional flag to indicate whether kibana is running in serverless */
isServerless?: boolean;
showFrozenDataTierChoice?: boolean;
}

export const ChangePointDetectionAppState: FC<ChangePointDetectionAppStateProps> = ({
dataView,
savedSearch,
appDependencies,
isServerless = false,
showFrozenDataTierChoice = true,
}) => {
const datePickerDeps: DatePickerDependencies = {
...pick(appDependencies, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']),
uiSettingsKeys: UI_SETTINGS,
isServerless,
showFrozenDataTierChoice,
};

const warning = timeSeriesDataViewWarning(dataView, 'change_point_detection');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ export interface LogCategorizationAppStateProps {
/** App dependencies */
appDependencies: AiopsAppDependencies;
/** Optional flag to indicate whether kibana is running in serverless */
isServerless?: boolean;
showFrozenDataTierChoice?: boolean;
}

export const LogCategorizationAppState: FC<LogCategorizationAppStateProps> = ({
dataView,
savedSearch,
appDependencies,
isServerless = false,
showFrozenDataTierChoice = true,
}) => {
if (!dataView) return null;

Expand All @@ -56,7 +56,7 @@ export const LogCategorizationAppState: FC<LogCategorizationAppStateProps> = ({
const datePickerDeps: DatePickerDependencies = {
...pick(appDependencies, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']),
uiSettingsKeys: UI_SETTINGS,
isServerless,
showFrozenDataTierChoice,
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export interface LogRateAnalysisAppStateProps {
/** Option to make main histogram sticky */
stickyHistogram?: boolean;
/** Optional flag to indicate whether kibana is running in serverless */
isServerless?: boolean;
showFrozenDataTierChoice?: boolean;
}

export const LogRateAnalysisAppState: FC<LogRateAnalysisAppStateProps> = ({
dataView,
savedSearch,
appDependencies,
stickyHistogram,
isServerless = false,
showFrozenDataTierChoice = true,
}) => {
if (!dataView) return null;

Expand All @@ -62,7 +62,7 @@ export const LogRateAnalysisAppState: FC<LogRateAnalysisAppStateProps> = ({
const datePickerDeps: DatePickerDependencies = {
...pick(appDependencies, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']),
uiSettingsKeys: UI_SETTINGS,
isServerless,
showFrozenDataTierChoice,
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface LogRateAnalysisContentWrapperProps {
*/
onAnalysisCompleted?: (d: LogRateAnalysisResultsData) => void;
/** Optional flag to indicate whether kibana is running in serverless */
isServerless?: boolean;
showFrozenDataTierChoice?: boolean;
}

export const LogRateAnalysisContentWrapper: FC<LogRateAnalysisContentWrapperProps> = ({
Expand All @@ -72,7 +72,7 @@ export const LogRateAnalysisContentWrapper: FC<LogRateAnalysisContentWrapperProp
barColorOverride,
barHighlightColorOverride,
onAnalysisCompleted,
isServerless = false,
showFrozenDataTierChoice = true,
}) => {
if (!dataView) return null;

Expand All @@ -85,6 +85,7 @@ export const LogRateAnalysisContentWrapper: FC<LogRateAnalysisContentWrapperProp
const datePickerDeps = {
...pick(appDependencies, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']),
uiSettingsKeys: UI_SETTINGS,
showFrozenDataTierChoice,
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,13 @@ export const DataVisualizerStateContextProvider: FC<DataVisualizerStateContextPr

interface Props {
getAdditionalLinks?: GetAdditionalLinks;
isServerless?: boolean;
showFrozenDataTierChoice?: boolean;
}

export const IndexDataVisualizer: FC<Props> = ({ getAdditionalLinks, isServerless = false }) => {
export const IndexDataVisualizer: FC<Props> = ({
getAdditionalLinks,
showFrozenDataTierChoice = true,
}) => {
const coreStart = getCoreStart();
const {
data,
Expand Down Expand Up @@ -302,7 +305,7 @@ export const IndexDataVisualizer: FC<Props> = ({ getAdditionalLinks, isServerles
const datePickerDeps: DatePickerDependencies = {
...pick(services, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']),
uiSettingsKeys: UI_SETTINGS,
isServerless,
showFrozenDataTierChoice,
};

return (
Expand Down
20 changes: 20 additions & 0 deletions x-pack/plugins/ml/common/constants/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,23 @@ export const ML_APP_NAME = i18n.translate('xpack.ml.navMenu.mlAppNameText', {
export const ML_APP_ROUTE = '/app/ml';
export const ML_INTERNAL_BASE_PATH = '/internal/ml';
export const ML_EXTERNAL_BASE_PATH = '/api/ml';

export type MlFeatures = Record<'ad' | 'dfa' | 'nlp', boolean>;

export interface ConfigSchema {
ad?: { enabled: boolean };
dfa?: { enabled: boolean };
nlp?: { enabled: boolean };
}

export function initEnabledFeatures(enabledFeatures: MlFeatures, config: ConfigSchema) {
if (config.ad?.enabled !== undefined) {
enabledFeatures.ad = config.ad.enabled;
}
if (config.dfa?.enabled !== undefined) {
enabledFeatures.dfa = config.dfa.enabled;
}
if (config.nlp?.enabled !== undefined) {
enabledFeatures.nlp = config.nlp.enabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ import { ChangePointDetection } from '@kbn/aiops-plugin/public';

import { useDataSource } from '../contexts/ml/data_source_context';
import { useFieldStatsTrigger, FieldStatsFlyoutProvider } from '../components/field_stats_flyout';
import { useMlKibana, useIsServerless } from '../contexts/kibana';
import { useMlKibana } from '../contexts/kibana';
import { HelpMenu } from '../components/help_menu';
import { TechnicalPreviewBadge } from '../components/technical_preview_badge';

import { MlPageHeader } from '../components/page_header';
import { useEnabledFeatures } from '../contexts/ml/serverless_context';

export const ChangePointDetectionPage: FC = () => {
const { services } = useMlKibana();
const isServerless = useIsServerless();
const { showNodeInfo } = useEnabledFeatures();

const { selectedDataView: dataView, selectedSavedSearch: savedSearch } = useDataSource();

Expand All @@ -46,7 +47,7 @@ export const ChangePointDetectionPage: FC = () => {
<ChangePointDetection
dataView={dataView}
savedSearch={savedSearch}
isServerless={isServerless}
showFrozenDataTierChoice={showNodeInfo}
appDependencies={{
...pick(services, [
'application',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { LogCategorization } from '@kbn/aiops-plugin/public';
import { useDataSource } from '../contexts/ml/data_source_context';
import { useMlKibana, useIsServerless } from '../contexts/kibana';
import { useMlKibana } from '../contexts/kibana';
import { useEnabledFeatures } from '../contexts/ml';
import { HelpMenu } from '../components/help_menu';
import { TechnicalPreviewBadge } from '../components/technical_preview_badge';
import { MlPageHeader } from '../components/page_header';

export const LogCategorizationPage: FC = () => {
const { services } = useMlKibana();
const isServerless = useIsServerless();
const { showNodeInfo } = useEnabledFeatures();

const { selectedDataView: dataView, selectedSavedSearch: savedSearch } = useDataSource();

Expand All @@ -41,7 +42,7 @@ export const LogCategorizationPage: FC = () => {
<LogCategorization
dataView={dataView}
savedSearch={savedSearch}
isServerless={isServerless}
showFrozenDataTierChoice={showNodeInfo}
appDependencies={pick(services, [
'application',
'data',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { LogRateAnalysis } from '@kbn/aiops-plugin/public';
import { useDataSource } from '../contexts/ml/data_source_context';
import { useMlKibana, useIsServerless } from '../contexts/kibana';
import { useMlKibana } from '../contexts/kibana';
import { HelpMenu } from '../components/help_menu';
import { TechnicalPreviewBadge } from '../components/technical_preview_badge';
import { MlPageHeader } from '../components/page_header';
import { useEnabledFeatures } from '../contexts/ml';

export const LogRateAnalysisPage: FC = () => {
const { services } = useMlKibana();
const isServerless = useIsServerless();
const { showNodeInfo } = useEnabledFeatures();

const { selectedDataView: dataView, selectedSavedSearch: savedSearch } = useDataSource();

Expand All @@ -44,7 +45,7 @@ export const LogRateAnalysisPage: FC = () => {
stickyHistogram={false}
dataView={dataView}
savedSearch={savedSearch}
isServerless={isServerless}
showFrozenDataTierChoice={showNodeInfo}
appDependencies={pick(services, [
'application',
'data',
Expand Down
Loading