From 1fb3b408458850230db36ec2281a52c60a218e42 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Sat, 16 Mar 2024 01:01:27 -0400 Subject: [PATCH 1/7] fix: Show recordings for interims Add methods uses_notes(), has_recordings(), and uses_chat_logs() to the meeting object (with semantically correct tests) and use them consistently throughout. List the recordings if the "meeting numnber" starts with "interim" Fixes: #6543 --- client/agenda/AgendaScheduleList.vue | 2 +- client/agenda/store.js | 4 ++-- ietf/meeting/models.py | 15 ++++++++++++++- ietf/meeting/tests_views.py | 4 ++-- ietf/meeting/views.py | 4 +--- ietf/templates/group/meetings-row.html | 4 ++-- .../meeting/interim_session_buttons.html | 2 +- .../meeting/session_buttons_include.html | 12 ++++++------ ietf/templates/meeting/session_details_panel.html | 8 ++++---- ietf/templates/meeting/upcoming.html | 2 +- playwright/helpers/meeting.js | 2 +- 11 files changed, 35 insertions(+), 24 deletions(-) diff --git a/client/agenda/AgendaScheduleList.vue b/client/agenda/AgendaScheduleList.vue index 9db763b74e..cdbf9c953b 100644 --- a/client/agenda/AgendaScheduleList.vue +++ b/client/agenda/AgendaScheduleList.vue @@ -296,7 +296,7 @@ const meetingEvents = computed(() => { color: 'red' }) } - if (agendaStore.useNotes) { + if (agendaStore.uses_notes) { links.push({ id: `lnk-${item.id}-note`, label: 'Notepad for note-takers', diff --git a/client/agenda/store.js b/client/agenda/store.js index 839d464c43..4f1492aa9c 100644 --- a/client/agenda/store.js +++ b/client/agenda/store.js @@ -50,7 +50,7 @@ export const useAgendaStore = defineStore('agenda', { selectedCatSubs: [], settingsShown: false, timezone: DateTime.local().zoneName, - useNotes: false, + uses_notes: false, visibleDays: [] }), getters: { @@ -160,7 +160,7 @@ export const useAgendaStore = defineStore('agenda', { this.isCurrentMeeting = agendaData.isCurrentMeeting this.meeting = agendaData.meeting this.schedule = agendaData.schedule - this.useNotes = agendaData.useNotes + this.uses_notes = agendaData.uses_notes // -> Compute current info note hash this.infoNoteHash = murmur(agendaData.meeting.infoNote, 0).toString() diff --git a/ietf/meeting/models.py b/ietf/meeting/models.py index dd6e2db6c5..3e1b68e281 100644 --- a/ietf/meeting/models.py +++ b/ietf/meeting/models.py @@ -382,7 +382,20 @@ def previous_meeting(self): return Meeting.objects.filter(type_id=self.type_id,date__lt=self.date).order_by('-date').first() def uses_notes(self): - return self.date>=datetime.date(2020,7,6) + if self.type_id != 'ietf': + return True + num = self.get_number() + return num != None and num >= 108 + + def has_recordings(self): + if self.type_id != 'ietf': + return True + num = self.get_number() + return num != None and num >= 80 + + def has_chat_logs(self): + num = self.get_number() + return num != None and num >= 60 def meeting_start(self): """Meeting-local midnight at the start of the meeting date""" diff --git a/ietf/meeting/tests_views.py b/ietf/meeting/tests_views.py index db62fe6204..996517e560 100644 --- a/ietf/meeting/tests_views.py +++ b/ietf/meeting/tests_views.py @@ -255,11 +255,11 @@ def test_meeting_agenda(self): "updated": rjson.get("meeting").get("updated"), # Just expect the value to exist "timezone": meeting.time_zone, "infoNote": meeting.agenda_info_note, - "warningNote": meeting.agenda_warning_note + "warningNote": meeting.agenda_warning_note, + "uses_notes": False }, "categories": rjson.get("categories"), # Just expect the value to exist "isCurrentMeeting": True, - "useNotes": True, "schedule": rjson.get("schedule"), # Just expect the value to exist "floors": [] } diff --git a/ietf/meeting/views.py b/ietf/meeting/views.py index 253f2852ff..0828c7601e 100644 --- a/ietf/meeting/views.py +++ b/ietf/meeting/views.py @@ -1616,7 +1616,6 @@ def agenda_plain(request, num=None, name=None, base=None, ext=None, owner=None, "now": timezone.now().astimezone(meeting.tz()), "display_timezone": display_timezone, "is_current_meeting": is_current_meeting, - "use_notes": meeting.uses_notes(), "cache_time": 150 if is_current_meeting else 3600, }, content_type=mimetype[ext], @@ -1691,7 +1690,7 @@ def api_get_agenda_data (request, num=None): }, "categories": filter_organizer.get_filter_categories(), "isCurrentMeeting": is_current_meeting, - "useNotes": meeting.uses_notes(), + "uses_notes": meeting.uses_notes(), "schedule": list(map(agenda_extract_schedule, filtered_assignments)), "floors": list(map(agenda_extract_floorplan, floors)) }) @@ -2498,7 +2497,6 @@ def session_details(request, num, acronym): 'can_manage_materials' : can_manage, 'can_view_request': can_view_request, 'thisweek': datetime_today()-datetime.timedelta(days=7), - 'use_notes': meeting.uses_notes(), }) class SessionDraftsForm(forms.Form): diff --git a/ietf/templates/group/meetings-row.html b/ietf/templates/group/meetings-row.html index 57c727eeae..3bbe1d425b 100644 --- a/ietf/templates/group/meetings-row.html +++ b/ietf/templates/group/meetings-row.html @@ -78,9 +78,9 @@
{# see note in the included templates re: show_agenda parameter and required JS import #} {% if s.meeting.type.slug == 'interim' %} - {% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False session=s meeting=s.meeting use_notes=s.meeting.use_notes %} + {% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False session=s meeting=s.meeting %} {% else %} - {% include "meeting/session_buttons_include.html" with show_agenda=False item=s.official_timeslotassignment session=s meeting=s.meeting use_notes=s.meeting.use_notes %} + {% include "meeting/session_buttons_include.html" with show_agenda=False item=s.official_timeslotassignment session=s meeting=s.meeting %} {% endif %}
{% endif %} diff --git a/ietf/templates/meeting/interim_session_buttons.html b/ietf/templates/meeting/interim_session_buttons.html index 2f0951338d..a32f4345c9 100644 --- a/ietf/templates/meeting/interim_session_buttons.html +++ b/ietf/templates/meeting/interim_session_buttons.html @@ -34,7 +34,7 @@ {% endif %} {# notes #} - {% if use_notes %} + {% if session.agenda.uses_notes %} {% endif %} {# Notes #} - {% if use_notes %} + {% if meeting.uses_notes %} {% else %} {# chat logs #} - {% if meeting.number|add:"0" >= 60 %} + {% if meeting.has_chat_logs %} {% endif %} {# Recordings #} - {% if meeting.number|add:"0" >= 80 %} + {% if meeting.has_recordings %} {% with session.recordings as recordings %} {% if recordings %} {# There's no guaranteed order, so this is a bit messy: #} @@ -229,7 +229,7 @@ {% endif %} {# Notes #} - {% if use_notes %} + {% if meeting.uses_notes %}
  • Notepad for note-takers @@ -303,7 +303,7 @@
  • {% else %} {# chat logs #} - {% if meeting.number|add:"0" >= 60 %} + {% if meeting.has_chat_logs %}
  • @@ -312,7 +312,7 @@
  • {% endif %} {# Recordings #} - {% if meeting.number|add:"0" >= 80 %} + {% if meeting.has_recordings %} {% with session.recordings as recordings %} {% if recordings %} {# There's no guaranteed order, so this is a bit messy: #} diff --git a/ietf/templates/meeting/session_details_panel.html b/ietf/templates/meeting/session_details_panel.html index d053ba1c1c..40a862d3b0 100644 --- a/ietf/templates/meeting/session_details_panel.html +++ b/ietf/templates/meeting/session_details_panel.html @@ -9,7 +9,7 @@ {% if meeting.type.slug == 'interim' %} {% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False %} {% else %} - {% include "meeting/session_buttons_include.html" with show_agenda=False item=session.official_timeslotassignment use_notes=session.meeting.use_notes %} + {% include "meeting/session_buttons_include.html" with show_agenda=False item=session.official_timeslotassignment %} {% endif %} {% endif %} @@ -230,7 +230,7 @@

    Meeting tools

    - {% if use_notes %} + {% if meeting.uses_notes %}
    @@ -310,7 +310,7 @@

    Notes and recordings

    - {% if use_notes %} + {% if session.uses_notes %} {% endif %} {# Recordings #} - {% if meeting.number|add:"0" >= 80 %} + {% if session.has_recordings %} {% with session.recordings as recordings %} {% if recordings %} {# There's no guaranteed order, so this is a bit messy: #} diff --git a/ietf/templates/meeting/upcoming.html b/ietf/templates/meeting/upcoming.html index 802b1b03ca..13a27ed910 100644 --- a/ietf/templates/meeting/upcoming.html +++ b/ietf/templates/meeting/upcoming.html @@ -89,7 +89,7 @@

    Upcoming Meetings

    Cancelled {% else %} - + {% endif %} {% endwith %} {% else %} diff --git a/playwright/helpers/meeting.js b/playwright/helpers/meeting.js index f07228b473..b587c07410 100644 --- a/playwright/helpers/meeting.js +++ b/playwright/helpers/meeting.js @@ -630,7 +630,7 @@ module.exports = { }, categories, isCurrentMeeting: dateMode !== 'past', - useNotes: true, + uses_notes: true, schedule, floors } From c03f9b47d87f8dbd46ed7acd9ec984d2872a4da1 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 29 Jul 2024 12:18:24 -0400 Subject: [PATCH 2/7] style: Use "is not" and "is" for None comparisons --- ietf/doc/views_doc.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py index 42898d2098..d553356d45 100644 --- a/ietf/doc/views_doc.py +++ b/ietf/doc/views_doc.py @@ -603,7 +603,7 @@ def document_main(request, name, rev=None, document_html=False): additional_urls = doc.documenturl_set.exclude(tag_id='auth48') # Stream description and name passing test - if doc.stream != None: + if doc.stream is not None: stream_desc = doc.stream.desc stream = "draft-stream-" + doc.stream.slug else: @@ -998,7 +998,7 @@ def document_raw_id(request, name, rev=None, ext=None): for t in possible_types: if os.path.exists(base_path + t): found_types[t]=base_path+t - if ext == None: + if ext is None: ext = 'txt' if not ext in found_types: raise Http404('dont have the file for that extension') @@ -1227,7 +1227,7 @@ def document_bibtex(request, name, rev=None): raise Http404() # Make sure URL_REGEXPS did not grab too much for the rev number - if rev != None and len(rev) != 2: + if rev is not None and len(rev) != 2: mo = re.search(r"^(?P[0-9]{1,2})-(?P[0-9]{2})$", rev) if mo: name = name+"-"+mo.group(1) @@ -1250,7 +1250,7 @@ def document_bibtex(request, name, rev=None): replaced_by = [d.name for d in doc.related_that("replaces")] draft_became_rfc = doc.became_rfc() - if rev != None and rev != doc.rev: + if rev is not None and rev != doc.rev: # find the entry in the history for h in doc.history_set.order_by("-time"): if rev == h.rev: @@ -1291,7 +1291,7 @@ def document_bibxml(request, name, rev=None): raise Http404() # Make sure URL_REGEXPS did not grab too much for the rev number - if rev != None and len(rev) != 2: + if rev is not None and len(rev) != 2: mo = re.search(r"^(?P[0-9]{1,2})-(?P[0-9]{2})$", rev) if mo: name = name+"-"+mo.group(1) @@ -1439,7 +1439,7 @@ def document_referenced_by(request, name): if doc.type_id in ["bcp","std","fyi"]: for rfc in doc.contains(): refs |= rfc.referenced_by() - full = ( request.GET.get('full') != None ) + full = ( request.GET.get('full') is not None ) numdocs = refs.count() if not full and numdocs>250: refs=refs[:250] @@ -1459,7 +1459,7 @@ def document_ballot_content(request, doc, ballot_id, editable=True): augment_events_with_revision(doc, all_ballots) ballot = None - if ballot_id != None: + if ballot_id is not None: ballot_id = int(ballot_id) for b in all_ballots: if b.id == ballot_id: @@ -1661,7 +1661,7 @@ def add_comment(request, name): login = request.user.person - if doc.type_id == "draft" and doc.group != None: + if doc.type_id == "draft" and doc.group is not None: can_add_comment = bool(has_role(request.user, ("Area Director", "Secretariat", "IRTF Chair", "IANA", "RFC Editor")) or ( request.user.is_authenticated and Role.objects.filter(name__in=("chair", "secr"), From ab9ae1b3f26eb37aee9a2d6ee35643b7f0b5df9d Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 29 Jul 2024 12:20:17 -0400 Subject: [PATCH 3/7] None comparison and non-IETF meetings style: Use "is not None" instead of "!=" For non-IETF meetings assume chat logs exist --- ietf/meeting/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ietf/meeting/models.py b/ietf/meeting/models.py index 3e1b68e281..46692d4b02 100644 --- a/ietf/meeting/models.py +++ b/ietf/meeting/models.py @@ -385,17 +385,19 @@ def uses_notes(self): if self.type_id != 'ietf': return True num = self.get_number() - return num != None and num >= 108 + return num is not None and num >= 108 def has_recordings(self): if self.type_id != 'ietf': return True num = self.get_number() - return num != None and num >= 80 + return num is not None and num >= 80 def has_chat_logs(self): + if self.type_id != 'ietf': + return True; num = self.get_number() - return num != None and num >= 60 + return num is not None and num >= 60 def meeting_start(self): """Meeting-local midnight at the start of the meeting date""" From ea28b5a427ec389e6e2f694a705d36ebe2ccf478 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Fri, 2 Aug 2024 16:32:27 -0400 Subject: [PATCH 4/7] fix: Restore useNotes for JS fields --- ietf/meeting/tests_views.py | 4 ++-- ietf/meeting/views.py | 2 +- playwright/helpers/meeting.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ietf/meeting/tests_views.py b/ietf/meeting/tests_views.py index 996517e560..225fd50717 100644 --- a/ietf/meeting/tests_views.py +++ b/ietf/meeting/tests_views.py @@ -255,11 +255,11 @@ def test_meeting_agenda(self): "updated": rjson.get("meeting").get("updated"), # Just expect the value to exist "timezone": meeting.time_zone, "infoNote": meeting.agenda_info_note, - "warningNote": meeting.agenda_warning_note, - "uses_notes": False + "warningNote": meeting.agenda_warning_note }, "categories": rjson.get("categories"), # Just expect the value to exist "isCurrentMeeting": True, + "usesNotes": False, "schedule": rjson.get("schedule"), # Just expect the value to exist "floors": [] } diff --git a/ietf/meeting/views.py b/ietf/meeting/views.py index 0828c7601e..6ce8790493 100644 --- a/ietf/meeting/views.py +++ b/ietf/meeting/views.py @@ -1690,7 +1690,7 @@ def api_get_agenda_data (request, num=None): }, "categories": filter_organizer.get_filter_categories(), "isCurrentMeeting": is_current_meeting, - "uses_notes": meeting.uses_notes(), + "usesNotes": meeting.uses_notes(), "schedule": list(map(agenda_extract_schedule, filtered_assignments)), "floors": list(map(agenda_extract_floorplan, floors)) }) diff --git a/playwright/helpers/meeting.js b/playwright/helpers/meeting.js index b587c07410..52bc331fd6 100644 --- a/playwright/helpers/meeting.js +++ b/playwright/helpers/meeting.js @@ -630,7 +630,7 @@ module.exports = { }, categories, isCurrentMeeting: dateMode !== 'past', - uses_notes: true, + usesNotes: true, schedule, floors } From 44d426c4a6e6c8166d1471c056b8cd9726eae0f6 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 5 Aug 2024 13:32:31 -0400 Subject: [PATCH 5/7] fix: uses_notes->useNotes (in JavaScript) Also add comment about meeting number field in tests --- client/agenda/store.js | 4 ++-- ietf/meeting/tests_views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/agenda/store.js b/client/agenda/store.js index 4f1492aa9c..839d464c43 100644 --- a/client/agenda/store.js +++ b/client/agenda/store.js @@ -50,7 +50,7 @@ export const useAgendaStore = defineStore('agenda', { selectedCatSubs: [], settingsShown: false, timezone: DateTime.local().zoneName, - uses_notes: false, + useNotes: false, visibleDays: [] }), getters: { @@ -160,7 +160,7 @@ export const useAgendaStore = defineStore('agenda', { this.isCurrentMeeting = agendaData.isCurrentMeeting this.meeting = agendaData.meeting this.schedule = agendaData.schedule - this.uses_notes = agendaData.uses_notes + this.useNotes = agendaData.useNotes // -> Compute current info note hash this.infoNoteHash = murmur(agendaData.meeting.infoNote, 0).toString() diff --git a/ietf/meeting/tests_views.py b/ietf/meeting/tests_views.py index 225fd50717..840bce46f1 100644 --- a/ietf/meeting/tests_views.py +++ b/ietf/meeting/tests_views.py @@ -259,7 +259,7 @@ def test_meeting_agenda(self): }, "categories": rjson.get("categories"), # Just expect the value to exist "isCurrentMeeting": True, - "usesNotes": False, + "usesNotes": False, # make_meeting_test_data sets number=72 "schedule": rjson.get("schedule"), # Just expect the value to exist "floors": [] } From 29817a85cbd8d9c29ef4335b2f5626b2b1a81686 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Tue, 6 Aug 2024 14:43:33 +0000 Subject: [PATCH 6/7] Missed a uses_notes->useNotes edit --- client/agenda/AgendaScheduleList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/agenda/AgendaScheduleList.vue b/client/agenda/AgendaScheduleList.vue index cdbf9c953b..9db763b74e 100644 --- a/client/agenda/AgendaScheduleList.vue +++ b/client/agenda/AgendaScheduleList.vue @@ -296,7 +296,7 @@ const meetingEvents = computed(() => { color: 'red' }) } - if (agendaStore.uses_notes) { + if (agendaStore.useNotes) { links.push({ id: `lnk-${item.id}-note`, label: 'Notepad for note-takers', From 4e8ce54cdbaeb35c77c370ba86e90a29ab629376 Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Tue, 6 Aug 2024 12:06:06 -0300 Subject: [PATCH 7/7] fix: useNotes->usesNotes --- client/agenda/AgendaScheduleList.vue | 2 +- client/agenda/store.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/agenda/AgendaScheduleList.vue b/client/agenda/AgendaScheduleList.vue index 9db763b74e..a6d2b9a5aa 100644 --- a/client/agenda/AgendaScheduleList.vue +++ b/client/agenda/AgendaScheduleList.vue @@ -296,7 +296,7 @@ const meetingEvents = computed(() => { color: 'red' }) } - if (agendaStore.useNotes) { + if (agendaStore.usesNotes) { links.push({ id: `lnk-${item.id}-note`, label: 'Notepad for note-takers', diff --git a/client/agenda/store.js b/client/agenda/store.js index 839d464c43..18c3e8c657 100644 --- a/client/agenda/store.js +++ b/client/agenda/store.js @@ -50,7 +50,7 @@ export const useAgendaStore = defineStore('agenda', { selectedCatSubs: [], settingsShown: false, timezone: DateTime.local().zoneName, - useNotes: false, + usesNotes: false, visibleDays: [] }), getters: { @@ -160,7 +160,7 @@ export const useAgendaStore = defineStore('agenda', { this.isCurrentMeeting = agendaData.isCurrentMeeting this.meeting = agendaData.meeting this.schedule = agendaData.schedule - this.useNotes = agendaData.useNotes + this.usesNotes = agendaData.usesNotes // -> Compute current info note hash this.infoNoteHash = murmur(agendaData.meeting.infoNote, 0).toString()
    @@ -320,7 +320,7 @@

    Notes and recordings

    {% include "meeting/interim_session_buttons.html" with show_agenda=True use_notes=meeting.uses_notes %}{% include "meeting/interim_session_buttons.html" with show_agenda=True %}