diff --git a/eslint-suppressions.json b/eslint-suppressions.json index a3292e1a102..18367de0c3f 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -3328,23 +3328,6 @@ "count": 2 } }, - "public/app/features/query/components/QueryEditorRow.tsx": { - "@grafana/no-aria-label-selectors": { - "count": 1 - }, - "@typescript-eslint/consistent-type-assertions": { - "count": 3 - }, - "no-restricted-syntax": { - "count": 1 - }, - "react-hooks/rules-of-hooks": { - "count": 1 - }, - "react-prefer-function-component/react-prefer-function-component": { - "count": 1 - } - }, "public/app/features/query/components/QueryEditorRowHeader.tsx": { "@grafana/no-aria-label-selectors": { "count": 1 diff --git a/public/app/features/query/components/QueryEditorRow.tsx b/public/app/features/query/components/QueryEditorRow.tsx index 79bf7b30ee2..5612ce37e0b 100644 --- a/public/app/features/query/components/QueryEditorRow.tsx +++ b/public/app/features/query/components/QueryEditorRow.tsx @@ -85,6 +85,7 @@ interface State { showingHelp: boolean; } +// eslint-disable-next-line react-prefer-function-component/react-prefer-function-component export class QueryEditorRow extends PureComponent, State> { dataSourceSrv = getDataSourceSrv(); id = ''; @@ -135,6 +136,7 @@ export class QueryEditorRow extends PureComponent, queriedDataSourceIdentifier: interpolatedUID, }); @@ -230,6 +232,17 @@ export class QueryEditorRow extends PureComponent { const { onRemoveQuery, query, onQueryRemoved } = this.props; + + // Track expression query removal + const isExpressionQuery = query.datasource?.uid === ExpressionDatasourceUID; + if (isExpressionQuery && 'type' in query && query.type) { + reportInteraction('dashboards_expression_interaction', { + action: 'remove_expression', + expression_type: query.type, + context: 'panel_query_section', + }); + } + onRemoveQuery(query); if (onQueryRemoved) { @@ -365,6 +378,7 @@ export class QueryEditorRow extends PureComponent void, dataSource, key: index, @@ -483,6 +497,7 @@ export class QueryEditorRow extends PureComponent e.refId === query.refId); const rowClasses = classNames('query-editor-row', { 'query-editor-row--disabled': isHidden, + // eslint-disable-next-line no-restricted-syntax 'gf-form-disabled': isHidden, }); @@ -524,6 +539,7 @@ export class QueryEditorRow extends PureComponent {queryLibraryRef && ( ({ extensionPointId: PluginExtensionPoints.QueryEditorRowAdaptiveTelemetryV1, });