Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💻 Remove default level of new adventures #6095

Merged
merged 6 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

msgid "select_lang"
msgstr ""

Expand Down
8 changes: 4 additions & 4 deletions templates/customize-adventure.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ <h2>{{_('customize_adventure')}}: <strong>{{adventure.name}}</strong></h2>
<div class="flex flex-row items-center mb-4">
<label for="custom_adventure_classes" class="inline-block w-40 text-xl">{{_('used_in')}}</label>
<div class="flex-1">
<custom-select data-type="multiple" id="classes_dropdown" data-cy="classes_select" data-label="{{_('used_in')}}">
<custom-select data-type="multiple" id="classes_dropdown" data-cy="classes_select"
data-label="{{_('select_classes')}}">
{% for class in all_classes %}
<option {% if class.id in adventure.classes %}selected{% endif %} value="{{class.id}}" data-cy="{{class.name}}">{{ class.name }}</option>
{% endfor %}
Expand All @@ -104,8 +105,7 @@ <h2>{{_('customize_adventure')}}: <strong>{{adventure.name}}</strong></h2>
<div class="flex-1">
<custom-select data-type="multiple" id="levels_dropdown" data-cy="level_select" data-label="{{_('select_levels')}}">
{% for i in range(1, (max_level + 1)) %}
{% set adv_levels = adventure.levels if adventure.get("levels") else [adventure.level|string] %}
<option {% if i|string in adv_levels %}selected{% endif %} data-value="{{i}}" data-cy="{{i}}">{{ i }}</option>
<option {% if i|string in adventure.levels %}selected{% endif %} data-value="{{i}}" data-cy="{{i}}">{{ i }}</option>
{% endfor %}
</custom-select>
</div>
Expand Down Expand Up @@ -298,4 +298,4 @@ <h3>{{_('adventure_exp_classes')}}</h3>
</div>

</div>
{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@ teachers.forEach((teacher) => {
loginForTeacher(teacher);
createClass(className);
createAdventure();

// select class
cy.getDataCy('custom_adventure_name').clear().type(advName)
cy.getDataCy('classes_select').click()
cy.wait(1000)
cy.getDataCy(`${className}`).click()
cy.getDataCy('classes_select').click()

// select levels
cy.getDataCy('level_select').click()
cy.wait(500)
cy.getDataCy('1').click()
cy.getDataCy('2').click()
cy.wait(500)
cy.getDataCy('level_select').click()
cy.wait(500)

// set adventure name
cy.getDataCy('custom_adventure_name').clear().type(advName)

// select class
cy.getDataCy('classes_select').click()
cy.wait(500)
cy.getDataCy(`${className}`).click()
cy.wait(500)
cy.getDataCy('classes_select').click()
cy.wait(500)

// agree public
cy.getDataCy('agree_public')
Expand All @@ -35,6 +40,9 @@ teachers.forEach((teacher) => {
.uncheck()
.should('not.be.checked');

cy.get('#submit_adventure').click();
cy.wait(500)

// go back button
cy.getDataCy('go_back_button')
.should('be.visible')
Expand All @@ -53,4 +61,4 @@ teachers.forEach((teacher) => {
openAdventureView();
cy.getDataCy('adventures_table').should("not.contain.text", advName);
})
})
})
6 changes: 6 additions & 0 deletions tests/cypress/e2e/tools/adventures/adventure.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export function createAdventure(name)

if (name) {
cy.intercept('/for-teachers/customize-adventure').as('customizeAdventure');
cy.getDataCy('level_select').click();
cy.wait(500)
cy.getDataCy('1').click();
cy.wait(500)
cy.getDataCy('level_select').click()
cy.wait(500)
cy.getDataCy('custom_adventure_name').clear().type(name);
cy.wait(500)
cy.wait('@customizeAdventure').should('have.nested.property', 'response.statusCode', 200);
Expand Down
6 changes: 6 additions & 0 deletions translations/ar/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,9 @@ msgstr "اختيار المغامرات"
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

msgid "select_lang"
msgstr "اختر اللغة"

Expand Down Expand Up @@ -2682,3 +2685,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/bg/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2894,3 +2897,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/bn/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1955,6 +1955,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -3012,3 +3015,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/ca/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,9 @@ msgstr "Selecciona i ordena aventures"
msgid "select_all"
msgstr "Selecciona-ho tot"

msgid "select_classes"
msgstr ""

msgid "select_lang"
msgstr "Selecciona l'idioma"

Expand Down Expand Up @@ -2366,3 +2369,6 @@ msgstr "El teu programa"
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/cs/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2906,3 +2909,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/cy/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2994,3 +2997,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/da/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2977,3 +2980,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/de/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,9 @@ msgstr "Wähle und ordne Abenteuer"
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2566,3 +2569,6 @@ msgstr "Dein Programm"
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/el/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,9 @@ msgstr "Επίλεξε περιπέτειες"
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2765,3 +2768,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

3 changes: 3 additions & 0 deletions translations/en/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,9 @@ msgstr "Select and order adventures"
msgid "select_all"
msgstr "Select all"

msgid "select_classes"
msgstr "Select classes"

msgid "select_lang"
msgstr "Select language"

Expand Down
6 changes: 6 additions & 0 deletions translations/eo/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1773,6 +1773,9 @@ msgstr "Elekti aventurojn"
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

msgid "select_lang"
msgstr "Elektu lingvon"

Expand Down Expand Up @@ -2755,3 +2758,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/es/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,9 @@ msgstr "Seleccionar y encargar aventuras"
msgid "select_all"
msgstr "Seleccionar todo"

msgid "select_classes"
msgstr ""

msgid "select_lang"
msgstr "Selecciona el idioma"

Expand Down Expand Up @@ -2376,3 +2379,6 @@ msgstr "Tu programa"
#~ msgid "classes"
#~ msgstr "Clases"

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/et/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2971,3 +2974,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/fa/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1950,6 +1950,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -3005,3 +3008,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/fi/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2993,3 +2996,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/fr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,9 @@ msgstr "Choisissez les aventures"
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2610,3 +2613,6 @@ msgstr "Ton programme"
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/fr_CA/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1951,6 +1951,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2825,3 +2828,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

6 changes: 6 additions & 0 deletions translations/fy/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,9 @@ msgstr ""
msgid "select_all"
msgstr ""

msgid "select_classes"
msgstr ""

#, fuzzy
msgid "select_lang"
msgstr ""
Expand Down Expand Up @@ -2896,3 +2899,6 @@ msgstr ""
#~ msgid "classes"
#~ msgstr ""

#~ msgid "select_class"
#~ msgstr ""

Loading
Loading