Migrate annotation changes - #1554
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1554 +/- ##
==========================================
- Coverage 63.70% 59.07% -4.63%
==========================================
Files 68 71 +3
Lines 6216 6752 +536
Branches 1378 1496 +118
==========================================
+ Hits 3960 3989 +29
- Misses 2217 2722 +505
- Partials 39 41 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cc2e50c to
274ddda
Compare
cdrini
left a comment
There was a problem hiding this comment.
Got through the first half ; will finish the rest later today!
| } | ||
|
|
||
| @customElement('br-annotation-menu') | ||
| class BRAnnotationMenu extends LitElement { |
There was a problem hiding this comment.
Also let's create a new file, plugin.annotations.js and move this there and then import it into this file. That'll let us start structuring these in the way we'll eventually want them to be structured, can keep this file a bit more focussed/targetted.
| if (storage[idx].uuid === currentUUID) { | ||
| storage.splice(idx, 1); | ||
| saveToLocalStorage(storage); | ||
| for (const ele of this.currentAnnotationNodes) { | ||
| const tempText = ele.textContent; |
There was a problem hiding this comment.
This is a lot of logic in this web component that requires internal knowledge of how annotations are saved. It would be better if it didn't have that internal knowledge, and all that logic was centralized in one place. Let's create a new class (in plugin.annotations.js) called AnnotationStorageService. That should have methods for easy edit/save/delete. This will also set us up for when we switch all these methods from local storage to instead using API calls.
This component can then just take in the storage service as another parameter.
b205c70 to
1ac3b87
Compare
Fix renamed parameter within markRange function
467afe4 to
2ed063b
Compare
Migrated annotation code to work with newly improved main branch