Uploaded image for project: 'Nuxeo Elements'
  1. Nuxeo Elements
  2. ELEMENTS-872

Fix entity resolution in nuxeo-document-suggestion element

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.4.5, 3.0.0
    • Component/s: Selectivity, UI
    • Release Notes Summary:
      The nuxeo-document-suggestion element resolves entities.
    • Backlog priority:
      600
    • Sprint:
      nxGang Sprint 11.1.6
    • Story Points:
      3

      Description

      Scenario to highlight the issue:

      1. Define a document type with a Document metadata (same with User or Directory metadata)
      2. Use the nuxeo-document-suggestion element with a custom selection formatter method and try to read a property on the Document metadata for the target document
        <nuxeo-document-suggestion ... selection-formatter="{{_selectionFormatter}}"></nuxeo-document-suggestion>
        
        ...
        
        _resultFormatter(doc)  {             
            console.log(doc); // will display an id
            return doc.properties['custom:doc'].title;
        }  
        
      3. Observe that the title is not displayed

      Looking at the payload returned by the Repository.PageProvider operation, the entity is not resolved, only the document id is there for "custom:doc"

        {
               "isCheckedOut" : true,
               "title" : "mydoc 2",
               "path" : "/default-domain/workspaces/user/folder/mydoc2",
               "facets" : [
                  "Versionable",
                  "NXTag",
                  "Publishable",
                  "Commentable",
                  "HasRelatedText",
                  "Downloadable"
               ],
               "parentRef" : "d58d5d32-818b-4583-9767-a72c8f2117ac",
               "isVersion" : false,
               "state" : "project",
               "lastModified" : "2019-02-18T10:55:47.264Z",
               "uid" : "6b51c66d-6413-4bee-ab85-09e977047d11",
               "isProxy" : false,
               "repository" : "default",
               "properties" : {
                  "custom:mydocs" : [],
                  "custom:extrait" : null,
                  "custom:doc" : "9eb41232-b90e-4361-a725-3e12bfc68d54"
               },
               "entity-type" : "document",
               "type" : "CustomDoc",
               "changeToken" : "5-0"
            }
         ],
         "hasError" : false,
         "isPaginable" : true,
         "isNextPageAvailable" : false,
         "pageCount" : 1
      }
      

        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 - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h