Skip to content
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

[Job Launcher] Client V2 #703

Merged
merged 30 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5d69292
job launcher v2 UI/UX
m00n620 Jul 20, 2023
7145a15
Merge branch 'develop' into feat/job-launcher-client-v2
m00n620 Jul 20, 2023
8252374
integrate sign in/sign up API
m00n620 Jul 20, 2023
37b89b1
UI cleanup, top-up, create-job API integration
m00n620 Jul 24, 2023
3f89d80
Merge branch 'develop' into feat/job-launcher-client-v2
m00n620 Jul 25, 2023
f7eca39
connect user balance api, forget password api, clean UI elements
m00n620 Jul 26, 2023
35ec911
Merge branch 'develop' into feat/job-launcher-client-v2
m00n620 Jul 27, 2023
d656a07
use rate api, add table component
m00n620 Jul 28, 2023
8c1a1f0
Merge branch 'develop' into feat/job-launcher-client-v2
m00n620 Aug 3, 2023
17e2fa5
clean up UI components
m00n620 Aug 3, 2023
ecaf22f
Merge branch 'develop' into feat/job-launcher-client-v2
m00n620 Aug 10, 2023
2210bc3
update auth endpoints
m00n620 Aug 11, 2023
1c07971
Merge branch 'develop' into feat/job-launcher-client-v2
m00n620 Aug 21, 2023
d04f18b
Merge branch 'develop' into feat/job-launcher-client-v2
m00n620 Aug 24, 2023
6d30085
fix auth flow
m00n620 Aug 25, 2023
39f4efb
Merge branch 'develop' into feat/job-launcher-client-v2
m00n620 Aug 27, 2023
1334cd1
fix fiat topup, fiat pay
m00n620 Aug 29, 2023
482f147
merge with develop
m00n620 Aug 29, 2023
ed35622
crypto top-up, pay with crypto, cvat job
m00n620 Aug 30, 2023
94e2054
Merge branch 'develop' into feat/job-launcher-client-v2
m00n620 Aug 30, 2023
1716042
job list endpoint, fix other details
m00n620 Aug 30, 2023
3d82a27
fix crypto pay form, number elements, job table loading
m00n620 Aug 31, 2023
eaf21e6
fix crypto pay form, fit pay form, job detail
m00n620 Sep 1, 2023
ff5b33c
Merge branch 'develop' into feat/job-launcher-client-v2
m00n620 Sep 1, 2023
2d8987b
job details
m00n620 Sep 1, 2023
1f2f91d
Added get details endpoint
eugenvoronov Sep 5, 2023
0ff3fe6
Added get transfer log and get paid amount methods
eugenvoronov Sep 6, 2023
1b20831
Added cvat job type
eugenvoronov Sep 6, 2023
13950ba
Merge branch 'feature/launcher/job-details' into feat/job-launcher-cl…
m00n620 Sep 6, 2023
bd8a2a0
integrate job details endpoint
m00n620 Sep 6, 2023
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
67 changes: 67 additions & 0 deletions packages/apps/job-launcher/client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"extends": [
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:prettier/recommended",
"react-app"
],
"settings": {
"import/resolver": {
"typescript": {},
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx", ".d.ts"]
}
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
}
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"rules": {
"no-console": "warn",
"no-unused-vars": "off",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"import/order": [
"error",
{
"pathGroups": [
{
"pattern": "~/**",
"group": "external"
}
],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"@typescript-eslint/no-unused-vars": ["error"],
"prettier/prettier": ["error"]
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"no-undef": "off"
}
}
],
"env": {
"browser": true,
"jest": true,
"node": true
}
}
9 changes: 9 additions & 0 deletions packages/apps/job-launcher/client/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2022 Metahuman Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 change: 1 addition & 0 deletions packages/apps/job-launcher/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Job Launcher Client
34 changes: 34 additions & 0 deletions packages/apps/job-launcher/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Human Protocol Job Launcher" />
<link rel="apple-touch-icon" href="/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700&display=swap"
/>
<title>Human Protocol Job Launcher</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
81 changes: 81 additions & 0 deletions packages/apps/job-launcher/client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"name": "@human-protocol/job-launcher-client",
"version": "1.0.0",
"description": "Job Launcher Client",
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@hcaptcha/react-hcaptcha": "^1.8.1",
"@human-protocol/core": "*",
"@human-protocol/sdk": "*",
"@mui/lab": "^5.0.0-alpha.141",
"@mui/material": "^5.11.7",
"@reduxjs/toolkit": "^1.9.5",
"@stripe/react-stripe-js": "^1.16.4",
"@stripe/stripe-js": "^1.46.0",
"axios": "^1.1.3",
"dayjs": "^1.11.9",
"ethers": "^5.7.2",
"formik": "^2.4.2",
"jwt-decode": "^3.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.1.1",
"react-router-dom": "^6.14.1",
"recharts": "^2.7.2",
"swr": "^2.2.2",
"typescript": "^4.9.3",
"wagmi": "^0.12.2",
"web-vitals": "^2.1.4",
"yup": "^1.2.0"
},
"scripts": {
"lint": "eslint \"**/*.{ts,tsx}\"",
"start": "vite --port 3005",
"build": "vite build",
"preview": "vite preview",
"start-prod": "serve -s build",
"test": "vitest run -u",
"format:prettier": "prettier --write \"**/*.{ts,tsx,js,jsx}\"",
"format:lint": "eslint --fix \"**/*.{ts,tsx,js,jsx}\"",
"format": "npm run format:prettier && npm run format:lint"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@types/react-test-renderer": "^18.0.0",
"@vitejs/plugin-react": "^3.1.0",
"eslint-config-react-app": "^7.0.1",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"happy-dom": "^8.9.0",
"identity-obj-proxy": "^3.0.0",
"jsdom": "^21.1.0",
"resize-observer-polyfill": "^1.5.1",
"vite": "^4.1.4",
"vite-plugin-node-polyfills": "^0.9.0",
"vitest": "^0.28.4"
},
"lint-staged": {
"*.{ts,tsx}": [
"prettier --write",
"eslint --fix"
]
}
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions packages/apps/job-launcher/client/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions packages/apps/job-launcher/client/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
71 changes: 71 additions & 0 deletions packages/apps/job-launcher/client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import React from 'react';
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
import { ProtectedRoute } from './components/ProtectedRoute';
import Layout from './layouts';
import Dashboard from './pages/Dashboard';
import ForgotPassword from './pages/ForgotPassword';
import Home from './pages/Home';
import CreateJob from './pages/Job/CreateJob';
import JobDetail from './pages/Job/JobDetail';
import JobList from './pages/Job/JobList';
import TopUpAccount from './pages/Profile/TopUpAccount';
import ResetPassword from './pages/ResetPassword';
import VerifyEmail from './pages/VerifyEmail';

import './index.css';

export default function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<Home />} />
<Route path="/verify" element={<VerifyEmail />} />
<Route path="/forgot-password" element={<ForgotPassword />} />
<Route path="/reset-password" element={<ResetPassword />} />
<Route
path="dashboard"
element={
<ProtectedRoute>
<Dashboard />
</ProtectedRoute>
}
/>
<Route
path="jobs/create"
element={
<ProtectedRoute>
<CreateJob />
</ProtectedRoute>
}
/>
<Route
path="jobs/details/:jobId"
element={
<ProtectedRoute>
<JobDetail />
</ProtectedRoute>
}
/>
<Route
path="jobs/:status"
element={
<ProtectedRoute>
<JobList />
</ProtectedRoute>
}
/>
<Route
path="/profile/top-up"
element={
<ProtectedRoute>
<TopUpAccount />
</ProtectedRoute>
}
/>
<Route path="*" element={<Navigate to="/" />} />
</Route>
</Routes>
</BrowserRouter>
);
}
11 changes: 11 additions & 0 deletions packages/apps/job-launcher/client/src/assets/CreditCardFilled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions packages/apps/job-launcher/client/src/assets/Plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions packages/apps/job-launcher/client/src/assets/coinbase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading