1. 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
  2. 13 Jul, 2021 5 commits
  3. 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
  4. 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
  5. 07 Jul, 2021 1 commit
  6. 06 Jul, 2021 12 commits
  7. 05 Jul, 2021 1 commit
  8. 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
  9. 29 Jun, 2021 3 commits
  10. 28 Jun, 2021 6 commits