1. 15 Jul, 2021 5 commits
    • Kyle Keating's avatar
      Fix tag service to work with unicode chars · a2f6b311
      Kyle Keating authored
      The tag filter's regex was not capturing words at the start of a line which had non-word ASCII or unicode characters. Additionally it was not escaping special chars for the regex query.
      
      This fix first splits the tag based on words, escapes the query, searches for any match, and then additionally checks the entire tag against the query
      a2f6b311
    • Kyle Keating's avatar
      Fix tag service to work with ASCII chars · 5e9d9eb9
      Kyle Keating authored
      The regex-ex was not capturing words at the start of a line which had ASCII characters.
      
      This fix first splits the string based on words and searches for any match and then additionally checks the entire string against the query
      5e9d9eb9
    • Robert Knight's avatar
      Remove unnecessary TS suppression for `URLSearchParams.entries` · ede3280f
      Robert Knight authored
      This method is available after including the `dom.iterable` typings.
      Also the use of `entries()` is unnecessary because the result is the
      same as directly iterating over the `URLSearchParams` instance.
      
      Also add an example for `stringify`.
      ede3280f
    • Robert Knight's avatar
      Replace query-string dependency with wrapper around `URLSearchParams` · e466e836
      Robert Knight authored
      For the client's very simple query string generating and parsing needs
      we can avoid this dependency by using a very simple wrapper around
      `URLSearchParams`. This also improves type checking since this
      dependency didn't provide types and we weren't using the
      @types/query-string package.
      
      The `stringify` function sorts parameters in the returned string for
      consistency with query-string's behavior.
      e466e836
    • Eduardo Sanz García's avatar
      Remove `off` method on `Bridge` class · d17a3c22
      Eduardo Sanz García authored
      This method was not used anywhere. In addition for this method to have
      the intended effect, it needed to be called before `createChannel`,
      because at that point the methods are registered with the `RPC` class
      and there is no way to remove the listeners.
      d17a3c22
  2. 14 Jul, 2021 7 commits
    • Robert Knight's avatar
      Use `$imports.$mock` to mock RPC in bridge-test.js · b5e717ae
      Robert Knight authored
      The `Bridge` code was written before we had good mocking tools in the
      client. As a result the `Bridge` class mocks `RPC` in an unconventional
      way where it constructs the real class, but then stubs out specific
      methods. Also tests varied in the degree to which they tested only
      `Bridge` vs Bridge + RPC together.
      
      This commit mocks `RPC` in bridge-test.js using our standard mocking
      tools and makes all tests in the file unit tests. This involved some
      significant changes to the `onConnect` tests.
      b5e717ae
    • Eduardo Sanz García's avatar
      Various improvements based on PR feedback · 12982d25
      Eduardo Sanz García authored
      * change `@deprecated` for a comment
      * added a test to cover some missing lines in `_isValidSender` function.
      * `_isValidMessage` renamed to `_parseMessage`
      * created helper function `waitForMessageDelivery`
      * parametrise test
      12982d25
    • Eduardo Sanz García's avatar
      Cleanup/follow up work on `RPC` · 1aea95e6
      Eduardo Sanz García authored
      RPC:
      * added `@deprecated` statements and additional comments
      * removed `this._destroyed` for the listener checks, because the
        listener is removed when called `destroy()`.
      * added `this._port.close()` in addition to removing the listner.
      
      `bridge-test`:
      * refactor all the `function () {}` to arrow functions
      
      `frame-rpc-test.js`:
      * added these tests to check the `MessageChannel` functionality.
      1aea95e6
    • Eduardo Sanz García's avatar
      Strengthen types · 3e94f694
      Eduardo Sanz García authored
      3e94f694
    • Eduardo Sanz García's avatar
      Simplify internals · b0f23457
      Eduardo Sanz García authored
      Created a couple of utility methods to avoid duplication of code and
      enable to decouple RPC for `Window` or for `MessagePort`.
      b0f23457
    • Eduardo Sanz García's avatar
      Add `ListenerCollection` utility to handle listeners · 75525988
      Eduardo Sanz García authored
      It simplifies the code.
      75525988
    • Eduardo Sanz García's avatar
      Initial support of `MessageChannel` on `RPC` · 87832dbc
      Eduardo Sanz García authored
      It is a bit of a Frankenstein. The plan is to clean up on the next
      commits.
      87832dbc
  3. 13 Jul, 2021 5 commits
  4. 12 Jul, 2021 1 commit
    • Kyle Keating's avatar
      Remove aria-label from TagEditor and AnnotationPublishControl button · 4ae836c4
      Kyle Keating authored
      Per WCAG 2.1 criterion: 2.5.3 Label in Name--we should not differentiate between the aria-label and the visual name in an input element. In the case of the TagEditor, the `placeholder` and `aria-label` were different. The simple fix is to remove `aria-label`.
      
      The second problem is with AnnotationPublishControl's button where the `aria-label` and button's text did not match. Again, the simple fix is to remove `aria-label`.
      4ae836c4
  5. 09 Jul, 2021 2 commits
    • Robert Knight's avatar
      Always use object shorthand for properties · 2cccebc2
      Robert Knight authored
      Enforce the use of object shorthand syntax everywhere for consistency.
      eg. `{ foo }` instead of `{ foo: foo }`. We had already converted most
      occurrences manually.
      2cccebc2
    • Robert Knight's avatar
      Convert remaining anonymous callbacks to arrow functions · 088864e9
      Robert Knight authored
      We've been gradually converting anonymous functions to arrow functions
      since adopting ES6. This commit uses ESLint to finish the process by
      converting the remaining non-named, non-`this`-using callbacks to arrow
      functions.
      
       - Enable `prefer-arrow-callbacks` lint rule. The `allowNamedFunctions`
         option is enabled because we have a few instances (eg. in
         gulpfile.js) of explicitly naming functions for use in debugging /
         logging etc.
      
       - Run `eslint --fix .` and `yarn format` to automatically fix up the
         code
      088864e9
  6. 07 Jul, 2021 1 commit
  7. 06 Jul, 2021 12 commits
  8. 05 Jul, 2021 1 commit
  9. 02 Jul, 2021 2 commits
    • Eduardo Sanz García's avatar
      Render the `NotebookModal` only when `groupId` is defined · fcf1e6ac
      Eduardo Sanz García authored
      On Firefox, I have noticed that the notebook close button is briefly
      displayed and then hidden. This delay is probably caused by time that it
      takes to parse the CSS until it is applied. To avoid this 'blink' we
      render the component only when the `groupId` is set.
      fcf1e6ac
    • Eduardo Sanz García's avatar
      Small visual improvements for the notebook close button · 1d0e3a32
      Eduardo Sanz García authored
      Currently, because of the `notebook` and `sidebar` are not able to
      communicate directly it is not possible to place the close button on the
      `notebook` app itself.
      
      While waiting for the above to be fixed, I propose a few minor style
      changes:
      
      * Changed the `LabeledButton` to `IconButton` and only show the `X`
        (cancel icon). This is a widely understood and accepted pattern for
        modals
      
      * Increase the size of the cancel icon
      
      * Re-enable the cursor when hovering on the button (it seems that the
        `cursor: pointer` rule was not longer functional)
      
      * Made the margin bigger to avoid the browser scrolling bar to hidden by
        the button.
      
      These changes are meant to be a temporary improvement.
      1d0e3a32
  10. 29 Jun, 2021 3 commits
  11. 28 Jun, 2021 1 commit