Skip to content

refactor(tsx): Migrate React components to TSX #984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5211d0e
Merge branch 'main' into typescript-setup
JamieSlome Mar 24, 2025
773754e
Merge branch 'main' into typescript-setup
fabiovincenzi Apr 2, 2025
2e85fa9
refactor(tsx): vite.config.ts
fabiovincenzi Apr 3, 2025
ef24787
refactor(ts): update eslinrc
fabiovincenzi Apr 3, 2025
bc039b6
refactor(tsx): convert index file
fabiovincenzi Apr 3, 2025
27101e8
refactor(tsx): convert routes file
fabiovincenzi Apr 3, 2025
012bfbb
refactor(tsx): convert utils file
fabiovincenzi Apr 3, 2025
2038426
refactor(tsx): convert GridItem component
fabiovincenzi Apr 3, 2025
c3a01cd
refactor(tsx): convert GridContainer component
fabiovincenzi Apr 9, 2025
48cae4e
refactor(tsx): convert Buttons components
fabiovincenzi Apr 9, 2025
1efa504
refactor(tsx): convert Snackbar components
fabiovincenzi Apr 10, 2025
0c12d1a
refactor(tsx): fix button issues with colors
fabiovincenzi Apr 10, 2025
9a82ce6
refactor(tsx): convert Card components
fabiovincenzi Apr 11, 2025
397db37
Merge remote-tracking branch 'finos/main' into react-conversion
fabiovincenzi Apr 11, 2025
5523283
refactor(tsx): convert Search component
fabiovincenzi Apr 11, 2025
56e04e6
refactor(tsx): convert NavBar components
fabiovincenzi Apr 15, 2025
5cfc666
refactor(tsx): convert Admin component
fabiovincenzi Apr 15, 2025
e62a77d
refactor(tsx): convert Diff to tsx
fabiovincenzi Apr 17, 2025
ec96e37
refactor(tsx): convert User view
fabiovincenzi Apr 17, 2025
499279b
refactor(tsx): convert Footer component
fabiovincenzi Apr 17, 2025
1feec68
refactor(tsx): convert Filtering Pagination and Search components
fabiovincenzi Apr 17, 2025
e6a75a1
refactor(tsx): convert SideBar component
fabiovincenzi Apr 17, 2025
ba2036c
refactor(tsx): convert CustomTabs component
fabiovincenzi Apr 17, 2025
e743543
fix(tsx): fixing colors and size
fabiovincenzi Apr 17, 2025
0bac84f
refactor(tsx): convert Styles to ts
fabiovincenzi Apr 17, 2025
20ab300
refactor(tsx): convert SideBar Style to ts
fabiovincenzi Apr 17, 2025
f76c659
refactor(tsx): convert Login view
fabiovincenzi Apr 17, 2025
90299ce
refactor(tsx): convert OpenPushRequests view
fabiovincenzi Apr 17, 2025
91836f9
refactor(tsx): convert PushDetails view
fabiovincenzi Apr 17, 2025
414ac29
refactor(tsx): convert RepoDetails view
fabiovincenzi Apr 17, 2025
88f7e4e
refactor(tsx): convert RepoList view
fabiovincenzi Apr 18, 2025
9935b0b
refactor(tsx): convert UserList view
fabiovincenzi Apr 18, 2025
995e244
refactor(tsx): convert context to ts
fabiovincenzi Apr 18, 2025
e0d9a31
refactor(tsx): fix admin
fabiovincenzi Apr 18, 2025
d3235d7
refactor(tsx): refactor GridItem
fabiovincenzi Apr 18, 2025
afeca36
Merge branch 'main' into react-conversion
fabiovincenzi Apr 18, 2025
daddff1
refactor(tsx): ignore history dependancy
fabiovincenzi Apr 18, 2025
9671316
Merge branch 'react-conversion' of https://github.com/fabiovincenzi/g…
fabiovincenzi Apr 18, 2025
db8fa08
Merge branch 'main' into react-conversion
fabiovincenzi May 2, 2025
3e1d3f3
Merge branch 'main' into react-conversion
fabiovincenzi May 6, 2025
e4e904f
Merge branch 'main' into react-conversion
fabiovincenzi May 6, 2025
422950d
Merge branch 'main' into react-conversion
fabiovincenzi May 9, 2025
861a763
Merge branch 'main' into react-conversion
JamieSlome May 19, 2025
e5e4fe1
Merge branch 'main' into react-conversion
fabiovincenzi May 20, 2025
9f83b1b
Merge branch 'main' into react-conversion
fabiovincenzi May 20, 2025
5a0d2b2
Merge branch 'main' into react-conversion
fabiovincenzi May 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unused-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
node-version: '20.x'
- name: 'Run depcheck'
run: |
npx depcheck --skip-missing --ignores="tsx,@babel/*,@commitlint/*,eslint,eslint-*,husky,mocha,ts-mocha,ts-node,concurrently,nyc,prettier,typescript,tsconfig-paths,vite-tsconfig-paths"
npx depcheck --skip-missing --ignores="tsx,@babel/*,@commitlint/*,eslint,eslint-*,husky,mocha,ts-mocha,ts-node,concurrently,nyc,prettier,typescript,tsconfig-paths,vite-tsconfig-paths,history"
echo $?
if [[ $? == 1 ]]; then
echo "Unused dependencies or devDependencies found"
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
<script type="module" src="/src/index.jsx"></script>
<script type="module" src="/src/index.tsx"></script>
</html>
39 changes: 39 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Deploy custom push protections and policies on top of Git.",
"scripts": {
"cli": "node ./packages/git-proxy-cli/index.js",
"client": "vite --config vite.config.js",
"client": "vite --config vite.config.ts",
"clientinstall": "npm install --prefix client",
"server": "tsx index.ts",
"start": "concurrently \"npm run server\" \"npm run client\"",
Expand Down Expand Up @@ -90,6 +90,7 @@
"@types/lodash": "^4.17.15",
"@types/mocha": "^10.0.10",
"@types/node": "^22.13.5",
"@types/react-html-parser": "^2.0.7",
"@types/yargs": "^17.0.33",
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
Expand Down
3 changes: 0 additions & 3 deletions src/context.js

This file was deleted.

8 changes: 8 additions & 0 deletions src/context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { createContext } from 'react';
import { UserContextType } from './ui/views/RepoDetails/RepoDetails';

export const UserContext = createContext<UserContextType>({
user: {
admin: false,
},
});
11 changes: 4 additions & 7 deletions src/index.jsx → src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createBrowserHistory } from 'history';
import { BrowserRouter as Router, Route, Routes, Navigate } from 'react-router-dom';

// core components
import Admin from './ui/layouts/Admin';
import Login from './ui/views/Login/Login';
import './ui/assets/css/material-dashboard-react.css';

const hist = createBrowserHistory();

ReactDOM.render(
<Router history={hist}>
<Router>
<Routes>
<Route exact path='/admin/*' element={<Admin />} />
<Route exact path='/login' element={<Login />} />
<Route exact path='/' element={<Navigate from='/' to='/admin/repo' />} />
<Route path='/admin/*' element={<Admin />} />
<Route path='/login' element={<Login />} />
<Route path='/' element={<Navigate to='/admin/repo' />} />
</Routes>
</Router>,
document.getElementById('root'),
Expand Down
13 changes: 11 additions & 2 deletions src/routes.jsx → src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

*/

import React from 'react';
import Person from '@material-ui/icons/Person';
import OpenPushRequests from './ui/views/OpenPushRequests/OpenPushRequests';
import PushDetails from './ui/views/PushDetails/PushDetails';
Expand All @@ -25,10 +26,18 @@ import RepoDetails from './ui/views/RepoDetails/RepoDetails';
import RepoList from './ui/views/RepoList/RepoList';

import { RepoIcon } from '@primer/octicons-react';

import { Group, AccountCircle, Dashboard } from '@material-ui/icons';

const dashboardRoutes = [
interface RouteType {
path: string;
name: string;
icon: React.ComponentType<any>;
component: React.ComponentType<any>;
layout: string;
visible: boolean;
}

const dashboardRoutes: RouteType[] = [
{
path: '/repo',
name: 'Repositories',
Expand Down
2 changes: 1 addition & 1 deletion src/ui/assets/jss/material-dashboard-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const container = {

const defaultFont = {
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
fontWeight: '300',
fontWeight: 300,
lineHeight: '1.5em',
};

Expand Down
Loading
Loading