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

feat(nested collections): allow non-index files #7359

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fgnass
Copy link

@fgnass fgnass commented Dec 23, 2024

This PR is based on #6498 and resolves all outstanding merge conflicts. It recreates the necessary test snapshots and ensures the feature aligns with the latest codebase.

Summary

This commit fixes #4972 to allow nested folders with additional content beyond an index file.

Side effect: To keep the feature simple, this will now show index files as pages within a folder in NetlifyCMS. This enables creating additional files alongside the given index, but is a change in behavior from the current implementation.

Additionally, this PR:

Test Plan

  1. Run the test suite:
    npm test
    
  2. Verify that all tests, including the recreated snapshot for NestedCollection.spec.js, pass successfully.
  3. Manually test the behavior of nested folders with additional content to ensure it functions as expected.

Checklist

  • I have read the contribution guidelines.
  • Tests have been updated to reflect changes.
  • Changes have been manually verified.

A picture of a cute animal (not mandatory but encouraged)

my-cat

This commit fixes decaporg#4972 to allow nested folders with additional content
beyond an index file.

Side effect: To keep the feature simple, this will now show index files
as pages within a folder in NetlifyCMS. This enables creating additional
files alongside the given index, but is a change in behavior from the
current implementation.

Co-authored-by: Eric Gade <105373963+eric-gade@users.noreply.github.com>
@fgnass fgnass requested a review from a team as a code owner December 23, 2024 12:59
 We use regexps as otherwise .contains("Sub Directory") would also match "Another Sub Directory"
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.

Make nested collections work with a flat content structure
2 participants