Skip to content

Commit

Permalink
[Workspace] Refactor new home page (opensearch-project#8467)
Browse files Browse the repository at this point in the history
* update home page

Signed-off-by: yubonluo <yubonluo@amazon.com>

* updated useCase card in workspace initial page

Signed-off-by: yubonluo <yubonluo@amazon.com>

* Integrate use case flyout and add unit tests

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* implemet populate use case when clicking create/view button

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* Changeset file for PR opensearch-project#8467 created/updated

* update css

Signed-off-by: yubonluo <yubonluo@amazon.com>

* fix the test errors

Signed-off-by: yubonluo <yubonluo@amazon.com>

* delete useless code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* update snap shot

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* fix i18n validation error

Signed-off-by: yubonluo <yubonluo@amazon.com>

---------

Signed-off-by: yubonluo <yubonluo@amazon.com>
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 Oct 8, 2024
1 parent 58e1645 commit 61eedf7
Show file tree
Hide file tree
Showing 27 changed files with 1,914 additions and 2,282 deletions.
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 @@ export class HomePublicPlugin
navLinkStatus: AppNavLinkStatus.hidden,
mount: async (params: AppMountParameters) => {
const [coreStart, { navigation }] = await core.getStartServices();
if (!!coreStart.application.capabilities.workspaces?.enabled) {
coreStart.application.navigateToApp('workspace_initial');
return () => {};
}
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

0 comments on commit 61eedf7

Please sign in to comment.