Add feature to save turnip data from JSON to the manager - #2
Open
patrikhillner wants to merge 6 commits into
Open
Add feature to save turnip data from JSON to the manager#2patrikhillner wants to merge 6 commits into
patrikhillner wants to merge 6 commits into
Conversation
Also add feature usage instructions to index page
Contributor
Author
|
Still needs to update a variable name: |
patrikhillner
marked this pull request as draft
July 2, 2021 15:18
* Refactor checked and setChecked to jsonAutoUpdate and setJsonAutoUpdate respectively. This is to improve clarity on what it does. * Remove redundant semi-colon.
patrikhillner
marked this pull request as ready for review
July 2, 2021 18:52
Also set jsonAutoUpdate state to be tracked in TurnipPriceStore.
Owner
|
Updating the JSON does not work? For example, changi the textarea value to |
Contributor
Author
|
This PR adds feature to fill blank spaces with data. Saving does not overwrite all data, so it works as it should. |
JSON text area did not update automatically when ticked. This was due to the fact that jsonAutoUpdate variable did not extend the observable property that the similarly named variable in the store did. This commit fixes that by directly using the variable (through reference) of the store and updating only that through the method in the store.
If user had removed a price through the TurnipPriceDialog, and then wanted to add a price through the JSON text area for the same (morning/afternoon) date, then stored price was `NaN`. This caused undefined and null checks to return false, thus not saving the new price.
Since calendar tiles do not directly use the same objects as in turnips list in the turnip store, the calendar tiles did not update when saving JSON text area and null prices were set to a non-null value. Add check to see if the tile needs to update its turnip. Existing TurnipPriceStore functions refresh turnip objects in TurnipPriceDialog when turnip list in store is updated, causing the object to re-render and do the check.
Contributor
Author
|
Final issues of this PR have been fixed:
|
This file contains hidden or 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
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.
Also add feature usage instructions to index page