Skip to content

Commit

Permalink
[Workspace] Support workspace initial page (#7708)
Browse files Browse the repository at this point in the history
* Support workspace initial page

Signed-off-by: yubonluo <[email protected]>

* Changeset file for PR #7708 created/updated

* optimzie the code

Signed-off-by: yubonluo <[email protected]>

* fix the test error

Signed-off-by: yubonluo <[email protected]>

* add dark mode svg url

Signed-off-by: yubonluo <[email protected]>

---------

Signed-off-by: yubonluo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
yubonluo and opensearch-changeset-bot[bot] authored Aug 20, 2024
1 parent 85fae59 commit 9aeebec
Show file tree
Hide file tree
Showing 16 changed files with 2,211 additions and 12 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7708.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Support workspace initial page ([#7708](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7708))
1 change: 1 addition & 0 deletions src/plugins/workspace/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const WORKSPACE_FATAL_ERROR_APP_ID = 'workspace_fatal_error';
export const WORKSPACE_CREATE_APP_ID = 'workspace_create';
export const WORKSPACE_LIST_APP_ID = 'workspace_list';
export const WORKSPACE_DETAIL_APP_ID = 'workspace_detail';
export const WORKSPACE_INITIAL_APP_ID = 'workspace_initial';
/**
* Since every workspace always have overview and update page, these features will be selected by default
* and can't be changed in the workspace form feature selector
Expand Down
19 changes: 17 additions & 2 deletions src/plugins/workspace/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter as Router, Route, Switch, Redirect } from 'react-router-dom';
import { HashRouter as Router, Route, Switch } from 'react-router-dom';
import { AppMountParameters, ScopedHistory } from '../../../core/public';
import { OpenSearchDashboardsContextProvider } from '../../opensearch_dashboards_react/public';
import { WorkspaceFatalError } from './components/workspace_fatal_error';
Expand All @@ -15,7 +15,7 @@ import { Services } from './types';
import { WorkspaceCreatorProps } from './components/workspace_creator/workspace_creator';
import { WorkspaceDetailApp } from './components/workspace_detail_app';
import { WorkspaceDetailProps } from './components/workspace_detail/workspace_detail';
import { DetailTab } from './components/workspace_form/constants';
import { WorkspaceInitialApp } from './components/workspace_initial_app';

export const renderCreatorApp = (
{ element }: AppMountParameters,
Expand Down Expand Up @@ -87,3 +87,18 @@ export const renderDetailApp = (
ReactDOM.unmountComponentAtNode(element);
};
};

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

ReactDOM.render(
<OpenSearchDashboardsContextProvider services={services}>
<WorkspaceInitialApp />
</OpenSearchDashboardsContextProvider>,
rootElement
);

return () => {
ReactDOM.unmountComponentAtNode(rootElement!);
};
};
363 changes: 363 additions & 0 deletions src/plugins/workspace/public/assets/background_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
363 changes: 363 additions & 0 deletions src/plugins/workspace/public/assets/background_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9aeebec

Please sign in to comment.