-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(nested collections): allow non-index files #7359
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
Conversation
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>
We use regexps as otherwise .contains("Sub Directory") would also match "Another Sub Directory"
Amazing work once again @fgnass . I discussed and tested this with @martinjagodic against some of our projects that use this. I don’t think the breaking change dramatically changes the behaviour for current implementations, especially since the whole feature is still marked as Beta. I suggest release this and discuss some kind of a temporary legacy mode in case of some reasonable concerns arise from the community. We did encounter a semi-related issue though. When getNodeTitle obtains the title it will take the title of the first child, which is the _index file unless in this edge case there is a file name that starts with a number. In this case this will be the title of the section. We will investigate this a bit and open an issue that will address this and maybe even add a possibility to take the dir name as nodeTitle when _index file is not present. |
* feat(nested collections): allow non-index files (decaporg#7359) * feat(nested collections): allow non-index files 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> * test(e2e): adapt to new way nested collections work We use regexps as otherwise .contains("Sub Directory") would also match "Another Sub Directory" --------- Co-authored-by: Andrew Dunkman <adunkman@gmail.com> Co-authored-by: Eric Gade <105373963+eric-gade@users.noreply.github.com> Co-authored-by: Anze Demsar <anze.demsar@p-m.si> * fix(markdown): convert inline CSS from Google Docs to Markdown (decaporg#7351) Extends the HTML to Markdown conversion to better support bold and italic formatting from Google Docs, which generates inline styles on a `span` element instead of strong/b/em/i type elements. Co-authored-by: Anze Demsar <anze.demsar@p-m.si> * feat: visual editing (click-to-edit) (decaporg#7374) * refactor: clean up controlRef handling * feat: add click-to-edit * test: update snapshots --------- Co-authored-by: Anze Demsar <anze.demsar@p-m.si> * fix(widgetsFor): return widgets for variable type lists (decaporg#7296) When using a Variable Type list widget and a custom preview component, the `widgetsFor` helper would only return a `data` list with each of the items in the list, not a `widgets` list, e.g. {"data" => {"markdown" => "# Title"} {"type" => "block_body"} } {"widgets" => undefined} 🚫 The `widgets` list should also be supplied, particularly for nested Markdown widgets, so a fully formatted preview can be rendered: {"data" => {"markdown" => "# Title"} {"type" => "block_body"} } {"widgets" => {"markdown" => Object} ✅ } This extends support in `widgetsFor` to detect variable type list widgets and correctly construct the `widgets` return value. As reported at decaporg#2307 (comment) Co-authored-by: Anze Demsar <anze.demsar@p-m.si> * chore(release): publish - decap-cms@3.6.0 - decap-cms-app@3.6.0 - decap-cms-core@3.6.0 - decap-cms-lib-util@3.2.0 - decap-cms-widget-list@3.3.0 - decap-cms-widget-markdown@3.3.0 - decap-cms-widget-object@3.3.0 - decap-server@3.2.0 * fix(ObjectControl): hotfix nested object validation (decaporg#7385) * chore(release): publish - decap-cms@3.6.1 - decap-cms-app@3.6.1 - decap-cms-widget-object@3.3.1 * chore: update to upload-artifact@v4 (decaporg#7388) * feat(nested collections) legacy mode (decaporg#7387) * feat(nested-collections): opt-in to legacy nested folder behaviour * style: lint * feat(nested-collection): default subfolders to true * test(nested-collections): keep the tests in the subfolders: false scenario * chore(release): publish - decap-cms@3.6.2 - decap-cms-app@3.6.2 - decap-cms-core@3.6.1 * fix(nested-i18n): pass newPath only when customPath differs from current path (decaporg#7418) * fix(decaporg#7371): Duplicate Localized Content When Duplicating Entries with i18n Enabled (decaporg#7372) * chore: add i18n to EntryObject type * fix: draftDuplicateEntry function duplicate i18n data --------- Co-authored-by: Anze Demsar <anze.demsar@p-m.si> * chore(release): publish - decap-cms@3.6.3 - decap-cms-app@3.6.3 - decap-cms-core@3.6.2 * Update README.md, fix spelling error (decaporg#7472) * PNW-2564 - duplicate workflow (#21) * Merge with feature/PNW-2564_duplicate--wip * feat: duplicate workflow wip * feat: duplicate workflow wip * feat: added local empty draft * feat: added isCustomEntry to edit state with data * feat: added function to retrieve current unpublished entries * feat: added enty and avoid problems if empty is missing * feat: refactor context structure and error name with integration --------- Co-authored-by: Felix Gnass <fgnass@gmail.com> Co-authored-by: Andrew Dunkman <adunkman@gmail.com> Co-authored-by: Eric Gade <105373963+eric-gade@users.noreply.github.com> Co-authored-by: Anze Demsar <anze.demsar@p-m.si> Co-authored-by: Dominic Cleal <dominic.cleal@freeagent.com> Co-authored-by: Anze Demsar <demshy@gmail.com> Co-authored-by: starkovio <deniss@n3xtcoder.org> Co-authored-by: kare-rentelligent <128468921+kare-rentelligent@users.noreply.github.com>
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:
NestedCollection.spec.js
to align with the updated codebase.Test Plan
NestedCollection.spec.js
, pass successfully.Checklist
A picture of a cute animal (not mandatory but encouraged)