Uploaded image for project: 'Nuxeo Web UI'
  1. Nuxeo Web UI
  2. WEBUI-1202

Fix blob enrichers initialization when WOPI is installed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.x
    • Fix Version/s: 3.0.26, 3.1.3
    • Component/s: WOPI
    • Release Notes Summary:
      When using the WOPI addon, the related button is now displayed on first load for a document
    • Backlog priority:
      700
    • Sprint:
      UI COOLDOWN - 2023-7, UI - 2023-8
    • Story Points:
      3

      Description

      Steps to reproduce

      1. install the Nuxeo WOPI addon :
        nuxeoctl mp-install nuxeo-wopi
      2. Set the WOPI properties in nuxeo.conf (the values are not important to reproduce)
        nuxeo.jwt.secret=xxx
        nuxeo.wopi.discoveryURL=https://onenote.officeapps.live.com/hosting/discovery
        nuxeo.wopi.baseURL=https://tech.com/nuxeo
        
      3. Log in as Administrator
      4. Navigate to the personal workspace
      5. Upload a .docx file
      6. Do a refresh of the page
      7. Observe that the WOPI button is not displayed among the blob actions <== this is the bug
      8. Navigate to the parent
      9. Navigate back to the document
      10. Observe that now the WOPI button is displayed among the blob actions

      Analysis:

      After doing a refresh, the "wopi" value is not passed to the "Enrichers-Blob" header => it's causing the bug

      The "wopi" value is added by nuxeo-wopi.bundle.js.

              const a = window.Nuxeo || {};
              a.UI = a.UI || {},
              a.UI.config = a.UI.config || {},
              a.UI.config.enrichers = a.UI.config.enrichers || {},
              a.UI.config.enrichers.blob = a.UI.config.enrichers.blob || [],
              a.UI.config.enrichers.blob.push("wopi"); 

      However it seems that this code is executed too late (= after the call to compute the enrichers)

      From main.bundle.js:

                      _loadDocument(e) {
                          return this.loading = !0,
                          this.docId = e.uid,
                          this.docPath = e.path,
                          this.$.doc.headers = this._computeHeaders(),
                          this.$.doc.enrichers = this._computeEnrichers(), 

        Attachments

        There are no Sub-Tasks for this issue.

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 week, 5 hours
                1w 5h
                Remaining:
                Time Spent - 4 days, 4 hours Remaining Estimate - 1 day, 1 hour
                1d 1h
                Logged:
                Time Spent - 4 days, 4 hours Remaining Estimate - 1 day, 1 hour
                4d 4h