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

Fix creating document creator not being contributor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Not A Bug
    • Affects Version/s: 10.10
    • Fix Version/s: None
    • Component/s: Tests, Web UI
    • Tags:
    • Team:
      UI
    • Sprint:
      QA - 11.1.19, QA - 11.1.25, QA - 11.1.32, QA - 11.1.33, nxApps 2020 Cycle 12, nxApps 2021 Cycle 1, nxApps 2021 Cycle 2
    • Story Points:
      3

      Description

      When using the nuxeo-web-ui-ftest framework, when provisioning, the created documents are being created by a chosen user but the contributor is still Administrator. The creator of a document should also be a contributor.

      Example in step used in search.feature

      • search.js
        Given(/^I have the following documents$/, (table) => {
          browser.pause(1000);
          const tasks = table.rows().map(row => () => {
            const doc = fixtures.documents.init(row[0]);
            doc.name = row[1];
            doc.properties = {
              'dc:title': row[1],
              'dc:nature': row[2],
              'dc:subjects': [row[3]],
              'dc:coverage': row[4],
            };
            if (row[0] === 'Note') {
              doc.properties = {
                'dc:title': row[1],
                'dc:nature': row[2],
                'dc:subjects': [row[3]],
                'dc:coverage': row[4],
                'note:note': 'Lorem Ipsum',
              };
            }
            // create the document
            return fixtures.documents.createWithAuthor(row[6], doc, row[5]).then((docWithAuthor) => {
              if (row[7].length > 0) {
                return fixtures.collections.addToCollection(docWithAuthor, row[7]).then((docInCollection) => {
                  if (row[8].length > 0) {
                    return fixtures.documents.addTag(docInCollection, row[8]).then((docWithTag) => {
                      if (row[9].length > 0) {
                        return fixtures.documents.attach(docWithTag, fixtures.blobs.get(row[9]));
                      }
                    });
                  }
                });
              }
            });
          });
          return tasks.reduce((current, next) => current.then(next), Promise.resolve([]));
        });
        
      • document.js:
      createWithAuthor: (parent, document, username) => nuxeo.repository()
          .create(parent, document)
          .then((doc) => {
            liveDocuments.push(doc.uid);
            if (username) {
              return doc.set({
                'dc:creator': username,
              }).save();
            }
            return doc;
          }),
      

        Attachments

          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 - 30 minutes
                30m