-
Notifications
You must be signed in to change notification settings - Fork 139
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
Filtering Area Based on Currently Edited Seeding Log #628
Open
FutzMonitor
wants to merge
6
commits into
DickinsonCollege:main
Choose a base branch
from
FarmData-2-Dev-Team-2022:FilteringAreaAndCrop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Filtering Area Based on Currently Edited Seeding Log #628
FutzMonitor
wants to merge
6
commits into
DickinsonCollege:main
from
FarmData-2-Dev-Team-2022:FilteringAreaAndCrop
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added a new function to the created hook. This is the 'getAllPages(area)' in order to get the JSON objects for all the areas. I need this data because currently the page only has the names of the areas available to it but not whether the area belongs to the greenhouse or not. - To the point above, this is incredibly inefficient in my mind. Should we be caching these areas? I imagine they're already cached if someone is visiting the Seeding Input. - Two new data variables have been added: 'editRowID' which will be assigned the ID of the row being edited which is returned by the CustomTable's edit-clicked event. The other one is the 'editingAreaFilter' which serves as the dynamic area array that is sent to the CustomTable with direct/tray seeding areas depending on what log is being edited. There's also the 'areaJSONList' which is used for holding the JSON objects for all areas. - A new function has been added 'updateRowEditID'. This name should be changed but the function basically assigns 'editingAreaFilter with the appropriate area names depending on what seeding log is being edited. - The CustomTable feeds the edit-clicked straight to the new 'updateRowEditID'. I couldn't figure out how to run two functions because doing so wouldn't send the payload to the new function, so I moved the execution of the 'disableFilters' into the new function. - 'enableFilters' also has an added line that emptys the dynamic list now that it's not needed.
There are a couple of issues that I have with my own implementation. However, it will hopefully serve as a starting point of conversation to resolve the overall issue.
|
- Minor changes
- Renamed 'updateRowEditID' to 'updateEditable'. The method takes the ID of the emitted 'edit-clicked' event to search the list of logs for the matching log and check its seeding type. If the seeding type is direct: the editableAreas is set to only field areas; if the seeding type is tray seeding: the editableAreas is set only to greenhouse areas. - Three new arrays have been made: editableAreas is returned in the computed function that returns all the column information to the CustomTableComponent. Its value is assigned in 'updatEditable'. The greenhouseAreas' array is assigned its value on created. The 'fieldAreas' array is assigned its value on created. - Figured out how to add the 'disableFilters' back in the CustomTable tag while still passing the event payload to the 'updateEditableAreas' method. - Created now caches araeas and code was added to assign the values for 'greenhouseAreas' and 'fieldAreas'. - CreatedCounter updated to 9 since although two more created API calls were technically created only one or the other will actually be called.
- Removed some commented code
- Removed computed method for area names as nothing but the CustomTable was using it and it no longer uses it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Closes #585. This PR aims to remove the user's ability to assign the incorrect area to seeding logs when they're being edited. For example, a direct seeding should not be allowed to be assigned a greenhouse area and a tray seeding should not be allowed to be assigned a field area.
This pull request is NOT ready to be merged.
There are a couple of things that need to be addressed before merging.
Licensing Certification
FarmData2 is a Free Cultural Work and all accepted contributions are licensed as described in the LICENSE.md file. This requires that the contributor holds the rights to do so. By submitting this pull request I certify that I satisfy the terms of the Developer Certificate of Origin for its contents.