fix: include IRTF and BoF groups on meeting requests page (#4528)

* fix: include IRTF and BoF groups on meeting requests page

* test: test bof/irtf groups on the meeting requests page

* chore: remove some accidentally committed changes

* style: improve formatting of requests.html template
This commit is contained in:
Jennifer Richards 2022-09-30 12:08:11 -03:00 committed by GitHub
parent 3e2b1fc92e
commit f043797742
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 4 deletions

View file

@ -6458,7 +6458,7 @@ class SessionTests(TestCase):
group_type_without_meetings = 'editorial'
self.assertFalse(GroupFeatures.objects.get(pk=group_type_without_meetings).has_meetings)
area = GroupFactory(type_id='area')
area = GroupFactory(type_id='area', acronym='area')
requested_session = SessionFactory(meeting=meeting,group__parent=area,status_id='schedw',add_to_schedule=False)
conflicting_session = SessionFactory(meeting=meeting,group__parent=area,status_id='schedw',add_to_schedule=False)
ConstraintFactory(name_id='key_participant',meeting=meeting,source=requested_session.group,target=conflicting_session.group)
@ -6498,7 +6498,21 @@ class SessionTests(TestCase):
status_id='schedw',
add_to_schedule=False,
)
# bof sessions should be shown
bof_session = SessionFactory(
meeting=meeting,
group__parent=area,
group__state_id='bof',
status_id='schedw',
add_to_schedule=False,
)
# rg sessions should be shown under 'irtf' heading
rg_session = SessionFactory(
meeting=meeting,
group__type_id='rg',
status_id='schedw',
add_to_schedule=False,
)
def _sreq_edit_link(sess):
return urlreverse(
'ietf.secr.sreq.views.edit',
@ -6531,6 +6545,17 @@ class SessionTests(TestCase):
self.assertContains(r, _sreq_edit_link(has_meetings_not_meeting)) # link to the session request
self.assertNotContains(r, not_has_meetings.group.acronym)
self.assertNotContains(r, _sreq_edit_link(not_has_meetings)) # no link to the session request
self.assertContains(r, bof_session.group.acronym)
self.assertContains(r, _sreq_edit_link(bof_session)) # link to the session request
self.assertContains(r, rg_session.group.acronym)
self.assertContains(r, _sreq_edit_link(rg_session)) # link to the session request
# check headings - note that the special types (has_meetings, etc) do not have a group parent
# so they show up in 'other'
q = PyQuery(r.content)
self.assertEqual(len(q('h2#area')), 1)
self.assertEqual(len(q('h2#other-groups')), 1)
self.assertEqual(len(q('h2#irtf')), 1) # rg group has irtf group as parent
def test_request_minutes(self):
meeting = MeetingFactory(type_id='ietf')

View file

@ -2320,7 +2320,10 @@ def agenda_json(request, num=None):
def meeting_requests(request, num=None):
meeting = get_meeting(num)
groups_to_show = Group.objects.filter(state_id='active', type__features__has_meetings=True)
groups_to_show = Group.objects.filter(
state_id__in=('active', 'bof'),
type__features__has_meetings=True,
)
sessions = list(
Session.objects.requests().filter(
meeting__number=meeting.number,
@ -2340,7 +2343,7 @@ def meeting_requests(request, num=None):
for s in sessions:
s.current_status_name = status_names.get(s.current_status, s.current_status)
s.requested_by_person = session_requesters.get(s.requested_by)
if s.group.parent and s.group.parent.type.slug == 'area':
if s.group.parent and s.group.parent.type.slug in ('area', 'irtf'):
s.display_area = s.group.parent
else:
s.display_area = None

View file

@ -68,6 +68,9 @@
<i class="bi bi-people-fill"></i> {{ session.attendees }}
</div>
{% endif %}
{% if session.group.is_bof %}
<span class="badge bg-success float-end">BOF</span>
{% endif %}
</td>
<td class="d-none d-lg-table-cell">
{% if session.requested_duration %}{{ session.requested_duration|stringformat:"s"|slice:"0:4" }}{% endif %}