Skip to content

Commit 606298e

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 56f25e4 commit 606298e

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

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
@@ -134,6 +134,9 @@ export function ClustersTable({ clusters }: Props) {
134134

135135
return (
136136
<EuiBasicTable
137+
tableCaption={i18n.translate('inspector.requests.clusters.table.caption', {
138+
defaultMessage: 'Cluster details',
139+
})}
137140
items={
138141
sortField
139142
? 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
@@ -101,6 +101,9 @@ export function ShardFailureTable({ failures }: Props) {
101101

102102
return (
103103
<EuiBasicTable
104+
tableCaption={i18n.translate('inspector.requests.clusters.shards.table.caption', {
105+
defaultMessage: 'Shard failures',
106+
})}
104107
items={failures.map((failure) => {
105108
return {
106109
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
@@ -139,6 +139,7 @@ export const WorkpadTable = ({
139139
items={workpads}
140140
columns={columns}
141141
message={strings.getNoWorkpadsFoundMessage()}
142+
tableCaption={strings.getTableCaption()}
142143
search={search}
143144
sorting={{
144145
sort: {
@@ -181,6 +182,10 @@ const strings = {
181182
i18n.translate('xpack.canvas.workpadTable.searchPlaceholder', {
182183
defaultMessage: 'Find workpad',
183184
}),
185+
getTableCaption: () =>
186+
i18n.translate('xpack.canvas.workpadTable.table.caption', {
187+
defaultMessage: 'Canvas workpads list',
188+
}),
184189
getTableCreatedColumnTitle: () =>
185190
i18n.translate('xpack.canvas.workpadTable.table.createdColumnTitle', {
186191
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
@@ -116,6 +116,7 @@ export const WorkpadTemplates = ({ templates, onCreateWorkpad }: Props) => {
116116
}}
117117
pagination={true}
118118
data-test-subj="canvasTemplatesTable"
119+
tableCaption={strings.getTableCaption()}
119120
/>
120121
);
121122
};
@@ -128,6 +129,10 @@ const strings = {
128129
templateName,
129130
},
130131
}),
132+
getTableCaption: () =>
133+
i18n.translate('xpack.canvas.workpadTemplates.table.caption', {
134+
defaultMessage: 'Workpad templates',
135+
}),
131136
getTableDescriptionColumnTitle: () =>
132137
i18n.translate('xpack.canvas.workpadTemplates.table.descriptionColumnTitle', {
133138
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)