Skip to content

Conversation

@alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Aug 4, 2025

Backport

This will backport the following commits from main to 9.1:

Questions ?

Please refer to the Backport tool documentation

…nt rule (Step 3) (elastic#229616)

## Summary

This PR manually fixes some remaining violations of the following rule
that, for some reason, were not addressed in the previous PR:
elastic#227821

It applies the auto-fix for the newly introduced
`@elastic/eui/require-aria-label-for-modals` rule. This rule ensures
that `EUI` modal components (`EuiModal` and `EuiFlyout`) include either
an aria-label or `aria-labelledby` prop to support screen reader
accessibility. These attributes help users understand the purpose and
content of modal dialogs.

## Changes Made

1. **Identified the modal title/header element** used within `EuiModal`
or `EuiFlyout`.
Common elements include: `EuiFlyoutTitle`, `EuiModalTitle`, `EuiTitle`,
`<h2>`, `<h3>`, or other heading tags.

2. **Ensured the title element has an `id`:**
If the header element lacked an `id`, one was programmatically
generated:

   * **For function components:**

* Imported `useGeneratedHtmlId` from `@elastic/eui` if not already
present:

       ```ts
       import { useGeneratedHtmlId } from '@elastic/eui';
       ```
     * Defined a unique ID before the `return` statement:

       ```ts
       const modalTitleId = useGeneratedHtmlId();
       ```
     * Applied the ID to the title element:

       ```tsx
       <EuiModalTitle id={modalTitleId}>Title</EuiModalTitle>
       ```

   * **For class components:**

* Imported `htmlIdGenerator` from `@elastic/eui` if not already present:

       ```ts
       import { htmlIdGenerator } from '@elastic/eui';
       ```
     * Defined a unique ID within the `render()` method:

       ```ts
       const modalTitleId = htmlIdGenerator()('modalTitle');
       ```
     * Applied the ID to the title element:

       ```tsx
       <EuiModalTitle id={modalTitleId}>Title</EuiModalTitle>
       ```

3. **Updated the `EuiModal` or `EuiFlyout` component** to include the
`aria-labelledby` attribute referencing the generated title ID:

   ```tsx
   <EuiModal aria-labelledby={modalTitleId} />
   ```

<!--ONMERGE {"backportTargets":["9.1"]} ONMERGE-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit ef05e61)

# Conflicts:
#	src/platform/plugins/shared/workflows_management/public/features/run_workflow/ui/test_workflow_modal.tsx
#	src/platform/plugins/shared/workflows_management/public/features/run_workflow/ui/workflow_event_modal.tsx
@alexwizp alexwizp requested a review from kibanamachine as a code owner August 4, 2025 13:36
@alexwizp alexwizp added the backport This PR is a backport of another PR label Aug 4, 2025
@alexwizp alexwizp enabled auto-merge (squash) August 4, 2025 13:36
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Fleet Team label for Observability Data Collection Fleet team labels Aug 4, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@alexwizp
Copy link
Contributor Author

alexwizp commented Aug 4, 2025

/ci

@elasticmachine
Copy link
Contributor

elasticmachine commented Aug 4, 2025

💚 Build Succeeded

  • Buildkite Build
  • Commit: 3543ddb
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-230417-3543ddb65471

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
canvas 1.1MB 1.1MB +65.0B
crossClusterReplication 138.0KB 138.2KB +150.0B
ml 5.4MB 5.4MB +250.0B
monitoring 631.3KB 631.3KB +57.0B
observabilityAiAssistantManagement 97.6KB 97.7KB +51.0B
securitySolution 9.8MB 9.8MB +54.0B
triggersActionsUi 1.5MB 1.5MB +51.0B
visTypeTimeseries 439.1KB 439.2KB +130.0B
total +808.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
interactiveSetup 37.4KB 37.5KB +51.0B

History

@alexwizp alexwizp merged commit 9265847 into elastic:9.1 Aug 4, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR ci:project-deploy-observability Create an Observability project Team:Fleet Team label for Observability Data Collection Fleet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants