-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Upgrade Patternfly from v4 to v5 - Upgrade React from 17 to 18 - Upgrade react router from v5 to v6 - Upgrade packages & replace some unrelevant - Fix stylings - Make linter happy - Make tests work - Format code for better visibility - Create elementWrapper helper component to make router v6 work - Fix some warnings - Some bugfixes to already existing issues - Minor backend issue fix - Make filtering work for ibutsu projects on backend side - Remove unused components
- Loading branch information
1 parent
be116c3
commit 0848b65
Showing
61 changed files
with
2,802 additions
and
1,294 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
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
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
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
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,9 +1,7 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { render } from '@testing-library/react'; | ||
import { Base } from './base'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<Base />, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
render(<Base />); | ||
}); |
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,28 +1,37 @@ | ||
import React from 'react'; | ||
|
||
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; | ||
import { BrowserRouter as Router, Route, Routes, Navigate } from 'react-router-dom'; | ||
import { App } from './app'; | ||
import { Admin } from './admin'; | ||
import { Profile } from './profile'; | ||
import { Login } from './login'; | ||
import { SignUp } from './sign-up'; | ||
import { ForgotPassword } from './forgot-password'; | ||
import { ResetPassword } from './reset-password'; | ||
import { ProtectedRoute } from './components/protected-route'; | ||
import { AuthService } from './services/auth'; | ||
import ElementWrapper from './components/elementWrapper'; | ||
|
||
export const Base = () => { | ||
return ( | ||
<Router> | ||
<Switch> | ||
<Route path="/login" exact component={Login} /> | ||
<Route path="/sign-up" exact component={SignUp} /> | ||
<Route path="/forgot-password" exact component={ForgotPassword} /> | ||
<Route path="/reset-password/:activationCode" exact component={ResetPassword} /> | ||
<ProtectedRoute path="/profile*" exact isLoggedIn={AuthService.isLoggedIn()} redirectRoute="/login" component={Profile} /> | ||
<ProtectedRoute path="/admin*" exact isLoggedIn={AuthService.isLoggedIn()} redirectRoute="/" component={Admin} /> | ||
<ProtectedRoute path="/" isLoggedIn={AuthService.isLoggedIn()} redirectRoute="/login" component={App} /> | ||
</Switch> | ||
<Routes> | ||
<Route path="/login" element={<ElementWrapper routeElement={Login} />} /> | ||
<Route path="/sign-up" element={<ElementWrapper routeElement={SignUp} />} /> | ||
<Route path="/forgot-password" element={<ElementWrapper routeElement={ForgotPassword} />} /> | ||
<Route path="/reset-password/:activationCode" element={<ElementWrapper routeElement={ResetPassword} />} /> | ||
<Route | ||
path="/profile/*" | ||
element={AuthService.isLoggedIn() ? <Profile /> : <Navigate to="/login" />} | ||
/> | ||
<Route | ||
path="/admin/*" | ||
element={AuthService.isLoggedIn() ? <Admin /> : <Navigate to="/" />} | ||
/> | ||
<Route | ||
path="*" | ||
element={AuthService.isLoggedIn() ? <App /> : <Navigate to="/login" />} | ||
/> | ||
</Routes> | ||
</Router> | ||
); | ||
}; |
Oops, something went wrong.