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

[Workspace] Refactor new home page #8467

Merged
merged 21 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/8467.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
refactor:
- [Workspace] Refactor new home page. ([#8467](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8467))
4 changes: 4 additions & 0 deletions src/plugins/home/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@
navLinkStatus: AppNavLinkStatus.hidden,
mount: async (params: AppMountParameters) => {
const [coreStart, { navigation }] = await core.getStartServices();
if (!!coreStart.application.capabilities.workspaces?.enabled) {
coreStart.application.navigateToApp('workspace_initial');
yubonluo marked this conversation as resolved.
Show resolved Hide resolved
return () => {};

Check warning on line 171 in src/plugins/home/public/plugin.ts

View check run for this annotation

Codecov / codecov/patch

src/plugins/home/public/plugin.ts#L170-L171

Added lines #L170 - L171 were not covered by tests
}
setCommonService();
coreStart.chrome.docTitle.change(
i18n.translate('home.pageTitle', { defaultMessage: 'Home' })
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/workspace/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,5 @@ export const WORKSPACE_DATA_SOURCE_AND_CONNECTION_OBJECT_TYPES = [
DATA_SOURCE_SAVED_OBJECT_TYPE,
DATA_CONNECTION_SAVED_OBJECT_TYPE,
];

export const USE_CASE_CARD_GRADIENT_PREFIX = 'workspace-initial-use-case-card';
15 changes: 9 additions & 6 deletions src/plugins/workspace/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { WorkspaceDetailApp } from './components/workspace_detail_app';
import { WorkspaceDetailProps } from './components/workspace_detail/workspace_detail';
import { WorkspaceInitialApp } from './components/workspace_initial_app';
import { WorkspaceUseCaseOverviewApp } from './components/workspace_use_case_overview_app';
import { WorkspaceInitialProps } from './components/workspace_initial/workspace_initial';

export const renderCreatorApp = (
{ element }: AppMountParameters,
Expand Down Expand Up @@ -101,18 +102,20 @@ export const renderDetailApp = (
};
};

export const renderInitialApp = ({}: AppMountParameters, services: Services) => {
const rootElement = document.getElementById('opensearch-dashboards-body');

export const renderInitialApp = (
{ element }: AppMountParameters,
services: Services,
props: WorkspaceInitialProps
) => {
ReactDOM.render(
<OpenSearchDashboardsContextProvider services={services}>
<WorkspaceInitialApp />
<WorkspaceInitialApp {...props} />
</OpenSearchDashboardsContextProvider>,
rootElement
element
);

return () => {
ReactDOM.unmountComponentAtNode(rootElement!);
ReactDOM.unmountComponentAtNode(element);
};
};

Expand Down
363 changes: 0 additions & 363 deletions src/plugins/workspace/public/assets/background_dark.svg

This file was deleted.

363 changes: 0 additions & 363 deletions src/plugins/workspace/public/assets/background_light.svg

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading