diff --git a/public/app/plugins/datasource/tempo/traceql/QueryEditor.tsx b/public/app/plugins/datasource/tempo/traceql/QueryEditor.tsx index c4e9f977f22..21b4cfc6cd1 100644 --- a/public/app/plugins/datasource/tempo/traceql/QueryEditor.tsx +++ b/public/app/plugins/datasource/tempo/traceql/QueryEditor.tsx @@ -2,7 +2,7 @@ import { css } from '@emotion/css'; import { defaults } from 'lodash'; import React, { useRef, useState } from 'react'; -import { QueryEditorProps } from '@grafana/data'; +import { GrafanaTheme2, QueryEditorProps } from '@grafana/data'; import { config, reportInteraction } from '@grafana/runtime'; import { Button, InlineLabel, useStyles2 } from '@grafana/ui'; @@ -46,32 +46,30 @@ export function QueryEditor(props: Props) { {!showCopyFromSearchButton && ( - -
- Continue editing the query from the Search tab? - -
-
+ props.onClearResults(); + props.onChange({ + ...query, + query: generateQueryFromFilters(query.filters || []), + }); + setShowCopyFromSearchButton(true); + }} + style={{ marginLeft: '10px' }} + > + Copy query from Search + + )} ({ +const getStyles = (theme: GrafanaTheme2) => ({ optionsContainer: css({ marginTop: '10px', }), + copyContainer: css({ + backgroundColor: theme.colors.background.secondary, + padding: theme.spacing(0.5, 1), + fontSize: theme.typography.body.fontSize, + }), });