feat: Index fields
Summary
As described in issue https://github.com/decaporg/decap-cms/issues/7381 we need a way to have a specific field set for index files in collections. More info coming as we smooth out the details and clean up the code.
Update March 5th: Added an option to select path type when adding new entries in such collections. Updated proxy and github backends to work in combination with the new nested system, i18n.
It is ready for some careful internal testing, but there is a ton of stuff still to do:
- [ ] discuss and agree upon the config structure and all the terms used
- [ ] heavy refactoring, according to above
- [ ] updating other backends
- [ ] updating tests
- [x] update and uncomment path validation
- [x] test changing index -> single and vice versa
Test plan
Add the following config to the collection options. Pattern is required. Fields are optional, setting them will result in a different entry form for this file. Label is also optional and will add prefix to the title in the entry list.
index_file: {
pattern: "^index$",
fields: [
...
],
label: 'Index'
}
Checklist
Please add a x inside each checkbox:
- [ ] I have read the contribution guidelines.
A picture of a cute animal (not mandatory but encouraged)
We need to handle the deletion of entries that are missing some translations. Currently, we get API_ERROR: GitRPC::BadObjectState error. This is the case when we have multiple files for locales, I did not test same-file cases.