forked from oldboyxx/jira_clone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented kanban board page with lists of issues
- Loading branch information
Showing
73 changed files
with
1,334 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import express from 'express'; | ||
|
||
import { catchErrors } from 'errors'; | ||
|
||
const router = express.Router(); | ||
|
||
router.get( | ||
'/currentUser', | ||
catchErrors((req, res) => { | ||
res.respond({ currentUser: req.currentUser }); | ||
}), | ||
); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,49 @@ | ||
import faker from 'faker'; | ||
import { sample } from 'lodash'; | ||
|
||
import { Comment, Issue, Project, User } from 'entities'; | ||
import { ProjectCategory } from 'constants/projects'; | ||
import { IssueType, IssueStatus, IssuePriority } from 'constants/issues'; | ||
import { createEntity } from 'utils/typeorm'; | ||
|
||
const seedProject = (user: User): Promise<Project> => | ||
const seedUsers = (): Promise<User[]> => { | ||
const users = [ | ||
createEntity(User, { | ||
email: '[email protected]', | ||
name: 'Greg the Egg', | ||
avatarUrl: faker.image.avatar(), | ||
}), | ||
createEntity(User, { | ||
email: '[email protected]', | ||
name: 'Baby Yoda', | ||
avatarUrl: faker.image.avatar(), | ||
}), | ||
]; | ||
return Promise.all(users); | ||
}; | ||
|
||
const seedProject = (users: User[]): Promise<Project> => | ||
createEntity(Project, { | ||
name: 'Project: Hello World', | ||
name: 'singularity 1.0', | ||
url: 'https://www.atlassian.com/software/jira', | ||
description: | ||
'Plan, track, and manage your agile and software development projects in Jira. Customize your workflow, collaborate, and release great software.', | ||
category: ProjectCategory.SOFTWARE, | ||
users: [user], | ||
users, | ||
}); | ||
|
||
const seedIssues = (project: Project): Promise<Issue[]> => { | ||
const user = project.users[0]; | ||
const getRandomUser = (): User => sample(project.users) as User; | ||
const issues = [ | ||
createEntity(Issue, { | ||
title: 'This is an issue of type: Task.', | ||
type: IssueType.TASK, | ||
status: IssueStatus.BACKLOG, | ||
priority: IssuePriority.LOWEST, | ||
estimate: 8, | ||
reporterId: user.id, | ||
reporterId: getRandomUser().id, | ||
project, | ||
users: [user], | ||
users: [getRandomUser()], | ||
}), | ||
createEntity(Issue, { | ||
title: "Click on an issue to see what's behind it.", | ||
|
@@ -33,7 +52,7 @@ const seedIssues = (project: Project): Promise<Issue[]> => { | |
priority: IssuePriority.LOW, | ||
description: 'Nothing in particular.', | ||
estimate: 40, | ||
reporterId: user.id, | ||
reporterId: getRandomUser().id, | ||
project, | ||
}), | ||
createEntity(Issue, { | ||
|
@@ -42,9 +61,9 @@ const seedIssues = (project: Project): Promise<Issue[]> => { | |
status: IssueStatus.BACKLOG, | ||
priority: IssuePriority.MEDIUM, | ||
estimate: 15, | ||
reporterId: user.id, | ||
reporterId: getRandomUser().id, | ||
project, | ||
users: [user], | ||
users: [getRandomUser()], | ||
}), | ||
createEntity(Issue, { | ||
title: 'You can use markdown for issue descriptions.', | ||
|
@@ -54,17 +73,17 @@ const seedIssues = (project: Project): Promise<Issue[]> => { | |
description: | ||
"#### Colons can be used to align columns.\n\n| Tables | Are | Cool |\n| ------------- |:-------------:| -----:|\n| col 3 is | right-aligned | |\n| col 2 is | centered | |\n| zebra stripes | are neat | |\n\nThe outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.\n\nMarkdown | Less | Pretty\n--- | --- | ---\n*Still* | `renders` | **nicely**\n1 | 2 | 3", | ||
estimate: 4, | ||
reporterId: user.id, | ||
reporterId: getRandomUser().id, | ||
project, | ||
users: [user], | ||
users: [getRandomUser()], | ||
}), | ||
createEntity(Issue, { | ||
title: 'You must assign priority from lowest to highest to all issues.', | ||
type: IssueType.TASK, | ||
status: IssueStatus.SELECTED, | ||
priority: IssuePriority.HIGHEST, | ||
estimate: 15, | ||
reporterId: user.id, | ||
reporterId: getRandomUser().id, | ||
project, | ||
}), | ||
createEntity(Issue, { | ||
|
@@ -73,17 +92,17 @@ const seedIssues = (project: Project): Promise<Issue[]> => { | |
status: IssueStatus.SELECTED, | ||
priority: IssuePriority.MEDIUM, | ||
estimate: 55, | ||
reporterId: user.id, | ||
reporterId: getRandomUser().id, | ||
project, | ||
users: [user], | ||
users: [getRandomUser()], | ||
}), | ||
createEntity(Issue, { | ||
title: 'Try leaving a comment on this issue.', | ||
type: IssueType.TASK, | ||
status: IssueStatus.SELECTED, | ||
priority: IssuePriority.MEDIUM, | ||
estimate: 12, | ||
reporterId: user.id, | ||
reporterId: getRandomUser().id, | ||
project, | ||
}), | ||
]; | ||
|
@@ -97,10 +116,12 @@ const seedComments = (issue: Issue, user: User): Promise<Comment> => | |
user, | ||
}); | ||
|
||
const seedGuestUserEntities = async (user: User): Promise<void> => { | ||
const project = await seedProject(user); | ||
const seedGuestUserEntities = async (): Promise<User> => { | ||
const users = await seedUsers(); | ||
const project = await seedProject(users); | ||
const issues = await seedIssues(project); | ||
await seedComments(issues[issues.length - 1], project.users[0]); | ||
return users[0]; | ||
}; | ||
|
||
export default seedGuestUserEntities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.