From d4605c5647b546efe2bfccf59cc42287faa8c183 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Sat, 20 Apr 2024 00:44:21 +0800 Subject: [PATCH] fix rebase issue Signed-off-by: Hailong Cui --- src/plugins/workspace/public/application.tsx | 9 +++++++-- .../public/components/workspace_overview/index.tsx | 11 ++++++++--- .../workspace_overview_settings.tsx | 9 +++++++-- .../public/components/workspace_overview_app.tsx | 6 +++--- src/plugins/workspace/public/utils.ts | 4 ++-- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/plugins/workspace/public/application.tsx b/src/plugins/workspace/public/application.tsx index a82f74ed9fb5..1601c64af3f9 100644 --- a/src/plugins/workspace/public/application.tsx +++ b/src/plugins/workspace/public/application.tsx @@ -16,6 +16,7 @@ import { Services } from './types'; import { WorkspaceOverviewApp } from './components/workspace_overview_app'; import { WorkspaceCreatorProps } from './components/workspace_creator/workspace_creator'; import { WorkspaceListProps } from './components/workspace_list'; +import { WorkspaceOverviewProps } from './components/workspace_overview'; export const renderCreatorApp = ( { element }: AppMountParameters, @@ -83,10 +84,14 @@ export const renderListApp = ( }; }; -export const renderOverviewApp = ({ element }: AppMountParameters, services: Services) => { +export const renderOverviewApp = ( + { element }: AppMountParameters, + services: Services, + props: WorkspaceOverviewProps +) => { ReactDOM.render( - + , element ); diff --git a/src/plugins/workspace/public/components/workspace_overview/index.tsx b/src/plugins/workspace/public/components/workspace_overview/index.tsx index f9c57a56e3e3..7d0b26bfecdf 100644 --- a/src/plugins/workspace/public/components/workspace_overview/index.tsx +++ b/src/plugins/workspace/public/components/workspace_overview/index.tsx @@ -21,7 +21,8 @@ import { import { useObservable } from 'react-use'; import { i18n } from '@osd/i18n'; -import { CoreStart } from 'opensearch-dashboards/public'; +import { CoreStart, PublicAppInfo } from 'opensearch-dashboards/public'; +import { BehaviorSubject } from 'rxjs'; import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public'; import { WorkspaceOverviewLibrary } from './workspace_overview_library'; import { WorkspaceOverviewSettings } from './workspace_overview_settings'; @@ -32,7 +33,11 @@ import { featureMatchesConfig } from '../../utils'; import { WorkspaceOverviewCard } from './getting_start_card'; import { WorkspaceOverviewGettingStartModal } from './getting_start_modal'; -export const WorkspaceOverview = () => { +export interface WorkspaceOverviewProps { + workspaceConfigurableApps$?: BehaviorSubject; +} + +export const WorkspaceOverview = (props: WorkspaceOverviewProps) => { const { services: { workspaces, application, http }, } = useOpenSearchDashboards(); @@ -81,7 +86,7 @@ export const WorkspaceOverview = () => { name: i18n.translate('workspace.overview.setting.tabTitle', { defaultMessage: 'Settings', }), - content: , + content: , }, ]; diff --git a/src/plugins/workspace/public/components/workspace_overview/workspace_overview_settings.tsx b/src/plugins/workspace/public/components/workspace_overview/workspace_overview_settings.tsx index 2026f8fbbdb9..997724c000c5 100644 --- a/src/plugins/workspace/public/components/workspace_overview/workspace_overview_settings.tsx +++ b/src/plugins/workspace/public/components/workspace_overview/workspace_overview_settings.tsx @@ -5,7 +5,12 @@ import React from 'react'; import { WorkspaceUpdater } from '../workspace_updater'; +import { WorkspaceOverviewProps } from './index'; -export const WorkspaceOverviewSettings = () => { - return ; +export const WorkspaceOverviewSettings = ({ + workspaceConfigurableApps$, +}: WorkspaceOverviewProps) => { + return ( + + ); }; diff --git a/src/plugins/workspace/public/components/workspace_overview_app.tsx b/src/plugins/workspace/public/components/workspace_overview_app.tsx index bf68051e6952..3bfaa6191803 100644 --- a/src/plugins/workspace/public/components/workspace_overview_app.tsx +++ b/src/plugins/workspace/public/components/workspace_overview_app.tsx @@ -8,9 +8,9 @@ import { I18nProvider } from '@osd/i18n/react'; import { CoreStart } from 'opensearch-dashboards/public'; import { useObservable } from 'react-use'; import { useOpenSearchDashboards } from '../../../opensearch_dashboards_react/public'; -import { WorkspaceOverview } from './workspace_overview'; +import { WorkspaceOverview, WorkspaceOverviewProps } from './workspace_overview'; -export const WorkspaceOverviewApp = () => { +export const WorkspaceOverviewApp = (props: WorkspaceOverviewProps) => { const { services: { workspaces, chrome, application }, } = useOpenSearchDashboards(); @@ -36,7 +36,7 @@ export const WorkspaceOverviewApp = () => { return ( - + ); }; diff --git a/src/plugins/workspace/public/utils.ts b/src/plugins/workspace/public/utils.ts index c75a6b131e28..30a306fae913 100644 --- a/src/plugins/workspace/public/utils.ts +++ b/src/plugins/workspace/public/utils.ts @@ -12,7 +12,7 @@ import { WorkspaceObject, WorkspaceAccessibility, } from '../../../core/public'; -import { DEFAULT_CHECKED_FEATURES_IDS } from '../common/constants'; +import { DEFAULT_SELECTED_FEATURES_IDS } from '../common/constants'; /** * Checks if a given feature matches the provided feature configuration. @@ -132,7 +132,7 @@ export const filterWorkspaceConfigurableApps = (applications: PublicAppInfo[]) = return ( navLinkStatus !== AppNavLinkStatus.hidden && !chromeless && - !DEFAULT_CHECKED_FEATURES_IDS.includes(id) && + !DEFAULT_SELECTED_FEATURES_IDS.includes(id) && category?.id !== DEFAULT_APP_CATEGORIES.management.id ); });