Skip to content

Commit cf716b0

Browse files
committed
Address @elastic/eui/require-table-caption lint violations across @elastic/kibana-presentation files (#245661)
> [!CAUTION] > ⚠️ **Changes / translations were made by GenAI**. I’ve reviewed them carefully, but your code owners’ expert eyes will ensure they’re 100% right. ## Summary This PR applies the auto-fix for the newly introduced `@elastic/eui/require-table-caption`. This rule ensure `EuiInMemoryTable`, `EuiBasicTable` have a `tableCaption` prop for accessibility. ## Changes 1. 🎯 Added missing `tableCaption` attributes to elements flagged by `@elastic/eui/require-table-caption` — accessibility leveled up! ## Related - elastic/eui#9168 This time, to avoid annoying approvals collection, we've broken files down by teams. Now, we are waiting a review only from your team! (cherry picked from commit b9aa07a) # Conflicts: # x-pack/platform/plugins/private/canvas/public/components/home/my_workpads/workpad_table.component.tsx
1 parent cd6463f commit cf716b0

5 files changed

Lines changed: 21 additions & 0 deletions

File tree

src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/clusters_table.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ export function ClustersTable({ clusters }: Props) {
135135

136136
return (
137137
<EuiBasicTable
138+
tableCaption={i18n.translate('inspector.requests.clusters.table.caption', {
139+
defaultMessage: 'Cluster details',
140+
})}
138141
items={
139142
sortField
140143
? items.sort(Comparators.property(sortField, Comparators.default(sortDirection)))

src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_table.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ export function ShardFailureTable({ failures }: Props) {
102102

103103
return (
104104
<EuiBasicTable
105+
tableCaption={i18n.translate('inspector.requests.clusters.shards.table.caption', {
106+
defaultMessage: 'Shard failures',
107+
})}
105108
items={failures.map((failure) => {
106109
return {
107110
rowId: getRowId(failure),

x-pack/platform/plugins/private/canvas/public/components/home/my_workpads/workpad_table.component.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export const WorkpadTable = ({
141141
items={workpads}
142142
columns={columns}
143143
message={strings.getNoWorkpadsFoundMessage()}
144+
tableCaption={strings.getTableCaption()}
144145
search={search}
145146
sorting={{
146147
sort: {
@@ -183,6 +184,10 @@ const strings = {
183184
i18n.translate('xpack.canvas.workpadTable.searchPlaceholder', {
184185
defaultMessage: 'Find workpad',
185186
}),
187+
getTableCaption: () =>
188+
i18n.translate('xpack.canvas.workpadTable.table.caption', {
189+
defaultMessage: 'Canvas workpads list',
190+
}),
186191
getTableCreatedColumnTitle: () =>
187192
i18n.translate('xpack.canvas.workpadTable.table.createdColumnTitle', {
188193
defaultMessage: 'Created',

x-pack/platform/plugins/private/canvas/public/components/home/workpad_templates/workpad_templates.component.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export const WorkpadTemplates = ({ templates, onCreateWorkpad }: Props) => {
111111
}}
112112
pagination={true}
113113
data-test-subj="canvasTemplatesTable"
114+
tableCaption={strings.getTableCaption()}
114115
/>
115116
);
116117
};
@@ -123,6 +124,10 @@ const strings = {
123124
templateName,
124125
},
125126
}),
127+
getTableCaption: () =>
128+
i18n.translate('xpack.canvas.workpadTemplates.table.caption', {
129+
defaultMessage: 'Workpad templates',
130+
}),
126131
getTableDescriptionColumnTitle: () =>
127132
i18n.translate('xpack.canvas.workpadTemplates.table.descriptionColumnTitle', {
128133
defaultMessage: 'Description',

x-pack/platform/plugins/private/canvas/public/components/var_config/var_config.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ const strings = {
9595
i18n.translate('xpack.canvas.varConfig.titleTooltip', {
9696
defaultMessage: 'Add variables to store and edit common values',
9797
}),
98+
getTableCaption: () =>
99+
i18n.translate('xpack.canvas.varConfig.tableCaption', {
100+
defaultMessage: 'Canvas variables list',
101+
}),
98102
};
99103

100104
export const VarConfig: FC<Props> = ({
@@ -219,6 +223,7 @@ export const VarConfig: FC<Props> = ({
219223
pagination={false}
220224
sorting={true}
221225
compressed
226+
tableCaption={strings.getTableCaption()}
222227
/>
223228
</div>
224229
)}

0 commit comments

Comments
 (0)