-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lf 4473 add new animal movement task type to pure task type selection component #3502
base: integration
Are you sure you want to change the base?
Conversation
@Duncan-Brain looks like the |
…g when adding new task types
Thanks @antsgar I removed them so as not to confuse others in the future. I finally found the use of _LOWER you mention here: 2a25cde#diff-b41a29e7942af162f245d82d225d73b6303f015de760bb6d3b2d1efdaa81be70R92 and the file has since been moved+updated The filter for taskTypes when coming from crop plan has also now been added and is ready for re-review |
@@ -123,7 +126,15 @@ export const PureTaskTypeSelection = ({ | |||
{taskTypes | |||
?.filter(({ farm_id, task_translation_key }) => { | |||
const supportedTaskTypes = getSupportedTaskTypesSet(isAdmin); | |||
return farm_id === null && supportedTaskTypes.has(task_translation_key); | |||
// If trying to make a task through the crop management plan Add Task link -- exclude animal tasks from selection for now | |||
const isNotAnimalTaskWhileCreatingCropTask = !( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker for merging, but the variable name is confusing me more 😂 I'd rename it to shouldDisplayTaskType
, which is the result, and then the statement afterwards is what contains the logic for displaying or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I specifically did not group it with the other logic... I personally prefer to separate long ,tough to read, logic into "readable chunks" . So, in my head, I read the return statement below as: isLiteFarmDefaultTaskType && isSupportedTaskType && isNotAnimalTaskWhileCreatingCropTask
.
The name is wordy I am open to a better name ahaha. But the logic points do seem distinct to me.
I did an inbetween change to address this comment -- let me know if its ok!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall! I just left a few comments with some suggestions.
Description
Notes:
Jira link: LF-4473
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
I used this function which did not work perfectly but did the job:
Checklist: