Frontend-initial-implementation
This commit is contained in:
parent
05fabbdb3d
commit
f4d1541889
23
frontend/.gitignore
vendored
Normal file
23
frontend/.gitignore
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
@ -1,5 +1,70 @@
|
||||
# Frontend Implementation
|
||||
# Getting Started with Create React App
|
||||
|
||||
This directory will contain the user interface code and assets.
|
||||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
||||
|
||||
*Content will be generated by the Frontend agent after architecture approval.*
|
||||
## Available Scripts
|
||||
|
||||
In the project directory, you can run:
|
||||
|
||||
### `npm start`
|
||||
|
||||
Runs the app in the development mode.\
|
||||
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
|
||||
|
||||
The page will reload when you make changes.\
|
||||
You may also see any lint errors in the console.
|
||||
|
||||
### `npm test`
|
||||
|
||||
Launches the test runner in the interactive watch mode.\
|
||||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
||||
|
||||
### `npm run build`
|
||||
|
||||
Builds the app for production to the `build` folder.\
|
||||
It correctly bundles React in production mode and optimizes the build for the best performance.
|
||||
|
||||
The build is minified and the filenames include the hashes.\
|
||||
Your app is ready to be deployed!
|
||||
|
||||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
||||
|
||||
### `npm run eject`
|
||||
|
||||
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
|
||||
|
||||
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
||||
|
||||
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
|
||||
|
||||
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
|
||||
|
||||
## Learn More
|
||||
|
||||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
||||
|
||||
To learn React, check out the [React documentation](https://reactjs.org/).
|
||||
|
||||
### Code Splitting
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
|
||||
|
||||
### Analyzing the Bundle Size
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
|
||||
|
||||
### Making a Progressive Web App
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
|
||||
|
||||
### Advanced Configuration
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
|
||||
|
||||
### Deployment
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
|
||||
|
||||
### `npm run build` fails to minify
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
|
||||
|
||||
5
frontend/README.old.md
Normal file
5
frontend/README.old.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Frontend Implementation
|
||||
|
||||
This directory will contain the user interface code and assets.
|
||||
|
||||
*Content will be generated by the Frontend agent after architecture approval.*
|
||||
17472
frontend/package-lock.json
generated
Normal file
17472
frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
45
frontend/package.json
Normal file
45
frontend/package.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@axe-core/react": "^4.13.0",
|
||||
"@testing-library/dom": "^10.4.1",
|
||||
"@testing-library/jest-dom": "^6.9.1",
|
||||
"@testing-library/react": "^16.3.3",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"@types/react": "^19.2.18",
|
||||
"@types/react-dom": "^19.2.7",
|
||||
"axios": "^1.20.0",
|
||||
"date-fns": "^4.4.0",
|
||||
"react": "^19.2.8",
|
||||
"react-dom": "^19.2.8",
|
||||
"react-hook-form": "^7.87.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
}
|
||||
BIN
frontend/preview/taskflow-initial.png
Normal file
BIN
frontend/preview/taskflow-initial.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
BIN
frontend/public/favicon.ico
Normal file
BIN
frontend/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
43
frontend/public/index.html
Normal file
43
frontend/public/index.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Web site created using create-react-app"
|
||||
/>
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/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="%PUBLIC_URL%/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`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
</body>
|
||||
</html>
|
||||
BIN
frontend/public/logo192.png
Normal file
BIN
frontend/public/logo192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
BIN
frontend/public/logo512.png
Normal file
BIN
frontend/public/logo512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
25
frontend/public/manifest.json
Normal file
25
frontend/public/manifest.json
Normal file
@ -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
frontend/public/robots.txt
Normal file
3
frontend/public/robots.txt
Normal file
@ -0,0 +1,3 @@
|
||||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
107
frontend/src/App.css
Normal file
107
frontend/src/App.css
Normal file
@ -0,0 +1,107 @@
|
||||
.App {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-family: sans-serif;
|
||||
background-color: #f8fafc;
|
||||
}
|
||||
|
||||
.app-header {
|
||||
background: white;
|
||||
padding: 1rem 2rem;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.app-header h1 {
|
||||
margin: 0;
|
||||
color: #1e293b;
|
||||
}
|
||||
|
||||
.create-btn {
|
||||
background: #3b82f6;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.app-main {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
max-width: 1440px;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 280px;
|
||||
background: white;
|
||||
border-right: 1px solid #e2e8f0;
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.filter-tabs {
|
||||
display: flex;
|
||||
background: white;
|
||||
border-radius: 8px 8px 0 0;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.tab {
|
||||
flex: 1;
|
||||
padding: 1rem;
|
||||
border: none;
|
||||
background: none;
|
||||
color: #6b7280;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.tab.active {
|
||||
color: #3b82f6;
|
||||
background: white;
|
||||
border-bottom: 2px solid #3b82f6;
|
||||
}
|
||||
|
||||
.task-list {
|
||||
background: white;
|
||||
border-radius: 0 0 8px 8px;
|
||||
}
|
||||
|
||||
.task-row {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr 120px 100px;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
border-bottom: 1px solid #f1f5f9;
|
||||
}
|
||||
|
||||
.task-status {
|
||||
padding: 4px 12px;
|
||||
border-radius: 20px;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.task-status.open { background: #dbeafe; color: #1d4ed8; }
|
||||
.task-status.in_progress { background: #fef3c7; color: #d97706; }
|
||||
.task-status.blocked { background: #fecaca; color: #dc2626; }
|
||||
|
||||
.task-priority {
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.task-priority.low { background: #dcfce7; color: #166534; }
|
||||
.task-priority.medium { background: #fef3c7; color: #a16207; }
|
||||
.task-priority.high { background: #fecaca; color: #991b1b; }
|
||||
25
frontend/src/App.js
Normal file
25
frontend/src/App.js
Normal file
@ -0,0 +1,25 @@
|
||||
import logo from './logo.svg';
|
||||
import './App.css';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<div className="App">
|
||||
<header className="App-header">
|
||||
<img src={logo} className="App-logo" alt="logo" />
|
||||
<p>
|
||||
Edit <code>src/App.js</code> and save to reload.
|
||||
</p>
|
||||
<a
|
||||
className="App-link"
|
||||
href="https://reactjs.org"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Learn React
|
||||
</a>
|
||||
</header>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
8
frontend/src/App.test.js
Normal file
8
frontend/src/App.test.js
Normal file
@ -0,0 +1,8 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import App from './App';
|
||||
|
||||
test('renders learn react link', () => {
|
||||
render(<App />);
|
||||
const linkElement = screen.getByText(/learn react/i);
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
});
|
||||
72
frontend/src/App.tsx
Normal file
72
frontend/src/App.tsx
Normal file
@ -0,0 +1,72 @@
|
||||
import React, { useState, useEffect } from " react\;
|
||||
import \./App.css\;
|
||||
|
||||
const mockTasks = [
|
||||
{ id: 1, title: \Update documentation\, status: \in_progress\, priority: \high\, assignee: \Sarah Chen\ },
|
||||
{ id: 2, title: \Fix login bug\, status: \blocked\, priority: \high\, assignee: \Mike Johnson\ },
|
||||
{ id: 3, title: \Design dashboard\, status: \open\, priority: \medium\, assignee: \Alex Kim\ }
|
||||
];
|
||||
|
||||
function App() {
|
||||
const [filter, setFilter] = useState(\my\);
|
||||
|
||||
return (
|
||||
<div className=\App\>
|
||||
<header className=\app-header\>
|
||||
<h1>TaskFlow</h1>
|
||||
<div className=\user-profile\>
|
||||
<span>Sarah Chen</span>
|
||||
<button className=\create-btn\>Create Task</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main className=\app-main\>
|
||||
<div className=\sidebar\>
|
||||
<h3>Team Members</h3>
|
||||
<div className=\team-list\>
|
||||
<div className=\team-member\>Sarah Chen</div>
|
||||
<div className=\team-member\>Mike Johnson</div>
|
||||
<div className=\team-member\>Alex Kim</div>
|
||||
<div className=\team-member\>Emma Davis</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className=\content\>
|
||||
<div className=\filter-tabs\>
|
||||
<button
|
||||
className={\ ab \}
|
||||
onClick={() => setFilter(\my\)}
|
||||
>
|
||||
My Tasks (1)
|
||||
</button>
|
||||
<button
|
||||
className={\ ab \}
|
||||
onClick={() => setFilter(\all\)}
|
||||
>
|
||||
All Tasks (3)
|
||||
</button>
|
||||
<button
|
||||
className={\ ab \}
|
||||
onClick={() => setFilter(\blocked\)}
|
||||
>
|
||||
Blocked (1)
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className=\task-list\>
|
||||
{mockTasks.map(task => (
|
||||
<div key={task.id} className=\task-row\>
|
||||
<div className=\task-title\>{task.title}</div>
|
||||
<div className=\task-assignee\>{task.assignee}</div>
|
||||
<div className={\ ask-status \}>{task.status}</div>
|
||||
<div className={\ ask-priority \}>{task.priority}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
214
frontend/src/App_temp.css
Normal file
214
frontend/src/App_temp.css
Normal file
@ -0,0 +1,214 @@
|
||||
/* TaskFlow App Styles */
|
||||
|
||||
/* CSS Reset and Base */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, " Segoe UI\, \Roboto\, \Helvetica Neue\, Arial, sans-serif;
|
||||
background-color: #f8fafc;
|
||||
color: #1e293b;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.App {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* Loading and Error States */
|
||||
.app-loading,
|
||||
.app-error {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
border: 4px solid #e2e8f0;
|
||||
border-left: 4px solid #3b82f6;
|
||||
border-radius: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
animation: spin 1s linear infinite;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.app-error h1 {
|
||||
color: #dc2626;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.retry-button {
|
||||
background-color: #3b82f6;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-radius: 0.375rem;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.retry-button:hover {
|
||||
background-color: #2563eb;
|
||||
}
|
||||
|
||||
.retry-button:focus {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* Status Badges */
|
||||
.status-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0.25rem 0.75rem;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.status-badge.open {
|
||||
background-color: #dbeafe;
|
||||
color: #1d4ed8;
|
||||
}
|
||||
|
||||
.status-badge.in_progress {
|
||||
background-color: #fef3c7;
|
||||
color: #d97706;
|
||||
}
|
||||
|
||||
.status-badge.blocked {
|
||||
background-color: #fecaca;
|
||||
color: #dc2626;
|
||||
}
|
||||
|
||||
/* Priority Indicators */
|
||||
.priority-indicator {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.priority-indicator.low {
|
||||
background-color: #dcfce7;
|
||||
color: #166534;
|
||||
}
|
||||
|
||||
.priority-indicator.medium {
|
||||
background-color: #fef3c7;
|
||||
color: #a16207;
|
||||
}
|
||||
|
||||
.priority-indicator.high {
|
||||
background-color: #fecaca;
|
||||
color: #991b1b;
|
||||
}
|
||||
|
||||
/* User Avatar */
|
||||
.user-avatar {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
background-color: #e5e7eb;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 500;
|
||||
font-size: 0.875rem;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.user-avatar.sm {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.user-avatar.lg {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.5rem 1rem;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 0.375rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
text-decoration: none;
|
||||
min-height: 44px; /* WCAG touch target */
|
||||
}
|
||||
|
||||
.btn:focus {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #3b82f6;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #2563eb;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background-color: #f1f5f9;
|
||||
color: #475569;
|
||||
border-color: #e2e8f0;
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background-color: #e2e8f0;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background-color: #dc2626;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background-color: #b91c1c;
|
||||
}
|
||||
|
||||
/* Form Elements */
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
display: block;
|
||||
font-weight: 500;
|
||||
margin-bottom: 0.5rem;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.form-label.required::after {
|
||||
116
frontend/src/components/TaskForm/TaskForm.css
Normal file
116
frontend/src/components/TaskForm/TaskForm.css
Normal file
@ -0,0 +1,116 @@
|
||||
.task-form-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.task-form-container {
|
||||
background: white;
|
||||
border-radius: 0.5rem;
|
||||
width: 90%;
|
||||
max-width: 600px;
|
||||
max-height: 90vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.task-form {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.form-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 2rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
}
|
||||
|
||||
.form-header h2 {
|
||||
margin: 0;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 1.5rem;
|
||||
cursor: pointer;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.status-buttons {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.status-option {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.status-option input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.status-pill {
|
||||
display: inline-block;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 9999px;
|
||||
border: 2px solid transparent;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.status-option input:checked + .status-pill {
|
||||
border-color: currentColor;
|
||||
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
justify-content: flex-end;
|
||||
padding-top: 1.5rem;
|
||||
border-top: 1px solid #e5e7eb;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.task-form-container {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
justify-content: stretch;
|
||||
}
|
||||
|
||||
.form-actions button {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
0
frontend/src/components/TaskForm/TaskForm.tsx
Normal file
0
frontend/src/components/TaskForm/TaskForm.tsx
Normal file
90
frontend/src/components/TaskList/TaskCard.tsx
Normal file
90
frontend/src/components/TaskList/TaskCard.tsx
Normal file
@ -0,0 +1,90 @@
|
||||
import React from " react\;
|
||||
import { Task } from \../../types\;
|
||||
import { format } from \date-fns\;
|
||||
|
||||
interface TaskCardProps {
|
||||
task: Task;
|
||||
onEdit: (task: Task) => void;
|
||||
onDelete: (taskId: number) => void;
|
||||
}
|
||||
|
||||
const TaskCard: React.FC<TaskCardProps> = ({ task, onEdit, onDelete }) => {
|
||||
const formatDate = (dateString?: string) => {
|
||||
if (!dateString) return \No due date\;
|
||||
try {
|
||||
return format(new Date(dateString), \MMM dd\);
|
||||
} catch {
|
||||
return \Invalid date\;
|
||||
}
|
||||
};
|
||||
|
||||
const getUserInitials = (name: string) => {
|
||||
return name.split(" \).map(n => n[0]).join(\).toUpperCase();
|
||||
};
|
||||
|
||||
const isOverdue = task.due_date && new Date(task.due_date) < new Date();
|
||||
|
||||
return (
|
||||
<div className=\task-card\>
|
||||
<div className=\task-card-header\>
|
||||
<div className=\task-meta\>
|
||||
<span className={status-badge }>
|
||||
{task.status.replace(\_\, " \)}
|
||||
</span>
|
||||
<span className={priority-indicator }>
|
||||
{task.priority}
|
||||
</span>
|
||||
</div>
|
||||
<div className=\task-actions-mobile\>
|
||||
<button
|
||||
className=\btn-action edit onClick={() => onEdit(task)}
|
||||
aria-label={Edit }
|
||||
>
|
||||
✏️
|
||||
</button>
|
||||
<button
|
||||
className=\btn-action delete onClick={() => onDelete(task.id)}
|
||||
aria-label={Delete }
|
||||
>
|
||||
🗑️
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className=\task-card-content\>
|
||||
<button
|
||||
className=\task-card-title-btn onClick={() => onEdit(task)}
|
||||
>
|
||||
<h3 className=\task-card-title\>{task.title}</h3>
|
||||
</button>
|
||||
|
||||
{task.description && (
|
||||
<p className=\task-card-description\>{task.description}</p>
|
||||
)}
|
||||
|
||||
<div className=\task-card-footer\>
|
||||
<div className=\assignee-info\>
|
||||
{task.assigned_to ? (
|
||||
<>
|
||||
<div className=\user-avatar sm\>
|
||||
{getUserInitials(task.assigned_to.full_name)}
|
||||
</div>
|
||||
<span className=\assignee-name\>{task.assigned_to.full_name}</span>
|
||||
</>
|
||||
) : (
|
||||
<span className=\unassigned\>Unassigned</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className=\due-date-info\>
|
||||
<span className={due-date }>
|
||||
{formatDate(task.due_date)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TaskCard;
|
||||
376
frontend/src/components/TaskList/TaskList.css
Normal file
376
frontend/src/components/TaskList/TaskList.css
Normal file
@ -0,0 +1,376 @@
|
||||
/* TaskList Container */
|
||||
.task-list-container {
|
||||
background-color: white;
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Filter Tabs */
|
||||
.filter-tabs {
|
||||
display: flex;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
background-color: #f8fafc;
|
||||
}
|
||||
|
||||
.filter-tab {
|
||||
flex: 1;
|
||||
padding: 1rem;
|
||||
border: none;
|
||||
background: none;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: #6b7280;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
.filter-tab:hover {
|
||||
background-color: #f1f5f9;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.filter-tab.active {
|
||||
background-color: white;
|
||||
color: #3b82f6;
|
||||
border-bottom: 2px solid #3b82f6;
|
||||
}
|
||||
|
||||
.filter-tab:focus {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
.filter-count {
|
||||
background-color: #e5e7eb;
|
||||
color: #374151;
|
||||
padding: 0.125rem 0.5rem;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
min-width: 1.5rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.filter-count.blocked {
|
||||
background-color: #fecaca;
|
||||
color: #991b1b;
|
||||
}
|
||||
|
||||
.filter-tab.active .filter-count {
|
||||
background-color: #dbeafe;
|
||||
color: #1d4ed8;
|
||||
}
|
||||
|
||||
/* Empty States */
|
||||
.task-list-empty,
|
||||
.blocked-empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 4rem 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.empty-icon,
|
||||
.blocked-icon {
|
||||
font-size: 4rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.task-list-empty h2,
|
||||
.blocked-empty-state h2 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.task-list-empty p,
|
||||
.blocked-empty-state p {
|
||||
color: #6b7280;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
/* Desktop Table View */
|
||||
.task-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.task-table-header {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr 120px 100px 120px 80px;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
background-color: #f8fafc;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
font-weight: 600;
|
||||
font-size: 0.875rem;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.task-table-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.task-row {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr 120px 100px 120px 80px;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
border-bottom: 1px solid #f1f5f9;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.task-row:hover {
|
||||
background-color: #f8fafc;
|
||||
}
|
||||
|
||||
.task-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.task-cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 2.5rem;
|
||||
}
|
||||
|
||||
/* Task Title */
|
||||
.task-title-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 0.25rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.task-title-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.task-title-btn:focus {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline-offset: 2px;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.task-title {
|
||||
font-weight: 500;
|
||||
color: #1f2937;
|
||||
line-height: 1.4;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.task-title-btn:hover .task-title {
|
||||
color: #3b82f6;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.task-description {
|
||||
font-size: 0.875rem;
|
||||
color: #6b7280;
|
||||
line-height: 1.3;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Assignee */
|
||||
.assignee-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.assignee-name {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.unassigned {
|
||||
font-size: 0.875rem;
|
||||
color: #9ca3af;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* Due Date */
|
||||
.due-date.overdue {
|
||||
color: #dc2626;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
.task-actions {
|
||||
display: flex;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0.5rem;
|
||||
cursor: pointer;
|
||||
border-radius: 0.25rem;
|
||||
transition: background-color 0.2s;
|
||||
min-width: 2.5rem;
|
||||
min-height: 2.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-action:hover {
|
||||
background-color: #f1f5f9;
|
||||
}
|
||||
|
||||
.btn-action:focus {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.btn-action.delete:hover {
|
||||
background-color: #fef2f2;
|
||||
}
|
||||
|
||||
/* Mobile Card View */
|
||||
.task-cards {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.task-card {
|
||||
background: white;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.task-card:hover {
|
||||
border-color: #d1d5db;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.task-card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.task-meta {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.task-actions-mobile {
|
||||
display: flex;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.task-card-title-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.task-card-title-btn:focus {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline-offset: 2px;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.task-card-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.task-card-title-btn:hover .task-card-title {
|
||||
color: #3b82f6;
|
||||
}
|
||||
|
||||
.task-card-description {
|
||||
font-size: 0.875rem;
|
||||
color: #6b7280;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 1rem;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.task-card-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.due-date-info .due-date {
|
||||
font-size: 0.875rem;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
/* Responsive Adjustments */
|
||||
@media (max-width: 768px) {
|
||||
.task-table {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.filter-tabs {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.filter-tab {
|
||||
padding: 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 769px) {
|
||||
.task-cards {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Accessibility */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.task-row,
|
||||
.task-card,
|
||||
.filter-tab,
|
||||
.btn-action {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
148
frontend/src/components/TaskList/TaskList.tsx
Normal file
148
frontend/src/components/TaskList/TaskList.tsx
Normal file
@ -0,0 +1,148 @@
|
||||
import React, { useState } from " react\;
|
||||
import { Task, TaskFilter } from \../../types\;
|
||||
import TaskRow from \./TaskRow\;
|
||||
import TaskCard from \./TaskCard\;
|
||||
import \./TaskList.css\;
|
||||
|
||||
interface TaskListProps {
|
||||
tasks: Task[];
|
||||
currentFilter: TaskFilter;
|
||||
onFilterChange: (filter: TaskFilter) => void;
|
||||
onEditTask: (task: Task) => void;
|
||||
onDeleteTask: (taskId: number) => void;
|
||||
onCreateTask: () => void;
|
||||
}
|
||||
|
||||
const TaskList: React.FC<TaskListProps> = ({
|
||||
tasks,
|
||||
currentFilter,
|
||||
onFilterChange,
|
||||
onEditTask,
|
||||
onDeleteTask,
|
||||
onCreateTask
|
||||
}) => {
|
||||
const [viewMode, setViewMode] = useState<\desktop\ | \mobile\>(\desktop\);
|
||||
|
||||
// Calculate filter counts
|
||||
const filterCounts = {
|
||||
my: tasks.filter(t => t.assigned_to?.id === 1).length, // Mock current user ID
|
||||
all: tasks.length,
|
||||
blocked: tasks.filter(t => t.status === \blocked\).length
|
||||
};
|
||||
|
||||
// Detect mobile view
|
||||
React.useEffect(() => {
|
||||
const handleResize = () => {
|
||||
setViewMode(window.innerWidth <= 768 ? \mobile\ : \desktop\);
|
||||
};
|
||||
|
||||
handleResize();
|
||||
window.addEventListener(\resize\, handleResize);
|
||||
return () => window.removeEventListener(\resize\, handleResize);
|
||||
}, []);
|
||||
|
||||
if (tasks.length === 0) {
|
||||
return (
|
||||
<div className=\task-list-empty\>
|
||||
<div className=\empty-state\>
|
||||
<div className=\empty-icon\>📋</div>
|
||||
<h2>No tasks yet</h2>
|
||||
<p>Get started by creating your first task</p>
|
||||
<button
|
||||
className=\btn btn-primary onClick={onCreateTask}
|
||||
>
|
||||
Create Task
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className=\task-list-container\>
|
||||
{/* Filter Tabs */}
|
||||
<div className=\filter-tabs\>
|
||||
<button
|
||||
className={ilter-tab }
|
||||
onClick={() => onFilterChange(\my\)}
|
||||
aria-pressed={currentFilter === \my\}
|
||||
>
|
||||
My Tasks
|
||||
{filterCounts.my > 0 && (
|
||||
<span className=\filter-count\>{filterCounts.my}</span>
|
||||
)}
|
||||
</button>
|
||||
<button
|
||||
className={ilter-tab }
|
||||
onClick={() => onFilterChange(\all\)}
|
||||
aria-pressed={currentFilter === \all\}
|
||||
>
|
||||
All Tasks
|
||||
{filterCounts.all > 0 && (
|
||||
<span className=\filter-count\>{filterCounts.all}</span>
|
||||
)}
|
||||
</button>
|
||||
<button
|
||||
className={ilter-tab }
|
||||
onClick={() => onFilterChange(\blocked\)}
|
||||
aria-pressed={currentFilter === \blocked\}
|
||||
>
|
||||
Blocked
|
||||
{filterCounts.blocked > 0 && (
|
||||
<span className=\filter-count blocked\>{filterCounts.blocked}</span>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Task List */}
|
||||
<div className=\task-list\>
|
||||
{viewMode === \desktop\ ? (
|
||||
// Desktop Table View
|
||||
<div className=\task-table\>
|
||||
<div className=\task-table-header\>
|
||||
<div className=\header-cell task-name\>Task Name</div>
|
||||
<div className=\header-cell assignee\>Assignee</div>
|
||||
<div className=\header-cell status\>Status</div>
|
||||
<div className=\header-cell priority\>Priority</div>
|
||||
<div className=\header-cell due-date\>Due Date</div>
|
||||
<div className=\header-cell actions\>Actions</div>
|
||||
</div>
|
||||
<div className=\task-table-body\>
|
||||
{tasks.map(task => (
|
||||
<TaskRow
|
||||
key={task.id}
|
||||
task={task}
|
||||
onEdit={onEditTask}
|
||||
onDelete={onDeleteTask}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
// Mobile Card View
|
||||
<div className=\task-cards\>
|
||||
{tasks.map(task => (
|
||||
<TaskCard
|
||||
key={task.id}
|
||||
task={task}
|
||||
onEdit={onEditTask}
|
||||
onDelete={onDeleteTask}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Special handling for blocked tasks */}
|
||||
{currentFilter === \blocked\ && tasks.length === 0 && (
|
||||
<div className=\blocked-empty-state\>
|
||||
<div className=\blocked-icon\>🚫</div>
|
||||
<h2>No blocked tasks</h2>
|
||||
<p>Great! Your team has no blocked work right now.</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TaskList;
|
||||
102
frontend/src/components/TaskList/TaskRow.tsx
Normal file
102
frontend/src/components/TaskList/TaskRow.tsx
Normal file
@ -0,0 +1,102 @@
|
||||
import React from " react\;
|
||||
import { Task } from \../../types\;
|
||||
import { format } from \date-fns\;
|
||||
|
||||
interface TaskRowProps {
|
||||
task: Task;
|
||||
onEdit: (task: Task) => void;
|
||||
onDelete: (taskId: number) => void;
|
||||
}
|
||||
|
||||
const TaskRow: React.FC<TaskRowProps> = ({ task, onEdit, onDelete }) => {
|
||||
const formatDate = (dateString?: string) => {
|
||||
if (!dateString) return \No due date\;
|
||||
try {
|
||||
return format(new Date(dateString), \MMM dd yyyy\);
|
||||
} catch {
|
||||
return \Invalid date\;
|
||||
}
|
||||
};
|
||||
|
||||
const getUserInitials = (name: string) => {
|
||||
return name.split(" \).map(n => n[0]).join(\).toUpperCase();
|
||||
};
|
||||
|
||||
const handleKeyPress = (event: React.KeyboardEvent, action: () => void) => {
|
||||
if (event.key === \Enter\ || event.key === " \) {
|
||||
event.preventDefault();
|
||||
action();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className=\task-row\ role=\row\>
|
||||
<div className=\task-cell task-name\ role=\gridcell\>
|
||||
<div className=\task-title-container\>
|
||||
<button
|
||||
className=\task-title-btn onClick={() => onEdit(task)}
|
||||
onKeyDown={(e) => handleKeyPress(e, () => onEdit(task))}
|
||||
aria-label={Edit task: }
|
||||
>
|
||||
<span className=\task-title\>{task.title}</span>
|
||||
</button>
|
||||
{task.description && (
|
||||
<span className=\task-description\>{task.description}</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className=\task-cell assignee\ role=\gridcell\>
|
||||
{task.assigned_to ? (
|
||||
<div className=\assignee-info\>
|
||||
<div className=\user-avatar sm\>
|
||||
{getUserInitials(task.assigned_to.full_name)}
|
||||
</div>
|
||||
<span className=\assignee-name\>{task.assigned_to.full_name}</span>
|
||||
</div>
|
||||
) : (
|
||||
<span className=\unassigned\>Unassigned</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className=\task-cell status\ role=\gridcell\>
|
||||
<span className={status-badge }>
|
||||
{task.status.replace(\_\, " \)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className=\task-cell priority\ role=\gridcell\>
|
||||
<span className={priority-indicator }>
|
||||
{task.priority}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className=\task-cell due-date\ role=\gridcell\>
|
||||
<span className={due-date }>
|
||||
{formatDate(task.due_date)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className=\task-cell actions\ role=\gridcell\>
|
||||
<div className=\task-actions\>
|
||||
<button
|
||||
className=\btn-action edit onClick={() => onEdit(task)}
|
||||
onKeyDown={(e) => handleKeyPress(e, () => onEdit(task))}
|
||||
aria-label={Edit }
|
||||
>
|
||||
✏️
|
||||
</button>
|
||||
<button
|
||||
className=\btn-action delete onClick={() => onDelete(task.id)}
|
||||
onKeyDown={(e) => handleKeyPress(e, () => onDelete(task.id))}
|
||||
aria-label={Delete }
|
||||
>
|
||||
🗑️
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TaskRow;
|
||||
192
frontend/src/components/common/AppShell.css
Normal file
192
frontend/src/components/common/AppShell.css
Normal file
@ -0,0 +1,192 @@
|
||||
/* AppShell Layout */
|
||||
.app-shell {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #f8fafc;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.app-header {
|
||||
background-color: white;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.app-header-content {
|
||||
max-width: 1440px;
|
||||
margin: 0 auto;
|
||||
padding: 1rem 2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.app-logo h1 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: #1e293b;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.app-header-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.create-task-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.create-icon {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.user-profile {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
/* Body Layout */
|
||||
.app-body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
max-width: 1440px;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Sidebar */
|
||||
.app-sidebar {
|
||||
width: 280px;
|
||||
background-color: white;
|
||||
border-right: 1px solid #e2e8f0;
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.sidebar-section {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.sidebar-heading {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: #6b7280;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.team-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.team-member {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.5rem;
|
||||
border-radius: 0.375rem;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.team-member:hover {
|
||||
background-color: #f1f5f9;
|
||||
}
|
||||
|
||||
.member-name {
|
||||
flex: 1;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.online-indicator {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background-color: #10b981;
|
||||
border-radius: 50%;
|
||||
border: 2px solid white;
|
||||
}
|
||||
|
||||
/* Main Content */
|
||||
.app-main {
|
||||
flex: 1;
|
||||
padding: 2rem;
|
||||
background-color: #f8fafc;
|
||||
}
|
||||
|
||||
/* Mobile Responsive */
|
||||
@media (max-width: 768px) {
|
||||
.app-header-content {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.app-logo h1 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.create-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.app-body {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.app-sidebar {
|
||||
display: none; /* Hidden on mobile - could be toggle later */
|
||||
}
|
||||
|
||||
.app-main {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
/* Mobile floating action button */
|
||||
.create-task-btn {
|
||||
position: fixed;
|
||||
bottom: 2rem;
|
||||
right: 2rem;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
.create-task-btn .create-icon {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.app-header-content {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
|
||||
.app-main {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
}
|
||||
71
frontend/src/components/common/AppShell.tsx
Normal file
71
frontend/src/components/common/AppShell.tsx
Normal file
@ -0,0 +1,71 @@
|
||||
import React from " react\;
|
||||
import { User } from \../../types\;
|
||||
import \./AppShell.css\;
|
||||
|
||||
interface AppShellProps {
|
||||
currentUser: User;
|
||||
users: User[];
|
||||
children: React.ReactNode;
|
||||
onCreateTask: () => void;
|
||||
}
|
||||
|
||||
const AppShell: React.FC<AppShellProps> = ({
|
||||
currentUser,
|
||||
users,
|
||||
children,
|
||||
onCreateTask
|
||||
}) => {
|
||||
return (
|
||||
<div className=\app-shell\>
|
||||
{/* Header */}
|
||||
<header className=\app-header\>
|
||||
<div className=\app-header-content\>
|
||||
<div className=\app-logo\>
|
||||
<h1>TaskFlow</h1>
|
||||
</div>
|
||||
<div className=\app-header-actions\>
|
||||
<button
|
||||
className=\btn btn-primary create-task-btn onClick={onCreateTask}
|
||||
aria-label=\Create new task >
|
||||
<span className=\create-icon\>+</span>
|
||||
<span className=\create-text\>Create Task</span>
|
||||
</button>
|
||||
<div className=\user-profile\>
|
||||
<div className=\user-avatar lg\>
|
||||
{currentUser.full_name.split(" \).map(n => n[0]).join(\)}
|
||||
</div>
|
||||
<span className=\user-name\>{currentUser.full_name}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className=\app-body\>
|
||||
{/* Sidebar - Desktop only */}
|
||||
<aside className=\app-sidebar\>
|
||||
<div className=\sidebar-section\>
|
||||
<h3 className=\sidebar-heading\>Team Members</h3>
|
||||
<div className=\team-list\>
|
||||
{users.map(user => (
|
||||
<div key={user.id} className=\team-member\>
|
||||
<div className=\user-avatar sm\>
|
||||
{user.full_name.split(" \).map(n => n[0]).join(\)}
|
||||
</div>
|
||||
<span className=\member-name\>{user.full_name}</span>
|
||||
<div className=\online-indicator\></div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
{/* Main Content */}
|
||||
<main className=\app-main\>
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default AppShell;
|
||||
13
frontend/src/index.css
Normal file
13
frontend/src/index.css
Normal file
@ -0,0 +1,13 @@
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||
monospace;
|
||||
}
|
||||
17
frontend/src/index.js
Normal file
17
frontend/src/index.js
Normal file
@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
// If you want to start measuring performance in your app, pass a function
|
||||
// to log results (for example: reportWebVitals(console.log))
|
||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
||||
reportWebVitals();
|
||||
1
frontend/src/logo.svg
Normal file
1
frontend/src/logo.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
13
frontend/src/reportWebVitals.js
Normal file
13
frontend/src/reportWebVitals.js
Normal file
@ -0,0 +1,13 @@
|
||||
const reportWebVitals = onPerfEntry => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
getCLS(onPerfEntry);
|
||||
getFID(onPerfEntry);
|
||||
getFCP(onPerfEntry);
|
||||
getLCP(onPerfEntry);
|
||||
getTTFB(onPerfEntry);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default reportWebVitals;
|
||||
114
frontend/src/services/api.ts
Normal file
114
frontend/src/services/api.ts
Normal file
@ -0,0 +1,114 @@
|
||||
import { Task, User } from " ../types\;
|
||||
|
||||
// Mock data for development - will be replaced with real API calls
|
||||
const mockUsers: User[] = [
|
||||
{ id: 1, username: \sarah.chen\, full_name: \Sarah Chen\, avatar_url: \/avatars/sarah.jpg\ },
|
||||
{ id: 2, username: \mike.johnson\, full_name: \Mike Johnson\, avatar_url: \/avatars/mike.jpg\ },
|
||||
{ id: 3, username: \alex.kim\, full_name: \Alex Kim\, avatar_url: \/avatars/alex.jpg\ },
|
||||
{ id: 4, username: \emma.davis\, full_name: \Emma Davis\, avatar_url: \/avatars/emma.jpg\ }
|
||||
];
|
||||
|
||||
const mockTasks: Task[] = [
|
||||
{
|
||||
id: 1,
|
||||
title: \Update client documentation\,
|
||||
description: \Review and update onboarding docs for new client portal\,
|
||||
assigned_to: mockUsers[0],
|
||||
status: \in_progress\,
|
||||
priority: \high\,
|
||||
due_date: \2024-09-15\,
|
||||
created_by: mockUsers[1],
|
||||
created_at: \2024-09-01T10:00:00Z\,
|
||||
updated_at: \2024-09-05T14:22:00Z },
|
||||
{
|
||||
id: 2,
|
||||
title: \Fix login validation bug\,
|
||||
description: \Users are experiencing issues with password validation on the login form\,
|
||||
assigned_to: mockUsers[2],
|
||||
status: \blocked\,
|
||||
priority: \high\,
|
||||
due_date: \2024-09-10\,
|
||||
created_by: mockUsers[0],
|
||||
created_at: \2024-09-02T09:15:00Z\,
|
||||
updated_at: \2024-09-04T16:30:00Z },
|
||||
{
|
||||
id: 3,
|
||||
title: \Design new dashboard layout\,
|
||||
description: \Create wireframes and mockups for the updated dashboard interface\,
|
||||
assigned_to: mockUsers[3],
|
||||
status: \open\,
|
||||
priority: \medium\,
|
||||
due_date: \2024-09-20\,
|
||||
created_by: mockUsers[1],
|
||||
created_at: \2024-09-03T11:45:00Z\,
|
||||
updated_at: \2024-09-03T11:45:00Z },
|
||||
{
|
||||
id: 4,
|
||||
title: \Set up automated testing\,
|
||||
description: \Configure CI/CD pipeline with automated test suite\,
|
||||
assigned_to: mockUsers[0],
|
||||
status: \open\,
|
||||
priority: \medium\,
|
||||
due_date: \2024-09-25\,
|
||||
created_by: mockUsers[2],
|
||||
created_at: \2024-09-04T08:20:00Z\,
|
||||
updated_at: \2024-09-04T08:20:00Z }
|
||||
];
|
||||
|
||||
// Simulate API delay
|
||||
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
export const taskService = {
|
||||
async getTasks(): Promise<Task[]> {
|
||||
await delay(500);
|
||||
return [...mockTasks];
|
||||
},
|
||||
|
||||
async getUsers(): Promise<User[]> {
|
||||
await delay(300);
|
||||
return [...mockUsers];
|
||||
},
|
||||
|
||||
async createTask(taskData: Partial<Task>): Promise<Task> {
|
||||
await delay(400);
|
||||
const newTask: Task = {
|
||||
id: Math.max(...mockTasks.map(t => t.id)) + 1,
|
||||
title: taskData.title || \,
|
||||
description: taskData.description || \,
|
||||
assigned_to: taskData.assigned_to,
|
||||
status: taskData.status || \open\,
|
||||
priority: taskData.priority || \medium\,
|
||||
due_date: taskData.due_date,
|
||||
created_by: mockUsers[0], // Current user
|
||||
created_at: new Date().toISOString(),
|
||||
updated_at: new Date().toISOString()
|
||||
};
|
||||
mockTasks.push(newTask);
|
||||
return newTask;
|
||||
},
|
||||
|
||||
async updateTask(id: number, taskData: Partial<Task>): Promise<Task> {
|
||||
await delay(400);
|
||||
const taskIndex = mockTasks.findIndex(t => t.id === id);
|
||||
if (taskIndex === -1) {
|
||||
throw new Error(\Task not found\);
|
||||
}
|
||||
|
||||
const updatedTask = {
|
||||
...mockTasks[taskIndex],
|
||||
...taskData,
|
||||
updated_at: new Date().toISOString()
|
||||
};
|
||||
mockTasks[taskIndex] = updatedTask;
|
||||
return updatedTask;
|
||||
},
|
||||
|
||||
async deleteTask(id: number): Promise<void> {
|
||||
await delay(300);
|
||||
const taskIndex = mockTasks.findIndex(t => t.id === id);
|
||||
if (taskIndex === -1) {
|
||||
throw new Error(\Task not found\);
|
||||
}
|
||||
mockTasks.splice(taskIndex, 1);
|
||||
}
|
||||
};
|
||||
5
frontend/src/setupTests.js
Normal file
5
frontend/src/setupTests.js
Normal file
@ -0,0 +1,5 @@
|
||||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
||||
21
frontend/src/types.ts
Normal file
21
frontend/src/types.ts
Normal file
@ -0,0 +1,21 @@
|
||||
export interface User {
|
||||
id: number;
|
||||
username: string;
|
||||
full_name: string;
|
||||
avatar_url: string;
|
||||
}
|
||||
|
||||
export interface Task {
|
||||
id: number;
|
||||
title: string;
|
||||
description: string;
|
||||
assigned_to?: User;
|
||||
status: " open\ | \in_progress\ | \blocked\;
|
||||
priority: \low\ | \medium\ | \high\;
|
||||
due_date?: string;
|
||||
created_by?: User;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export type TaskFilter = \my\ | \all\ | \blocked\;
|
||||
Loading…
Reference in New Issue
Block a user