Skip to content

Commit

Permalink
Fix browser warnings (#7550)
Browse files Browse the repository at this point in the history
* fix warnings

Signed-off-by: Kapian1234 <2254087899@qq.com>

* fix warnings

Signed-off-by: Kapian1234 <wanjinch@amazon.com>

* Changeset file for PR #7548 created/updated

* fix warnings

Signed-off-by: Kapian1234 <wanjinch@amazon.com>

* Changeset file for PR #7550 created/updated

* Modified the expect of addNavLinksToGroup in workspace plugin.test.js

Signed-off-by: Kapian1234 <wanjinch@amazon.com>

* Modified the expect of addNavLinksToGroup in workspace plugin.test.js

Signed-off-by: Kapian1234 <wanjinch@amazon.com>

* remove the duplicate changelogs

Signed-off-by: Kapian1234 <wanjinch@amazon.com>

* Renamed keys to comply with the directory the file is in

Signed-off-by: Kapian1234 <wanjinch@amazon.com>

---------

Signed-off-by: Kapian1234 <2254087899@qq.com>
Signed-off-by: Kapian1234 <wanjinch@amazon.com>
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>
  • Loading branch information
1 parent ef47b5f commit ca89488
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 23 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7550.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Resolve some browser warnings ([#7550](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7550))
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const PageRender = ({ page, embeddable, savedObjectsClient }: Props) => {
style={{ margin: '10px 20px' }}
>
{sections.map((section) => (
<EuiFlexItem>
<EuiFlexItem key={section.id}>
<SectionRender
key={section.id}
embeddable={embeddable}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const HomeListCard = ({ config }: { config: Config }) => {
{config.list.length > 0 && (
<EuiDescriptionList>
{config.list.map((item) => (
<>
<React.Fragment key={item.href}>
<EuiDescriptionListTitle>
<EuiLink href={item.href} target="_blank">
{item.label}
Expand All @@ -94,7 +94,7 @@ export const HomeListCard = ({ config }: { config: Config }) => {
<EuiDescriptionListDescription>
{item.description}
</EuiDescriptionListDescription>
</>
</React.Fragment>
))}
</EuiDescriptionList>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/home/public/application/home_render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const setupHome = (contentManagement: ContentManagementPluginSetup) => {
<>
{contents.map((content) => {
if (content.kind === 'custom') {
return content.render();
return <React.Fragment key={content.id}>{content.render()}</React.Fragment>;
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -94,7 +93,9 @@ export const UseCaseFooter = ({
onClick={showModal}
data-test-subj="useCase.footer.createWorkspace.button"
>
<FormattedMessage id="useCase.footer.createWorkspace" defaultMessage="Create workspace" />
{i18n.translate('workspace.useCase.footer.createWorkspace', {
defaultMessage: 'Create workspace',
})}
</EuiButton>
{isModalVisible && (
<EuiModal onClose={closeModal} style={{ width: '450px' }}>
Expand All @@ -108,18 +109,19 @@ export const UseCaseFooter = ({

<EuiModalFooter>
<EuiButton onClick={closeModal} data-test-subj="useCase.footer.modal.close.button">
<FormattedMessage id="useCase.footer.modal.close" defaultMessage="Close" />
{i18n.translate('workspace.useCase.footer.modal.close', {
defaultMessage: 'Close',
})}
</EuiButton>
{isDashboardAdmin && (
<EuiButton
href={core.application.getUrlForApp('workspace_create', { absolute: false })}
data-test-subj="useCase.footer.modal.create.button"
fill
>
<FormattedMessage
id="useCase.footer.modal.create"
defaultMessage="Create workspace"
/>
{i18n.translate('workspace.useCase.footer.modal.create', {
defaultMessage: 'Create workspace',
})}
</EuiButton>
)}
</EuiModalFooter>
Expand All @@ -137,7 +139,7 @@ export const UseCaseFooter = ({
);
return (
<EuiButton href={useCaseURL} data-test-subj="useCase.footer.openWorkspace.button">
<FormattedMessage id="useCase.footer.openWorkspace" defaultMessage="Open" />
{i18n.translate('workspace.useCase.footer.openWorkspace', { defaultMessage: 'Open' })}
</EuiButton>
);
}
Expand Down Expand Up @@ -175,7 +177,9 @@ export const UseCaseFooter = ({

const button = (
<EuiButton iconType="arrowDown" iconSide="right" onClick={onButtonClick}>
<FormattedMessage id="useCase.footer.selectWorkspace" defaultMessage="Select workspace" />
{i18n.translate('workspace.useCase.footer.selectWorkspace', {
defaultMessage: 'Select workspace',
})}
</EuiButton>
);
const panels = [
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/workspace/public/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ describe('Workspace plugin', () => {
expect.arrayContaining([
{
id: 'workspace_list',
title: 'workspace settings',
order: 150,
title: 'Workspace settings',
},
])
);
Expand Down
9 changes: 0 additions & 9 deletions src/plugins/workspace/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit ca89488

Please sign in to comment.