Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint Telemetry Rule #151173

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a25c970
Tryout
CoenWarmer Oct 14, 2022
7ab8847
First pass of eslint rule
CoenWarmer Oct 18, 2022
4f7ae81
Second pass of ESLint rule
CoenWarmer Oct 29, 2022
1ccdcd9
Merge branch 'main' of github.com:elastic/kibana into feature/telemetry
CoenWarmer Nov 10, 2022
250e804
Merge branch 'main' of github.com:elastic/kibana into feature/telemetry
CoenWarmer Dec 7, 2022
3f8f487
Fix Typescript typing, clean up function
CoenWarmer Dec 8, 2022
dedb910
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Dec 8, 2022
85d7367
Update Bazel file
CoenWarmer Dec 8, 2022
baa688a
Merge branch 'feature/telemetry' of github.com:CoenWarmer/kibana into…
CoenWarmer Dec 8, 2022
403d279
Remove test files
CoenWarmer Dec 8, 2022
5ac3bcb
Update docs
CoenWarmer Dec 8, 2022
5266a01
Cleanup
CoenWarmer Dec 8, 2022
14cf066
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Feb 10, 2023
336f3e8
Tweak generated suggestion
CoenWarmer Feb 10, 2023
88fb78f
Add more typesafety
CoenWarmer Feb 14, 2023
ba0f575
Add tests
CoenWarmer Feb 14, 2023
d76c486
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Feb 14, 2023
d1c9023
Update readme
CoenWarmer Feb 14, 2023
105e7db
Update package.json
CoenWarmer Feb 14, 2023
79ed102
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Feb 14, 2023
4223a83
Revert CODEOWNERS
CoenWarmer Feb 14, 2023
7f1e8aa
Merge branch 'feature/telemetry-renewed' of github.com:CoenWarmer/kib…
CoenWarmer Feb 14, 2023
c0e95f7
Revert CODEOWNERS
CoenWarmer Feb 14, 2023
e6ab2ef
Fix unnecessary main in plugin package.json
CoenWarmer Feb 14, 2023
401026c
Run code owners script locally
CoenWarmer Feb 15, 2023
ad65ba7
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Feb 15, 2023
56354c1
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Feb 15, 2023
c60b073
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Feb 15, 2023
290693f
Merge branch 'feature/telemetry-renewed' of github.com:CoenWarmer/kib…
CoenWarmer Feb 15, 2023
4211a7e
Support const function definitions and HOCs
CoenWarmer Feb 15, 2023
48316dd
Support const function definitions and HOCs
CoenWarmer Feb 15, 2023
3a99ee9
Merge branch 'feature/telemetry-renewed' of github.com:CoenWarmer/kib…
CoenWarmer Feb 15, 2023
b7f1bd0
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Feb 15, 2023
9c20ae7
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Feb 15, 2023
edd2840
Readability tweaks
CoenWarmer Feb 15, 2023
03fd329
Merge branch 'feature/telemetry-renewed' of github.com:CoenWarmer/kib…
CoenWarmer Feb 15, 2023
eab80fb
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Feb 15, 2023
056bd6d
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Feb 15, 2023
17f4627
Revert changes made by CI
CoenWarmer Feb 15, 2023
24efb17
Fix test
CoenWarmer Feb 15, 2023
bdc07c2
Remove extraneous Bazel files
CoenWarmer Feb 16, 2023
06461ce
Use dynamic repo folders in getAppName
CoenWarmer Feb 16, 2023
a8a0b01
Revert accidental code change
CoenWarmer Feb 16, 2023
77f169d
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Feb 16, 2023
05d0b7f
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Feb 16, 2023
21e4d93
Fix test
CoenWarmer Feb 16, 2023
cb0a3ba
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Feb 16, 2023
fe44171
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Feb 16, 2023
a9721e1
Revert CI made changes
CoenWarmer Feb 16, 2023
4081bbf
Set rule to error instead of warn
CoenWarmer Feb 17, 2023
42f0f6a
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Feb 17, 2023
00ceda3
Add Should run in Editor check
CoenWarmer Feb 21, 2023
d42309e
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Feb 21, 2023
26cec8a
Revert earlier --fix check
CoenWarmer Feb 21, 2023
c08261e
Add running in editor check
CoenWarmer Feb 21, 2023
a8ca293
Merge branch 'main' of github.com:elastic/kibana into feature/telemet…
CoenWarmer Mar 6, 2023
5efa52b
Dont use running in editor check
CoenWarmer Mar 6, 2023
dd05f03
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Mar 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ packages/kbn-eslint-config @elastic/kibana-operations
packages/kbn-eslint-plugin-disable @elastic/kibana-operations
packages/kbn-eslint-plugin-eslint @elastic/kibana-operations
packages/kbn-eslint-plugin-imports @elastic/kibana-operations
packages/kbn-eslint-plugin-telemetry @elastic/actionable-observability
x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin @elastic/kibana-security
src/plugins/event_annotation @elastic/kibana-visualizations
x-pack/test/plugin_api_integration/plugins/event_log @elastic/response-ops
Expand Down
14 changes: 12 additions & 2 deletions examples/bfetch_explorer/public/components/count_until/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ export const CountUntil: React.FC<Props> = ({ fetchStreaming }) => {
<EuiForm data-test-subj="CountUntil">
<pre>{JSON.stringify(error || results, null, 4)}</pre>
<EuiSpacer size="l" />
<EuiButton disabled={!completed} onClick={handleReset}>
<EuiButton
data-test-subj="bfetchExplorerCountUntilResetButton"
disabled={!completed}
onClick={handleReset}
>
Reset
</EuiButton>
</EuiForm>
Expand All @@ -69,12 +73,18 @@ export const CountUntil: React.FC<Props> = ({ fetchStreaming }) => {
<EuiForm data-test-subj="CountUntil">
<EuiFormRow label="Some integer" fullWidth>
<EuiFieldNumber
data-test-subj="bfetchExplorerCountUntilFieldNumber"
placeholder="Some integer"
value={data}
onChange={(e) => setData(Number(e.target.value))}
/>
</EuiFormRow>
<EuiButton type="submit" fill onClick={handleSubmit}>
<EuiButton
data-test-subj="bfetchExplorerCountUntilStartButton"
type="submit"
fill
onClick={handleSubmit}
>
Start
</EuiButton>
</EuiForm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ export const DoubleIntegers: React.FC<Props> = ({ double }) => {
<EuiForm data-test-subj="DoubleIntegers">
<pre>{JSON.stringify(results, null, 4)}</pre>
<EuiSpacer size="l" />
<EuiButton disabled={!!numberOfResultsAwaiting} onClick={handleReset}>
<EuiButton
data-test-subj="bfetchExplorerDoubleIntegersResetButton"
disabled={!!numberOfResultsAwaiting}
onClick={handleReset}
>
Reset
</EuiButton>
</EuiForm>
Expand All @@ -80,13 +84,19 @@ export const DoubleIntegers: React.FC<Props> = ({ double }) => {
<EuiForm data-test-subj="DoubleIntegers">
<EuiFormRow label="Numbers in ms separated by new line" fullWidth>
<EuiTextArea
data-test-subj="bfetchExplorerDoubleIntegersTextArea"
fullWidth
placeholder="Enter numbers in milliseconds separated by new line"
value={numbers}
onChange={(e) => setNumbers(e.target.value)}
/>
</EuiFormRow>
<EuiButton type="submit" fill onClick={handleSubmit}>
<EuiButton
data-test-subj="bfetchExplorerDoubleIntegersSendButton"
type="submit"
fill
onClick={handleSubmit}
>
Send
</EuiButton>
</EuiForm>
Expand Down
2 changes: 2 additions & 0 deletions examples/controls_example/public/edit_example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const EditExample = () => {
<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiButtonEmpty
data-test-subj="controlsExampleEditExampleAddControlButtonEmpty"
color="primary"
iconType="plusInCircle"
isDisabled={controlGroup === undefined}
Expand All @@ -87,6 +88,7 @@ export const EditExample = () => {
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
data-test-subj="controlsExampleEditExampleSaveButton"
color="primary"
isDisabled={controlGroup === undefined || isSaving}
fill
Expand Down
2 changes: 2 additions & 0 deletions examples/developer_examples/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function DeveloperExamples({ examples, navigateToApp, getUrlForApp }: Props) {
<p>
The following examples showcase services and APIs that are available to developers.
<EuiFieldSearch
data-test-subj="developerExamplesDeveloperExamplesFieldSearch"
placeholder="Search"
value={search}
onChange={(e) => setSearch(e.target.value)}
Expand All @@ -72,6 +73,7 @@ function DeveloperExamples({ examples, navigateToApp, getUrlForApp }: Props) {
title={
<React.Fragment>
<EuiLink
data-test-subj="developerExamplesDeveloperExamplesLink"
onClick={() => {
navigateToApp(def.appId);
}}
Expand Down
1 change: 1 addition & 0 deletions examples/expressions_explorer/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const ExpressionsExplorer = ({ expressions, inspector, actions, uiSettings }: Pr
There are a couple of ways to run the expressions. Below some of the options are
demonstrated. You can read more about it{' '}
<EuiLink
data-test-subj="expressionsExplorerExpressionsExplorerHereLink"
href={
'https://github.com/elastic/kibana/blob/main/src/plugins/expressions/README.asciidoc'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export function RenderExpressionsExample({ expressions, inspector }: Props) {
</EuiFlexItem>
<EuiFlexItem>
<EuiButton
data-test-subj="expressionsExplorerRenderExpressionsExampleOpenInspectorButton"
onClick={() => {
inspector.open(inspectorAdapters);
}}
Expand Down
1 change: 1 addition & 0 deletions examples/expressions_explorer/public/run_expressions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export function RunExpressionsExample({ expressions, inspector }: Props) {
</EuiFlexItem>
<EuiFlexItem>
<EuiButton
data-test-subj="expressionsExplorerRunExpressionsExampleOpenInspectorButton"
onClick={() => {
inspector.open(inspectorAdapters);
}}
Expand Down
10 changes: 8 additions & 2 deletions examples/field_formats_example/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ const CreatingCustomFieldFormat: React.FC<{ deps: Deps }> = (props) => {
<p>
Currency formatter that we&apos;ve just created is already integrated with data views. It
can be applied to any <EuiCode>numeric</EuiCode> field of any data view.{' '}
<EuiLink onClick={() => props.deps.openDateViewNumberFieldEditor()}>
<EuiLink
data-test-subj="fieldFormatsExampleCreatingCustomFieldFormatOpenDataViewFieldEditorToGiveItATryLink"
onClick={() => props.deps.openDateViewNumberFieldEditor()}
>
Open data view field editor to give it a try.
</EuiLink>
</p>
Expand Down Expand Up @@ -162,7 +165,10 @@ const CreatingCustomFieldFormatEditor: React.FC<{ deps: Deps }> = (props) => {
<p>
Currency formatter and its custom editor are integrated with data views. It can be applied
to any <EuiCode>numeric</EuiCode> field of any data view.{' '}
<EuiLink onClick={() => props.deps.openDateViewNumberFieldEditor()}>
<EuiLink
data-test-subj="fieldFormatsExampleCreatingCustomFieldFormatEditorOpenDateViewFieldEditorToGiveItATryLink"
onClick={() => props.deps.openDateViewNumberFieldEditor()}
>
Open date view field editor to give it a try.
</EuiLink>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const ExampleCurrencyFormatEditor: FieldFormatEditor<{ currency: string }> = (pr
return (
<EuiFormRow label={'Currency'}>
<EuiSelect
data-test-subj="fieldFormatsExampleExampleCurrencyFormatEditorSelect"
defaultValue={props.formatParams.currency}
options={[
{ text: 'EUR', value: 'EUR' },
Expand Down
8 changes: 7 additions & 1 deletion examples/files_example/public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ export const FilesExampleApp = ({ files, notifications }: FilesExampleAppDeps) =
const renderToolsRight = () => {
return [
<EuiButton
data-test-subj="filesExampleRenderToolsRightSelectAFileButton"
onClick={() => setShowFilePickerModal(true)}
isDisabled={isLoading || isDeletingFile}
iconType="eye"
>
Select a file
</EuiButton>,
<EuiButton
data-test-subj="filesExampleRenderToolsRightUploadImageButton"
onClick={() => setShowUploadModal(true)}
isDisabled={isLoading || isDeletingFile}
iconType="exportAction"
Expand All @@ -73,7 +75,11 @@ export const FilesExampleApp = ({ files, notifications }: FilesExampleAppDeps) =
field: 'name',
name: 'Name',
render: (name, item) => (
<EuiLink disabled={isDeletingFile} onClick={() => setSelectedItem(item)}>
<EuiLink
data-test-subj="filesExampleColumnsLink"
disabled={isDeletingFile}
onClick={() => setSelectedItem(item)}
>
{name}
</EuiLink>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const DetailsFlyout: FunctionComponent<Props> = ({ files, file, onDismiss
<EuiFlexGroup justifyContent="flexEnd" alignItems="center">
<EuiFlexItem grow={false}>
<EuiButton
data-test-subj="filesExampleDetailsFlyoutDownloadButton"
iconType="download"
href={files.example.getDownloadHref(file)}
download={file.name}
Expand All @@ -107,7 +108,11 @@ export const DetailsFlyout: FunctionComponent<Props> = ({ files, file, onDismiss
</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty iconType="cross" onClick={onDismiss}>
<EuiButtonEmpty
data-test-subj="filesExampleDetailsFlyoutCloseButtonEmpty"
iconType="cross"
onClick={onDismiss}
>
Close
</EuiButtonEmpty>
</EuiFlexItem>
Expand Down
25 changes: 21 additions & 4 deletions examples/guided_onboarding_example/public/components/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export const Main = (props: MainProps) => {
return (
<EuiFlexItem>
<EuiButton
data-test-subj="guidedOnboardingExampleMainButton"
onClick={() => activateGuide(guideId, guideState)}
fill
disabled={guideState?.status === 'complete'}
Expand Down Expand Up @@ -279,6 +280,7 @@ export const Main = (props: MainProps) => {
<EuiFlexItem>
<EuiFormRow label="Guide" helpText="Select a guide">
<EuiSelect
data-test-subj="guidedOnboardingExampleMainSelect"
id="guideSelect"
options={selectOptions}
value={selectedGuide}
Expand All @@ -298,14 +300,20 @@ export const Main = (props: MainProps) => {
<EuiFlexItem>
<EuiFormRow label="Step ID">
<EuiFieldText
data-test-subj="guidedOnboardingExampleMainFieldText"
value={selectedStep}
onChange={(e) => setSelectedStep(e.target.value as GuideStepIds)}
/>
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFormRow hasEmptyLabelSpace>
<EuiButton onClick={updateGuideState}>Save</EuiButton>
<EuiButton
data-test-subj="guidedOnboardingExampleMainSaveButton"
onClick={updateGuideState}
>
Save
</EuiButton>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
Expand All @@ -322,23 +330,32 @@ export const Main = (props: MainProps) => {
<EuiSpacer />
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiButton onClick={() => history.push('stepOne')}>
<EuiButton
data-test-subj="guidedOnboardingExampleMainStep1Button"
onClick={() => history.push('stepOne')}
>
<FormattedMessage
id="guidedOnboardingExample.main.examplePages.stepOne.link"
defaultMessage="Step 1"
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton onClick={() => history.push('stepTwo')}>
<EuiButton
data-test-subj="guidedOnboardingExampleMainStep2Button"
onClick={() => history.push('stepTwo')}
>
<FormattedMessage
id="guidedOnboardingExample.main.examplePages.stepTwo.link"
defaultMessage="Step 2"
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton onClick={() => history.push('stepThree')}>
<EuiButton
data-test-subj="guidedOnboardingExampleMainStep3Button"
onClick={() => history.push('stepThree')}
>
<FormattedMessage
id="guidedOnboardingExample.main.examplePages.stepThree.link"
defaultMessage="Step 3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const StepOne = ({ guidedOnboarding }: GuidedOnboardingExampleAppDeps) =>
anchorPosition="rightUp"
>
<EuiButton
data-test-subj="guidedOnboardingExampleStepOneCompleteStep1Button"
onClick={async () => {
await guidedOnboardingApi?.completeGuideStep('testGuide', 'step1');
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const StepThree = (props: StepThreeProps) => {
anchorPosition="rightUp"
>
<EuiButton
data-test-subj="guidedOnboardingExampleStepThreeCompleteStep3Button"
onClick={async () => {
await guidedOnboardingApi?.completeGuideStep('testGuide', 'step3');
}}
Expand Down
8 changes: 7 additions & 1 deletion examples/locator_explorer/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,19 @@ const ActionsExplorer = ({ share }: Props) => {
<p>Create new links using the most recent version of a locator.</p>
</EuiText>
<EuiFieldText
data-test-subj="locatorExplorerActionsExplorerFieldText"
prepend="First name"
onChange={(e) => {
setFirstName(e.target.value);
}}
/>
<EuiFieldText prepend="Last name" onChange={(e) => setLastName(e.target.value)} />
<EuiFieldText
data-test-subj="locatorExplorerActionsExplorerFieldText"
prepend="Last name"
onChange={(e) => setLastName(e.target.value)}
/>
<EuiButton
data-test-subj="locatorExplorerActionsExplorerAddNewLinkButton"
onClick={() =>
setPersistedLinks([
...persistedLinks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,20 @@ export const DynamicByReferenceExample = () => {
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="s">
<EuiFlexItem>
<EuiButton onClick={addByValue} isDisabled={disableButtons}>
<EuiButton
data-test-subj="portableDashboardsExampleDynamicByReferenceExampleAddVisualizationByValueButton"
onClick={addByValue}
isDisabled={disableButtons}
>
Add visualization by value
</EuiButton>
</EuiFlexItem>
<EuiFlexItem>
<EuiButton onClick={addByReference} isDisabled={disableButtons}>
<EuiButton
data-test-subj="portableDashboardsExampleDynamicByReferenceExampleAddVisualizationFromLibraryButton"
onClick={addByReference}
isDisabled={disableButtons}
>
Add visualization from library
</EuiButton>
</EuiFlexItem>
Expand All @@ -123,12 +131,19 @@ export const DynamicByReferenceExample = () => {
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="s">
<EuiFlexItem>
<EuiButton fill onClick={onSave} isLoading={isSaving} isDisabled={disableButtons}>
<EuiButton
data-test-subj="portableDashboardsExampleDynamicByReferenceExampleSaveToLocalStorageButton"
fill
onClick={onSave}
isLoading={isSaving}
isDisabled={disableButtons}
>
Save to local storage
</EuiButton>
</EuiFlexItem>
<EuiFlexItem>
<EuiButton
data-test-subj="portableDashboardsExampleDynamicByReferenceExampleEmptyDashboardAndResetLocalStorageButton"
onClick={resetPersistableInput}
isLoading={isSaving}
isDisabled={disableButtons}
Expand Down
Loading