Skip to content

Commit

Permalink
Update node version
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraTschamon committed Jan 28, 2025
1 parent 8383ae5 commit 9c88d2c
Show file tree
Hide file tree
Showing 29 changed files with 51 additions and 54 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Tests

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
test:
Expand All @@ -24,4 +24,3 @@ jobs:
run: yarn run lint
- name: Run tests
run: yarn test

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The simplest task tracking tool for dev teams.

![Scrumboard](scrumboard.gif)

## ⚙️ Technologies used
## ⚙️ Technologies used

- [Next.js](https://nextjs.org)
- [Socket.io](https://socket.io)
Expand Down
2 changes: 1 addition & 1 deletion _api/controllers/taskController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type UserType = {

const createUserIfNotExists = async (
req: NextApiRequest,
boardName: string,
boardName: string
): Promise<void> => {
const board = await Board.findOne({
where: { name: boardName },
Expand Down
2 changes: 1 addition & 1 deletion _api/models/Board.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Board.init(
tableName: 'board',
indexes: [{ unique: true, fields: ['name'] }],
paranoid: true,
},
}
);

Board.hasMany(Story);
Expand Down
2 changes: 1 addition & 1 deletion _api/models/Story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Story.init(
tableName: 'story',
indexes: [{ unique: true, fields: ['id'] }],
paranoid: true,
},
}
);

Story.hasMany(Task);
Expand Down
2 changes: 1 addition & 1 deletion _api/models/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Task.init(
tableName: 'task',
indexes: [{ unique: true, fields: ['id'] }],
paranoid: true,
},
}
);

export default Task;
2 changes: 1 addition & 1 deletion _api/models/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ User.init(
modelName: 'user',
tableName: 'user',
paranoid: true,
},
}
);

export default User;
2 changes: 1 addition & 1 deletion pages/api/boards/[boardName].ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Board from '../../../_api/models/Board';

export default async (
req: NextApiRequest,
res: NextApiResponse,
res: NextApiResponse
): Promise<void> => {
if (req.method === 'GET') {
const board = await Board.findOne({
Expand Down
4 changes: 2 additions & 2 deletions pages/api/boards/[boardName]/stories/[storyId].ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Task from '../../../../../_api/models/Task';

export default async (
req: NextApiRequest,
res: NextApiResponse,
res: NextApiResponse
): Promise<void> => {
switch (req.method) {
case 'PUT':
Expand All @@ -13,7 +13,7 @@ export default async (
{ name: req.body.name, link: req.body.link },
{
where: { id: req.query.storyId, boardName: req.query.boardName },
},
}
);
res.status(200).json(req.body);
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import createUserIfNotExists from '../../../../../../../_api/controllers/taskCon

export default async (
req: NextApiRequest,
res: NextApiResponse,
res: NextApiResponse
): Promise<void> => {
switch (req.method) {
case 'PUT':
Expand All @@ -17,7 +17,7 @@ export default async (
},
{
where: { id: req.query.taskId, storyId: req.query.storyId },
},
}
);
await createUserIfNotExists(req, `${req.query.boardName}`);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import createUserIfNotExists from '../../../../../../../_api/controllers/taskCon

export default async (
req: NextApiRequest,
res: NextApiResponse,
res: NextApiResponse
): Promise<void> => {
switch (req.method) {
case 'POST':
Expand Down
2 changes: 1 addition & 1 deletion pages/api/boards/[boardName]/stories/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Task from '../../../../../_api/models/Task';

export default async (
req: NextApiRequest,
res: NextApiResponse,
res: NextApiResponse
): Promise<void> => {
switch (req.method) {
case 'GET':
Expand Down
2 changes: 1 addition & 1 deletion pages/api/boards/[boardName]/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import User from '../../../../../_api/models/User';

export default async (
req: NextApiRequest,
res: NextApiResponse,
res: NextApiResponse
): Promise<void> => {
switch (req.method) {
case 'GET':
Expand Down
2 changes: 1 addition & 1 deletion pages/api/boards/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { boardNameRegex } from '../../../constants';

export default async (
req: NextApiRequest,
res: NextApiResponse,
res: NextApiResponse
): Promise<void> => {
switch (req.method) {
case 'POST':
Expand Down
2 changes: 1 addition & 1 deletion pages/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import User from '../../_api/models/User';

export default async (
req: NextApiRequest,
res: NextApiResponse,
res: NextApiResponse
): Promise<void> => {
await Board.sync();
await Story.sync();
Expand Down
2 changes: 1 addition & 1 deletion server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ app.prepare().then(() => {
console.log(
`> Server listening at http://localhost:${port} as ${
dev ? 'development' : process.env.NODE_ENV
}`,
}`
);
});
2 changes: 1 addition & 1 deletion ui/api/createBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const createBoard = async (values: FormValues): Promise<Board> => {
return board;
}
message.error(
'Some error occurred while creating your board. Please try again.',
'Some error occurred while creating your board. Please try again.'
);
return null;
};
Expand Down
2 changes: 1 addition & 1 deletion ui/api/createStory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const createStory = async (story: Story): Promise<Story> => {
return story;
}
message.error(
'Some error occurred while creating your story. Please try again.',
'Some error occurred while creating your story. Please try again.'
);
return null;
};
Expand Down
4 changes: 2 additions & 2 deletions ui/api/createTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const createTask = async (task: Task, boardName: string): Promise<Task> => {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(task),
},
}
);
message.destroy();
if (response.status === 202) {
Expand All @@ -18,7 +18,7 @@ const createTask = async (task: Task, boardName: string): Promise<Task> => {
return task;
}
message.error(
'Some error occurred while creating your task. Please try again.',
'Some error occurred while creating your task. Please try again.'
);
return null;
};
Expand Down
4 changes: 2 additions & 2 deletions ui/api/deleteStory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { message } from 'antd';

const deleteStory = async (
storyId: string,
boardName: string,
boardName: string
): Promise<void> => {
message.info('Deleting story ...');
const response = await fetch(`/api/boards/${boardName}/stories/${storyId}`, {
Expand All @@ -14,7 +14,7 @@ const deleteStory = async (
return;
}
message.error(
'Some error occurred while deleting your story. Please try again.',
'Some error occurred while deleting your story. Please try again.'
);
};

Expand Down
4 changes: 2 additions & 2 deletions ui/api/deleteTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ const deleteTask = async (task: Task, boardName: string): Promise<void> => {
`/api/boards/${boardName}/stories/${task.storyId}/tasks/${task.id}`,
{
method: 'DELETE',
},
}
);
message.destroy();
if (response.status === 200) {
message.success('Task deleted!');
return;
}
message.error(
'Some error occurred while deleting your task. Please try again.',
'Some error occurred while deleting your task. Please try again.'
);
};

Expand Down
2 changes: 1 addition & 1 deletion ui/api/fetchStories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const fetchStories = async (boardName: string): Promise<Story[]> => {
return await response.json();
}
message.error(
'Some error occurred while fetching your stories. Please try again.',
'Some error occurred while fetching your stories. Please try again.'
);
return null;
};
Expand Down
2 changes: 1 addition & 1 deletion ui/api/fetchUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const fetchUsers = async (boardName: string): Promise<User[]> => {
return await response.json();
}
message.error(
'Some error occurred while fetching your boards users. Please try again.',
'Some error occurred while fetching your boards users. Please try again.'
);
return null;
};
Expand Down
4 changes: 2 additions & 2 deletions ui/api/updateStory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const updateStory = async (story: Story): Promise<Story> => {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(story),
},
}
);
message.destroy();
if (response.status === 200) {
Expand All @@ -18,7 +18,7 @@ const updateStory = async (story: Story): Promise<Story> => {
return story;
}
message.error(
'Some error occurred while updating your story. Please try again.',
'Some error occurred while updating your story. Please try again.'
);
return null;
};
Expand Down
6 changes: 3 additions & 3 deletions ui/api/updateTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Task from '../models/Task';
const updateTask = async (
task: Task,
boardName: string,
muted = false,
muted = false
): Promise<Task> => {
!muted && message.info('Updating task ...');
const response = await fetch(
Expand All @@ -13,7 +13,7 @@ const updateTask = async (
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(task),
},
}
);
message.destroy();
if (response.status === 200) {
Expand All @@ -22,7 +22,7 @@ const updateTask = async (
return task;
}
message.error(
'Some error occurred while updating your task. Please try again.',
'Some error occurred while updating your task. Please try again.'
);
return null;
};
Expand Down
2 changes: 1 addition & 1 deletion ui/components/Board/Board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Board: React.FC = () => {
{store.stories.map(
(story: Story): JSX.Element => (
<TableRow key={story.id} story={story} />
),
)
)}
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions ui/components/BoardNameForm/BoardNameForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const BoardNameForm: React.FC<PropTypes> = ({ onSubmit }: PropTypes) => {

const validateBoardName = async (
rules: object,
value: string,
value: string
): Promise<void> => {
setExistingBoard(false);
setValid(false);
Expand All @@ -31,7 +31,7 @@ const BoardNameForm: React.FC<PropTypes> = ({ onSubmit }: PropTypes) => {
Board name needs to be URL safe
<br />
Example: my-board-1
</span>,
</span>
);
}
const { status } = await fetch(`/api/boards/${value}`);
Expand Down
22 changes: 10 additions & 12 deletions ui/components/TableRow/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ const TableRow: React.FC<PropTypes> = ({ story }: PropTypes) => {
collect,
});

const [
{ isOver: isOverVerify, canDrop: canDropVerify },
dropVerify,
] = useDrop({
accept: [TODO, IN_PROGRESS, DONE],
drop: onDropVerify,
collect,
});
const [{ isOver: isOverVerify, canDrop: canDropVerify }, dropVerify] =
useDrop({
accept: [TODO, IN_PROGRESS, DONE],
drop: onDropVerify,
collect,
});

const [{ isOver: isOverDone, canDrop: canDropDone }, dropDone] = useDrop({
accept: [TODO, IN_PROGRESS, VERIFY],
Expand Down Expand Up @@ -142,7 +140,7 @@ const TableRow: React.FC<PropTypes> = ({ story }: PropTypes) => {
onChange={(task): void => store.saveOrUpdateTask(task)}
onDelete={(task): void => store.deleteTask(task)}
/>
),
)
)}
</div>
</td>
Expand All @@ -161,7 +159,7 @@ const TableRow: React.FC<PropTypes> = ({ story }: PropTypes) => {
onChange={(task): void => store.saveOrUpdateTask(task)}
onDelete={(task): void => store.deleteTask(task)}
/>
),
)
)}
</div>
</td>
Expand All @@ -180,7 +178,7 @@ const TableRow: React.FC<PropTypes> = ({ story }: PropTypes) => {
onChange={(task): void => store.saveOrUpdateTask(task)}
onDelete={(task): void => store.deleteTask(task)}
/>
),
)
)}
</div>
</td>
Expand All @@ -199,7 +197,7 @@ const TableRow: React.FC<PropTypes> = ({ story }: PropTypes) => {
onChange={(task): void => store.saveOrUpdateTask(task)}
onDelete={(task): void => store.deleteTask(task)}
/>
),
)
)}
</div>
</td>
Expand Down
Loading

0 comments on commit 9c88d2c

Please sign in to comment.