-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[report] Replace example with proper report parsing (#11)
This PR adds an initial working version of report parsing and include the following additional changes: 1. Add jest dependencies. 2. Add a simple popup to display the details when clicking on "Link" 3. Updated types from interuss/monitoring schemas. Few known issues: - Requirements and child capabilities are not displayed at the same time on a page. - Error handling is probably too aggressive Note that report_uspace.json will be removed before merge to not checkin big files on the main branch.
- Loading branch information
Showing
11 changed files
with
2,190 additions
and
279 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import { RouterProvider, createBrowserRouter } from "react-router-dom"; | ||
import { RouterProvider, createHashRouter } from "react-router-dom"; | ||
import { useReport } from "./capability/useReport"; | ||
import "./App.css"; | ||
|
||
function App() { | ||
// FIXME use the report from the config | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const configuration = JSON.stringify((window as any)["interuss"]); | ||
const configuration = JSON.parse((window as any)["interuss"] || "{}"); | ||
console.log("Configuration:", configuration); | ||
|
||
const { report, nav } = useReport(); | ||
const { loading, report, nav } = useReport(configuration); | ||
if (loading) { | ||
return <div>Loading report...</div>; | ||
} | ||
if (!report) { | ||
return <div>Report not found</div>; | ||
} | ||
const router = createBrowserRouter(nav); | ||
return <RouterProvider router={router} />; | ||
const router = createHashRouter(nav); | ||
return <> | ||
<RouterProvider router={router} /> | ||
</>; | ||
} | ||
|
||
export default App; |
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
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
Oops, something went wrong.