Skip to content

Commit

Permalink
Replace angular modules with react components
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
abbyhu2000 committed Jun 1, 2023
1 parent bb0c98f commit a121e6f
Show file tree
Hide file tree
Showing 18 changed files with 204 additions and 2,505 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 a121e6f

Please sign in to comment.