File tree Expand file tree Collapse file tree
x-pack/platform/plugins/shared/cases/public/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 */
77
88import React from 'react' ;
9- import { EuiConfirmModal } from '@elastic/eui' ;
9+ import { EuiConfirmModal , useGeneratedHtmlId } from '@elastic/eui' ;
1010import * as i18n from '../custom_fields/translations' ;
1111
1212interface ConfirmDeleteCaseModalProps {
@@ -22,6 +22,8 @@ const DeleteConfirmationModalComponent: React.FC<ConfirmDeleteCaseModalProps> =
2222 onCancel,
2323 onConfirm,
2424} ) => {
25+ const titleId = useGeneratedHtmlId ( ) ;
26+
2527 return (
2628 < EuiConfirmModal
2729 buttonColor = "danger"
@@ -31,7 +33,11 @@ const DeleteConfirmationModalComponent: React.FC<ConfirmDeleteCaseModalProps> =
3133 onCancel = { onCancel }
3234 onConfirm = { onConfirm }
3335 title = { title }
36+ titleProps = { {
37+ id : titleId ,
38+ } }
3439 confirmButtonText = { i18n . DELETE }
40+ aria-labelledby = { titleId }
3541 >
3642 { message }
3743 </ EuiConfirmModal >
Original file line number Diff line number Diff line change 66 */
77
88import React from 'react' ;
9- import { EuiConfirmModal } from '@elastic/eui' ;
9+ import { EuiConfirmModal , useGeneratedHtmlId } from '@elastic/eui' ;
1010import * as i18n from './translations' ;
1111
1212interface ConfirmDeleteCaseModalProps {
@@ -20,6 +20,8 @@ const ConfirmDeleteCaseModalComp: React.FC<ConfirmDeleteCaseModalProps> = ({
2020 onCancel,
2121 onConfirm,
2222} ) => {
23+ const titleId = useGeneratedHtmlId ( ) ;
24+
2325 return (
2426 < EuiConfirmModal
2527 buttonColor = "danger"
@@ -30,6 +32,10 @@ const ConfirmDeleteCaseModalComp: React.FC<ConfirmDeleteCaseModalProps> = ({
3032 onCancel = { onCancel }
3133 onConfirm = { onConfirm }
3234 title = { i18n . DELETE_CASE ( totalCasesToBeDeleted ) }
35+ titleProps = { {
36+ id : titleId ,
37+ } }
38+ aria-labelledby = { titleId }
3339 >
3440 { i18n . CONFIRM_QUESTION ( totalCasesToBeDeleted ) }
3541 </ EuiConfirmModal >
Original file line number Diff line number Diff line change 77
88import React from 'react' ;
99import type { EuiConfirmModalProps } from '@elastic/eui' ;
10- import { EuiConfirmModal } from '@elastic/eui' ;
10+ import { EuiConfirmModal , useGeneratedHtmlId } from '@elastic/eui' ;
1111import * as i18n from './translations' ;
1212
1313type Props = Pick <
@@ -22,16 +22,22 @@ const CancelCreationConfirmationModalComponent: React.FC<Props> = ({
2222 onConfirm,
2323 onCancel,
2424} ) => {
25+ const titleId = useGeneratedHtmlId ( ) ;
26+
2527 return (
2628 < EuiConfirmModal
2729 title = { title }
30+ titleProps = { {
31+ id : titleId ,
32+ } }
2833 onCancel = { onCancel }
2934 onConfirm = { onConfirm }
3035 cancelButtonText = { cancelButtonText }
3136 confirmButtonText = { confirmButtonText }
3237 buttonColor = "danger"
3338 defaultFocusedButton = "confirm"
3439 data-test-subj = "cancel-creation-confirmation-modal"
40+ aria-labelledby = { titleId }
3541 />
3642 ) ;
3743} ;
Original file line number Diff line number Diff line change 66 */
77
88import React from 'react' ;
9- import { EuiConfirmModal } from '@elastic/eui' ;
9+ import { EuiConfirmModal , useGeneratedHtmlId } from '@elastic/eui' ;
1010import * as i18n from './translations' ;
1111
1212interface ConfirmDeleteCaseModalProps {
@@ -20,6 +20,8 @@ const DeleteConfirmationModalComponent: React.FC<ConfirmDeleteCaseModalProps> =
2020 onCancel,
2121 onConfirm,
2222} ) => {
23+ const titleId = useGeneratedHtmlId ( ) ;
24+
2325 return (
2426 < EuiConfirmModal
2527 buttonColor = "danger"
@@ -29,7 +31,11 @@ const DeleteConfirmationModalComponent: React.FC<ConfirmDeleteCaseModalProps> =
2931 onCancel = { onCancel }
3032 onConfirm = { onConfirm }
3133 title = { i18n . DELETE_FIELD_TITLE ( label ) }
34+ titleProps = { {
35+ id : titleId ,
36+ } }
3237 confirmButtonText = { i18n . DELETE }
38+ aria-labelledby = { titleId }
3339 >
3440 { i18n . DELETE_FIELD_DESCRIPTION }
3541 </ EuiConfirmModal >
Original file line number Diff line number Diff line change 66 */
77
88import React from 'react' ;
9- import { EuiConfirmModal } from '@elastic/eui' ;
9+ import { EuiConfirmModal , useGeneratedHtmlId } from '@elastic/eui' ;
1010import * as i18n from './translations' ;
1111
1212interface ConfirmDeleteCaseModalProps {
@@ -20,6 +20,8 @@ const DeleteConfirmationModalComponent: React.FC<ConfirmDeleteCaseModalProps> =
2020 onCancel,
2121 onConfirm,
2222} ) => {
23+ const titleId = useGeneratedHtmlId ( ) ;
24+
2325 return (
2426 < EuiConfirmModal
2527 buttonColor = "danger"
@@ -29,7 +31,11 @@ const DeleteConfirmationModalComponent: React.FC<ConfirmDeleteCaseModalProps> =
2931 onCancel = { onCancel }
3032 onConfirm = { onConfirm }
3133 title = { i18n . DELETE_OBSERVABLE_TYPE_TITLE ( label ) }
34+ titleProps = { {
35+ id : titleId ,
36+ } }
3237 confirmButtonText = { i18n . DELETE }
38+ aria-labelledby = { titleId }
3339 >
3440 { i18n . DELETE_OBSERVABLE_TYPE_DESCRIPTION }
3541 </ EuiConfirmModal >
Original file line number Diff line number Diff line change 77
88import React from 'react' ;
99import type { EuiConfirmModalProps } from '@elastic/eui' ;
10- import { EuiConfirmModal } from '@elastic/eui' ;
10+ import { EuiConfirmModal , useGeneratedHtmlId } from '@elastic/eui' ;
1111import { CANCEL_BUTTON } from './property_actions/translations' ;
1212
1313type Pros = Pick < EuiConfirmModalProps , 'title' | 'confirmButtonText' | 'onConfirm' | 'onCancel' > ;
@@ -18,16 +18,22 @@ const DeleteAttachmentConfirmationModalComponent: React.FC<Pros> = ({
1818 onConfirm,
1919 onCancel,
2020} ) => {
21+ const titleId = useGeneratedHtmlId ( ) ;
22+
2123 return (
2224 < EuiConfirmModal
2325 title = { title }
26+ titleProps = { {
27+ id : titleId ,
28+ } }
2429 onCancel = { onCancel }
2530 onConfirm = { onConfirm }
2631 cancelButtonText = { CANCEL_BUTTON }
2732 confirmButtonText = { confirmButtonText }
2833 buttonColor = "danger"
2934 defaultFocusedButton = "confirm"
3035 data-test-subj = "property-actions-confirm-modal"
36+ aria-labelledby = { titleId }
3137 />
3238 ) ;
3339} ;
You can’t perform that action at this time.
0 commit comments