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

Issue: update from 8.2.0 to 8.3.0 breaks editing of arrays in data view #531

Closed
Mai-Lapyst opened this issue Mar 12, 2023 · 2 comments
Closed
Labels

Comments

@Mai-Lapyst
Copy link

Describe the bug
When defining a data type which has a array as member, the fields dont get loaded and stored correctly.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project
  2. Initialize frontmatter
  3. Add following to frontmatter.json
    "frontMatter.data.types": [
      {
        "id": "bass_player",
        "schema": {
          "title": "Bass Player",
          "type": "object",
          "required": ["discography"],
          "properties": {
            "name": {
              "type": "string"
            },
            "discography": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    ],
    "frontMatter.data.folders": [
      {
        "id": "bass_players",
        "path": "[[workspace]]/data/jazz/bass",
        "type": "bass_player",
        "singleEntry": true
      }
    ]
  4. Add a data file: data/jazz/bass/jacopastorius.json:
    "name": "Jaco Pastorius",
    "discography": [
      "1974 - Modern American Music … Period! The Criteria Sessions",
      "2003 - Punk Jazz: The Jaco Pastorius Anthology (compilation)",
      "2007 - The Essential Jaco Pastorius (compilation)"
    ]
  5. Open the data view in front matter

Expected behavior
That arrays are editable in the data view.

Screenshots
Version 8.2.0:
image

Version 8.3.0:
image

Desktop (please complete the following information):

  • OS: Linux
  • Browser VScode
  • Version 1.76.0

Additional context
Seems mostly due to this line being commented out:

// name: (child.props.name || '').replace('$', '' + itemIndex),

@Mai-Lapyst Mai-Lapyst added the bug Something isn't working label Mar 12, 2023
@estruyf
Copy link
Owner

estruyf commented Mar 13, 2023

Thank you @Mai-Lapyst, for reporting and investigating the issue. The prettier changes that were PR-ed recently accidentally commented on this line.

I have reverted the change and tested it with your configuration. The fix is now included in the latest beta.

@Mai-Lapyst
Copy link
Author

@estruyf thanks for the qiuck response; have tested the beta, and can confirm that it works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants