Skip to content

Commit

Permalink
feat #8887: fixing question order on the attendee overview (#8921)
Browse files Browse the repository at this point in the history
* feat #8887: fixing question order on the attendee overview

* removing the "return true"

---------

Co-authored-by: cweitat <[email protected]>
  • Loading branch information
Bekka592 and cweitat authored Jul 5, 2023
1 parent f09d121 commit 1701900
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
9 changes: 5 additions & 4 deletions app/components/forms/orders/attendee-list.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classic from 'ember-classic-decorator';
import Component from '@ember/component';
import { action, computed } from '@ember/object';
import { groupBy } from 'lodash-es';
import { groupBy, orderBy } from 'lodash-es';
import { or } from '@ember/object/computed';
import { tracked } from '@glimmer/tracking';
import { languageForms1 } from 'open-event-frontend/utils/dictionary/language-form-1';
Expand Down Expand Up @@ -56,7 +56,7 @@ export default class AttendeeList extends Component {
@computed('[email protected]')
get allFields() {
const current_locale = this.cookies.read('current_locale');
return groupBy(this.fields.toArray(), field => {
const customFields = orderBy(this.fields.toArray()?.map(field => {
const { main_language } = field;

if ((main_language && main_language.split('-')[0] === current_locale) || !field.translations || !field.translations.length) {
Expand All @@ -74,8 +74,9 @@ export default class AttendeeList extends Component {
field.transName = field.name;
}

return field.form;
});
return field;
}), ['position']);
return groupBy(customFields, field => field.get('form'));
}

@action
Expand Down
16 changes: 8 additions & 8 deletions app/models/custom-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,22 @@ export default ModelBase.extend({
twitter : tn.t('Twitter'),
facebook : tn.t('Facebook'),
github : tn.t('GitHub'),
instagram : tn.t('Instagram'),
linkedin : tn.t('LinkedIn'),
instagram : tn.t('Instagram'),
mastodon : tn.t('Mastodon'),
gender : tn.t('Which of these categories describe your gender identity? (check all that apply)'),
acceptReceiveEmails : tn.t('Email consent'),
ageGroup : tn.t('Age Group'),
acceptVideoRecording : tn.t('Photo & video & text consent'),
acceptShareDetails : tn.t('Partner contact consent'),
ageGroup : tn.t('Age Group'),
acceptReceiveEmails : tn.t('Email consent'),
is_consent_form_field : tn.t('Consent form field'),
is_consent_form_field_photo : tn.t('Wikimania photo consent'),
is_consent_form_field_email : tn.t('Wikimania email updates'),
isConsentOfRefundPolicy : tn.t('Consent of refund policy'),
homeWiki : tn.t('What is your home wiki'),
languageForm1 : tn.t('What is your native language, or what language are you most fluent in?'),
languageForm2 : tn.t('Are you fluent in any other of the following languages?'),
is_consent_form_field : tn.t('Consent form field'),
wikiScholarship : tn.t('Have you received a Wikimania scholarship?'),
is_consent_form_field_photo : tn.t('Wikimania photo consent'),
is_consent_form_field_email : tn.t('Wikimania email updates')
homeWiki : tn.t('What is your home wiki'),
wikiScholarship : tn.t('Have you received a Wikimania scholarship?')
},

ready() {
Expand Down

1 comment on commit 1701900

@vercel
Copy link

@vercel vercel bot commented on 1701900 Jul 5, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.