Skip to content

Commit 0832898

Browse files
authored
feature-8830: Attendee Form: Implement scholarship question with drop… (#8837)
* feature-8830: Attendee Form: Implement scholarship question with dropdown * feature-8830: translate text * feature-8830 update translate for indonesia
1 parent 7ac0dcd commit 0832898

File tree

25 files changed

+530
-7
lines changed

25 files changed

+530
-7
lines changed

app/components/forms/orders/order-form.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { countries } from 'open-event-frontend/utils/dictionary/demography';
1616
import { years } from 'open-event-frontend/utils/dictionary/year-list';
1717
import { languageForms } from 'open-event-frontend/utils/dictionary/language-form';
1818
import { homeWikis } from 'open-event-frontend/utils/dictionary/home-wikis';
19+
import { wikiScholarship } from 'open-event-frontend/utils/dictionary/wiki-scholarship';
1920

2021
export default Component.extend(FormMixin, {
2122
router : service(),
@@ -248,6 +249,14 @@ export default Component.extend(FormMixin, {
248249
}
249250
]
250251
};
252+
const wikiScholarshipValidation = {
253+
rules: [
254+
{
255+
type : 'empty',
256+
prompt : this.l10n.t('Please enter your wiki scholarship.')
257+
}
258+
]
259+
};
251260

252261
const shippingAddressValidation = {
253262
rules: [
@@ -601,6 +610,7 @@ export default Component.extend(FormMixin, {
601610
validationRules.fields[`billingAddress_required_${ index}`] = billingAddressValidation;
602611
validationRules.fields[`homeAddress_required_${ index}`] = homeAddressValidation;
603612
validationRules.fields[`homeWiki_required_${ index}`] = homeWikiValidation;
613+
validationRules.fields[`wikiScholarship_required_${ index}`] = wikiScholarshipValidation;
604614
validationRules.fields[`shippingAddress_required_${ index}`] = shippingAddressValidation;
605615
validationRules.fields[`company_required_${ index}`] = companyValidation;
606616
validationRules.fields[`workAddress_required_${ index}`] = workAddressValidation;
@@ -656,12 +666,13 @@ export default Component.extend(FormMixin, {
656666
return groupBy(requiredFixed.concat(customFields), field => field.get('form'));
657667
}),
658668

659-
genders : orderBy(genders, 'name'),
660-
ageGroups : orderBy(ageGroups, 'position'),
661-
countries : orderBy(countries, 'name'),
662-
years : orderBy(years, 'year'),
663-
languageForms : orderBy(languageForms, 'name'),
664-
homeWikis : orderBy(homeWikis, 'item'),
669+
genders : orderBy(genders, 'name'),
670+
ageGroups : orderBy(ageGroups, 'position'),
671+
countries : orderBy(countries, 'name'),
672+
years : orderBy(years, 'year'),
673+
languageForms : orderBy(languageForms, 'name'),
674+
homeWikis : orderBy(homeWikis, 'item'),
675+
wikiScholarship : orderBy(wikiScholarship, 'position'),
665676

666677
actions: {
667678
submit(data) {

app/mixins/custom-form.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,17 @@ export default Mixin.create(MutableArray, {
682682
isIncluded : false,
683683
isPublic : false,
684684
event : parent
685+
}),
686+
this.store.createRecord('custom-form', {
687+
name : 'wikiScholarship',
688+
fieldIdentifier : 'wiki_scholarship',
689+
formID : _formID,
690+
form : 'attendee',
691+
type : 'select',
692+
isRequired : false,
693+
isIncluded : false,
694+
isPublic : false,
695+
event : parent
685696
})
686697
];
687698
}

app/models/attendee.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export default ModelBase.extend({
4646
language_form_2 : attr('string'),
4747
home_wiki : attr('string'),
4848
is_consent_form_field : attr('boolean', { defaultValue: false }),
49+
wiki_scholarship : attr('string'),
4950

5051
/**
5152
* Relationships

app/models/custom-form.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export default ModelBase.extend({
111111
homeWiki : tn.t('What is your home wiki'),
112112
languageForm1 : tn.t('What is your native language, or what language are you most fluent in?'),
113113
languageForm2 : tn.t('Are you fluent in any other of the following languages?'),
114-
is_consent_form_field : tn.t('Consent form field')
114+
is_consent_form_field : tn.t('Consent form field'),
115+
wikiScholarship : tn.t('Have you received a Wikimedia scholarship?')
115116
},
116117

117118
ready() {

app/templates/components/forms/orders/order-form.hbs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,24 @@
197197
{{/each}}
198198
</div>
199199
</UiDropdown>
200+
{{else if (eq field.fieldIdentifier 'wiki_scholarship')}}
201+
<UiDropdown
202+
@class="search selection"
203+
@selected={{get holder field.identifierPath}}
204+
@onChange={{action (mut holder.wiki_scholarship)}} as |execute mapper|>
205+
<Input
206+
@type="hidden"
207+
@name={{if field.isRequired (concat field.fieldIdentifier "_required_" index) (concat field.fieldIdentifier "_" index)}} />
208+
<i class="dropdown icon"></i>
209+
<div class="default text">{{t 'Select your answer'}}</div>
210+
<div class="menu">
211+
{{#each this.wikiScholarship as |wikiScholarship|}}
212+
<div class="item" data-value="{{map-value mapper wikiScholarship.name}}">
213+
{{t wikiScholarship.name}}
214+
</div>
215+
{{/each}}
216+
</div>
217+
</UiDropdown>
200218
{{else if (eq field.fieldIdentifier 'acceptReceiveEmails')}}
201219
<UiCheckbox
202220
@label={{t "We would like to share information with you after the event by email for example through personal emails by our team, newsletters or other electronic communications. You can drop out of this agreement at any time. Do you agree to receive electronic mail?"}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { tn } from 'open-event-frontend/utils/text';
2+
3+
export const wikiScholarship = [
4+
{
5+
name : tn.t('No, I haven\'t'),
6+
position : 1
7+
},
8+
{
9+
name : tn.t('Yes, from the Wikimedia Foundation'),
10+
position : 2
11+
},
12+
{
13+
name : tn.t('Yes, from a Wikimedia affiliate'),
14+
position : 3
15+
}
16+
];

translations/bn.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11663,6 +11663,7 @@ msgstr "ফেরত নীতির সম্মতি"
1166311663

1166411664
msgid "I agree to the terms of the refund policy of the event."
1166511665
msgstr "আমি ইভেন্টের রিফান্ড নীতির শর্তাবলীতে সম্মত।"
11666+
1166611667
#: app/components/forms/wizard/custom-forms/table.hbs:56:25
1166711668
msgid "I agree to the terms of the"
1166811669
msgstr "আমি শর্তাবলী সম্মত"
@@ -11682,3 +11683,27 @@ msgstr "বন্ধুত্বপূর্ণ মহাকাশ নীতি"
1168211683
#: app/models/custom-form.js:113:28
1168311684
msgid "Consent form field"
1168411685
msgstr "সম্মতি ফর্ম ক্ষেত্র"
11686+
11687+
#: app/components/forms/orders/order-form.js:256:19
11688+
msgid "Please enter your wiki scholarship."
11689+
msgstr "আপনার উইকি বৃত্তি লিখুন."
11690+
11691+
#: app/models/custom-form.js:115:30
11692+
msgid "Have you received a Wikimedia scholarship?"
11693+
msgstr "আপনি কি উইকিমিডিয়া বৃত্তি পেয়েছেন?"
11694+
11695+
#: app/utils/dictionary/wiki-scholarship.ts:5:10
11696+
msgid "No, I haven't"
11697+
msgstr "না, আমি করিনি"
11698+
11699+
#: app/utils/dictionary/wiki-scholarship.ts:9:10
11700+
msgid "Yes, from the Wikimedia Foundation"
11701+
msgstr "হ্যাঁ, উইকিমিডিয়া ফাউন্ডেশন থেকে"
11702+
11703+
#: app/utils/dictionary/wiki-scholarship.ts:13:10
11704+
msgid "Yes, from a Wikimedia affiliate"
11705+
msgstr "হ্যাঁ, উইকিমিডিয়া অধিভুক্ত থেকে"
11706+
11707+
#: app/templates/components/forms/orders/order-form.hbs:209:48
11708+
msgid "Select your answer"
11709+
msgstr "আপনার উত্তর নির্বাচন করুন"

translations/de.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11678,6 +11678,7 @@ msgstr "Zustimmung zur Rückerstattungsrichtlinie"
1167811678

1167911679
msgid "I agree to the terms of the refund policy of the event."
1168011680
msgstr "Ich stimme den Bedingungen der Rückerstattungsrichtlinie der Veranstaltung zu."
11681+
1168111682
#: app/components/forms/wizard/custom-forms/table.hbs:56:25
1168211683
msgid "I agree to the terms of the"
1168311684
msgstr "Ich stimme den Bedingungen zu"
@@ -11697,3 +11698,27 @@ msgstr "Freundliche Weltraumpolitik"
1169711698
#: app/models/custom-form.js:113:28
1169811699
msgid "Consent form field"
1169911700
msgstr "Feld „Einwilligungsformular“."
11701+
11702+
#: app/components/forms/orders/order-form.js:256:19
11703+
msgid "Please enter your wiki scholarship."
11704+
msgstr "Bitte geben Sie Ihr Wiki-Stipendium ein."
11705+
11706+
#: app/models/custom-form.js:115:30
11707+
msgid "Have you received a Wikimedia scholarship?"
11708+
msgstr "Haben Sie ein Wikimedia-Stipendium erhalten?"
11709+
11710+
#: app/utils/dictionary/wiki-scholarship.ts:5:10
11711+
msgid "No, I haven't"
11712+
msgstr "Nein, das habe ich nicht"
11713+
11714+
#: app/utils/dictionary/wiki-scholarship.ts:9:10
11715+
msgid "Yes, from the Wikimedia Foundation"
11716+
msgstr "Ja, von der Wikimedia Foundation"
11717+
11718+
#: app/utils/dictionary/wiki-scholarship.ts:13:10
11719+
msgid "Yes, from a Wikimedia affiliate"
11720+
msgstr "Ja, von einem Wikimedia-Partner"
11721+
11722+
#: app/templates/components/forms/orders/order-form.hbs:209:48
11723+
msgid "Select your answer"
11724+
msgstr "Wählen Sie Ihre Antwort aus"

translations/de_DIVEO.po

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11659,6 +11659,12 @@ msgstr ""
1165911659
msgid "Are you fluent in any other of the following languages?"
1166011660
msgstr ""
1166111661

11662+
msgid "Consent of refund policy"
11663+
msgstr ""
11664+
11665+
msgid "I agree to the terms of the refund policy of the event."
11666+
msgstr ""
11667+
1166211668
#: app/components/forms/wizard/custom-forms/table.hbs:56:25
1166311669
msgid "I agree to the terms of the"
1166411670
msgstr ""
@@ -11678,3 +11684,27 @@ msgstr ""
1167811684
#: app/models/custom-form.js:113:28
1167911685
msgid "Consent form field"
1168011686
msgstr ""
11687+
11688+
#: app/components/forms/orders/order-form.js:256:19
11689+
msgid "Please enter your wiki scholarship."
11690+
msgstr ""
11691+
11692+
#: app/models/custom-form.js:115:30
11693+
msgid "Have you received a Wikimedia scholarship?"
11694+
msgstr ""
11695+
11696+
#: app/utils/dictionary/wiki-scholarship.ts:5:10
11697+
msgid "No, I haven't"
11698+
msgstr ""
11699+
11700+
#: app/utils/dictionary/wiki-scholarship.ts:9:10
11701+
msgid "Yes, from the Wikimedia Foundation"
11702+
msgstr ""
11703+
11704+
#: app/utils/dictionary/wiki-scholarship.ts:13:10
11705+
msgid "Yes, from a Wikimedia affiliate"
11706+
msgstr ""
11707+
11708+
#: app/templates/components/forms/orders/order-form.hbs:209:48
11709+
msgid "Select your answer"
11710+
msgstr ""

translations/en.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11673,6 +11673,7 @@ msgstr "Consent of refund policy"
1167311673

1167411674
msgid "I agree to the terms of the refund policy of the event."
1167511675
msgstr "I agree to the terms of the refund policy of the event."
11676+
1167611677
#: app/components/forms/wizard/custom-forms/table.hbs:56:25
1167711678
msgid "I agree to the terms of the"
1167811679
msgstr "I agree to the terms of the"
@@ -11692,3 +11693,27 @@ msgstr "Friendly Space Policy"
1169211693
#: app/models/custom-form.js:113:28
1169311694
msgid "Consent form field"
1169411695
msgstr "Consent form field"
11696+
11697+
#: app/components/forms/orders/order-form.js:256:19
11698+
msgid "Please enter your wiki scholarship."
11699+
msgstr "Please enter your wiki scholarship."
11700+
11701+
#: app/models/custom-form.js:115:30
11702+
msgid "Have you received a Wikimedia scholarship?"
11703+
msgstr "Have you received a Wikimedia scholarship?"
11704+
11705+
#: app/utils/dictionary/wiki-scholarship.ts:5:10
11706+
msgid "No, I haven't"
11707+
msgstr "No, I haven't"
11708+
11709+
#: app/utils/dictionary/wiki-scholarship.ts:9:10
11710+
msgid "Yes, from the Wikimedia Foundation"
11711+
msgstr "Yes, from the Wikimedia Foundation"
11712+
11713+
#: app/utils/dictionary/wiki-scholarship.ts:13:10
11714+
msgid "Yes, from a Wikimedia affiliate"
11715+
msgstr "Yes, from a Wikimedia affiliate"
11716+
11717+
#: app/templates/components/forms/orders/order-form.hbs:209:48
11718+
msgid "Select your answer"
11719+
msgstr "Select your answer"

0 commit comments

Comments
 (0)