From 96bba77b83927e198c24fd585ee20c7f2cee5f2e Mon Sep 17 00:00:00 2001 From: Kapian1234 <2254087899@qq.com> Date: Fri, 26 Jul 2024 16:46:12 +0800 Subject: [PATCH 1/9] fix warnings Signed-off-by: Kapian1234 <2254087899@qq.com> --- .../public/components/page_render.tsx | 2 +- .../application/components/home_list_card.tsx | 4 ++-- .../home/public/application/home_render.tsx | 6 +++++- .../home_get_start_card/use_case_footer.tsx | 15 ++++++--------- src/plugins/workspace/public/plugin.ts | 8 -------- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/plugins/content_management/public/components/page_render.tsx b/src/plugins/content_management/public/components/page_render.tsx index 90d6033576bb..1a28d1efec2f 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} {item.description} - + ))} )} diff --git a/src/plugins/home/public/application/home_render.tsx b/src/plugins/home/public/application/home_render.tsx index 5d0497b7c39e..59fe78467a1a 100644 --- a/src/plugins/home/public/application/home_render.tsx +++ b/src/plugins/home/public/application/home_render.tsx @@ -36,7 +36,11 @@ 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 fddd542f64d7..6d4ec0ab61a2 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,7 @@ import { EuiModalHeaderTitle, } from '@elastic/eui'; import React, { useMemo, useState } from 'react'; -import { FormattedMessage } from 'react-intl'; +// import { FormattedMessage } from 'react-intl'; import { i18n } from '@osd/i18n'; import { BehaviorSubject } from 'rxjs'; import { WORKSPACE_DETAIL_APP_ID } from '../../../common/constants'; @@ -94,7 +94,7 @@ export const UseCaseFooter = ({ onClick={showModal} data-test-subj="useCase.footer.createWorkspace.button" > - + {i18n.translate("useCase.footer.createWorkspace", {defaultMessage: "Create workspace"})} {isModalVisible && ( @@ -108,7 +108,7 @@ export const UseCaseFooter = ({ - + {i18n.translate("useCase.footer.modal.close", {defaultMessage: "Close"})} {isDashboardAdmin && ( - + {i18n.translate("useCase.footer.modal.create", {defaultMessage: "Create workspace"})} )} @@ -137,7 +134,7 @@ export const UseCaseFooter = ({ ); return ( - + {i18n.translate("useCase.footer.openWorkspace", {defaultMessage: "Open"})} ); } @@ -175,7 +172,7 @@ export const UseCaseFooter = ({ const button = ( - + {i18n.translate("useCase.footer.selectWorkspace", {defaultMessage: "Select workspace"})} ); const panels = [ diff --git a/src/plugins/workspace/public/plugin.ts b/src/plugins/workspace/public/plugin.ts index 5452bdd7f2fd..eafd43fd75bd 100644 --- a/src/plugins/workspace/public/plugin.ts +++ b/src/plugins/workspace/public/plugin.ts @@ -372,14 +372,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 From 335394d43f43706aab84c6e986a781cfc10eacaa Mon Sep 17 00:00:00 2001 From: Kapian1234 Date: Mon, 29 Jul 2024 13:52:45 +0800 Subject: [PATCH 2/9] fix warnings Signed-off-by: Kapian1234 --- src/plugins/home/public/application/home_render.tsx | 6 +----- .../home_get_start_card/use_case_footer.tsx | 12 +++++++----- src/plugins/workspace/public/plugin.ts | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/plugins/home/public/application/home_render.tsx b/src/plugins/home/public/application/home_render.tsx index 59fe78467a1a..afddae56ce63 100644 --- a/src/plugins/home/public/application/home_render.tsx +++ b/src/plugins/home/public/application/home_render.tsx @@ -36,11 +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 6d4ec0ab61a2..73ba4d8738b5 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 @@ -94,7 +94,7 @@ export const UseCaseFooter = ({ onClick={showModal} data-test-subj="useCase.footer.createWorkspace.button" > - {i18n.translate("useCase.footer.createWorkspace", {defaultMessage: "Create workspace"})} + {i18n.translate('useCase.footer.createWorkspace', { defaultMessage: 'Create workspace' })} {isModalVisible && ( @@ -108,7 +108,7 @@ export const UseCaseFooter = ({ - {i18n.translate("useCase.footer.modal.close", {defaultMessage: "Close"})} + {i18n.translate('useCase.footer.modal.close', { defaultMessage: 'Close' })} {isDashboardAdmin && ( - {i18n.translate("useCase.footer.modal.create", {defaultMessage: "Create workspace"})} + {i18n.translate('useCase.footer.modal.create', { + defaultMessage: 'Create workspace', + })} )} @@ -134,7 +136,7 @@ export const UseCaseFooter = ({ ); return ( - {i18n.translate("useCase.footer.openWorkspace", {defaultMessage: "Open"})} + {i18n.translate('useCase.footer.openWorkspace', { defaultMessage: 'Open' })} ); } @@ -172,7 +174,7 @@ export const UseCaseFooter = ({ const button = ( - {i18n.translate("useCase.footer.selectWorkspace", {defaultMessage: "Select workspace"})} + {i18n.translate('useCase.footer.selectWorkspace', { defaultMessage: 'Select workspace' })} ); const panels = [ diff --git a/src/plugins/workspace/public/plugin.ts b/src/plugins/workspace/public/plugin.ts index eafd43fd75bd..e593c3f941cc 100644 --- a/src/plugins/workspace/public/plugin.ts +++ b/src/plugins/workspace/public/plugin.ts @@ -371,7 +371,7 @@ export class WorkspacePlugin }), }, ]); - + /** * register workspace column into saved objects table From 0b02251f8a885167e40dd8efebd656020fc3f024 Mon Sep 17 00:00:00 2001 From: "opensearch-changeset-bot[bot]" <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:22:03 +0000 Subject: [PATCH 3/9] Changeset file for PR #7548 created/updated --- changelogs/fragments/7548.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/7548.yml diff --git a/changelogs/fragments/7548.yml b/changelogs/fragments/7548.yml new file mode 100644 index 000000000000..861a1873a8fb --- /dev/null +++ b/changelogs/fragments/7548.yml @@ -0,0 +1,2 @@ +fix: +- Resolve some browser warnings ([#7548](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7548)) \ No newline at end of file From 35f461fa6af844e76f4037b6a775bdcac0980419 Mon Sep 17 00:00:00 2001 From: Kapian1234 Date: Mon, 29 Jul 2024 17:40:37 +0800 Subject: [PATCH 4/9] fix warnings Signed-off-by: Kapian1234 --- src/plugins/workspace/public/plugin.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/workspace/public/plugin.ts b/src/plugins/workspace/public/plugin.ts index e593c3f941cc..79a83b3ce6e2 100644 --- a/src/plugins/workspace/public/plugin.ts +++ b/src/plugins/workspace/public/plugin.ts @@ -371,7 +371,6 @@ export class WorkspacePlugin }), }, ]); - /** * register workspace column into saved objects table From 23ca441f7dd79846809b623f1cd1224be63fd695 Mon Sep 17 00:00:00 2001 From: "opensearch-changeset-bot[bot]" <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:53:33 +0000 Subject: [PATCH 5/9] Changeset file for PR #7550 created/updated --- changelogs/fragments/7550.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/7550.yml diff --git a/changelogs/fragments/7550.yml b/changelogs/fragments/7550.yml new file mode 100644 index 000000000000..83cb4d9f0979 --- /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 From f2f42e387e14e165ae0f9ac6b7311380d399e158 Mon Sep 17 00:00:00 2001 From: Kapian1234 Date: Tue, 30 Jul 2024 17:07:06 +0800 Subject: [PATCH 6/9] Modified the expect of addNavLinksToGroup in workspace plugin.test.js Signed-off-by: Kapian1234 --- src/plugins/workspace/public/plugin.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/workspace/public/plugin.test.ts b/src/plugins/workspace/public/plugin.test.ts index 00f0f302ef8c..145989a51cc7 100644 --- a/src/plugins/workspace/public/plugin.test.ts +++ b/src/plugins/workspace/public/plugin.test.ts @@ -171,7 +171,8 @@ describe('Workspace plugin', () => { expect.arrayContaining([ { id: 'workspace_list', - title: 'workspace settings', + order:150, + title: 'Workspace settings', }, ]) ); From 7665ed50678cfda8957c73d3376fe1b9f243286a Mon Sep 17 00:00:00 2001 From: Kapian1234 Date: Tue, 30 Jul 2024 17:16:39 +0800 Subject: [PATCH 7/9] Modified the expect of addNavLinksToGroup in workspace plugin.test.js Signed-off-by: Kapian1234 --- src/plugins/workspace/public/plugin.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/workspace/public/plugin.test.ts b/src/plugins/workspace/public/plugin.test.ts index 145989a51cc7..7d9f030bb1d3 100644 --- a/src/plugins/workspace/public/plugin.test.ts +++ b/src/plugins/workspace/public/plugin.test.ts @@ -171,7 +171,7 @@ describe('Workspace plugin', () => { expect.arrayContaining([ { id: 'workspace_list', - order:150, + order: 150, title: 'Workspace settings', }, ]) From 2c8876ec8a22ab5f6c5c9a3872f9eeb04cc35386 Mon Sep 17 00:00:00 2001 From: Kapian1234 Date: Wed, 31 Jul 2024 10:10:52 +0800 Subject: [PATCH 8/9] remove the duplicate changelogs Signed-off-by: Kapian1234 --- changelogs/fragments/7548.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 changelogs/fragments/7548.yml diff --git a/changelogs/fragments/7548.yml b/changelogs/fragments/7548.yml deleted file mode 100644 index 861a1873a8fb..000000000000 --- a/changelogs/fragments/7548.yml +++ /dev/null @@ -1,2 +0,0 @@ -fix: -- Resolve some browser warnings ([#7548](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7548)) \ No newline at end of file From 765a46426ed7d965463c6e0e184edc973607be90 Mon Sep 17 00:00:00 2001 From: Kapian1234 Date: Wed, 31 Jul 2024 12:57:26 +0800 Subject: [PATCH 9/9] Renamed keys to comply with the directory the file is in Signed-off-by: Kapian1234 --- .../home_get_start_card/use_case_footer.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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 73ba4d8738b5..922cf3e66f7b 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('useCase.footer.createWorkspace', { defaultMessage: 'Create workspace' })} + {i18n.translate('workspace.useCase.footer.createWorkspace', { + defaultMessage: 'Create workspace', + })} {isModalVisible && ( @@ -108,7 +109,9 @@ export const UseCaseFooter = ({ - {i18n.translate('useCase.footer.modal.close', { defaultMessage: 'Close' })} + {i18n.translate('workspace.useCase.footer.modal.close', { + defaultMessage: 'Close', + })} {isDashboardAdmin && ( - {i18n.translate('useCase.footer.modal.create', { + {i18n.translate('workspace.useCase.footer.modal.create', { defaultMessage: 'Create workspace', })} @@ -136,7 +139,7 @@ export const UseCaseFooter = ({ ); return ( - {i18n.translate('useCase.footer.openWorkspace', { defaultMessage: 'Open' })} + {i18n.translate('workspace.useCase.footer.openWorkspace', { defaultMessage: 'Open' })} ); } @@ -174,7 +177,9 @@ export const UseCaseFooter = ({ const button = ( - {i18n.translate('useCase.footer.selectWorkspace', { defaultMessage: 'Select workspace' })} + {i18n.translate('workspace.useCase.footer.selectWorkspace', { + defaultMessage: 'Select workspace', + })} ); const panels = [