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

fix(i18n): data is not duplicated for default value setting #4463

Merged

Conversation

blackb1rd
Copy link
Contributor

Closes #4356

I'm not familar with React if any going wrong let me know.

@blackb1rd blackb1rd requested a review from a team October 16, 2020 19:40
@blackb1rd blackb1rd marked this pull request as draft October 17, 2020 03:45
@blackb1rd
Copy link
Contributor Author

blackb1rd commented Oct 17, 2020

simple_workflow_spec_proxy_git_backend.js failed, it seems not releted to the code change. running local and passing

For i18n_simple_workflow_spec_proxy_fs_backend.js

  1. I18N Proxy Backend Simple Workflow - 'fs' mode
    can create entry with translation in locale_folders mode:

    Timed out retrying

    • expected - actual

    -'---\ntemplate: post\ntitle: de\ndate: 1970-01-01T00:00:00.000Z\n---\n'
    +'---\ntitle: de\ndate: 1970-01-01T00:00:00.000Z\n---\n'

Not sure what we are expecting this test...

@blackb1rd
Copy link
Contributor Author

blackb1rd commented Oct 17, 2020

simple_workflow_spec_proxy_git_backend.js failed, it seems not releted to the code change. running local and passing

For i18n_simple_workflow_spec_proxy_fs_backend.js

  1. I18N Proxy Backend Simple Workflow - 'fs' mode
    can create entry with translation in locale_folders mode:
    Timed out retrying

    • expected - actual

    -'---\ntemplate: post\ntitle: de\ndate: 1970-01-01T00:00:00.000Z\n---\n'
    +'---\ntitle: de\ndate: 1970-01-01T00:00:00.000Z\n---\n'

Not sure what we are expecting this test...

Seems we are expecting template: post all locales.

@blackb1rd blackb1rd marked this pull request as ready for review October 17, 2020 12:31
@erezrokah erezrokah added the type: bug code to address defects in shipped code label Oct 20, 2020
Copy link
Contributor

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for jumping on this @blackb1rd.

The tests were failing since this fix will result in any field with a default value to be a part of the i18n entries (even if they are not configured as ones).

With this fix the template field is written to the i18n entries:
https://github.com/netlify/netlify-cms/blob/736ca57d6edfa0c7520db6be7978c3352463b839/dev-test/backends/proxy/config.yml#L21

and it shouldn't.

We'll need to duplicate only fields that has i18n as translate or duplicate set on them.

@blackb1rd blackb1rd force-pushed the fix/i18n/4356_data_is_not_duplicated branch from 05e4a47 to 7ba3e3f Compare October 26, 2020 14:42
@blackb1rd
Copy link
Contributor Author

We'll need to duplicate only fields that has i18n as translate or duplicate set on them.

@erezrokah done as your requested.

@blackb1rd blackb1rd requested a review from erezrokah October 26, 2020 15:56
@erezrokah erezrokah force-pushed the fix/i18n/4356_data_is_not_duplicated branch from 7ba3e3f to 22d06f2 Compare November 2, 2020 14:19
Copy link
Contributor

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @blackb1rd, I added another commit with some code cleanup - mostly to extract the i18n specific logic from createEmptyDraftData

@erezrokah erezrokah merged commit 1777665 into decaporg:master Nov 2, 2020
@blackb1rd
Copy link
Contributor Author

@erezrokah awesome 😀 and waiting for release version with this fix 😘

@erezrokah
Copy link
Contributor

This is now released https://github.com/netlify/netlify-cms/releases

vladdu pushed a commit to vladdu/netlify-cms that referenced this pull request Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

i18n: data is not duplicated for default value setting
2 participants