Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-5866

Allow multiple templates using nuxeo-data-table for the same field type

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.30.0
    • Fix Version/s: 3.31.0
    • Component/s: Studio Designer

      Description

      The problem is easier to understand through an example:

      Given that the Designer registries define these templates for the following field types:

      • string
        • Text: using nuxeo-input (default template for edit mode)
        • Textarea: using nuxeo-textarea
      • string[]
        • Text: using nuxeo-data-table (default template for edit mode)
        • Textarea: using nuxeo-data-table

      Currently, when a string[] field is scaffolded using a nuxeo-data-table, the default view or edit template for string will be used on each of the rows of the table. This means that both templates for string[] will generate the same config, as they do not specify which element/template is supposed to be used inside it.
      The goal of this ticket is to provide some flexibility to this mechanism, and allow specifying the element/template to be used directly from the registries.

      Proposal: Reference the (single-valued) widget to be used by name.

      "string[]": [
        {
          "default": "edit",
          "name": "Text",
          "is": "nuxeo-data-table",
          "rowWidget": "Text",
          "attributes": [...]
        }
      ]
      

      This would represent the definition of a widget for a string[] property, using the nuxeo-data-table element. Notice how it references a "Text" row widget via rowWidget (could have another name). This "Text" widget should be a valid widget defined for the string field.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 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 - 1 day, 1 hour
                  1d 1h