Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from phyloref/simplify-specifier
The Specifier component has some complex logic that allows users to modify the properties of a specifier in multiple ways, but this can lead to the specifier being overwritten just be opening it (#263). This PR sets about restructuring this component so that you can no longer modify the specifier just by opening it -- you have to explicitly modify something to trigger a modification action. (This is the minimum we need to close #263). Now, we can't just remove all of this code, because the way in which Vue Store's data model works, we can't just plug the UI directly into the data object -- we have to call `$store.commit('setSpecifierProps', {specifier, props})` or `$store.commit('replaceTUnitForPhylogenyNode', {...})` to commit the results. So instead we need a model like this: 1. When the component is loaded, we load all of its values into a bunch of local variables, which model fields in the UI (so changing the UI immediately changes these fields). This is handled in the method `loadSpecifier()`. 2. We watch all of these variables; if any of them change, we immediately update the underlying data object with the appropriate variables depending on the specifier type. This is handled in the method `updateSpecifier()`. Additionally, this PR: * Removes `Apomorphy` as an option for the specifier dropdown (closes #331). * Changes the "Expand" button on the specifier to the clearer "Edit" (this still changes to "Collapse" when the editor is expanded). * Fields that could previously be edited has now been made readonly. * Renames the "Verbatim specifier" field to the clearer "Specifier label". Closes #320: we don't include any special support for UUIDs, but we do now note that they can be used. They appear as collection IDs.
- Loading branch information