Skip to content

Commit

Permalink
[Dashboard De-Angular] Use React to start up dashboard plugin and con…
Browse files Browse the repository at this point in the history
…figure react routing (#4012)

* Replace angular modules with react components

Use React to start up the dashboard app, and use react routing to configure basic
routing for dashboard plugin.

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

* Skip dashboard state unit test

Will revisit when the proper state management is added.

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

---------

Signed-off-by: abbyhu2000 <[email protected]>
  • Loading branch information
abbyhu2000 authored May 18, 2023
1 parent 0188d05 commit c85cd44
Show file tree
Hide file tree
Showing 19 changed files with 209 additions and 2,507 deletions.
14 changes: 0 additions & 14 deletions src/plugins/dashboard/public/application/_hacks.scss

This file was deleted.

37 changes: 37 additions & 0 deletions src/plugins/dashboard/public/application/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { AppMountParameters } from 'opensearch-dashboards/public';
import React from 'react';
import { Route, Switch } from 'react-router-dom';
import { DashboardConstants, createDashboardEditUrl } from '../dashboard_constants';
import { DashboardEditor, DashboardListing, DashboardNoMatch } from './components';

export interface DashboardAppProps {
onAppLeave: AppMountParameters['onAppLeave'];
}

export const DashboardApp = ({ onAppLeave }: DashboardAppProps) => {
return (
<Switch>
<Route exact path={['/', DashboardConstants.LANDING_PAGE_PATH]}>
<DashboardListing />
</Route>
<Route
exact
path={[DashboardConstants.CREATE_NEW_DASHBOARD_URL, createDashboardEditUrl(':id')]}
>
<DashboardEditor />
</Route>
<DashboardNoMatch />
</Switch>
);
};
167 changes: 0 additions & 167 deletions src/plugins/dashboard/public/application/application.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from 'react';

export const DashboardEditor = () => {
return <div>Dashboard Editor</div>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from 'react';

export const DashboardListing = () => {
return <div>Dashboard Listing</div>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from 'react';

export const DashboardNoMatch = () => {
return <div>Dashboard No Match</div>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from 'react';

export const DashboardTopNav = () => {
return <div>Dashboard Top Nav</div>;
};
9 changes: 9 additions & 0 deletions src/plugins/dashboard/public/application/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export { DashboardListing } from './dashboard_listing';
export { DashboardEditor } from './dashboard_editor';
export { DashboardNoMatch } from './dashboard_no_match';
export { DashboardTopNav } from './dashboard_top_nav';
9 changes: 0 additions & 9 deletions src/plugins/dashboard/public/application/dashboard_app.html

This file was deleted.

102 changes: 0 additions & 102 deletions src/plugins/dashboard/public/application/dashboard_app.tsx

This file was deleted.

Loading

0 comments on commit c85cd44

Please sign in to comment.