Skip to content

Commit 420f88b

Browse files
Hieu Lam - TMAkhangonodkhang
authored
feature-8789: Add option "home wiki" to attendee form (#8805)
* feature-8470: Make attendee form ticket specific * feature-8470: Make attendee form ticket specific * feature-8740: Make attendee form ticket specific * feature-8740: Make attendee form ticket specific * feature-8740: Make attendee form ticket specific * Demo-20230616: Merge code * Demo-20230616: Merge code * Demo-20230616: Merge code * feature-8470: Revert code demo * feature-8470: Revert code demo * feature-8470: Make attendee form ticket specific * feature-8470: Make attendee form ticket specific * feature-8470: Make attendee form ticket specific * feature-8470: Make attendee form ticket specific * feature-8470: Make attendee form ticket specific * feature-8470: Merge code development * feature-8470: Make attendee form ticket specific * feature-8470: Make attendee form ticket specific * feature-8740: Make attendee form ticket specific * feature-8740: Make attendee form ticket specific * feature-8740: Make attendee form ticket specific * feature-8789: Add option 'home wiki' to attendee form * feature-8789: Add option 'home wiki' to attendee form * feature-8789:translate * feature-8789: Merge code development * feature-8789: Fix git comment * feature-8789: Fix git comment --------- Co-authored-by: Khang On - TMA <[email protected]> Co-authored-by: khangon <[email protected]>
1 parent 788cebd commit 420f88b

File tree

27 files changed

+4293
-7161
lines changed

27 files changed

+4293
-7161
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { genders } from 'open-event-frontend/utils/dictionary/genders';
1414
import { ageGroups } from 'open-event-frontend/utils/dictionary/age-groups';
1515
import { countries } from 'open-event-frontend/utils/dictionary/demography';
1616
import { years } from 'open-event-frontend/utils/dictionary/year-list';
17+
import { homeWikis } from 'open-event-frontend/utils/dictionary/home-wikis';
1718

1819
export default Component.extend(FormMixin, {
1920
router : service(),
@@ -238,6 +239,15 @@ export default Component.extend(FormMixin, {
238239
]
239240
};
240241

242+
const homeWikiValidation = {
243+
rules: [
244+
{
245+
type : 'empty',
246+
prompt : this.l10n.t('Please enter your home wiki.')
247+
}
248+
]
249+
};
250+
241251
const shippingAddressValidation = {
242252
rules: [
243253
{
@@ -551,6 +561,7 @@ export default Component.extend(FormMixin, {
551561
validationRules.fields[`taxBusinessInfo_required_${ index}`] = taxBusinessInfoValidation;
552562
validationRules.fields[`billingAddress_required_${ index}`] = billingAddressValidation;
553563
validationRules.fields[`homeAddress_required_${ index}`] = homeAddressValidation;
564+
validationRules.fields[`homeWiki_required_${ index}`] = homeWikiValidation;
554565
validationRules.fields[`shippingAddress_required_${ index}`] = shippingAddressValidation;
555566
validationRules.fields[`company_required_${ index}`] = companyValidation;
556567
validationRules.fields[`workAddress_required_${ index}`] = workAddressValidation;
@@ -594,6 +605,7 @@ export default Component.extend(FormMixin, {
594605
ageGroups : orderBy(ageGroups, 'position'),
595606
countries : orderBy(countries, 'name'),
596607
years : orderBy(years, 'year'),
608+
homeWikis : orderBy(homeWikis, 'item'),
597609

598610
actions: {
599611
submit(data) {

app/mixins/custom-form.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,17 @@ export default Mixin.create(MutableArray, {
627627
isIncluded : false,
628628
isPublic : false,
629629
event : parent
630+
}),
631+
this.store.createRecord('custom-form', {
632+
name : 'homeWiki',
633+
fieldIdentifier : 'home_wiki',
634+
formID : _formID,
635+
form : 'attendee',
636+
type : 'select',
637+
isRequired : false,
638+
isIncluded : false,
639+
isPublic : false,
640+
event : parent
630641
})
631642
];
632643
}

app/models/attendee.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default ModelBase.extend({
4141
acceptShareDetails : attr('boolean', { defaultValue: true }),
4242
birthDate : attr('moment'),
4343
complexFieldValues : attr(),
44+
home_wiki : attr('string'),
4445

4546
/**
4647
* Relationships

app/models/custom-form.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ export default ModelBase.extend({
106106
acceptReceiveEmails : tn.t('Email consent'),
107107
acceptVideoRecording : tn.t('Photo & video & text consent'),
108108
acceptShareDetails : tn.t('Partner contact consent'),
109-
ageGroup : tn.t('Age Group')
109+
ageGroup : tn.t('Age Group'),
110+
homeWiki : tn.t('What is your home wiki')
110111
},
111112

112113
ready() {

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,24 @@
179179
{{/each}}
180180
</div>
181181
</UiDropdown>
182+
{{else if (eq field.fieldIdentifier 'home_wiki')}}
183+
<UiDropdown
184+
@class="search selection"
185+
@selected={{get holder field.identifierPath}}
186+
@onChange={{action (mut holder.home_wiki)}} as |execute mapper|>
187+
<Input
188+
@type="hidden"
189+
@name={{if field.isRequired (concat field.fieldIdentifier "_required_" index) (concat field.fieldIdentifier "_" index)}} />
190+
<i class="dropdown icon"></i>
191+
<div class="default text">{{t 'Select your home wiki'}}</div>
192+
<div class="menu">
193+
{{#each this.homeWikis as |homeWiki|}}
194+
<div class="item" data-value="{{map-value mapper homeWiki.item}}">
195+
{{t homeWiki.item}}
196+
</div>
197+
{{/each}}
198+
</div>
199+
</UiDropdown>
182200
{{else if (eq field.fieldIdentifier 'acceptReceiveEmails')}}
183201
<UiCheckbox
184202
@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?"}}

app/utils/dictionary/age-groups.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,43 @@ import { tn } from '../text';
22

33
export const ageGroups = [
44
{
5-
age: tn.t('Under 18'),
6-
position: 1
5+
age : tn.t('Under 18'),
6+
position : 1
77
},
88
{
9-
age: '18-24',
10-
position: 2
9+
age : '18-24',
10+
position : 2
1111
},
1212
{
13-
age: '25-34',
14-
position: 3
13+
age : '25-34',
14+
position : 3
1515
},
1616
{
17-
age: '35-44',
18-
position: 4
17+
age : '35-44',
18+
position : 4
1919
},
2020
{
21-
age: '45-54',
22-
position: 5
21+
age : '45-54',
22+
position : 5
2323
},
2424
{
25-
age: '55-64',
26-
position: 6
25+
age : '55-64',
26+
position : 6
2727
},
2828
{
29-
age: '65-74',
30-
position: 7
29+
age : '65-74',
30+
position : 7
3131
},
3232
{
33-
age: '75-84',
34-
position: 8
33+
age : '75-84',
34+
position : 8
3535
},
3636
{
37-
age: '85+',
38-
position: 9
37+
age : '85+',
38+
position : 9
3939
},
4040
{
41-
age: tn.t('I prefer not to say'),
42-
position: 10
41+
age : tn.t('I prefer not to say'),
42+
position : 10
4343
}
4444
];

app/utils/dictionary/home-wikis.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { tn } from 'open-event-frontend/utils/text';
2+
3+
export const homeWikis = [
4+
{
5+
item: tn.t('Wikipedia')
6+
},
7+
{
8+
item: tn.t('Wiktionary')
9+
},
10+
{
11+
item: tn.t('Wikiquote')
12+
},
13+
{
14+
item: tn.t('Wikinews')
15+
},
16+
{
17+
item: tn.t('Wikisource')
18+
},
19+
{
20+
item: tn.t('Wikibooks')
21+
},
22+
{
23+
item: tn.t('Wikiversity')
24+
},
25+
{
26+
item: tn.t('Wikivoyage')
27+
},
28+
{
29+
item: tn.t('Wikimedia Commons')
30+
},
31+
{
32+
item: tn.t('Wikidata')
33+
},
34+
{
35+
item: tn.t('Wikispecies')
36+
},
37+
{
38+
item: tn.t('Meta-Wiki')
39+
}
40+
];

translations/ar.po

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11594,3 +11594,59 @@ msgstr ""
1159411594
#: app/utils/dictionary/age-groups.ts:41:9
1159511595
msgid "I prefer not to say"
1159611596
msgstr ""
11597+
11598+
#: app/utils/dictionary/home-wikis.ts:5:10
11599+
msgid "Wikipedia"
11600+
msgstr "Վիքիպեդիա"
11601+
11602+
#: app/utils/dictionary/home-wikis.ts:8:10
11603+
msgid "Wiktionary"
11604+
msgstr "Վիքիբառարան"
11605+
11606+
#: app/utils/dictionary/home-wikis.ts:11:10
11607+
msgid "Wikiquote"
11608+
msgstr "Վիքիքաղվածք"
11609+
11610+
#: app/utils/dictionary/home-wikis.ts:14:10
11611+
msgid "Wikinews"
11612+
msgstr "Վիքինորություններ"
11613+
11614+
#: app/utils/dictionary/home-wikis.ts:17:10
11615+
msgid "Wikisource"
11616+
msgstr "Վիքիդարան"
11617+
11618+
#: app/utils/dictionary/home-wikis.ts:20:10
11619+
msgid "Wikibooks"
11620+
msgstr "Վիքիգրքեր"
11621+
11622+
#: app/utils/dictionary/home-wikis.ts:23:10
11623+
msgid "Wikiversity"
11624+
msgstr "Վիքիհամալսարան"
11625+
11626+
#: app/utils/dictionary/home-wikis.ts:26:10
11627+
msgid "Wikivoyage"
11628+
msgstr "Վիքիճամփորդություն"
11629+
11630+
#: app/utils/dictionary/home-wikis.ts:29:10
11631+
msgid "Wikimedia Commons"
11632+
msgstr "Wikimedia Commons"
11633+
11634+
#: app/utils/dictionary/home-wikis.ts:32:10
11635+
msgid "Wikidata"
11636+
msgstr "Վիքիտվյալներ"
11637+
11638+
#: app/utils/dictionary/home-wikis.ts:35:10
11639+
msgid "Wikispecies"
11640+
msgstr "Վիքիտեսակներ"
11641+
11642+
#: app/utils/dictionary/home-wikis.ts:38:10
11643+
msgid "Meta-Wiki"
11644+
msgstr "Մետա-Վիքի"
11645+
11646+
#: app/models/custom-form.js:110:1
11647+
msgid "What is your home wiki"
11648+
msgstr "Ո՞րն է ձեր տնային վիքին"
11649+
11650+
#: app/templates/components/forms/orders/order-form.hbs:192:48
11651+
msgid "Select your home wiki"
11652+
msgstr "Ընտրեք ձեր տնային վիքին"

0 commit comments

Comments
 (0)