-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: multi content authoring #4139
Conversation
packages/netlify-cms-core/src/components/Editor/EditorControlPane/EditorControlPane.js
Show resolved
Hide resolved
Thanks, @erezrokah, some comments. |
544d2d0
to
23e7ac8
Compare
@@ -136,6 +140,7 @@ export const defaultSchema = ({ path = requiredString } = {}) => { | |||
status: requiredString, | |||
}).required(), | |||
}) | |||
.xor('entry', 'dataFiles') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either entry
(for backwards compatibility) or dataFiles
must be included in the request, but not both
try { | ||
release = await mutex.acquire(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes #4122
@@ -231,11 +242,23 @@ export const localGitMiddleware = ({ repoPath, logger }: GitOptions) => { | |||
const diffs = await getDiffs(git, branch, cmsBranch); | |||
const label = await git.raw(['config', branchDescription(cmsBranch)]); | |||
const status = label && labelToStatus(label.trim()); | |||
const updatedAt = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes an unrelated bug of dates not showing for editorial workflow entries in local git mode
@@ -6,4 +6,5 @@ export default { | |||
minimize_collapsed: { type: 'boolean' }, | |||
label_singular: { type: 'string' }, | |||
}, | |||
prohibited: ['i18n'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't allow a list field to have a i18n
configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty big change from the previous pull-request.
What was the reason for not including this into the PR and what can I do to help add/implement this again?
The reason why I ask is because I've spent this summer to implement internationalization and used the previous fork and had everything working and just introduced the entire team to my code and it relied on lists. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, going to fix this soon 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that was a fast answer!
I feel like an a**hole for asking but do you have an idea what soon means?
- before this PR is merged?
- days
- weeks
- I don't know
The reason why I ask is because I'm trying to set expectations for my team.
Of course, if you cannot answer or do not want to answer, I totally get it. <3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And again, point me in an direction and I'll try and help out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'll do then is to fork this PR and fix so that multicontent works with single files again and create a new PR once this one has landed. So excited!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the PR is merged 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with lists is when using i18n: duplicate
:
List widgets has a lot of internal state (e.g. toggle status).
To make that work in a good way for i18n: duplicate
we would need to synchronize the internal state of widgets across editors which would require too much work at the moment.
The initial thought was to disable it completely, however it is better to at least allow i18n: true
.
import ajvErrors from 'ajv-errors'; | ||
import { formatExtensions, frontmatterFormats, extensionFormatters } from 'Formats/formats'; | ||
import { getWidgets } from 'Lib/registry'; | ||
import { I18N_STRUCTURE, I18N_FIELD } from '../lib/i18n'; | ||
|
||
const localeType = { type: 'string', minLength: 2, maxLength: 10, pattern: '^[a-zA-Z-_]+$' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there is a error at UI when the locales string is not valid.
But it would be great if there a document to explain the limitation of the locale string.
Because some people like me, may not take a look at the code.
Example:
Limitation Locale Strings
- Minimum length 2
- Maximum length 10
- Allow characters a-z,A-Z and "-", "_"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use https://ajv.js.org/ for validation so a relevant error is printed.
An example error:
d0d32ea
to
1380884
Compare
@erezrokah final thoughts. The |
Thanks @barthc, I couldn't reproduce this issue. Can you post a more detailed reproduction?
Good point, let me look into that. I wanted duplicate fields to show up in the UI (hence I removed the code that duplicates them in
Not sure I understand this point. |
For existing entry, let's say a collection has
As I said it's |
This is really exciting! XD |
I think this is partially broken at the moment - couldn't find any call to |
33434d5
to
ccde073
Compare
ccde073
to
1621ec9
Compare
Hello there and hope everybodys summer was great. ☀️ First, thank you all for moving this track forward and thanks @erezrokah for adding support for list widgets. it was a really nice gesture. We at 29k.org are about to move forward and migrate from the previous multi-content PR and to this abd hope to have something up running in production within a month utilizing it. So is there anything you'd like us to test or help out with? Excited! |
Thanks @reimertz, just testing it out would be great. |
fdec4cc
to
8186d4a
Compare
8186d4a
to
671c705
Compare
Thank you @signalwerk for raising this issue. If/when we add that feature later on we can discuss naming, configuration structure, etc. and backwards compatibility should be handled fairly easily by transforming existing configurations to the new structure. |
@erezrokah I agree. The transformation of the config is indeed simple. And it could probably even co-exist. Thank you all for the big work went into that feature! I'm super excited! |
Whaaaat this is done! Can't wait to try it 🎉 |
This is now released in |
Hello everyone, I'm trying to implement this new feature, but as far as I see the preview only works for the default language. I believe it's related to this: I have this data variable in the preview, and it only returns the default language's content: Obs: I'm using Netlify CMS with gatsby, and the languages are english and portuguese. |
@bernardolima I would suggest you open up a new issue. |
First off, thank you for working on this massive feature, it's amazing to see it in action! 😄 Would there be a way to add an option such as I'm attempting to implement this new configuration into my build, and it's proving to be more cumbersome than I initially anticipated to get it to work with my setup (e.g. Thanks! EDIT: I have seemingly gotten this to work locally by extending |
Hi @chadwithuhc, do you mind opening a new issue/feature request for this? We can discuss possible solutions there |
@erezrokah Created issue #4416 — thanks! |
Impressive work on this one! Just one quick question, is it possible to store the corresponding |
Hi @naton, that is not possible yet. You could extract the |
Thanks! I finally got it to work for me, using |
Hey, great work on this feature so far! I would just like to ask if there is a way for it to automatically produce translations using something like Libre on the go, and also a way to notify the user which posts are missing certain translations or the translations are up for review. I believe these were mentioned back in #716. Great work again! Edit: found it, commented on #716 by @erquhart |
If anyone reaches here looking how to get i18n data in previews here's a test that demonstrates how the translations are structured: 23e2bce#diff-a0137750f308007aeb002ba8fcfb8fa2ab0e4b07eb9678d9baab8e46e3817d61R687 |
Follow up on #3366
Fixes #716
Also fixes #4122
Example configuration:
TODO
Thanks
@barthc, @joallard and a lot more I can't remember at the moment