Advertisement
Iv555

Untitled

Apr 8th, 2023
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1.  
  2. function solve(input) {
  3. const num = input.shift();
  4.  
  5. const initialCollection = input.splice(0, num);
  6. let sprintBoard = [];
  7.  
  8. let points = {
  9. 'ToDo': 0,
  10. 'In Progress': 0,
  11. 'Code Review': 0,
  12. 'Done': 0,
  13. };
  14.  
  15. for (let index = 0; index < num; index++) {
  16. let assigneeObj = {};
  17. const assignee = initialCollection[index].split(':')[0];
  18. const taskId = initialCollection[index].split(':')[1];
  19. const title = initialCollection[index].split(':')[2];
  20. const status = initialCollection[index].split(':')[3];
  21. const estimatedPoints = initialCollection[index].split(':')[4];
  22. let obj = sprintBoard.find(x=>)
  23. if (sprintBoard.includes()) {
  24. assigneeObj[assignee] = {};
  25. assigneeObj[assignee].tasks = [];
  26. }
  27. assigneeObj[assignee].tasks.push({ taskId, title, status, estimatedPoints });
  28. sprintBoard.push(assigneeObj);
  29. points[status] += estimatedPoints;
  30.  
  31. }
  32. console.log(sprintBoard)
  33.  
  34.  
  35. }
  36.  
  37. solve([
  38. '5',
  39. 'Kiril:BOP-1209:Fix Minor Bug:ToDo:3',
  40. 'Mariya:BOP-1210:Fix Major Bug:In Progress:3',
  41. 'Peter:BOP-1211:POC:Code Review:5',
  42. 'Georgi:BOP-1212:Investigation Task:Done:2',
  43. 'Mariya:BOP-1213:New Account Page:In Progress:13',
  44. 'Add New:Kiril:BOP-1217:Add Info Page:In Progress:5',
  45. 'Change Status:Peter:BOP-1290:ToDo',
  46. 'Remove Task:Mariya:1',
  47. 'Remove Task:Joro:1',
  48. ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement