Skip to content

Commit

Permalink
Revert "feat: remove experiment warning banner (opensearch-project#194)"
Browse files Browse the repository at this point in the history
This reverts commit 0ef4753.

Signed-off-by: Lin Wang <[email protected]>
  • Loading branch information
wanglam committed May 31, 2023
1 parent 9aaf1e4 commit eb87198
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
25 changes: 25 additions & 0 deletions public/components/experiment_warning/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react';
import { render, screen } from '../../../../test/test_utils';
import { ExperimentalWarning } from '..';

describe('<ExperimentalWarning />', () => {
it('should navigate to # when clicking link of "Machine Learning Documentation"', () => {
render(<ExperimentalWarning />);
const link = screen.getByText('Machine Learning Documentation');
expect(link.getAttribute('href')).toBe(
'https://opensearch.org/docs/latest/ml-commons-plugin/ml-dashbaord/'
);
});

it('should navigate to # when clicking forum.opensearch.org', () => {
render(<ExperimentalWarning />);
const link = screen.getByText('forum.opensearch.org');
expect(link.getAttribute('href')).toBe(
'https://forum.opensearch.org/t/feedback-ml-commons-ml-model-health-dashboard-for-admins-experimental-release/12494'
);
});
});
27 changes: 27 additions & 0 deletions public/components/experiment_warning/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react';

import { EuiCallOut, EuiLink } from '@elastic/eui';

export const ExperimentalWarning = () => {
return (
<EuiCallOut title="Experimental Feature" iconType="iInCircle">
The feature is experimental and should not be used in a production environment. For more
information, see{' '}
<EuiLink href="https://opensearch.org/docs/latest/ml-commons-plugin/ml-dashbaord/" external>
Machine Learning Documentation
</EuiLink>
. To leave feedback, visit{' '}
<EuiLink
href="https://forum.opensearch.org/t/feedback-ml-commons-ml-model-health-dashboard-for-admins-experimental-release/12494"
external
>
forum.opensearch.org
</EuiLink>
.
</EuiCallOut>
);
};
2 changes: 2 additions & 0 deletions public/components/monitoring/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import React, { useState, useRef, useCallback } from 'react';

import { RefreshInterval } from '../common/refresh_interval';
import { PreviewPanel } from '../preview_panel';
import { ExperimentalWarning } from '../experiment_warning';
import { ModelDeploymentItem, ModelDeploymentTable } from './model_deployment_table';
import { useMonitoring } from './use_monitoring';
import { ModelStatusFilter } from './model_status_filter';
Expand Down Expand Up @@ -68,6 +69,7 @@ export const Monitoring = () => {

return (
<div>
<ExperimentalWarning />
<EuiSpacer size="s" />
<EuiSpacer size="xs" />
<EuiPageHeader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
Compatible with OpenSearch 2.8.0


### Features

* Remove experiment warning banner. ([#194](https://github.com/opensearch-project/ml-commons-dashboards/pull/194))

### Infrastructure

* Update husky to 8.0.3 to remove execa as development dependency. ([#160](https://github.com/opensearch-project/ml-commons-dashboards/pull/160))

0 comments on commit eb87198

Please sign in to comment.