#4254 task labels#4256
Conversation
| } | ||
| } | ||
|
|
||
| static async getTasksByWbsNumAndLabels(req: Request, res: Response, next: NextFunction) { |
There was a problem hiding this comment.
why would we not just use the existing filter endpoint and add labels to that?
| deletedBy: getUserQueryArgs(organizationId), | ||
| assignees: getUserQueryArgs(organizationId) | ||
| assignees: getUserQueryArgs(organizationId), | ||
| labels: true |
There was a problem hiding this comment.
select and only include relevant info
| deletedBy: getUserQueryArgs(organizationId), | ||
| assignees: getUserQueryArgs(organizationId) | ||
| assignees: getUserQueryArgs(organizationId), | ||
| labels: true |
| * @param organization the organization that the user is currently in | ||
| * @returns array of tasks that have at least one matching label | ||
| */ | ||
| static async getTasksByWbsNumAndLabels( |
There was a problem hiding this comment.
yeah we should really move the labels part of this to the filters endpoint. Filtering by wbs is a seperate endpoint because that is what we are inherently doing on every page, but that is not the case for labels
| import { TaskLabel } from 'shared'; | ||
| import NERFormModal from '../../../components/NERFormModal'; | ||
|
|
||
| const COLOR_OPTIONS: { label: string; value: string }[] = [ |
There was a problem hiding this comment.
We do something very similar for the calendar event types, could be worth abstracting
| } catch (error: unknown) { | ||
| if (error instanceof Error) toast.error(error.message); | ||
| } | ||
| handleClose(); |
There was a problem hiding this comment.
In general I prefer to only close on success because its very annoying if there is some backend validation the frontend missed and the user has to re open the form and enter the values again
| isError: filteredTasksIsError, | ||
| error: filteredTasksError | ||
| } = useTasksByWbsNumFilteredByLabels(wbsNum, selectedLabelIds); | ||
| const { data: taskLabels } = useAllTaskLabels(); |
Changes
Adds a full task labels feature:
Test Cases
Setting labels on a task:
Create task label:
Edit task label:
Delete task label:
Screenshots
Checklist
It can be helpful to check the
ChecksandFiles changedtabs.Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.
yarn.lockchanges (unless dependencies have changed)Closes #4254