[Go] Write required string fields into the buffer when using Object API
In C++, CreateX allows to write the default "" value of a required string, when the string is not explicitly set (i.e., here). Object API Pack method uses this implementation of CreateX.
However, in go, despite whether the field is optional or required, it is always checked against empty string allowing to create messages that fail to pass the verifier. This commit partially reverts #7719 when the string field is required. It also affects string fields marked as key, which are considered required (i.e., here).
I was going ot merge this but then I noticed there are a handful of missing translations to fix.
unsavedChanges: undefined,Do you want to take care of that before I merge?
@DanRibbens undefined translations have been fixed 👍
I tried to test the feature with blocks and it errored for me. This was taken from our test/localization suite working with the Nested Arrays collection.
I'm not sure if this is because the collection has versions enabled or if it was nested data that couldn't be handled.
Aside from this, I have UX concerns about this feature as it would be too easy for a user to click the wrong locale and overwrite some existing data. It feels to me like we should have a modal or something to add an additional step for acknowledging that they might be overwriting everything in a document on the target locale.
The copy button should look more like a secondary actions with dropdown options like this:
Changes made:
- Fix copying any nested or relationship fields
- Improve button UI
- Add confirmation modal before copying
- Redirect to new locale
I found two more issues while reviewing this. Pardon me if you're still working on these details, thought I'd better share while you're still working on it!
- When I copy with nested blocks it is no longer erroring, but the data doesn't copy in a blocks field. The locale data is just empty in the target locale after a "successful" copy. Before copy: After:
- When editing a doc with drafts enabled, I don't have the Copy button.
Hey @DanRibbens these two issues are fixed and PR ready for review!
🚀 This is included in version v3.2.0
@JessChowdhury can this action be executed from another part of the document screen? Like adding a new button next to the "Save" Button or something
I'm not sure if this is because the collection has versions enabled or if it was nested data that couldn't be handled.