Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27414

nuxeo-document-attachments incorrect preview links

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.10-HF31
    • Fix Version/s: 9.10-HF32
    • Component/s: Web UI

      Description

      Studio-side

      1. in SETTING / Application Definition
      2. in Packages to install ensure Nuxeo Web UI and Nuxeo DAM are present
      3. save the project
      4. create a custom document type named MyCustomVideo inheriting from Video
      5. in Designer configure the view layout with the following code:
        <!--
        `nuxeo-mycustomvideo-view-layout`
        @group Nuxeo UI
        @element nuxeo-mycustomvideo-view-layout
        -->
        <dom-module id="nuxeo-mycustomvideo-view-layout">
          <template>
            <style>
              *[role=widget] {
                padding: 5px;
              }
            </style>
            <nuxeo-document-viewer role="widget" document="[[document]]"></nuxeo-document-viewer>
            <nuxeo-document-attachments role="widget" document="[[document]]"></nuxeo-document-attachments>
        
          </template>
        
          <script>
          Polymer({
            is: 'nuxeo-mycustomvideo-view-layout',
            behaviors: [Nuxeo.LayoutBehavior],
            properties: {
        
              /**
                 * @doctype MyCustomVideo
                 */
              document: {
                type: Object,
              },
        
            }
          });
          </script>
        </dom-module>
        
        
      6. save the project

      Server-side

      1. install nuxeo 9.10 (not with a later version)
      2. install nuxeo-web-ui and nuxeo-dam addons
      3. start the server
      4. sync the project
      5. create a workspace
      6. in the workspace create a video document with a main attachment (a video of course)
      7. on the right panel attach a 2nd video
      8. on the right panel attach a 3rd video
      9. wait for the preview to be generated
      10. click the preview button (the eye) for the main video
      11. observe it is working fine
      12. click the preview button (the eye) for the 2nd video
      13. observe the preview displayed is the one for the 1st video
      14. click the preview button (the eye) for the 3rd video
      15. observe the preview displayed is the one for the 1st video

      Server-side (bis) - retry the same scenario with Nuxeo 10.10 or master

      1. observe each preview is correctly displayed

      Expected behavior: each preview button should trigger the display of the right preview and not the one from the main blob.
      Note: This works fine with 10.10 and later versions, thus affecting only 9.10. The code has changed between 9.10

            <template is="dom-repeat" items="[[document.properties.files:files]]">
              <nuxeo-document-blob document="[[document]]" xpath="files:files/[[index]]/file"></nuxeo-document-blob>
            </template>
      

      https://github.com/nuxeo/nuxeo-web-ui/blob/9.10/elements/nuxeo-document-attachments/nuxeo-document-attachments.html#L55
      and 10.10 :

            <template is="dom-repeat" items="[[_computeFiles(document.*, xpath)]]">
              <nuxeo-document-blob document="[[document]]" xpath="[[_computeBlobXpath(xpath, index)]]"></nuxeo-document-blob>
            </template>
      

      https://github.com/nuxeo/nuxeo-web-ui/blob/10.10/elements/nuxeo-document-attachments/nuxeo-document-attachments.html#L55

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 1 hour, 10 minutes
                  2d 1h 10m