Skip to content

Commit 37c0c79

Browse files
[Search][Telemetry] Add data-test-subj eslint check missing Search plugins (#265004)
## Summary Adds ESLint config for telemetry check in missing Search plugins. ### Checklist Check the PR satisfies following conditions. Created with Claude Code instructed by @efegurkan Reviewers should verify this PR satisfies this list as well. - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] ~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~ - [ ] ~[Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios~ - [ ] ~If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~ - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] ~[Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed~ - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit e4bc92e)
1 parent d0ba5e1 commit 37c0c79

16 files changed

Lines changed: 60 additions & 7 deletions

File tree

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,11 @@ module.exports = {
12461246
},
12471247
},
12481248
{
1249-
files: ['x-pack/solutions/search/**/*.tsx'],
1249+
files: [
1250+
'x-pack/solutions/search/**/*.tsx',
1251+
'x-pack/platform/plugins/shared/content_connectors/**/*.{ts,tsx}',
1252+
'x-pack/platform/plugins/shared/search_inference_endpoints/**/*.{ts,tsx}',
1253+
],
12501254
rules: {
12511255
'@kbn/telemetry/event_generating_elements_should_be_instrumented': 'warn',
12521256
},

x-pack/platform/plugins/shared/content_connectors/public/components/connector_detail/components/generated_config_fields.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export const GeneratedConfigFields: React.FC<GeneratedConfigFieldsProps> = ({
153153
</EuiFlexItem>
154154
<EuiFlexItem>
155155
<EuiLinkTo
156+
data-test-subj="contentConnectorsGeneratedConfigFieldsConnectorNameLink"
156157
external
157158
target="_blank"
158159
to={generateEncodedPath(CONNECTOR_DETAIL_PATH, {
@@ -171,6 +172,7 @@ export const GeneratedConfigFields: React.FC<GeneratedConfigFieldsProps> = ({
171172
>
172173
<EuiFlexItem grow={false}>
173174
<EuiLinkTo
175+
data-test-subj="contentConnectorsGeneratedConfigFieldsConnectorIdLink"
174176
external
175177
target="_blank"
176178
to={generateEncodedPath(CONNECTOR_DETAIL_PATH, {

x-pack/platform/plugins/shared/content_connectors/public/components/connector_detail/connector_stats.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ export const ConnectorStats: React.FC<ConnectorStatsProps> = ({
238238
connector.status
239239
) && connector.index_name ? (
240240
<EuiButtonEmptyTo
241+
data-test-subj="contentConnectorsConnectorStatsConfigureEmptyButton"
241242
size="s"
242243
to={generateEncodedPath(CONNECTOR_DETAIL_TAB_PATH, {
243244
connectorId: connector.id,
@@ -248,6 +249,7 @@ export const ConnectorStats: React.FC<ConnectorStatsProps> = ({
248249
</EuiButtonEmptyTo>
249250
) : (
250251
<EuiButtonTo
252+
data-test-subj="contentConnectorsConnectorStatsConfigureButton"
251253
color="primary"
252254
size="s"
253255
fill
@@ -325,6 +327,7 @@ export const ConnectorStats: React.FC<ConnectorStatsProps> = ({
325327
</EuiFlexItem>
326328
<EuiFlexItem grow={false}>
327329
<EuiButtonEmptyTo
330+
data-test-subj="contentConnectorsConnectorStatsSeeDocumentsButton"
328331
isDisabled={!(connector.index_name && indexData)}
329332
size="s"
330333
to={generateEncodedPath(CONNECTOR_DETAIL_TAB_PATH, {
@@ -361,6 +364,7 @@ export const ConnectorStats: React.FC<ConnectorStatsProps> = ({
361364
<EuiFlexGroup justifyContent="flexEnd">
362365
<EuiFlexItem grow={false}>
363366
<EuiLink
367+
data-test-subj="contentConnectorsConnectorStatsLink"
364368
target={'_blank'}
365369
external={false}
366370
href={http?.basePath.prepend(
@@ -384,6 +388,7 @@ export const ConnectorStats: React.FC<ConnectorStatsProps> = ({
384388
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
385389
<EuiFlexItem grow={false}>
386390
<EuiButtonEmpty
391+
data-test-subj="contentConnectorsConnectorStatsElasticConnectorsButton"
387392
isDisabled={!connector.service_type}
388393
iconType="plugs"
389394
color="text"
@@ -428,6 +433,7 @@ export const ConnectorStats: React.FC<ConnectorStatsProps> = ({
428433
<EuiFlexItem grow={false}>
429434
{agentlessAgentExists && (
430435
<EuiButtonEmpty
436+
data-test-subj="contentConnectorsConnectorStatsHostOverviewButton"
431437
isDisabled={!agentlessOverview || !agentlessOverview.agent.id}
432438
size="s"
433439
href={http?.basePath.prepend(
@@ -445,6 +451,7 @@ export const ConnectorStats: React.FC<ConnectorStatsProps> = ({
445451
<EuiFlexItem grow={false}>
446452
{agnetlessPolicyExists ? (
447453
<EuiButtonEmpty
454+
data-test-subj="contentConnectorsConnectorStatsManagePolicyButton"
448455
isDisabled={!agentlessOverview || !agentlessOverview.policy.id}
449456
size="s"
450457
href={http?.basePath.prepend(

x-pack/platform/plugins/shared/content_connectors/public/components/connector_detail/overview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export const ConnectorDetailOverview: React.FC = () => {
135135
</EuiText>
136136
<EuiSpacer />
137137
<EuiButtonTo
138+
data-test-subj="contentConnectorsConnectorOverviewAttachIndexButton"
138139
color="warning"
139140
fill
140141
to={`${generateEncodedPath(CONNECTOR_DETAIL_TAB_PATH, {

x-pack/platform/plugins/shared/content_connectors/public/components/connectors/connectors_table.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const ConnectorsTable: React.FC<ConnectorsTableProps> = ({
6565
),
6666
render: (connector: ConnectorViewItem) => (
6767
<EuiLinkTo
68+
data-test-subj="contentConnectorsConnectorsTableNameLink"
6869
to={generateEncodedPath(CONNECTOR_DETAIL_PATH, { connectorId: connector.id })}
6970
>
7071
{connector.name}

x-pack/platform/plugins/shared/content_connectors/public/components/search_index/connector/connector_overview_panels.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const ConnectorOverviewPanels: React.FC = () => {
6969
>
7070
{ingestionStatus === IngestionStatus.INCOMPLETE ? (
7171
<EuiLinkTo
72+
data-test-subj="contentConnectorsConnectorOverviewPanelsIngestionStatusLink"
7273
to={generateEncodedPath(SEARCH_INDEX_TAB_PATH, {
7374
indexName: index.name,
7475
tabId: SearchIndexTabId.CONFIGURATION,

x-pack/platform/plugins/shared/content_connectors/public/components/search_index/connector/sync_rules/connector_sync_form.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const ConnectorSyncRulesForm: FC<PropsWithChildren<unknown>> = ({ childre
4646
{isEditing && (
4747
<EuiFlexItem grow={false}>
4848
<EuiButtonEmpty
49+
data-test-subj="contentConnectorsConnectorSyncRulesFormCancelButton"
4950
data-telemetry-id="entSearchContent-connector-syncRules-editRules-cancelEditing"
5051
onClick={() => {
5152
setIsEditing(!isEditing);
@@ -62,6 +63,7 @@ export const ConnectorSyncRulesForm: FC<PropsWithChildren<unknown>> = ({ childre
6263
)}
6364
<EuiFlexItem grow={false}>
6465
<EuiButton
66+
data-test-subj="contentConnectorsConnectorSyncRulesFormSaveAndValidateDraftButton"
6567
data-telemetry-id="entSearchContent-connector-syncRules-editRules-saveAndValidate"
6668
disabled={hasJsonValidationError}
6769
isLoading={isLoading}

x-pack/platform/plugins/shared/content_connectors/public/components/search_index/connector/sync_rules/editable_basic_rules_table.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ export const SyncRulesTable: React.FC = () => {
8282
<EuiText size="s" color="default">
8383
{getSyncRulesDescription(indexName)}
8484
<EuiSpacer />
85-
<EuiLink href={docLinks.syncRules} external target="_blank">
85+
<EuiLink
86+
data-test-subj="contentConnectorsSyncRulesTableLink"
87+
href={docLinks.syncRules}
88+
external
89+
target="_blank"
90+
>
8691
{SYNC_RULES_LEARN_MORE_LINK}
8792
</EuiLink>
8893
</EuiText>
@@ -92,6 +97,7 @@ export const SyncRulesTable: React.FC = () => {
9297
{
9398
editingRender: (filteringRule, onChange) => (
9499
<EuiSelect
100+
data-test-subj="contentConnectorsColumnsPolicySelect"
95101
fullWidth
96102
value={filteringRule.policy}
97103
onChange={(e) => onChange(e.target.value)}
@@ -119,6 +125,7 @@ export const SyncRulesTable: React.FC = () => {
119125
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
120126
<EuiFlexItem>
121127
<EuiFieldText
128+
data-test-subj="contentConnectorsColumnsFieldFieldText"
122129
fullWidth
123130
value={rule.field}
124131
onChange={(e) => onChange(e.target.value)}
@@ -138,6 +145,7 @@ export const SyncRulesTable: React.FC = () => {
138145
{
139146
editingRender: (filteringRule, onChange) => (
140147
<EuiSelect
148+
data-test-subj="contentConnectorsColumnsRuleSelect"
141149
fullWidth
142150
value={filteringRule.rule}
143151
onChange={(e) => onChange(e.target.value)}
@@ -157,6 +165,7 @@ export const SyncRulesTable: React.FC = () => {
157165
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
158166
<EuiFlexItem>
159167
<EuiFieldText
168+
data-test-subj="contentConnectorsColumnsValueFieldText"
160169
fullWidth
161170
value={rule.value}
162171
onChange={(e) => onChange(e.target.value)}

x-pack/platform/plugins/shared/content_connectors/public/components/search_index/connector/sync_rules/sync_rules_callouts.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const SyncRulesStateCallouts: React.FC<FilteringStatusCalloutsProps> = ({
5858
<EuiFlexItem>
5959
<span>
6060
<EuiButton
61+
data-test-subj="contentConnectorsSyncRulesStateCalloutsEditDraftRulesButton"
6162
data-telemetry-id="entSearchContent-connector-syncRules-validatingCallout-editRules"
6263
onClick={editDraft}
6364
color="warning"
@@ -97,6 +98,7 @@ export const SyncRulesStateCallouts: React.FC<FilteringStatusCalloutsProps> = ({
9798
<EuiFlexItem>
9899
<span>
99100
<EuiButton
101+
data-test-subj="contentConnectorsSyncRulesStateCalloutsEditDraftRulesButton"
100102
data-telemetry-id="entSearchContent-connector-syncRules-errorCallout-editRules"
101103
onClick={editDraft}
102104
color="danger"
@@ -140,6 +142,7 @@ export const SyncRulesStateCallouts: React.FC<FilteringStatusCalloutsProps> = ({
140142
<EuiFlexItem grow={false}>
141143
<span>
142144
<EuiButton
145+
data-test-subj="contentConnectorsSyncRulesStateCalloutsActivateDraftRulesButton"
143146
data-telemetry-id="entSearchContent-connector-syncRules-successCallout-applyRules"
144147
onClick={applyDraft}
145148
color="success"
@@ -157,6 +160,7 @@ export const SyncRulesStateCallouts: React.FC<FilteringStatusCalloutsProps> = ({
157160
<EuiFlexItem grow={false}>
158161
<span>
159162
<EuiButton
163+
data-test-subj="contentConnectorsSyncRulesStateCalloutsEditDraftRulesButton"
160164
data-telemetry-id="entSearchContent-connector-syncRules-successCallout-editRules"
161165
onClick={editDraft}
162166
color="success"

x-pack/platform/plugins/shared/content_connectors/public/components/shared/connector_view_search_indices_details/connector_view_search_indices_details.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const ConnectorViewIndexLink: React.FC<{
1919

2020
return (
2121
<EuiLink
22+
data-test-subj="contentConnectorsConnectorViewIndexLinkLink"
2223
target={target ? '_blank' : undefined}
2324
external={target ?? false}
2425
href={`${http?.basePath.prepend(

0 commit comments

Comments
 (0)