33 class="apos-wizard apos-i18n-localize"
44 :class =" { ' apos-wizard-busy' : wizard .busy } "
55 :modal =" modal "
6- :modal-data =" modalData "
7- @esc =" close ()"
6+ @esc =" close "
87 @inactive =" modal .active = false "
98 @show-modal =" modal .showModal = true "
109 >
2827 type="default"
2928 label="apostrophe:cancel "
3029 :modifiers =" [ ' block' ] "
31- @click =" cancel () "
30+ @click =" cancel "
3231 />
3332 </div >
3433 </template >
@@ -326,10 +325,6 @@ export default {
326325 required: true ,
327326 type: String
328327 },
329- modalData: {
330- type: Object ,
331- required: true
332- },
333328 shouldRedirect: {
334329 type: Boolean ,
335330 default: true
@@ -493,6 +488,13 @@ export default {
493488 isBatchMode () {
494489 return this .batchOptions .enabled ;
495490 },
491+ currentLocale () {
492+ // We need to grab the locale from the modal data, because it can change
493+ // while in modal (switch locale in editor modal).
494+ // Exposing `modalData` property breaks the internally used AposModal
495+ // component for some unknown reason, so we need to use the attrs.
496+ return this .$attrs [' modal-data' ]? .locale ?? this .moduleOptions .locale ;
497+ },
496498 action () {
497499 return this .doc .slug .startsWith (' /' )
498500 ? apos .page .action
@@ -518,7 +520,7 @@ export default {
518520 },
519521 relatedDocTypes () {
520522 if (this .isBatchMode ) {
521- return this .getRelatedSchemaTypes (this .batchOptions .checkedTypes );
523+ this .getRelatedSchemaTypes (this .batchOptions .checkedTypes );
522524 }
523525
524526 const types = {};
@@ -708,7 +710,7 @@ export default {
708710 return this .wizard .step === name;
709711 },
710712 isCurrentLocale (locale ) {
711- return this .modalData . locale === locale .name ;
713+ return this .currentLocale === locale .name ;
712714 },
713715 canEditLocale (locale ) {
714716 return !! locale ._edit ;
@@ -1178,7 +1180,7 @@ export default {
11781180 this.wizard.values.translateTargets.data = [];
11791181 return;
11801182 }
1181- const sourceLocale = this.modalData.locale ;
1183+ const sourceLocale = this.currentLocale ;
11821184 const targets = this.wizard.values.toLocales.data;
11831185
11841186 let response;
0 commit comments