-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
bb0c98f
commit a121e6f
Showing
18 changed files
with
204 additions
and
2,505 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
167
src/plugins/dashboard/public/application/application.ts
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
src/plugins/dashboard/public/application/components/dashboard_editor.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
}; |
10 changes: 10 additions & 0 deletions
10
src/plugins/dashboard/public/application/components/dashboard_listing.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
}; |
10 changes: 10 additions & 0 deletions
10
src/plugins/dashboard/public/application/components/dashboard_no_match.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
}; |
10 changes: 10 additions & 0 deletions
10
src/plugins/dashboard/public/application/components/dashboard_top_nav.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file was deleted.
Oops, something went wrong.
102 changes: 0 additions & 102 deletions
102
src/plugins/dashboard/public/application/dashboard_app.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.