Skip to content

Commit e887c9b

Browse files
authored
feat #8817: adding min and max value to the year (#8928)
* feat #8817: adding min and max value to the year * fix: displaying range in questionnaire creator overview
1 parent 1701900 commit e887c9b

File tree

5 files changed

+6
-19
lines changed

5 files changed

+6
-19
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
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';
16-
import { years } from 'open-event-frontend/utils/dictionary/year-list';
1716
import { languageForms1 } from 'open-event-frontend/utils/dictionary/language-form-1';
1817
import { languageForms2 } from 'open-event-frontend/utils/dictionary/language-form-2';
1918
import { homeWikis } from 'open-event-frontend/utils/dictionary/home-wikis';
@@ -651,7 +650,6 @@ export default Component.extend(FormMixin, {
651650
genders : orderBy(genders, 'position'),
652651
ageGroups : orderBy(ageGroups, 'position'),
653652
countries : orderBy(countries, 'name'),
654-
years : orderBy(years, 'year'),
655653
languageForms1 : orderBy(languageForms1, 'position'),
656654
languageForms2 : orderBy(languageForms2, 'position'),
657655
homeWikis : orderBy(homeWikis, 'item'),

app/components/forms/wizard/custom-form-input.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</div>
88
<div style="display: flex; flex-direction: column">
99
<div {{did-update this.updated @field}} class="ui action input main" style="width: inherit;">
10-
{{#if (eq this.type "number")}}
10+
{{#if (or (eq this.type "number") (eq this.type "year"))}}
1111
<div style="width: 20%">
1212
<Input type="text" placeholder={{t "Field Name"}} @value={{this.name}}/>
1313
</div>
@@ -29,7 +29,7 @@
2929
</div>
3030
</UiDropdown>
3131
{{/if}}
32-
{{#if (eq this.type "number")}}
32+
{{#if (or (eq this.type "number") (eq this.type "year"))}}
3333
<div class="ui action input input-attendee-custom-form" style="width: 8%;">
3434
<Input
3535
@type="number"

app/components/forms/wizard/custom-forms/table.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
</td>
9797
{{#if (and this.complexColumn (eq @form 'attendee'))}}
9898
<td class="border center aligned">
99-
{{if (eq field.type "number") (concat field.min " - " field.max) "-"}}
99+
{{if (or (eq field.type "number") (eq field.type "year")) (concat field.min " - " field.max) "-"}}
100100
</td>
101101
{{/if}}
102102
<td class="border center aligned">

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@
260260
<i class="dropdown icon"></i>
261261
<div class="default text">{{t 'Select your year'}}</div>
262262
<div class="menu">
263-
{{#each this.years as |years|}}
264-
<div class="item" data-value="{{@years.year}}">
265-
{{years.year}}
263+
{{#each (range field.min (add field.max 1)) as |year|}}
264+
<div class="item" data-value="{{year}}">
265+
{{year}}
266266
</div>
267267
{{/each}}
268268
</div>

app/utils/dictionary/year-list.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)