Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix browser warnings #7550

Merged
merged 12 commits into from
Aug 7, 2024
Merged
2 changes: 2 additions & 0 deletions changelogs/fragments/7548.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Resolve some browser warnings ([#7548](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7548))
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 @@ -74,14 +74,14 @@ 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}
</EuiLink>
</EuiDescriptionListTitle>
<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,7 @@ import {
EuiModalHeaderTitle,
} from '@elastic/eui';
import React, { useMemo, useState } from 'react';
import { FormattedMessage } from 'react-intl';
// import { FormattedMessage } from 'react-intl';
SuZhou-Joe marked this conversation as resolved.
Show resolved Hide resolved
import { i18n } from '@osd/i18n';
import { BehaviorSubject } from 'rxjs';
import { WORKSPACE_DETAIL_APP_ID } from '../../../common/constants';
Expand Down Expand Up @@ -94,7 +94,7 @@ export const UseCaseFooter = ({
onClick={showModal}
data-test-subj="useCase.footer.createWorkspace.button"
>
<FormattedMessage id="useCase.footer.createWorkspace" defaultMessage="Create workspace" />
{i18n.translate('useCase.footer.createWorkspace', { defaultMessage: 'Create workspace' })}
Kapian1234 marked this conversation as resolved.
Show resolved Hide resolved
</EuiButton>
{isModalVisible && (
<EuiModal onClose={closeModal} style={{ width: '450px' }}>
Expand All @@ -108,18 +108,17 @@ 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('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('useCase.footer.modal.create', {
defaultMessage: 'Create workspace',
})}
</EuiButton>
)}
</EuiModalFooter>
Expand All @@ -137,7 +136,7 @@ export const UseCaseFooter = ({
);
return (
<EuiButton href={useCaseURL} data-test-subj="useCase.footer.openWorkspace.button">
<FormattedMessage id="useCase.footer.openWorkspace" defaultMessage="Open" />
{i18n.translate('useCase.footer.openWorkspace', { defaultMessage: 'Open' })}
</EuiButton>
);
}
Expand Down Expand Up @@ -175,7 +174,7 @@ export const UseCaseFooter = ({

const button = (
<EuiButton iconType="arrowDown" iconSide="right" onClick={onButtonClick}>
<FormattedMessage id="useCase.footer.selectWorkspace" defaultMessage="Select workspace" />
{i18n.translate('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
Loading