1. 21 Sep, 2020 6 commits
    • Lyza Danger Gardner's avatar
      Fix case-sensitivity issue with rendering suggested tags. · 6bd09e71
      Lyza Danger Gardner authored
      The `TagEditor` component formerly did not take casing into account
      in its formatting function for suggested tags. The match should be
      case-insensitive in the formatter, as it is in the service that does
      the filtering of tags.
      
      This is fixed in two ways:
      
      1. Make substring matching in the formatting function case-insensitive.
         Render the substring match according to the suggested tag's casing.
         Fixes this issue specifically.
      2. Provide a fallback in the formatter for when the input text does not
         "seem" to match the suggested `item`. In these cases, just render the
         suggested tag as-is. This will prevent the formatter from spazzing
         out if its notion of matching differs from the tag-service's in
         any future case.
      
      Fixes #2547
      6bd09e71
    • Robert Knight's avatar
      Improve some test descriptions and do some small cleanups · 478c173c
      Robert Knight authored
       - Remove an `Object.assign` in favor of object spread
      
       - Remove an unused `ctx` argument to `emitGuestEvent`
      
       - Rewrite several test descriptions for readability
      
       - Re-order stub initializations in `beforeEach` to be more alphabetical
      478c173c
    • Robert Knight's avatar
      Convert `Guest` tests to JS · bf94d530
      Robert Knight authored
      This is the result of an automated conversion by decaffeinate followed
      by a manual review and clean-up of the result.
      bf94d530
    • Robert Knight's avatar
      Change jQuery `.each()` callback to avoid `this` · a8860c35
      Robert Knight authored
      To avoid confusion with different meanings of `this` between the
      callback and surrounding scope, get the element from callback arguments
      instead.
      a8860c35
    • Robert Knight's avatar
      Remove unnecessary fallback value for `Object.keys` call · 048a6c7b
      Robert Knight authored
      The `options` field is always initialized to an object, so the `|| {}`
      is not necessary.
      048a6c7b
    • Robert Knight's avatar
      Convert Guest class to JS · 1f7174f6
      Robert Knight authored
      1f7174f6
  2. 18 Sep, 2020 1 commit
  3. 17 Sep, 2020 6 commits
  4. 16 Sep, 2020 3 commits
  5. 15 Sep, 2020 12 commits
  6. 14 Sep, 2020 1 commit
    • Robert Knight's avatar
      Fix real-time update action processing · 9479612f
      Robert Knight authored
      When store modules were refactored to only receive their local state in
      selectors, the code in `store/modules/real-time-updates` which directly
      uses selectors from other modules rather than calling
      `store.<selectorMethod>(...)` was not updated to pass in the appropriate
      part of the state.
      
      Fixing this resolves two problems:
      
       - An error when processing notifications of deleted annotations from
         the server. These notifications are currently not getting delivered
         due to a server-side issue (see https://github.com/hypothesis/h/pull/6214).
      
       - Filtering notifications of new or updated annotations not excluding
         annotations from groups that are not currently focused.
      
         Fixing this second issue has the side effect that it _appears_ to fix
         https://github.com/hypothesis/support/issues/137 from the user's
         point of view. I say _appears to_ because the backend is still
         incorrectly delivering notifications that the user shouldn't be able
         to see. That is fixed by https://github.com/hypothesis/h/pull/6202
      9479612f
  7. 11 Sep, 2020 3 commits
  8. 10 Sep, 2020 1 commit
    • Robert Knight's avatar
      Convert `Delegator` base class to JS · 2e0eee75
      Robert Knight authored
      Convert the `Delegator` base class to JS and rewrite the documentation
      to match current functionality and usage. Also simplify the `options`
      initialization and add a note about why the constructor reads
      `this.options` before assigning it.
      
      I tried to convert the `Plugin` class as well but encountered an issue
      with interaction between Babel-compiled derived classes and CoffeeScript
      sub-classes (in particular, the `BucketBar` class), so it looks like
      `Plugin` sub-classes will need to be converted first.
      2e0eee75
  9. 09 Sep, 2020 2 commits
  10. 08 Sep, 2020 5 commits
    • Robert Knight's avatar
      Remove obsolete line from `destroy` method · 69c50358
      Robert Knight authored
      This selector is not referenced anywhere else in the code.
      69c50358
    • Robert Knight's avatar
      Respond to PR feedback · 2a5ce832
      Robert Knight authored
       - Fold `highlightsAt` into `annotationsAt` as it is only used in one
         place
      
       - Rename `xor` variable to a more obvious name
      2a5ce832
    • Robert Knight's avatar
      Remove unused code for listening to DOM events in `Delegator` · d56bf99e
      Robert Knight authored
      The `Delegator` events system was used for handling two kinds of event:
      
       - DOM events on highights and document elements
       - Custom events internal to the "annotator" module
      
      The handling of DOM events has been moved into the `Guest` class, so
      `Delegator` is now used only to subscribe to and publish internal
      events. This commit removes the DOM event handling code.
      
      There is an existing issue, noted in this commit, that the `destroy`
      method only removed event handlers declared via the `events` property
      and not those added later by `subscribe`.
      d56bf99e
    • Robert Knight's avatar
      Use `subscribe` to listen to `beforeAnnotationCreated` events · 4e2fba09
      Robert Knight authored
      This removes the last remaining usage of the `events` property of
      `Delegator`, enabling that code to be removed.
      4e2fba09
    • Robert Knight's avatar
      Re-implement highlight and document event handling in Guest class · 55269a89
      Robert Knight authored
      The way that the `Guest` class listened to clicks on highlights and the
      document involved a DOM event-listening abstraction in `Delegator` that
      is no longer used for anything else in the code. This indirection made
      it more complicated to follow how these events were handled.
      
      This commit replaces the event handling for clicks, hovers and taps on
      highlights and the page with regular DOM event listeners in the `Guest`
      class.
      55269a89