diff --git a/app/components/forms/orders/attendee-list.js b/app/components/forms/orders/attendee-list.js index 89111ef698d..0c6377fe448 100644 --- a/app/components/forms/orders/attendee-list.js +++ b/app/components/forms/orders/attendee-list.js @@ -84,23 +84,6 @@ export default class AttendeeList extends Component { return groupBy(customFields, field => field.get('form')); } - prepareFieldId(fieldIdentifier, holderIndex, fieldIndex) { - return `${fieldIdentifier}_${holderIndex}_${fieldIndex}`; - } - - get fieldNameConvertRichText() { - const fields = orderBy(this.fields.toArray(), 'position'); - this.holders.forEach((holder, indexHolder) => { - fields.forEach((field, index) => { - const elem = document.getElementById(this.prepareFieldId(field.fieldIdentifier, indexHolder, index)); - if (elem) { - elem.innerHTML = field.transName; - } - }); - }); - return null; - } - @action toggleEditFields() { this.editFields = !this.editFields; diff --git a/app/components/forms/orders/order-form.js b/app/components/forms/orders/order-form.js index f5d4cd64a01..b05766eeef4 100644 --- a/app/components/forms/orders/order-form.js +++ b/app/components/forms/orders/order-form.js @@ -630,7 +630,9 @@ export default Component.extend(FormMixin, { if ((main_language && main_language.split('-')[0] === current_locale) || !field.translations || !field.translations.length) { field.transName = field.name; } else if (field.translations?.length) { + const transName = field.translations.filter(trans => trans.language_code.split('-')[0] === current_locale); + if (transName.length) { field.transName = transName[0].name; } else { @@ -639,6 +641,7 @@ export default Component.extend(FormMixin, { } else { field.transName = field.name; } + return !isFixed; }), ['position']); return groupBy(requiredFixed.concat(customFields), field => field.get('form')); @@ -661,23 +664,6 @@ export default Component.extend(FormMixin, { return 'hello'; }, - prepareFieldId(fieldIdentifier, holderIndex, fieldIndex) { - return `${fieldIdentifier}_${holderIndex}_${fieldIndex}`; - }, - - get fieldNameConvertRichText() { - const fields = orderBy(this.fields.toArray(), 'position'); - this.holders.forEach((holder, indexHolder) => { - fields.forEach((field, index) => { - const elem = document.getElementById(this.prepareFieldId(field.fieldIdentifier, indexHolder, index)); - if (elem) { - elem.innerHTML = field.transName; - } - }); - }); - return null; - }, - actions: { submit(data) { this.onValid(() => { diff --git a/app/components/forms/wizard/custom-form-input-translation.hbs b/app/components/forms/wizard/custom-form-input-translation.hbs index 0265176b974..4b6a435c623 100644 --- a/app/components/forms/wizard/custom-form-input-translation.hbs +++ b/app/components/forms/wizard/custom-form-input-translation.hbs @@ -1,34 +1,25 @@ -{{#if (eq @type "number")}} -