tsgrp / OpenAnnotate

TSG's Browser-based Annotation Tool
8 stars 4 forks source link

Strikethrough Annotation Sometimes Doesn't Populate "rows" Property #818

Closed DuncanKummer closed 4 years ago

DuncanKummer commented 4 years ago

We've noticed a case where a strikethrough annotation does not populate the "rows" property, which causes an error while trying to save annotations because we expect text highlight, strikethrough, and underline annotations to have rows. This is most likely due to a special case while creating the annotation based on clicking-and-dragging

DuncanKummer commented 4 years ago

OC Commit #: 26348 OA Commit #: 7095

Description: This provides handling for when an annotation is not drawn correctly. We simply don't draw the annotation, and prompt the user that an error occurred and they should try again. This commit also contains handling for passed-in text select annotation JSON objects without rows. We do not create those annotations and notify the user about what happened. More specifically: OA: It was determined that this error occured in OA after the raphael mouseUp event fires when drawing text select annotations. For some reason, the rows and p1,p2,p3,p4 properties of the annotation object were not being calculated correctly. This commit aborts the process of saving that annotation, and triggers a notification that the user should try again. OC: We received a JSON object without an empty rows property on a strikethrough. This caused OC to throw an uncaught exception. This commit intercepts the objects with empty rows and skips over them, notifying the user in OA about what happened

CRs: jlittle, mbrouillete