Skip to content

Commit

Permalink
fix rebase issue
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <ihailong@amazon.com>
  • Loading branch information
Hailong-am committed Apr 19, 2024
1 parent b00bac7 commit d4605c5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
9 changes: 7 additions & 2 deletions src/plugins/workspace/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
<OpenSearchDashboardsContextProvider services={services}>
<WorkspaceOverviewApp />
<WorkspaceOverviewApp {...props} />
</OpenSearchDashboardsContextProvider>,
element
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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<PublicAppInfo[]>;
}

export const WorkspaceOverview = (props: WorkspaceOverviewProps) => {
const {
services: { workspaces, application, http },
} = useOpenSearchDashboards<CoreStart & { workspaceClient: WorkspaceClient }>();
Expand Down Expand Up @@ -81,7 +86,7 @@ export const WorkspaceOverview = () => {
name: i18n.translate('workspace.overview.setting.tabTitle', {
defaultMessage: 'Settings',
}),
content: <WorkspaceOverviewSettings />,
content: <WorkspaceOverviewSettings {...props} />,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

import React from 'react';
import { WorkspaceUpdater } from '../workspace_updater';
import { WorkspaceOverviewProps } from './index';

export const WorkspaceOverviewSettings = () => {
return <WorkspaceUpdater hideTitle={true} />;
export const WorkspaceOverviewSettings = ({
workspaceConfigurableApps$,
}: WorkspaceOverviewProps) => {
return (
<WorkspaceUpdater hideTitle={true} workspaceConfigurableApps$={workspaceConfigurableApps$} />
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -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<CoreStart>();
Expand All @@ -36,7 +36,7 @@ export const WorkspaceOverviewApp = () => {

return (
<I18nProvider>
<WorkspaceOverview />
<WorkspaceOverview {...props} />
</I18nProvider>
);
};
4 changes: 2 additions & 2 deletions src/plugins/workspace/public/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
);
});
Expand Down

0 comments on commit d4605c5

Please sign in to comment.