From 4211c7db6a756919ccf60457575222bad80c8270 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 8 Aug 2024 09:44:50 +0000 Subject: [PATCH] Fix browser warnings (#7550) * fix warnings Signed-off-by: Kapian1234 <2254087899@qq.com> * fix warnings Signed-off-by: Kapian1234 * Changeset file for PR #7548 created/updated * fix warnings Signed-off-by: Kapian1234 * Changeset file for PR #7550 created/updated * Modified the expect of addNavLinksToGroup in workspace plugin.test.js Signed-off-by: Kapian1234 * Modified the expect of addNavLinksToGroup in workspace plugin.test.js Signed-off-by: Kapian1234 * remove the duplicate changelogs Signed-off-by: Kapian1234 * Renamed keys to comply with the directory the file is in Signed-off-by: Kapian1234 --------- Signed-off-by: Kapian1234 <2254087899@qq.com> Signed-off-by: Kapian1234 Signed-off-by: Jincheng Wan <45655760+Kapian1234@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit ca89488aef48c8353ef8482bc15387c90f1ee66a) Signed-off-by: github-actions[bot] --- changelogs/fragments/7550.yml | 2 ++ .../public/components/page_render.tsx | 2 +- .../application/components/home_list_card.tsx | 4 ++-- .../home/public/application/home_render.tsx | 2 +- .../home_get_start_card/use_case_footer.tsx | 22 +++++++++++-------- src/plugins/workspace/public/plugin.test.ts | 3 ++- src/plugins/workspace/public/plugin.ts | 9 -------- 7 files changed, 21 insertions(+), 23 deletions(-) create mode 100644 changelogs/fragments/7550.yml diff --git a/changelogs/fragments/7550.yml b/changelogs/fragments/7550.yml new file mode 100644 index 00000000000..83cb4d9f097 --- /dev/null +++ b/changelogs/fragments/7550.yml @@ -0,0 +1,2 @@ +fix: +- Resolve some browser warnings ([#7550](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7550)) \ No newline at end of file diff --git a/src/plugins/content_management/public/components/page_render.tsx b/src/plugins/content_management/public/components/page_render.tsx index 90d6033576b..1a28d1efec2 100644 --- a/src/plugins/content_management/public/components/page_render.tsx +++ b/src/plugins/content_management/public/components/page_render.tsx @@ -28,7 +28,7 @@ export const PageRender = ({ page, embeddable, savedObjectsClient }: Props) => { style={{ margin: '10px 20px' }} > {sections.map((section) => ( - + { {config.list.length > 0 && ( {config.list.map((item) => ( - <> + {item.label} @@ -94,7 +94,7 @@ export const HomeListCard = ({ config }: { config: Config }) => { {item.description} - + ))} )} diff --git a/src/plugins/home/public/application/home_render.tsx b/src/plugins/home/public/application/home_render.tsx index 5d0497b7c39..afddae56ce6 100644 --- a/src/plugins/home/public/application/home_render.tsx +++ b/src/plugins/home/public/application/home_render.tsx @@ -36,7 +36,7 @@ export const setupHome = (contentManagement: ContentManagementPluginSetup) => { <> {contents.map((content) => { if (content.kind === 'custom') { - return content.render(); + return {content.render()}; } return null; diff --git a/src/plugins/workspace/public/components/home_get_start_card/use_case_footer.tsx b/src/plugins/workspace/public/components/home_get_start_card/use_case_footer.tsx index fddd542f64d..922cf3e66f7 100644 --- a/src/plugins/workspace/public/components/home_get_start_card/use_case_footer.tsx +++ b/src/plugins/workspace/public/components/home_get_start_card/use_case_footer.tsx @@ -22,7 +22,6 @@ import { EuiModalHeaderTitle, } from '@elastic/eui'; import React, { useMemo, useState } from 'react'; -import { FormattedMessage } from 'react-intl'; import { i18n } from '@osd/i18n'; import { BehaviorSubject } from 'rxjs'; import { WORKSPACE_DETAIL_APP_ID } from '../../../common/constants'; @@ -94,7 +93,9 @@ export const UseCaseFooter = ({ onClick={showModal} data-test-subj="useCase.footer.createWorkspace.button" > - + {i18n.translate('workspace.useCase.footer.createWorkspace', { + defaultMessage: 'Create workspace', + })} {isModalVisible && ( @@ -108,7 +109,9 @@ export const UseCaseFooter = ({ - + {i18n.translate('workspace.useCase.footer.modal.close', { + defaultMessage: 'Close', + })} {isDashboardAdmin && ( - + {i18n.translate('workspace.useCase.footer.modal.create', { + defaultMessage: 'Create workspace', + })} )} @@ -137,7 +139,7 @@ export const UseCaseFooter = ({ ); return ( - + {i18n.translate('workspace.useCase.footer.openWorkspace', { defaultMessage: 'Open' })} ); } @@ -175,7 +177,9 @@ export const UseCaseFooter = ({ const button = ( - + {i18n.translate('workspace.useCase.footer.selectWorkspace', { + defaultMessage: 'Select workspace', + })} ); const panels = [ diff --git a/src/plugins/workspace/public/plugin.test.ts b/src/plugins/workspace/public/plugin.test.ts index 02d36297ca1..738679250a0 100644 --- a/src/plugins/workspace/public/plugin.test.ts +++ b/src/plugins/workspace/public/plugin.test.ts @@ -170,7 +170,8 @@ describe('Workspace plugin', () => { expect.arrayContaining([ { id: 'workspace_list', - title: 'workspace settings', + order: 150, + title: 'Workspace settings', }, ]) ); diff --git a/src/plugins/workspace/public/plugin.ts b/src/plugins/workspace/public/plugin.ts index dd4dc78fdf2..6516525bdbf 100644 --- a/src/plugins/workspace/public/plugin.ts +++ b/src/plugins/workspace/public/plugin.ts @@ -376,15 +376,6 @@ export class WorkspacePlugin }, ]); - core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.settingsAndSetup, [ - { - id: WORKSPACE_LIST_APP_ID, - title: i18n.translate('workspace.settingsAndSetup.workspaceSettings', { - defaultMessage: 'workspace settings', - }), - }, - ]); - /** * register workspace column into saved objects table */