Skip to content

Commit 6ed07a3

Browse files
committed
[ML] Fix tab ids for expanded row.
1 parent 5514eca commit 6ed07a3

File tree

1 file changed

+8
-5
lines changed
  • x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list

1 file changed

+8
-5
lines changed

x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import React, { FC } from 'react';
88

99
import { EuiTabbedContent } from '@elastic/eui';
10+
import { htmlIdGenerator } from '@elastic/eui/lib/services';
1011
import { Optional } from '@kbn/utility-types';
1112
import { i18n } from '@kbn/i18n';
1213

@@ -162,9 +163,11 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
162163
position: 'left',
163164
};
164165

166+
const tabId = htmlIdGenerator()();
167+
165168
const tabs = [
166169
{
167-
id: `transform-details-tab-${item.id}`,
170+
id: `transform-details-tab-${tabId}`,
168171
'data-test-subj': 'transformDetailsTab',
169172
name: i18n.translate(
170173
'xpack.transform.transformList.transformDetails.tabs.transformDetailsLabel',
@@ -175,7 +178,7 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
175178
content: <ExpandedRowDetailsPane sections={[general, state, checkpointing]} />,
176179
},
177180
{
178-
id: `transform-stats-tab-${item.id}`,
181+
id: `transform-stats-tab-${tabId}`,
179182
'data-test-subj': 'transformStatsTab',
180183
name: i18n.translate(
181184
'xpack.transform.transformList.transformDetails.tabs.transformStatsLabel',
@@ -186,13 +189,13 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
186189
content: <ExpandedRowDetailsPane sections={[stats]} />,
187190
},
188191
{
189-
id: `transform-json-tab-${item.id}`,
192+
id: `transform-json-tab-${tabId}`,
190193
'data-test-subj': 'transformJsonTab',
191194
name: 'JSON',
192195
content: <ExpandedRowJsonPane json={item.config} />,
193196
},
194197
{
195-
id: `transform-messages-tab-${item.id}`,
198+
id: `transform-messages-tab-${tabId}`,
196199
'data-test-subj': 'transformMessagesTab',
197200
name: i18n.translate(
198201
'xpack.transform.transformList.transformDetails.tabs.transformMessagesLabel',
@@ -203,7 +206,7 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
203206
content: <ExpandedRowMessagesPane transformId={item.id} />,
204207
},
205208
{
206-
id: `transform-preview-tab-${item.id}`,
209+
id: `transform-preview-tab-${tabId}`,
207210
'data-test-subj': 'transformPreviewTab',
208211
name: i18n.translate(
209212
'xpack.transform.transformList.transformDetails.tabs.transformPreviewLabel',

0 commit comments

Comments
 (0)