From 19991d615bd9d1bfe5c9b63f7e078637bb4b948c Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 13 Sep 2021 15:27:40 -0500 Subject: [PATCH 01/11] Replacing EuiPopover with EuiComboBox * The combobox will help alleviate issues when the list of options is very long --- .../requests/components/request_selector.tsx | 79 +++++++++++-------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/src/plugins/inspector/public/views/requests/components/request_selector.tsx b/src/plugins/inspector/public/views/requests/components/request_selector.tsx index 2d94c7ff5bb18..f572a8e7e441a 100644 --- a/src/plugins/inspector/public/views/requests/components/request_selector.tsx +++ b/src/plugins/inspector/public/views/requests/components/request_selector.tsx @@ -14,6 +14,7 @@ import { i18n } from '@kbn/i18n'; import { EuiBadge, EuiButtonEmpty, + EuiComboBox, EuiContextMenuPanel, EuiContextMenuItem, EuiFlexGroup, @@ -98,33 +99,50 @@ export class RequestSelector extends Component - {this.props.selectedRequest.name} - - ); + // const button = ( + // + // {this.props.selectedRequest.name} + // + // ); + + const options = this.props.requests.map(item => { + return { + label: item.name + } + }); return ( - - + {/* + + */} + + - + ); } @@ -133,21 +151,20 @@ export class RequestSelector extends Component - - - - - - {requests.length <= 1 && ( + {/* {requests.length <= 1 && (
+ + {" "} + {selectedRequest.name}
)} - {requests.length > 1 && this.renderRequestDropdown()} + {requests.length > 1 && this.renderRequestDropdown()} */} + {requests.length && this.renderRequestDropdown()}
{selectedRequest.status !== RequestStatus.PENDING && ( From 4655dc457f0bf48a87bfe847c9e9cebd63fc84da Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 15 Sep 2021 12:37:36 -0500 Subject: [PATCH 02/11] Refactoring the Combobox to listen for change events * Added an onChange handler * Renamed the method to render the combobox * Commented out additional blocks of code before final refactor --- .../requests/components/request_selector.tsx | 46 +++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/src/plugins/inspector/public/views/requests/components/request_selector.tsx b/src/plugins/inspector/public/views/requests/components/request_selector.tsx index f572a8e7e441a..c2f24bb9a74b6 100644 --- a/src/plugins/inspector/public/views/requests/components/request_selector.tsx +++ b/src/plugins/inspector/public/views/requests/components/request_selector.tsx @@ -15,6 +15,7 @@ import { EuiBadge, EuiButtonEmpty, EuiComboBox, + EuiComboBoxOptionOption, EuiContextMenuPanel, EuiContextMenuItem, EuiFlexGroup, @@ -35,7 +36,7 @@ interface RequestSelectorState { interface RequestSelectorProps { requests: Request[]; selectedRequest: Request; - onRequestChanged: Function; + onRequestChanged: (request: Request) => void; } export class RequestSelector extends Component { @@ -49,6 +50,15 @@ export class RequestSelector extends Component>) => { + const selectedOption = this.props.requests.find(request => request.id === selectedOptions[0].value); + console.log({selectedOptions}) + + if(selectedOption) { + this.props.onRequestChanged(selectedOption); + } + } + togglePopover = () => { this.setState((prevState: RequestSelectorState) => ({ isPopoverOpen: !prevState.isPopoverOpen, @@ -98,7 +108,7 @@ export class RequestSelector extends Component { return { - label: item.name + label: item.name, + value: item.id, } }); @@ -134,14 +145,23 @@ export class RequestSelector extends Component */} - + ); } @@ -150,7 +170,7 @@ export class RequestSelector extends Component + {/* {requests.length <= 1 && (
)} {requests.length > 1 && this.renderRequestDropdown()} */} - {requests.length && this.renderRequestDropdown()} + {requests.length && this.renderRequestCombobox()} {selectedRequest.status !== RequestStatus.PENDING && ( From b88a76fce6964f23ee7c7e105fd3f65c4ae1b4f0 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 15 Sep 2021 13:15:30 -0500 Subject: [PATCH 03/11] Finished refactoring the Request Selector to use EUI Combobox * Removed three helper methods for the EUIPopover. * `togglePopover()` * `closePopover()` * `renderRequestDropdownItem()` * Removed the local state object and interface (no longer needed) * Renamed the const `options` to `selectedOptions` in `handleSelectd()` method to better reflect where the options array was coming from. --- .../requests/components/request_selector.tsx | 134 ++---------------- 1 file changed, 14 insertions(+), 120 deletions(-) diff --git a/src/plugins/inspector/public/views/requests/components/request_selector.tsx b/src/plugins/inspector/public/views/requests/components/request_selector.tsx index c2f24bb9a74b6..bd205306d7986 100644 --- a/src/plugins/inspector/public/views/requests/components/request_selector.tsx +++ b/src/plugins/inspector/public/views/requests/components/request_selector.tsx @@ -13,138 +13,49 @@ import { i18n } from '@kbn/i18n'; import { EuiBadge, - EuiButtonEmpty, EuiComboBox, EuiComboBoxOptionOption, - EuiContextMenuPanel, - EuiContextMenuItem, EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, - EuiPopover, - EuiTextColor, EuiToolTip, } from '@elastic/eui'; import { RequestStatus } from '../../../../common/adapters'; import { Request } from '../../../../common/adapters/request/types'; -interface RequestSelectorState { - isPopoverOpen: boolean; -} - interface RequestSelectorProps { requests: Request[]; selectedRequest: Request; onRequestChanged: (request: Request) => void; } -export class RequestSelector extends Component { +export class RequestSelector extends Component { static propTypes = { requests: PropTypes.array.isRequired, selectedRequest: PropTypes.object.isRequired, onRequestChanged: PropTypes.func, }; - state = { - isPopoverOpen: false, - }; - handleSelected = (selectedOptions: Array>) => { - const selectedOption = this.props.requests.find(request => request.id === selectedOptions[0].value); - console.log({selectedOptions}) + const selectedOption = this.props.requests.find( + (request) => request.id === selectedOptions[0].value + ); - if(selectedOption) { + if (selectedOption) { this.props.onRequestChanged(selectedOption); } - } - - togglePopover = () => { - this.setState((prevState: RequestSelectorState) => ({ - isPopoverOpen: !prevState.isPopoverOpen, - })); - }; - - closePopover = () => { - this.setState({ - isPopoverOpen: false, - }); - }; - - renderRequestDropdownItem = (request: Request, index: number) => { - const hasFailed = request.status === RequestStatus.ERROR; - const inProgress = request.status === RequestStatus.PENDING; - - return ( - { - this.props.onRequestChanged(request); - this.closePopover(); - }} - toolTipContent={request.description} - toolTipPosition="left" - data-test-subj={`inspectorRequestChooser${request.name}`} - > - - {request.name} - - {hasFailed && ( - - )} - - {inProgress && ( - - )} - - - ); }; renderRequestCombobox() { - // const button = ( - // - // {this.props.selectedRequest.name} - // - // ); - - const options = this.props.requests.map(item => { + const options = this.props.requests.map((item) => { return { label: item.name, value: item.id, - } + }; }); return ( - <> - {/* - - */} - - ); } @@ -171,21 +79,7 @@ export class RequestSelector extends Component - - {/* {requests.length <= 1 && ( -
- - {" "} - - {selectedRequest.name} -
- )} - {requests.length > 1 && this.renderRequestDropdown()} */} - {requests.length && this.renderRequestCombobox()} -
+ {requests.length && this.renderRequestCombobox()} {selectedRequest.status !== RequestStatus.PENDING && ( Date: Wed, 15 Sep 2021 16:27:49 -0500 Subject: [PATCH 04/11] Updating tests and translations * Fixed the inspector functional test to use comboBox service * Removed two unused translations --- .../views/requests/components/request_selector.tsx | 3 ++- test/functional/services/inspector.ts | 14 ++++---------- .../plugins/translations/translations/ja-JP.json | 2 -- .../plugins/translations/translations/zh-CN.json | 2 -- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/plugins/inspector/public/views/requests/components/request_selector.tsx b/src/plugins/inspector/public/views/requests/components/request_selector.tsx index bd205306d7986..b012cb4082b85 100644 --- a/src/plugins/inspector/public/views/requests/components/request_selector.tsx +++ b/src/plugins/inspector/public/views/requests/components/request_selector.tsx @@ -57,9 +57,10 @@ export class RequestSelector extends Component { return ( { const ariaDisabled = await this.testSubjects.getAttribute('openInspectorButton', 'disabled'); @@ -206,20 +207,13 @@ export class InspectorService extends FtrService { } /** - * Returns request name as the comma-separated string + * Returns request name as the comma-separated string from combobox */ public async getRequestNames(): Promise { await this.openInspectorRequestsView(); - const requestChooserExists = await this.testSubjects.exists('inspectorRequestChooser'); - if (requestChooserExists) { - await this.testSubjects.click('inspectorRequestChooser'); - const menu = await this.testSubjects.find('inspectorRequestChooserMenuPanel'); - const requestNames = await menu.getVisibleText(); - return requestNames.trim().split('\n').join(','); - } - const singleRequest = await this.testSubjects.find('inspectorRequestName'); - return await singleRequest.getVisibleText(); + const comboBoxOptions = await this.comboBox.getOptionsList('inspectorRequestChooser'); + return comboBoxOptions.trim().split('\n').join(','); } public getOpenRequestStatisticButton() { diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index d1069c2d7dbf8..702865e7f2159 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -4165,13 +4165,11 @@ "inspector.reqTimestampKey": "リクエストのタイムスタンプ", "inspector.requests.copyToClipboardLabel": "クリップボードにコピー", "inspector.requests.descriptionRowIconAriaLabel": "説明", - "inspector.requests.failedLabel": " (失敗)", "inspector.requests.noRequestsLoggedDescription.elementHasNotLoggedAnyRequestsText": "エレメントが(まだ)リクエストを記録していません。", "inspector.requests.noRequestsLoggedDescription.whatDoesItUsuallyMeanText": "これは通常、データを取得する必要がないか、エレメントがまだデータの取得を開始していないことを意味します。", "inspector.requests.noRequestsLoggedTitle": "リクエストが記録されていません", "inspector.requests.requestFailedTooltipTitle": "リクエストに失敗しました", "inspector.requests.requestInProgressAriaLabel": "リクエストが進行中", - "inspector.requests.requestLabel": "リクエスト:", "inspector.requests.requestsDescriptionTooltip": "データを収集したリクエストを表示します", "inspector.requests.requestsTitle": "リクエスト", "inspector.requests.requestSucceededTooltipTitle": "リクエスト成功", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index ed5a47395794c..18c4e685db719 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -4204,13 +4204,11 @@ "inspector.reqTimestampKey": "请求时间戳", "inspector.requests.copyToClipboardLabel": "复制到剪贴板", "inspector.requests.descriptionRowIconAriaLabel": "描述", - "inspector.requests.failedLabel": " (失败)", "inspector.requests.noRequestsLoggedDescription.elementHasNotLoggedAnyRequestsText": "该元素尚未记录任何请求。", "inspector.requests.noRequestsLoggedDescription.whatDoesItUsuallyMeanText": "这通常表示无需提取任何数据,或该元素尚未开始提取数据。", "inspector.requests.noRequestsLoggedTitle": "未记录任何请求", "inspector.requests.requestFailedTooltipTitle": "请求失败", "inspector.requests.requestInProgressAriaLabel": "进行中的请求", - "inspector.requests.requestLabel": "请求:", "inspector.requests.requestsDescriptionTooltip": "查看已收集数据的请求", "inspector.requests.requestsTitle": "请求", "inspector.requests.requestSucceededTooltipTitle": "请求成功", From f7f2e76e7767eb18549595ef7a97de2ff2e15c3b Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 28 Sep 2021 16:44:37 -0500 Subject: [PATCH 05/11] Updating Combobox options to pass data-test-sub string --- .../public/views/requests/components/request_selector.tsx | 3 +++ test/functional/apps/discover/_inspector.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/inspector/public/views/requests/components/request_selector.tsx b/src/plugins/inspector/public/views/requests/components/request_selector.tsx index b012cb4082b85..28b7ecd6532da 100644 --- a/src/plugins/inspector/public/views/requests/components/request_selector.tsx +++ b/src/plugins/inspector/public/views/requests/components/request_selector.tsx @@ -49,7 +49,10 @@ export class RequestSelector extends Component { renderRequestCombobox() { const options = this.props.requests.map((item) => { + const testLabel = item.name.replace(/\s+/, ''); + return { + 'data-test-subj': `inspectorRequestChooser${testLabel}`, label: item.name, value: item.id, }; diff --git a/test/functional/apps/discover/_inspector.ts b/test/functional/apps/discover/_inspector.ts index 9ff425be2739b..5e898e5c30f71 100644 --- a/test/functional/apps/discover/_inspector.ts +++ b/test/functional/apps/discover/_inspector.ts @@ -53,9 +53,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await inspector.open(); await testSubjects.click('inspectorRequestChooser'); let foundZero = false; - for (const subj of ['Documents', 'Total hits', 'Charts']) { + for (const subj of ['Documents', 'Chartdata']) { await testSubjects.click(`inspectorRequestChooser${subj}`); - if (testSubjects.exists('inspectorRequestDetailStatistics', { timeout: 500 })) { + if (await testSubjects.exists('inspectorRequestDetailStatistics', { timeout: 500 })) { await testSubjects.click(`inspectorRequestDetailStatistics`); const requestStatsTotalHits = getHitCount(await inspector.getTableData()); if (requestStatsTotalHits === '0') { From 27bfd9d22e2cd62bdecc894f5339e79e2498ac7e Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 29 Sep 2021 10:41:48 -0500 Subject: [PATCH 06/11] Updated two tests for Combobox single option * Updated the test expectations to the default string * Both tests were looking for a named string instead of a default message --- test/functional/apps/visualize/_vega_chart.ts | 2 +- x-pack/test/functional/apps/maps/embeddable/dashboard.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/apps/visualize/_vega_chart.ts b/test/functional/apps/visualize/_vega_chart.ts index b2692c2a00d78..44268038553b6 100644 --- a/test/functional/apps/visualize/_vega_chart.ts +++ b/test/functional/apps/visualize/_vega_chart.ts @@ -133,7 +133,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should set the default query name if not given in the schema', async () => { const requests = await inspector.getRequestNames(); - expect(requests).to.be('Unnamed request #0'); + expect(requests).to.be("You've selected all available options"); }); it('should log the request statistic', async () => { diff --git a/x-pack/test/functional/apps/maps/embeddable/dashboard.js b/x-pack/test/functional/apps/maps/embeddable/dashboard.js index 6c962c98c6a98..c38ab3e67788a 100644 --- a/x-pack/test/functional/apps/maps/embeddable/dashboard.js +++ b/x-pack/test/functional/apps/maps/embeddable/dashboard.js @@ -79,7 +79,7 @@ export default function ({ getPageObjects, getService }) { await dashboardPanelActions.openInspectorByTitle('geo grid vector grid example'); const gridExampleRequestNames = await inspector.getRequestNames(); await inspector.close(); - expect(gridExampleRequestNames).to.equal('logstash-*'); + expect(gridExampleRequestNames).to.equal("You've selected all available options"); }); it('should apply container state (time, query, filters) to embeddable when loaded', async () => { From 54daa2e33d918baafd920889d2529a02ca1e6abc Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Thu, 30 Sep 2021 10:40:12 -0500 Subject: [PATCH 07/11] Adding error handling to Inspector combobox * Checking for the item status code * Adding a " (failed)" message if the status code returns `2` * Updating test to look for "Chart_data" instead of "Chartdata" --- .../public/views/requests/components/request_selector.tsx | 5 +++-- test/functional/apps/discover/_inspector.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/inspector/public/views/requests/components/request_selector.tsx b/src/plugins/inspector/public/views/requests/components/request_selector.tsx index 28b7ecd6532da..fb159048dce90 100644 --- a/src/plugins/inspector/public/views/requests/components/request_selector.tsx +++ b/src/plugins/inspector/public/views/requests/components/request_selector.tsx @@ -49,11 +49,12 @@ export class RequestSelector extends Component { renderRequestCombobox() { const options = this.props.requests.map((item) => { - const testLabel = item.name.replace(/\s+/, ''); + const hasFailed = item.status === RequestStatus.ERROR; + const testLabel = item.name.replace(/\s+/, '_'); return { 'data-test-subj': `inspectorRequestChooser${testLabel}`, - label: item.name, + label: hasFailed ? `${item.name} (failed)` : item.name, value: item.id, }; }); diff --git a/test/functional/apps/discover/_inspector.ts b/test/functional/apps/discover/_inspector.ts index 5e898e5c30f71..10402703875d6 100644 --- a/test/functional/apps/discover/_inspector.ts +++ b/test/functional/apps/discover/_inspector.ts @@ -53,7 +53,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await inspector.open(); await testSubjects.click('inspectorRequestChooser'); let foundZero = false; - for (const subj of ['Documents', 'Chartdata']) { + for (const subj of ['Documents', 'Chart_data']) { await testSubjects.click(`inspectorRequestChooser${subj}`); if (await testSubjects.exists('inspectorRequestDetailStatistics', { timeout: 500 })) { await testSubjects.click(`inspectorRequestDetailStatistics`); From cb9894d2533d4d9184849250c9813d9b31f74431 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 12 Oct 2021 21:50:28 -0500 Subject: [PATCH 08/11] Updating two tests to validate single combobox options * Added helper method to check default text against combobox options * Added helper method to get the selected combobox option * Checking two inspector instances using helpers --- test/functional/apps/visualize/_vega_chart.ts | 6 +++-- test/functional/services/inspector.ts | 26 +++++++++++++++++++ .../apps/maps/embeddable/dashboard.js | 7 +++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/test/functional/apps/visualize/_vega_chart.ts b/test/functional/apps/visualize/_vega_chart.ts index 44268038553b6..6640b37b4a28a 100644 --- a/test/functional/apps/visualize/_vega_chart.ts +++ b/test/functional/apps/visualize/_vega_chart.ts @@ -131,9 +131,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); it('should set the default query name if not given in the schema', async () => { - const requests = await inspector.getRequestNames(); + const singleExampleRequest = await inspector.hasSingleRequest(); + const selectedExampleRequest = await inspector.getSelectedOption(); - expect(requests).to.be("You've selected all available options"); + expect(singleExampleRequest).to.be(true); + expect(selectedExampleRequest).to.equal('Unnamed request #0'); }); it('should log the request statistic', async () => { diff --git a/test/functional/services/inspector.ts b/test/functional/services/inspector.ts index 3d03813526a13..6f909f7a7b92e 100644 --- a/test/functional/services/inspector.ts +++ b/test/functional/services/inspector.ts @@ -206,6 +206,19 @@ export class InspectorService extends FtrService { await this.openInspectorView('inspectorViewChooserRequests'); } + /** + * Returns the selected option value from combobox + * @param index combobox option array + */ + public async getSelectedOption(index: number = 0): Promise { + await this.openInspectorRequestsView(); + const selectedOption = await this.comboBox.getComboBoxSelectedOptions( + 'inspectorRequestChooser' + ); + + return selectedOption[index]; + } + /** * Returns request name as the comma-separated string from combobox */ @@ -227,4 +240,17 @@ export class InspectorService extends FtrService { public getOpenRequestDetailResponseButton() { return this.testSubjects.find('inspectorRequestDetailResponse'); } + + /** + * Returns true if the value equals the combobox options list + * @param value default combobox single option text + */ + public async hasSingleRequest( + value: string = "You've selected all available options" + ): Promise { + await this.openInspectorRequestsView(); + const comboBoxOptions = await this.comboBox.getOptionsList('inspectorRequestChooser'); + + return value === comboBoxOptions; + } } diff --git a/x-pack/test/functional/apps/maps/embeddable/dashboard.js b/x-pack/test/functional/apps/maps/embeddable/dashboard.js index c38ab3e67788a..a892a0d547339 100644 --- a/x-pack/test/functional/apps/maps/embeddable/dashboard.js +++ b/x-pack/test/functional/apps/maps/embeddable/dashboard.js @@ -77,9 +77,12 @@ export default function ({ getPageObjects, getService }) { await inspector.close(); await dashboardPanelActions.openInspectorByTitle('geo grid vector grid example'); - const gridExampleRequestNames = await inspector.getRequestNames(); + const singleExampleRequest = await inspector.hasSingleRequest(); + const selectedExampleRequest = await inspector.getSelectedOption(); await inspector.close(); - expect(gridExampleRequestNames).to.equal("You've selected all available options"); + + expect(singleExampleRequest).to.be(true); + expect(selectedExampleRequest).to.equal('logstash-*'); }); it('should apply container state (time, query, filters) to embeddable when loaded', async () => { From 33a011bc3049220c152f2551b1785d320a8449d8 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 12 Oct 2021 22:29:46 -0500 Subject: [PATCH 09/11] Adding a defensive check to helper method. --- test/functional/services/inspector.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/functional/services/inspector.ts b/test/functional/services/inspector.ts index 6f909f7a7b92e..d768b54e2f352 100644 --- a/test/functional/services/inspector.ts +++ b/test/functional/services/inspector.ts @@ -208,15 +208,18 @@ export class InspectorService extends FtrService { /** * Returns the selected option value from combobox - * @param index combobox option array */ - public async getSelectedOption(index: number = 0): Promise { + public async getSelectedOption(): Promise { await this.openInspectorRequestsView(); const selectedOption = await this.comboBox.getComboBoxSelectedOptions( 'inspectorRequestChooser' ); - return selectedOption[index]; + if (selectedOption.length !== 1) { + return false; + } + + return selectedOption[0]; } /** From c58ceba90e2334e5db5e95652513509d5c4944d5 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 13 Oct 2021 08:28:45 -0500 Subject: [PATCH 10/11] Correct a type error in test return --- test/functional/services/inspector.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/services/inspector.ts b/test/functional/services/inspector.ts index d768b54e2f352..753d9b7b0b85e 100644 --- a/test/functional/services/inspector.ts +++ b/test/functional/services/inspector.ts @@ -216,7 +216,7 @@ export class InspectorService extends FtrService { ); if (selectedOption.length !== 1) { - return false; + return 'Combobox has multiple options'; } return selectedOption[0]; From 55f6fc8df769d79425d9b45d7d0753572c094518 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Thu, 14 Oct 2021 16:28:46 -0500 Subject: [PATCH 11/11] Adding back translated failLabel --- .../requests/components/request_selector.tsx | 6 +++++- .../translations/translations/ja-JP.json | 21 ++++++++++--------- .../translations/translations/zh-CN.json | 21 ++++++++++--------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/plugins/inspector/public/views/requests/components/request_selector.tsx b/src/plugins/inspector/public/views/requests/components/request_selector.tsx index fb159048dce90..04fac0bd93b7e 100644 --- a/src/plugins/inspector/public/views/requests/components/request_selector.tsx +++ b/src/plugins/inspector/public/views/requests/components/request_selector.tsx @@ -54,7 +54,11 @@ export class RequestSelector extends Component { return { 'data-test-subj': `inspectorRequestChooser${testLabel}`, - label: hasFailed ? `${item.name} (failed)` : item.name, + label: hasFailed + ? `${item.name} ${i18n.translate('inspector.requests.failedLabel', { + defaultMessage: ' (failed)', + })}` + : item.name, value: item.id, }; }); diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 4e4f2a5fbd86c..f1efbbb76c319 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -4160,6 +4160,7 @@ "inspector.reqTimestampKey": "リクエストのタイムスタンプ", "inspector.requests.copyToClipboardLabel": "クリップボードにコピー", "inspector.requests.descriptionRowIconAriaLabel": "説明", + "inspector.requests.failedLabel": " (失敗)", "inspector.requests.noRequestsLoggedDescription.elementHasNotLoggedAnyRequestsText": "エレメントが(まだ)リクエストを記録していません。", "inspector.requests.noRequestsLoggedDescription.whatDoesItUsuallyMeanText": "これは通常、データを取得する必要がないか、エレメントがまだデータの取得を開始していないことを意味します。", "inspector.requests.noRequestsLoggedTitle": "リクエストが記録されていません", @@ -4910,6 +4911,16 @@ "visTypeMetric.colorModes.backgroundOptionLabel": "背景", "visTypeMetric.colorModes.labelsOptionLabel": "ラベル", "visTypeMetric.colorModes.noneOptionLabel": "なし", + "visTypeMetric.metricDescription": "計算結果を単独の数字として表示します。", + "visTypeMetric.metricTitle": "メトリック", + "visTypeMetric.params.color.useForLabel": "使用する色", + "visTypeMetric.params.rangesTitle": "範囲", + "visTypeMetric.params.settingsTitle": "設定", + "visTypeMetric.params.showTitleLabel": "タイトルを表示", + "visTypeMetric.params.style.fontSizeLabel": "ポイント単位のメトリックフォントサイズ", + "visTypeMetric.params.style.styleTitle": "スタイル", + "visTypeMetric.schemas.metricTitle": "メトリック", + "visTypeMetric.schemas.splitGroupTitle": "グループを分割", "expressionMetricVis.function.dimension.splitGroup": "グループを分割", "expressionMetricVis.function.bgFill.help": "html 16 進数コード(#123456)、html 色(red、blue)、または rgba 値(rgba(255,255,255,1))。", "expressionMetricVis.function.bucket.help": "バケットディメンションの構成です。", @@ -4925,16 +4936,6 @@ "expressionMetricVis.function.showLabels.help": "メトリック値の下にラベルを表示します。", "expressionMetricVis.function.subText.help": "メトリックの下に表示するカスタムテキスト", "expressionMetricVis.function.useRanges.help": "有効な色範囲です。", - "visTypeMetric.metricDescription": "計算結果を単独の数字として表示します。", - "visTypeMetric.metricTitle": "メトリック", - "visTypeMetric.params.color.useForLabel": "使用する色", - "visTypeMetric.params.rangesTitle": "範囲", - "visTypeMetric.params.settingsTitle": "設定", - "visTypeMetric.params.showTitleLabel": "タイトルを表示", - "visTypeMetric.params.style.fontSizeLabel": "ポイント単位のメトリックフォントサイズ", - "visTypeMetric.params.style.styleTitle": "スタイル", - "visTypeMetric.schemas.metricTitle": "メトリック", - "visTypeMetric.schemas.splitGroupTitle": "グループを分割", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.deprecation": "Visualizeの円グラフのレガシーグラフライブラリは廃止予定であり、8.0以降ではサポートされません。", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.description": "Visualizeで円グラフのレガシーグラフライブラリを有効にします。", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.name": "円グラフのレガシーグラフライブラリ", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 6f018d2222005..0592f19837a84 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -4199,6 +4199,7 @@ "inspector.reqTimestampKey": "请求时间戳", "inspector.requests.copyToClipboardLabel": "复制到剪贴板", "inspector.requests.descriptionRowIconAriaLabel": "描述", + "inspector.requests.failedLabel": " (失败)", "inspector.requests.noRequestsLoggedDescription.elementHasNotLoggedAnyRequestsText": "该元素尚未记录任何请求。", "inspector.requests.noRequestsLoggedDescription.whatDoesItUsuallyMeanText": "这通常表示无需提取任何数据,或该元素尚未开始提取数据。", "inspector.requests.noRequestsLoggedTitle": "未记录任何请求", @@ -4955,6 +4956,16 @@ "visTypeMetric.colorModes.backgroundOptionLabel": "背景", "visTypeMetric.colorModes.labelsOptionLabel": "标签", "visTypeMetric.colorModes.noneOptionLabel": "无", + "visTypeMetric.metricDescription": "将计算结果显示为单个数字。", + "visTypeMetric.metricTitle": "指标", + "visTypeMetric.params.color.useForLabel": "将颜色用于", + "visTypeMetric.params.rangesTitle": "范围", + "visTypeMetric.params.settingsTitle": "设置", + "visTypeMetric.params.showTitleLabel": "显示标题", + "visTypeMetric.params.style.fontSizeLabel": "指标字体大小(磅)", + "visTypeMetric.params.style.styleTitle": "样式", + "visTypeMetric.schemas.metricTitle": "指标", + "visTypeMetric.schemas.splitGroupTitle": "拆分组", "expressionMetricVis.function.dimension.splitGroup": "拆分组", "expressionMetricVis.function.bgFill.help": "将颜色表示为 html 十六进制代码 (#123456)、html 颜色(red、blue)或 rgba 值 (rgba(255,255,255,1))。", "expressionMetricVis.function.bucket.help": "存储桶维度配置", @@ -4970,16 +4981,6 @@ "expressionMetricVis.function.showLabels.help": "在指标值下显示标签。", "expressionMetricVis.function.subText.help": "要在指标下显示的定制文本", "expressionMetricVis.function.useRanges.help": "已启用颜色范围。", - "visTypeMetric.metricDescription": "将计算结果显示为单个数字。", - "visTypeMetric.metricTitle": "指标", - "visTypeMetric.params.color.useForLabel": "将颜色用于", - "visTypeMetric.params.rangesTitle": "范围", - "visTypeMetric.params.settingsTitle": "设置", - "visTypeMetric.params.showTitleLabel": "显示标题", - "visTypeMetric.params.style.fontSizeLabel": "指标字体大小(磅)", - "visTypeMetric.params.style.styleTitle": "样式", - "visTypeMetric.schemas.metricTitle": "指标", - "visTypeMetric.schemas.splitGroupTitle": "拆分组", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.deprecation": "Visualize 中饼图的旧版图表库已弃用,自 8.0 后将不受支持。", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.description": "在 Visualize 中启用饼图的旧版图表库。", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.name": "饼图旧版图表库",