1. 08 Mar, 2021 9 commits
  2. 05 Mar, 2021 9 commits
    • Lyza Danger Gardner's avatar
      9cb70c87
    • Lyza Danger Gardner's avatar
      Make links to annotation documents open in new tab/window · 37803f91
      Lyza Danger Gardner authored
      Open links to documents in a new tab. This is important in the Notebook
      view at present to "escape" the Notebook's frame, but makes sense in
      all contexts as it more closely adheres to our pattern of opening links
      to external properties in new windows.
      37803f91
    • Lyza Danger Gardner's avatar
      Adjust styling on document metadata · 76d03be3
      Lyza Danger Gardner authored
      Make sure document titles that are not linked don't look like links.
      76d03be3
    • Lyza Danger Gardner's avatar
      Simplify `AnnotationTimestamps` · bc58c21c
      Lyza Danger Gardner authored
      Make `AnnotationTimestamps` align with changes to `ShowDocumentInfo`;
      it is now a dumb component. Centralize logic in `AnnotationHeader`.
      bc58c21c
    • Lyza Danger Gardner's avatar
      Do not link to documents for third-party annotations · 0aa62e16
      Lyza Danger Gardner authored
      - Refactor `ShowDocumentInfo`: don't link to documents for third-party
        annotations. This is a possibly-temporary measure to prevent linking
        to documents that are not directly accessible, e.g. in an LMS context.
      - Remove unnecessary forwarding of `showDocumentInfo` through several
        components.
      - Centralize some logic in `AnnotationHeader` and make `ShowDocumentInfo`
        a dumb component.
      0aa62e16
    • Eduardo Sanz García's avatar
      Avoid leaving elements from bucket-bar test · 72208f96
      Eduardo Sanz García authored
      These changes enforce that the bucket-bar is destroyed and allows
      multiple creations of the bucket bar, if needed.
      72208f96
    • Robert Knight's avatar
      Generalize a comment · cebe7dbd
      Robert Knight authored
      The sidebar is not the only other frame that may be interested in new
      annotations. The notebook is too.
      cebe7dbd
    • Robert Knight's avatar
      Improve tests for `getDocumentInfo` event handling in Guest · 6bcf0b8c
      Robert Knight authored
       - Extract the repeated logic for checking the data passed to the
         event's callback into a `createCallback` helper
      
       - Add separate tests for HTML and PDF documents
      
       - Add test for the error path when getting the URL of a PDF fails
      6bcf0b8c
    • Robert Knight's avatar
      Replace the "plugin" functionality in the Guest · bcd65da1
      Robert Knight authored
      Replace the "plugin" functionality in the Guest that indirectly
      instantiates the `DocumentMeta`, `PDF` and `CrossFrame` classes with
      direct instantiation of those classes.
      
      The annotator part of the Hypothesis client is no longer a pluggable
      toolbox which can be arbitrarily extended by user-provided plugins.
      Removing the "plugins" logic and replacing it with direct construction
      of the necessary classes removes a lot of indirection that made the code
      harder to follow and also makes it easier for TypeScript to statically
      check the code. It will also enable the `config` object that is passed
      to `Guest` to be paired down to just the fields that are actually needed
      and properly typed.
      
      In future we will need some kind of plugin/integration facility to
      support different document viewers. For we will build a more specific
      document type integration facility when the time comes.
      
       - Remove `this.plugins` field from `Guest` class and `pluginClasses`
         config and replace with direct construction of `PDFIntegration`,
         `DocumentMeta` and `CrossFrame` classes
      
       - Update the `AnchoringImpl` typedef to correctly reflect that some anchoring
         implementations (HTML) have a synchronous `describe` method
      
       - Remove unnecessary `config` argument to `PDF` constructor
      
       - Replace the `PDF: {}` content in the guest config with `documentType:
         'pdf'` as a more obvious way for the annotator entry point to
         configure which document viewer integration is loaded. In future we
         can generalize this to support different types of viewer integration.
      bcd65da1
  3. 03 Mar, 2021 13 commits
  4. 02 Mar, 2021 6 commits
    • Kyle Keating's avatar
      14f4ad80
    • Kyle Keating's avatar
      Remove frontend-share subfolder · e3467f5d
      Kyle Keating authored
      - Remove github actions related to frontend-shared
      - Remove scripts and gulp commands related to frontend-shared
      - frontend-shared is now managed from its own repository.
      e3467f5d
    • Kyle Keating's avatar
      Update shared package · 4ac2b1b5
      Kyle Keating authored
      There was a version issue between the current installed version 1.4.0 and the local copy being using in the subfolder (/frontend-shared). The newest shared package exports an _index.scss file which is required by the client, but it was not formally importing a version of the shared package which exported the _index.scss file. The client now imports 1.9.0 which has _index.scss and now the frontend-shared folder can be fully removed from the client.
      
      TL;DR, This is just more reason to move the shared package to its own repo because this issue was being masked.
      4ac2b1b5
    • Robert Knight's avatar
      Fix clicking on PDF closing sidebar when side-by-side is active · f69f3803
      Robert Knight authored
      Fix a regression introduced in b52f00e0 where clicking in a PDF
      when side-by-side is active would cause the sidebar to close instead of
      remaining open. That PR made `PdfSidebar` no longer inherit (indirectly)
      from Guest but did not update the references to the `closeSidebarOnDocumentClick`
      property of the Guest.
      f69f3803
    • Robert Knight's avatar
      Remove `beforeAnnotationCreated` event handler in `DocumentMeta` · 3771ff0e
      Robert Knight authored
      This handler sets the `document` property of new annotations to metadata
      extracted from `<meta>` and `<link>` tags on the page. It is unnecessary
      however because the `Guest` class sets this property using either
      `DocumentMeta.metadata` or `PDF.getMetadata`, depending on the document
      type, before it emits the `beforeAnnotationCreated` event.
      
      In PDFs this code is a serious hazard because if the
      `beforeAnnotationCreated` event subscriber in `DocumentMeta` runs before
      `AnnotationSync`'s corresponding event handler then DocumentMeta will
      overwrite the PDF document-specific annotation metadata with generic
      HTML document metadata - losing the critical `documentFingerprint`
      property. Fortunately this problem did not occur because the `Guest`
      constructor instantiates the `AnnotationSync` class before the
      `DocumentMeta` class. Consequently AnnotationSync's
      `beforeAnnotationCreated` event handler runs before DocumentMeta's and
      pushes new annotations to the sidebar with the correct document metadata
      before `DocumentMeta` overwrites it.
      3771ff0e
    • Kyle Keating's avatar
      Fix test warnings from missing prop · 39d6e181
      Kyle Keating authored
      The ThreadList component has a required felid  `threads` but its value was undefined in tests. The value comes from the mocked version of `useRootThread.children`
      39d6e181
  5. 01 Mar, 2021 3 commits
    • Robert Knight's avatar
      Ensure PDF integration is loaded in PDF documents · bc8ddf96
      Robert Knight authored
      The recent refactor to change the relationship between the `Guest` and `Sidebar`
      classes broke PDF.js integration because the `PdfSidebar` class is no
      longer able to modify the config that is passed to the `Guest` class.
      Previously it would pass `PDF: {}` in the config to the `super()` call
      which would then result in the `Guest` class loading the PDF
      integration.
      
      This now has to be done in the `index.js` module. We already had to do
      this previously for ebooks. Now it has to be done for all scenarios.
      bc8ddf96
    • Eduardo Sanz García's avatar
      Update packages before running prettier · c4e74296
      Eduardo Sanz García authored
      If `make sure` or `make checkformatting` are the first command that are
      run after version update that included prettier, the commands will use
      the previous version of prettier.
      c4e74296
    • Eduardo Sanz García's avatar
      Remove servetests make target · 40ee1f43
      Eduardo Sanz García authored
      With the recent changes in the gulp test command (#2989), everything
      that could be achieved by `make servetest` can be done by options to the
      `make test` target.
      40ee1f43