Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor / Add support for conditional default view #8548

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

fxprunayre
Copy link
Member

When creating an editor configuration with more than one default view an exception is returned.

Error on line 82 of edit.xsl:
  XPTY0004: A sequence of more than one item is not allowed as the second argument of concat()

Instead, select the first default view defined.

Also add support for conditionally defined default views:

    <view name="default-for-dataset"
          default="true"
          displayIfRecord="count(//dcat:Catalog/dcat:dataset) > 0">
      <tab id="Dataset" default="true">
        <section name="Dataset info"/>
      </tab>
    </view>
    <view name="default-for-service"
          default="true"
          displayIfRecord="count(//dcat:Catalog/dcat:service) > 0">
      <tab id="Service" default="true">
        <section name="Service info"/>
      </tab>
    </view>

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

When creating an editor configuration with more than one default view an exception is returned.

```
Error on line 82 of edit.xsl:
  XPTY0004: A sequence of more than one item is not allowed as the second argument of concat()
```

Instead, select the first default view defined.

Also add support for conditionally defined default views:

```xml
    <view name="default-for-dataset"
          default="true"
          displayIfRecord="count(//dcat:Catalog/dcat:dataset) > 0">
      <tab id="Dataset" default="true">
        <section name="Dataset info"/>
      </tab>
    </view>
    <view name="default-for-service"
          default="true"
          displayIfRecord="count(//dcat:Catalog/dcat:service) > 0">
      <tab id="Service" default="true">
        <section name="Service info"/>
      </tab>
    </view>
```
@fxprunayre fxprunayre added this to the 4.4.7 milestone Dec 10, 2024
Copy link

sonarcloud bot commented Dec 10, 2024

Copy link
Collaborator

@joachimnielandt joachimnielandt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally with two views defined as default=true, editor loads fine.

@fxprunayre fxprunayre merged commit d5dc0d6 into main Dec 11, 2024
10 checks passed
@fxprunayre fxprunayre deleted the 44-editormultipledefaultviewsupport branch December 11, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants