Skip to content

Commit

Permalink
[ML] Fix handling of default and advanced search on step summary view.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Mar 30, 2020
1 parent b6101f0 commit 796825f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ export const StepDefineForm: FC<Props> = React.memo(({ overrides = {}, onChange,
width="100%"
value={advancedEditorSourceConfig}
onChange={(d: string) => {
setSearchString(undefined);
setAdvancedEditorSourceConfig(d);

// Disable the "Apply"-Button if the config hasn't changed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
EuiText,
} from '@elastic/eui';

import { getPivotQuery } from '../../../../common';
import { getPivotQuery, isDefaultQuery } from '../../../../common';
import { PivotPreview } from '../../../../components/pivot_preview';
import { SearchItems } from '../../../../hooks/use_search_items';

Expand Down Expand Up @@ -60,7 +60,7 @@ export const StepDefineSummary: FC<Props> = ({
<span>{searchString}</span>
</EuiFormRow>
)}
{typeof searchString === 'undefined' && (
{typeof searchString === 'undefined' && !isDefaultQuery(pivotQuery) && (
<EuiFormRow
label={i18n.translate('xpack.transform.stepDefineSummary.queryCodeBlockLabel', {
defaultMessage: 'Query',
Expand All @@ -74,7 +74,7 @@ export const StepDefineSummary: FC<Props> = ({
overflowHeight={300}
isCopyable
>
{JSON.stringify(searchQuery, null, 2)}
{JSON.stringify(pivotQuery, null, 2)}
</EuiCodeBlock>
</EuiFormRow>
)}
Expand Down

0 comments on commit 796825f

Please sign in to comment.