-
Notifications
You must be signed in to change notification settings - Fork 79
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-4545 Adjust read only task view for movement tasks #3552
base: integration
Are you sure you want to change the base?
LF-4545 Adjust read only task view for movement tasks #3552
Conversation
…per when in TaskLocations
…e type error crash between readonly and edit by keeping original property name
@@ -1952,7 +1952,7 @@ | |||
"ADD_TASK_FLOW": "task creation", | |||
"AMOUNT_TO_ALLOCATE": "Amount to allocate", | |||
"ANIMAL_MOVING_TO_LOCATION": "Moving to:", | |||
"ANIMAL_MOVEMENT_EXPANDING_SUMMARY_TITLE": "See detail list of animals to move", | |||
"ANIMAL_MOVEMENT_EXPANDING_SUMMARY_TITLE": "Animals in this task", |
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.
The original string had just gone up to CrowdIn less than an hour ago, so I went ahead and manually adjusted this on CrowdIn (so translators will not have to translate the now irrelevant string).
Since this is already on CrowdIn, I will remove the "new translations" tag from this branch.
Per yesterday's discussion about animals on custom tasks, it will not be task-type defined
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.
Looking great!!
I had a similar bug in the animal read-only view where "uses" are not shown right after logging in. (it's not very useful, but here is the commit for reference) I think we need to render the purposes after the options are fetched here too!
…or initial fetch not being complete
@SayakaOno thank you so much for taking on more than your share of reviews 🙇❤️ And thank you for the heads up about the purposes bug!! 🙏 Since I set the purposes in the component, my impulse would be to just add the options to the setting dependency array (I'll push commit of which one I mean), so it will re-run once the options go from empty array to populated. Do you think there is a disadvantage to doing it that way vs delaying render? |
@kathyavini Ah yes, you're calling |
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!! 🙌
Only one minor comment that is a more generic change (not only applicable to this screen). I think we shouldn't show the Remove button on the pills and the dropdown indicator when the field is disabled (for the multiselect component on Purposes here). We could hide them easily by editing the styles in the component
multiValueRemove: (provided, state) => ({
...
display: state.isDisabled ? 'none' : 'block',
}),
multiValue: (provided, state) => ({
...
padding: state.isDisabled ? '0 18px 0 12px' : '0 4px 0 12px'
}),
dropdownIndicator: (provided, state) => ({
...
display: state.isDisabled ? 'none' : 'block',
}),
@antsgar oh that's a very good point -- much better!! Unrelated to anything, I kind of love writing CSS in TS in like this 😂 |
Ah please hold off on re-review, I think there is a bug!! 🐞🙏 Edit: Please nevermind me, it mainly impacts complete so I can fix it on the other PR anyway! ...but while I'm waiting on re-review I'll just go ahead and fix it here :) |
purposeOptions is re-created on every render; it is 'purposes' that is the useQuery hook return
Description
This PR completes the readonly task view for animal movement tasks. Modifications:
animal_movement_task
(incoming from the backend) /movement_task
(outgoing towards backend, and adjusted in saga)Although some of the work of complete (e.g. putting the task details into StepOne and common data formatting) has been added to this branch, please consider this branch as only for populating readonly. -- edit/complete will be done on the other branch.
Jira link: https://lite-farm.atlassian.net/browse/LF-4545
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
Checklist: