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.
Description
Ensures that
learned
facts are displayed for selection in theAddPotentialLinkModal
Current Behavior
In the current design, operations and sources are collect in the
onMounted
hook:magma/src/components/operations/AddPotentialLinkModal.vue
Lines 102 to 114 in 32b5594
And then later, these objects are used to collect the imported facts and learned facts:
magma/src/components/operations/AddPotentialLinkModal.vue
Lines 132 to 134 in 32b5594
However, this design doesn't achieve the designed behavior because the
AddPotentialLinkModal
is only mounted once and then hidden/shown when the+ Potential Link
button is pressed. Therefore, thegetFacts
function is not called again and thelearned
facts are not updated.New Behavior
The
getFacts
call is moved inside theselectedPotentialLink
function, so it is called every time an ability is selected. This updates the facts array prior to displaying the screen where values can be selected.Note 1: In this change, I also updated the sources that make up the facts. Previously, the facts were drawn from 3 sources:
In this update I removed source 3 from the list above because this is a replica of sources 1 and 2 and causes all facts to be duplicated. If there is a reason to retain this feature, it can be re-added.
Note 2: The
AddPotentialLinkModal
retains the state of the last use of the modal. So if a user adds a Potential Link and then returns to the modal to add the same link again, the facts will not update unless the user goes back and re-selects the same ability.