From 31df7d45893e933999f9d97db2d5c606159f9e6b Mon Sep 17 00:00:00 2001 From: Lin Wang Date: Thu, 1 Jun 2023 01:00:44 +0800 Subject: [PATCH] Revert remove experiment banner and enable by default (#203) * Revert "feat: enable ml-commons-dashboards plugin by default (#200)" This reverts commit a1cb7dead905179dc120abd0bd9aae648f72d9d3. Signed-off-by: Lin Wang * Revert "feat: remove experiment warning banner (#194)" This reverts commit 0ef4753d120aea661c9a4caff734edf51d6de3e5. Signed-off-by: Lin Wang --------- Signed-off-by: Lin Wang --- .../__tests__/index.test.tsx | 25 +++++++++++++++++ .../components/experiment_warning/index.tsx | 27 +++++++++++++++++++ public/components/monitoring/index.tsx | 2 ++ ...ommons-dashboards.release-notes-2.8.0.0.md | 5 ---- server/index.ts | 2 +- 5 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 public/components/experiment_warning/__tests__/index.test.tsx create mode 100644 public/components/experiment_warning/index.tsx diff --git a/public/components/experiment_warning/__tests__/index.test.tsx b/public/components/experiment_warning/__tests__/index.test.tsx new file mode 100644 index 00000000..ab50552e --- /dev/null +++ b/public/components/experiment_warning/__tests__/index.test.tsx @@ -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('', () => { + it('should navigate to # when clicking link of "Machine Learning Documentation"', () => { + render(); + 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(); + 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' + ); + }); +}); diff --git a/public/components/experiment_warning/index.tsx b/public/components/experiment_warning/index.tsx new file mode 100644 index 00000000..668fcc0a --- /dev/null +++ b/public/components/experiment_warning/index.tsx @@ -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 ( + + The feature is experimental and should not be used in a production environment. For more + information, see{' '} + + Machine Learning Documentation + + . To leave feedback, visit{' '} + + forum.opensearch.org + + . + + ); +}; diff --git a/public/components/monitoring/index.tsx b/public/components/monitoring/index.tsx index dea2a7aa..cf4b1745 100644 --- a/public/components/monitoring/index.tsx +++ b/public/components/monitoring/index.tsx @@ -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'; @@ -68,6 +69,7 @@ export const Monitoring = () => { return (
+