Skip to content

Commit

Permalink
Post TS-Migrate Cleanup
Browse files Browse the repository at this point in the history
TS-Migrate did not run flawlessly. This cleans up any
errors it created, as well as a few existing inconsistencies
that only now turned up.
  • Loading branch information
Arnei committed Sep 11, 2023
1 parent ceabc66 commit 14a65dd
Show file tree
Hide file tree
Showing 189 changed files with 318 additions and 3,994 deletions.
10 changes: 10 additions & 0 deletions app/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

const { override, addBabelPlugins } = require('customize-cra')


module.exports = override(
addBabelPlugins(
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-syntax-optional-chaining'
)
)
10 changes: 0 additions & 10 deletions app/config-overrides.ts

This file was deleted.

49 changes: 49 additions & 0 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@material-ui/pickers": "^3.3.10",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12.1.5",
"@types/react-router-dom": "^5.3.3",
"array-move": "^4.0.0",
"axios": "^1.4.0",
"classnames": "^2.3.2",
Expand Down
4 changes: 0 additions & 4 deletions app/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import React from "react";
import { render } from "@testing-library/react";
// @ts-expect-error TS(6142): Module './App' was resolved to '/home/arnewilken/I... Remove this comment to see the full error message
import App from "./App";

// @ts-expect-error TS(2582): Cannot find name 'test'. Do you need to install ty... Remove this comment to see the full error message
test("renders learn react link", () => {
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
// @ts-expect-error TS(2304): Cannot find name 'expect'.
expect(linkElement).toBeInTheDocument();
});
56 changes: 12 additions & 44 deletions app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,16 @@ import React, { useEffect } from "react";
import { connect } from "react-redux";
import { HashRouter, Navigate, Route, Routes } from "react-router-dom";
import "./App.scss";
// @ts-expect-error TS(6142): Module './components/events/Events' was resolved t... Remove this comment to see the full error message
import Events from "./components/events/Events";
// @ts-expect-error TS(6142): Module './components/recordings/Recordings' was re... Remove this comment to see the full error message
import Recordings from "./components/recordings/Recordings";
// @ts-expect-error TS(6142): Module './components/systems/Jobs' was resolved to... Remove this comment to see the full error message
import Jobs from "./components/systems/Jobs";
// @ts-expect-error TS(6142): Module './components/configuration/Themes' was res... Remove this comment to see the full error message
import Themes from "./components/configuration/Themes";
// @ts-expect-error TS(6142): Module './components/users/Users' was resolved to ... Remove this comment to see the full error message
import Users from "./components/users/Users";
// @ts-expect-error TS(6142): Module './components/statistics/Statistics' was re... Remove this comment to see the full error message
import Statistics from "./components/statistics/Statistics";
// @ts-expect-error TS(6142): Module './components/events/Series' was resolved t... Remove this comment to see the full error message
import Series from "./components/events/Series";
// @ts-expect-error TS(6142): Module './components/systems/Servers' was resolved... Remove this comment to see the full error message
import Servers from "./components/systems/Servers";
// @ts-expect-error TS(6142): Module './components/systems/Services' was resolve... Remove this comment to see the full error message
import Services from "./components/systems/Services";
// @ts-expect-error TS(6142): Module './components/users/Groups' was resolved to... Remove this comment to see the full error message
import Groups from "./components/users/Groups";
// @ts-expect-error TS(6142): Module './components/users/Acls' was resolved to '... Remove this comment to see the full error message
import Acls from "./components/users/Acls";
import { fetchOcVersion, fetchUserInfo } from "./thunks/userInfoThunks";

Expand All @@ -38,53 +27,32 @@ function App({
}, [loadingOcVersion, loadingUserInfo]);

return (
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<HashRouter>
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Routes>
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/"} element={<Events />} />
<Route path={"/"} element={<Events />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/events/events"} element={<Events />} />
<Route path={"/events/events"} element={<Events />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/events/series"} element={<Series />} />
<Route path={"/events/series"} element={<Series />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/recordings/recordings"} element={<Recordings />} />
<Route path={"/recordings/recordings"} element={<Recordings />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/systems/jobs"} element={<Jobs />} />
<Route path={"/systems/jobs"} element={<Jobs />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/systems/servers"} element={<Servers />} />
<Route path={"/systems/servers"} element={<Servers />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/systems/services"} element={<Services />} />
<Route path={"/systems/services"} element={<Services />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/users/users"} element={<Users />} />
<Route path={"/users/users"} element={<Users />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/users/groups"} element={<Groups />} />
<Route path={"/users/groups"} element={<Groups />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/users/acls"} element={<Acls />} />
<Route path={"/users/acls"} element={<Acls />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route exact path={"/configuration/themes"} element={<Themes />} />
<Route path={"/configuration/themes"} element={<Themes />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route
// @ts-expect-error TS(2322): Type '{ exact: true; path: string; element: Elemen... Remove this comment to see the full error message
exact
path={"/statistics/organization"}
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
element={<Statistics />}
/>
<Route path={"/statistics/organization"} element={<Statistics />} />

// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<Route
path={"*"}
// @ts-expect-error TS(2322): Type '{ path: string; render: () => Element; }' is... Remove this comment to see the full error message
Expand Down
6 changes: 0 additions & 6 deletions app/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,20 @@ const Footer = ({ user, orgProperties }) => {
const feedbackUrlPropertyId = "org.opencastproject.admin.feedback.url";

return (
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<footer id="main-footer">
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<div className="default-footer">
{/* Only render if a version is set */}
{!!user.ocVersion && (
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<div className="meta">
Opencast {user.ocVersion.version}
{hasAccess("ROLE_ADMIN", user) && (
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<span> - {user.ocVersion.buildNumber || "undefined"}</span>
)}
</div>
)}
{/* Only render if a feedback URL is set*/}
{!!orgProperties && !!orgProperties[feedbackUrlPropertyId] && (
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<div className="feedback-btn" id="feedback-btn">
// @ts-expect-error TS(17004): Cannot use JSX unless the '--jsx' flag is provided... Remove this comment to see the full error message
<a href={orgProperties[feedbackUrlPropertyId]}>Feedback</a>
</div>
)}
Expand Down
Loading

0 comments on commit 14a65dd

Please sign in to comment.