Commit df4493b0 authored by Chrysanthi Lagodimou's avatar Chrysanthi Lagodimou

Merge branch 'features/add-bestaetigt-filter-on-spv-index' into 'develop'

Features/Add filter on bestaetigt on spv index

See merge request !862
parents 7c492b1c 52bc36b1
Pipeline #31753 passed with stage
in 37 minutes and 59 seconds
......@@ -7,12 +7,15 @@ nav.navbar.section-navigation
- if @semester_process
li= button_link 'Semester Prozess bearbeiten', edit_semester_process_path(@semester_process), dimension: 'sm'
= custom_filter_dropdown('Bestätigt',
{ q: :commited_by_id_null, text: 'Unbestätigt', value: 'true' },
{ q: :commited_by_id_not_null, text: 'Bestätigt', value: 'true'})
= custom_filter_dropdown('Übernommen',
{ q: :responsible_id_null, text: 'Offen', value: 'true' },
{ q: :responsible_id_not_null, text: 'Übernommen', value: 'true' },
*@responsibles)
{ q: :responsible_id_null, text: 'Offen', value: 'true' },
{ q: :responsible_id_not_null, text: 'Übernommen', value: 'true' },
*@responsibles)
= custom_filter_dropdown('Quittiert',
{ q: :reviewed_by_id_null, text: 'Unquittiert', value: 'true' },
{ q: :reviewed_by_id_not_null, text: 'Quittiert', value: 'true' },
*@reviewers)
{ q: :reviewed_by_id_null, text: 'Unquittiert', value: 'true' },
{ q: :reviewed_by_id_not_null, text: 'Quittiert', value: 'true' },
*@reviewers)
hr
......@@ -9,7 +9,6 @@ h1= t_title(:index)
thead
tr
th.hidden-print Aktionen
th.limit-width Journal / Stunden
th Status
th.limit-width Freiwilige/r
th Einsätze
......@@ -17,8 +16,6 @@ h1= t_title(:index)
th Erfolge
th Zukunft
th Bemerkungen
th= t_attr(:commited_by)
th Letzte Bestätigung
th Übernommen
th Quittiert
......@@ -27,7 +24,6 @@ h1= t_title(:index)
tr
td.index-action-cell.hidden-print
= button_link icon_span(:edit), review_semester_semester_process_volunteer_path(spv), title: 'Bearbeiten'
td.index-action-cell.hidden-print
= button_link icon_span(:journal), volunteer_journals_path(spv.volunteer), title: 'Journal'
= button_link icon_span(:journal_new), new_volunteer_journal_path(spv.volunteer,
semester_feedback_id: spv.semester_feedbacks.ids), title: 'Neuen Journal eintrag mit Zitat erstellen'
......@@ -43,8 +39,6 @@ h1= t_title(:index)
= td_truncate_content_modal(spv.render_feedback(:achievements), 'Erfolge', shorten_size: 300)
= td_truncate_content_modal(spv.render_feedback(:future), 'Zukunft', shorten_size: 300)
= td_truncate_content_modal(spv.render_feedback(:comments), 'Bemerkungen', shorten_size: 300)
td= spv.commited_by
td= spv.commited_at && l(spv.commited_at)
td.index-action-cell.hidden-print
- if spv.responsible.present?
= 'Übernommen durch '
......
......@@ -30,14 +30,17 @@ class SemesterProcessVolunteerActionsTest < ApplicationSystemTestCase
# Offen/open -> @spv1
# Übernommen/Quittiert from superadmin2
# Bestätigt from volunteer 2
@volunteer2 = create :volunteer_with_user
@volunteer2.contact.update(first_name: 'volunteer2', last_name: 'volunteer2')
@spv2 = create(:semester_process_volunteer, :with_mission, volunteer: @volunteer2,
semester_process: @semester_process)
@superadmin2 = create :user
@spv2.update(responsible: @superadmin2, reviewed_by: @superadmin2, reviewed_at: Time.zone.now)
@spv2.update(responsible: @superadmin2, reviewed_by: @superadmin2, reviewed_at: Time.zone.now,
commited_by: @volunteer2.user)
# Übernommen/Quittiert from superadmin3
# Unbestätigt
@volunteer3 = create :volunteer_with_user
@volunteer3.contact.update(first_name: 'volunteer3', last_name: 'volunteer3')
@spv3 = create(:semester_process_volunteer, :with_mission, volunteer: @volunteer3,
......@@ -172,4 +175,43 @@ class SemesterProcessVolunteerActionsTest < ApplicationSystemTestCase
assert_not page.has_text? "Quittiert von #{@superadmin3.email}"\
" am #{I18n.l(@spv3.reviewed_at.to_date)}"
end
test 'bestätigt for semester process volunteer index works' do
filters_setup
# filter for Alle/all (Bestätigt)
within page.find_all('nav.section-navigation').last do
click_link 'Bestätigt'
click_link 'Alle'
end
visit current_url
within 'tbody' do
assert page.has_text? @volunteer.contact.full_name
assert page.has_text? @volunteer2.contact.full_name
assert page.has_text? @volunteer3.contact.full_name
end
# filter for Unbestätigt
within page.find_all('nav.section-navigation').last do
click_link 'Bestätigt'
click_link 'Unbestätigt'
end
visit current_url
within 'tbody' do
assert page.has_text? @volunteer.contact.full_name
assert_not page.has_text? @volunteer2.contact.full_name
assert page.has_text? @volunteer3.contact.full_name
end
# filter for Bestätigt
click_link 'Bestätigt: Unbestätigt', match: :first
within 'li.dropdown.open' do
click_link 'Bestätigt'
end
visit current_url
within 'tbody' do
assert_not page.has_text? @volunteer.contact.full_name
assert page.has_text? @volunteer2.contact.full_name
assert_not page.has_text? @volunteer3.contact.full_name
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment