[MGNLUI-6603] defaultValue for preconfigured link fields doesn't work (page,json,damLinkField) Created: 18/Dec/20  Updated: 20/May/21  Resolved: 10/May/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.6
Fix Version/s: 6.2.9

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Adam Siska
Resolution: Done Votes: 1
Labels: VN-Testing
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
documentation
to be documented by MGNLUI-6708 DOC: Setting default values for preco... Closed
relation
supersession
is superseded by MGNLUI-6375 Remove generic type of default value ... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Documentation update required:
Yes
Date of First Response:
Epic Link: Improve Content Linking
Sprint: UI FW 27
Story Points: 1

 Description   

In the documentation we specify that there is a defaultValue configuration for all link fields. See https://docs.magnolia-cms.com/product-docs/Templating/Dialog-definition/Field-definition/List-of-fields/Link-field.html. When trying to configure it on the jsonLinkField nothing is written to the field.



 Comments   
Comment by Adam Siska [ 10/May/21 ]

After MGNLUI-6375 one can set defaultValue to preconfigured linkFields in this manner:

pageLinkField:

  • path or UUID can be set (i.e. same as for basic jcr linkField)

 

pageLinkPath:
  $type: pageLinkField
  defaultValue: /travel
pageLinkUUID:
  $type: pageLinkField
  defaultValue: 53b073cc-ea3a-4e44-bdea-8c8a790b55c5

 

damLinkField:

  • UUID with prefix can be set

 

damLinkUUID:
  $type: damLinkField
  defaultValue: jcr:baa86f2d-b1c6-413e-9879-bc2b166f9f1d

 

jsonLinkField

  • string value can be set

 

jsonLink:
  $type: jsonLinkField
  defaultValue: Andorra
  chooser:
    workbenchChooser:
      datasource:
        $type: jsonDatasource
        restClient: countries
        restCall: allCountries
        jsonPathExpressions:
          itemId: '$.name'
          items: '$.*'
          describeBy: '$.name'
          properties:
            name: '$.name'
      workbench:
        contentViews:
          - name: list
            $type: listView
            columns:
              - name: name
                label: Name

 

(this ^ example is definition from linked SUPPORT ticket adapted for declarative-rest-demo)

Generated at Mon Feb 12 09:38:08 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.