-
Notifications
You must be signed in to change notification settings - Fork 615
Pro 8541 switch locale empty doc #5135
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
base: main
Are you sure you want to change the base?
Conversation
…to parent component
…ehavior, emit entire locale
…s when localizing
…Name to localize modal, sets missing currentId
| "willMoveImageToArchive": "Tým sa obrázok presunie do archívu.", | ||
| "yes": "Áno", | ||
| "yesLocalizeAndSwitchLocales": "Áno, preložte túto stránku a prepnite jazykovú mutáciu", | ||
| "yesLocalizeAndSwitchLocalesDoc": "Sim, localizar este {{ docType }} e trocar idiomas", |
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 portugese
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.
fixed
| }, | ||
| computed: { | ||
| ...mapState(useModalStore, [ 'activeModal', 'updateModalData' ]), | ||
| ...mapState(useModalStore, [ 'activeModal' ]), |
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 still use updateModalData, why did we removed it?
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 it was already here in the methods, so when you added it in the computed it created a duplicates warning. (methods should be added to methods not computed which is for reactive data: refs / computed).
CHANGELOG.md
Outdated
|
|
||
| ### Adds | ||
|
|
||
| * When switching locale from the doc editor, ask the user if he wants to localize the current one in the target locale or want to start a blank document. |
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.
| * When switching locale from the doc editor, ask the user if he wants to localize the current one in the target locale or want to start a blank document. | |
| * When switching locale from the doc editor, ask if the user wants to localize the current document in the target locale or want to start a blank document. |
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.
changed
b28a981 to
c03f0e3
Compare
| }, | ||
| isBatchMode() { | ||
| return this.batchOptions.enabled; | ||
| }, |
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.currentLocale is still used in this file
| } | ||
| }, | ||
| close() { | ||
| close(hasBeenSubmitted = false) { |
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.
A bit confusing, don't think it has anything to do with submit draft feature, so I don't know what this is
| } | ||
| }); | ||
| if (result.redirectTo) { | ||
| if (this.redirect && result.redirectTo) { |
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.
if you don't want to redirect, why do we return a redirectTo property? We then add a new vue prop to skip the redirect if it's there. It works ok, I'm confused.
| const forbiddenTooltip = $t('apostrophe:localeSwitcherPermissionToCreate', { | ||
| docType: props.moduleOptions.label.toLowerCase() | ||
| }); | ||
| const docType = $t(props.moduleOptions.label)?.toLowerCase(); |
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.
I don't think this is a reliable way to get the doc type. It should be props.moduleOptions.name.
| if (isLocalized) { | ||
| this.switchModalLocale(locale.name); | ||
| await this.$nextTick(); |
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.
Why here only?
Summary
See ticket, flow support:
Cypress tests: https://github.com/apostrophecms/testbed/pull/399
What kind of change does this PR introduce?
Make sure the PR fulfills these requirements: