mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
retain query language on step edit (#116227)
This commit is contained in:
parent
38026a8bd3
commit
d91bd98e97
2 changed files with 9 additions and 2 deletions
|
@ -127,6 +127,7 @@ export const ConfigurationStepForm: FC<ConfigurationStepProps> = ({
|
|||
dependentVariable,
|
||||
includes,
|
||||
jobConfigQuery,
|
||||
jobConfigQueryLanguage,
|
||||
jobConfigQueryString,
|
||||
jobType,
|
||||
modelMemoryLimit,
|
||||
|
@ -150,14 +151,18 @@ export const ConfigurationStepForm: FC<ConfigurationStepProps> = ({
|
|||
|
||||
const [query, setQuery] = useState<Query>({
|
||||
query: jobConfigQueryString ?? '',
|
||||
language: SEARCH_QUERY_LANGUAGE.KUERY,
|
||||
language: jobConfigQueryLanguage ?? SEARCH_QUERY_LANGUAGE.KUERY,
|
||||
});
|
||||
|
||||
const toastNotifications = getToastNotifications();
|
||||
|
||||
const setJobConfigQuery: ExplorationQueryBarProps['setSearchQuery'] = (update) => {
|
||||
if (update.query) {
|
||||
setFormState({ jobConfigQuery: update.query, jobConfigQueryString: update.queryString });
|
||||
setFormState({
|
||||
jobConfigQuery: update.query,
|
||||
jobConfigQueryLanguage: update.language,
|
||||
jobConfigQueryString: update.queryString,
|
||||
});
|
||||
}
|
||||
setQuery({ query: update.queryString, language: update.language });
|
||||
};
|
||||
|
|
|
@ -79,6 +79,7 @@ export interface State {
|
|||
jobType: AnalyticsJobType;
|
||||
jobConfigQuery: any;
|
||||
jobConfigQueryString: string | undefined;
|
||||
jobConfigQueryLanguage: string | undefined;
|
||||
lambda: number | undefined;
|
||||
lossFunction: string | undefined;
|
||||
lossFunctionParameter: number | undefined;
|
||||
|
@ -162,6 +163,7 @@ export const getInitialState = (): State => ({
|
|||
jobType: undefined,
|
||||
jobConfigQuery: defaultSearchQuery,
|
||||
jobConfigQueryString: undefined,
|
||||
jobConfigQueryLanguage: undefined,
|
||||
lambda: undefined,
|
||||
lossFunction: undefined,
|
||||
lossFunctionParameter: undefined,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue