Conversation
…s element error but bedtime
…al but editing still broken
chpy04
left a comment
There was a problem hiding this comment.
Good start, couple notes:
- If I'm editting a task from the wp task kanban, I should still be able to change the task's work package
- I should be able to edit a task and remove the work package
- Saw ur slack but yes we need to support select a wp via gantt chart as well
| } | ||
| } | ||
|
|
||
| static async editTaskWbsElement(req: Request, res: Response, next: NextFunction) { |
There was a problem hiding this comment.
Unless we have different permissions (which I don't think we do) we should just add a wbselement param to the edit and then use that route instead of this
There was a problem hiding this comment.
yeah makes sense. I separated it cause I saw that assignees and status were separated but I guess those have valid reasons and this doesn't, so I'll throw it in with editTask
| blocking: { where: { wbsElement: { dateDeleted: null } }, include: { wbsElement: true } }, | ||
| descriptionBullets: { where: { dateDeleted: null }, ...getDescriptionBulletQueryArgs(organizationId) } | ||
| descriptionBullets: { where: { dateDeleted: null }, ...getDescriptionBulletQueryArgs(organizationId) }, | ||
| tasks: { where: { dateDeleted: null }, ...getTaskQueryArgs(organizationId) } |
There was a problem hiding this comment.
I'm a little concerned about adding this much nested information to the generic work package query args. Can we instead make a seperate endpoint to get the tasks for a specific work package and then use that? Could also just make a get task by wbs element and then abstract it for both project and wp task page
| 'easy to forget McCauley, in his blue racing jacket and jet black helmet, is racing laps around the roof of ' + | ||
| "Columbus Parking Garage on Northeastern's Boston campus. But that's the reality of Northeastern Electric " + | ||
| 'Racing, a student club that has made due and found massive success in the world of electric racing despite its ' + | ||
| 'Racing, a student club that has made do and found massive success in the world of electric racing despite its ' + |
| }, | ||
| workPackage: { | ||
| include: { | ||
| project: { |
There was a problem hiding this comment.
you already have this information at the project level above so this is redundant
There was a problem hiding this comment.
It's not, because project and wp are mutually exclusive on a wbs element. If createTask is called on a project, requestedWbsElement.project is populated and requestedWbsElement.workPackage is null, and vice versa for if called on a wp. So I think we need both full includes in the query because only one will actually return.
| * @returns the updated task | ||
| * @throws if the task does not exist, the task is already deleted, the wbs element doesn't exist, or if the user does not have permissions | ||
| */ | ||
| static async editTaskWbsElement( |
There was a problem hiding this comment.
same as above, lets just group this in with edit task
| project: Project; | ||
| wbsNum: WbsNumber; | ||
| wbsElementId: string; | ||
| workPackages?: WorkPackage[]; |
There was a problem hiding this comment.
same thing here the task column component should not need a list of work packages
| tasks: Task[]; | ||
| wbsNum: WbsNumber; | ||
| wbsElementId: string; | ||
| workPackages?: WorkPackage[]; |
| title: yup.string().required(), | ||
| taskId: yup.string().required() | ||
| taskId: yup.string().required(), | ||
| wpWbsNum: yup.mixed<WbsNumber>().optional() |
There was a problem hiding this comment.
Pretty sure yup.mixed is used when it could be one of a number of different primative types. In this case you could just do string. If you wanted to specifcally ensure its a wbsnumber you could add a test function for that but because users aren't manually typing in numbers I think its fine to just say string.
| onHide: () => void; | ||
| onSubmit: (data: EditTaskFormInput) => Promise<void>; | ||
| onReset?: () => void; | ||
| workPackages?: WorkPackage[]; |
| teamTypes: TeamType[]; | ||
| projectId: string; | ||
| events: EventPreview[]; | ||
| tasks: Task[]; |
There was a problem hiding this comment.
same, would really like to remove this
|
|
I lied I read the ticket more carefully and I guess the main spec was that it's locked in the wp task kanban creation modal, but I do see the value of editing there. So yes I'll add that back in! |
|
I think its always better to give the user the option so I'd prefer to always let them edit the wp but then if they create from within a work package it should default to the wp they are in so lets always have the field regardless. In terms of removing the wp, when I tested it the x wasn't working for editting an already created task on a wp, but let me know if you are unable to reproduce |
Changes
There's a new Tasks tab on work packages that shows tasks associated with that work package. The project tasks tab shows all tasks associated with that project, including tasks on its wp's tasks. A task's WP can be edited or deleted.
Backend
Frontend
Notes
Test Cases
Screenshots
Task Form Modal in projects page tasks tab

Task Modal on projects page tasks tab shows wp as line item

Projects page, containing tasks associated with wps

You can't see my cursor but they're clickable and highlight when hovered over

WP page now has a tasks tab, filtered for only that wp's tasks, which don't show chips because they're obviously on that wp

No option to choose wp when creating task from wp page - they're automatically associated with the relevant wp

Checklist
yarn.lockchanges (unless dependencies have changed)Closes #4048