From 7c591a9c182ff7b498cdcdb7e292ecb3d89f35ff Mon Sep 17 00:00:00 2001 From: Eric Vyncke Date: Tue, 22 Jul 2025 13:31:54 +0000 Subject: [PATCH 1/7] Add "Outside of the WG Internet-Draft" when IESG state != idexists --- ietf/group/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ietf/group/views.py b/ietf/group/views.py index f59b270a086..83e4a7524d0 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -432,14 +432,15 @@ def prepare_group_documents(request, group, clist): d.search_heading = "Related Internet-Drafts and RFCs" docs_related.append(d) else: + if d.type_id == "draft" and d.get_state_slug('draft-iesg') != 'idexists': # values can be: ad-eval idexists approved rfcqueue dead iesg-eva + d.search_heading = "Outside of the WG Internet-Draft" if not (d.get_state_slug('draft-iesg') == "dead" or (d.stream_id and d.get_state_slug("draft-stream-%s" % d.stream_id) == "dead")): docs.append(d) meta_related = meta.copy() - + docs.sort(key=lambda d: d.search_heading) return docs, meta, docs_related, meta_related - def get_leadership(group_type): people = Person.objects.filter( role__name__slug="chair", From 221fb872bbfcd303be20b030b4a69098aed59ea9 Mon Sep 17 00:00:00 2001 From: Eric Vyncke Date: Wed, 23 Jul 2025 14:44:31 +0000 Subject: [PATCH 2/7] No plural forms in the dividers --- ietf/templates/doc/search/search_results.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/templates/doc/search/search_results.html b/ietf/templates/doc/search/search_results.html index bd6b072f0d2..8f70e9bf33c 100644 --- a/ietf/templates/doc/search/search_results.html +++ b/ietf/templates/doc/search/search_results.html @@ -49,7 +49,7 @@ - {{ doc_group.grouper|plural:doc_group.list }} ({{ doc_group.list|length }} {{"hit"|plural:doc_group.list }}) + {{ doc_group.grouper }} ({{ doc_group.list|length }} {{"hit"|plural:doc_group.list }}) From 846bf9d0810319f32ecdb8e5b840f8d68dbfd711 Mon Sep 17 00:00:00 2001 From: Eric Vyncke Date: Wed, 23 Jul 2025 14:46:00 +0000 Subject: [PATCH 3/7] Use different search_heading --- ietf/group/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ietf/group/views.py b/ietf/group/views.py index 83e4a7524d0..b615e1413de 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -432,8 +432,9 @@ def prepare_group_documents(request, group, clist): d.search_heading = "Related Internet-Drafts and RFCs" docs_related.append(d) else: - if d.type_id == "draft" and d.get_state_slug('draft-iesg') != 'idexists': # values can be: ad-eval idexists approved rfcqueue dead iesg-eva - d.search_heading = "Outside of the WG Internet-Draft" + # TODO need to write test to cover other streams and other states + if d.type_id == "draft" and d.stream_id == 'iesg' and d.get_state_slug('draft-iesg') != 'idexists': # values can be: ad-eval idexists approved rfcqueue dead iesg-eva + d.search_heading = "Internet-Draft at the IESG" if not (d.get_state_slug('draft-iesg') == "dead" or (d.stream_id and d.get_state_slug("draft-stream-%s" % d.stream_id) == "dead")): docs.append(d) From a6a4d1fdac15d6e6fd1da162a3e032a05ea13a1b Mon Sep 17 00:00:00 2001 From: Eric Vyncke Date: Wed, 23 Jul 2025 14:51:24 +0000 Subject: [PATCH 4/7] Use the right stream_id --- ietf/group/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/group/views.py b/ietf/group/views.py index b615e1413de..f13c6832625 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -433,7 +433,7 @@ def prepare_group_documents(request, group, clist): docs_related.append(d) else: # TODO need to write test to cover other streams and other states - if d.type_id == "draft" and d.stream_id == 'iesg' and d.get_state_slug('draft-iesg') != 'idexists': # values can be: ad-eval idexists approved rfcqueue dead iesg-eva + if d.type_id == "draft" and d.stream_id == 'ietf' and d.get_state_slug('draft-iesg') != 'idexists': # values can be: ad-eval idexists approved rfcqueue dead iesg-eva d.search_heading = "Internet-Draft at the IESG" if not (d.get_state_slug('draft-iesg') == "dead" or (d.stream_id and d.get_state_slug("draft-stream-%s" % d.stream_id) == "dead")): docs.append(d) From 371c7e7bd4404a763614767b8d018ece1d9cfa4c Mon Sep 17 00:00:00 2001 From: Eric Vyncke Date: Wed, 30 Jul 2025 21:32:44 +0000 Subject: [PATCH 5/7] Adding tests_info coverage for prepare_group_documents --- ietf/group/tests_info.py | 22 +++++++++++++++++++++- ietf/group/views.py | 1 - 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ietf/group/tests_info.py b/ietf/group/tests_info.py index aaf937ee43b..41b6ef1545f 100644 --- a/ietf/group/tests_info.py +++ b/ietf/group/tests_info.py @@ -27,7 +27,7 @@ from ietf.community.models import CommunityList from ietf.community.utils import reset_name_contains_index_for_rule -from ietf.doc.factories import WgDraftFactory, IndividualDraftFactory, CharterFactory, BallotDocEventFactory +from ietf.doc.factories import WgDraftFactory, RgDraftFactory, IndividualDraftFactory, CharterFactory, BallotDocEventFactory from ietf.doc.models import Document, DocEvent, State from ietf.doc.storage_utils import retrieve_str from ietf.doc.utils_charter import charter_name_for_group @@ -413,6 +413,7 @@ def test_group_documents(self): self.assertContains(r, draft3.name) for ah in draft3.action_holders.all(): self.assertContains(r, escape(ah.name)) + self.assertContains(r, "Internet-Draft at the IESG") # draft3 is pub-req hence should have such a divider self.assertContains(r, 'for 173 days', count=1) # the old_dah should be tagged self.assertContains(r, draft4.name) self.assertNotContains(r, draft5.name) @@ -425,6 +426,25 @@ def test_group_documents(self): q = PyQuery(r.content) self.assertTrue(any([draft2.name in x.attrib['href'] for x in q('table td a.track-untrack-doc')])) + # Let's also check the IRTF stream + rg = GroupFactory(type_id='rg') + setup_default_community_list_for_group(rg) + rgDraft = RgDraftFactory(group=rg) + rgDraft4 = RgDraftFactory(group=rg) + rgDraft4.set_state(State.objects.get(slug='irsg-w')) + rgDraft7 = RgDraftFactory(group=rg) + rgDraft7.set_state(State.objects.get(type='draft-stream-%s' % rgDraft7.stream_id, slug='dead')) + for url in group_urlreverse_list(rg, 'ietf.group.views.group_documents'): + with self.settings(DOC_ACTION_HOLDER_MAX_AGE_DAYS=20): + r = self.client.get(url) + self.assertEqual(r.status_code, 200) + self.assertContains(r, rgDraft.name) + self.assertContains(r, rg.name) + self.assertContains(r, rg.acronym) + self.assertNotContains(r, draft3.name) # As draft3 is a WG draft, it should not be listed here + self.assertContains(r, rgDraft4.name) + self.assertNotContains(r, rgDraft7.name) + # test the txt version too while we're at it for url in group_urlreverse_list(group, 'ietf.group.views.group_documents_txt'): r = self.client.get(url) diff --git a/ietf/group/views.py b/ietf/group/views.py index 81bc1bc7221..08b060e30c3 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -432,7 +432,6 @@ def prepare_group_documents(request, group, clist): d.search_heading = "Related Internet-Drafts and RFCs" docs_related.append(d) else: - # TODO need to write test to cover other streams and other states if d.type_id == "draft" and d.stream_id == 'ietf' and d.get_state_slug('draft-iesg') != 'idexists': # values can be: ad-eval idexists approved rfcqueue dead iesg-eva d.search_heading = "Internet-Draft at the IESG" if not (d.get_state_slug('draft-iesg') == "dead" or (d.stream_id and d.get_state_slug("draft-stream-%s" % d.stream_id) == "dead")): From 385325aae90d8b9be29194dfa23efc5f353579ee Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Fri, 26 Sep 2025 12:16:14 -0500 Subject: [PATCH 6/7] fix: move identifying and sorting doxs with IESG into search utility. --- ietf/doc/utils_search.py | 9 ++++++++- ietf/group/tests_info.py | 2 +- ietf/group/views.py | 4 +--- ietf/templates/doc/search/search_results.html | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ietf/doc/utils_search.py b/ietf/doc/utils_search.py index cfc8a872f81..00bf01fa0d4 100644 --- a/ietf/doc/utils_search.py +++ b/ietf/doc/utils_search.py @@ -108,7 +108,10 @@ def fill_in_document_table_attributes(docs, have_telechat_date=False): d.search_heading = "Withdrawn Internet-Draft" d.expirable = False else: - d.search_heading = "%s Internet-Draft" % d.get_state() + if d.type_id == "draft" and d.stream_id == 'ietf' and d.get_state_slug('draft-iesg') != 'idexists': # values can be: ad-eval idexists approved rfcqueue dead iesg-eva + d.search_heading = "%s with the IESG Internet-Draft" % d.get_state() + else: + d.search_heading = "%s Internet-Draft" % d.get_state() if state_slug == "active": d.expirable = d.pk in expirable_pks else: @@ -221,6 +224,10 @@ def num(i): if d.type_id == "draft": res.append(num(["Active", "Expired", "Replaced", "Withdrawn", "RFC"].index(d.search_heading.split()[0]))) + if d.search_heading.startswith("Active with"): + res.append("1") + else: + res.append("0") else: res.append(d.type_id); res.append("-"); diff --git a/ietf/group/tests_info.py b/ietf/group/tests_info.py index 6e96619a727..34f8500854b 100644 --- a/ietf/group/tests_info.py +++ b/ietf/group/tests_info.py @@ -413,7 +413,7 @@ def test_group_documents(self): self.assertContains(r, draft3.name) for ah in draft3.action_holders.all(): self.assertContains(r, escape(ah.name)) - self.assertContains(r, "Internet-Draft at the IESG") # draft3 is pub-req hence should have such a divider + self.assertContains(r, "Active with the IESG Internet-Draft") # draft3 is pub-req hence should have such a divider self.assertContains(r, 'for 173 days', count=1) # the old_dah should be tagged self.assertContains(r, draft4.name) self.assertNotContains(r, draft5.name) diff --git a/ietf/group/views.py b/ietf/group/views.py index 05f0977bee9..efe3eca15d5 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -436,13 +436,11 @@ def prepare_group_documents(request, group, clist): d.search_heading = "Related Internet-Drafts and RFCs" docs_related.append(d) else: - if d.type_id == "draft" and d.stream_id == 'ietf' and d.get_state_slug('draft-iesg') != 'idexists': # values can be: ad-eval idexists approved rfcqueue dead iesg-eva - d.search_heading = "Internet-Draft at the IESG" if not (d.get_state_slug('draft-iesg') == "dead" or (d.stream_id and d.get_state_slug("draft-stream-%s" % d.stream_id) == "dead")): docs.append(d) meta_related = meta.copy() - docs.sort(key=lambda d: d.search_heading) + return docs, meta, docs_related, meta_related def get_leadership(group_type): diff --git a/ietf/templates/doc/search/search_results.html b/ietf/templates/doc/search/search_results.html index 8f70e9bf33c..bd6b072f0d2 100644 --- a/ietf/templates/doc/search/search_results.html +++ b/ietf/templates/doc/search/search_results.html @@ -49,7 +49,7 @@ - {{ doc_group.grouper }} ({{ doc_group.list|length }} {{"hit"|plural:doc_group.list }}) + {{ doc_group.grouper|plural:doc_group.list }} ({{ doc_group.list|length }} {{"hit"|plural:doc_group.list }}) From 79a3a8ea75eccc0d14ab8815ec5eda350abc259d Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Fri, 26 Sep 2025 12:26:03 -0500 Subject: [PATCH 7/7] fix: improve ordering conditional --- ietf/doc/utils_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/doc/utils_search.py b/ietf/doc/utils_search.py index 00bf01fa0d4..a5f461f9bb7 100644 --- a/ietf/doc/utils_search.py +++ b/ietf/doc/utils_search.py @@ -224,7 +224,7 @@ def num(i): if d.type_id == "draft": res.append(num(["Active", "Expired", "Replaced", "Withdrawn", "RFC"].index(d.search_heading.split()[0]))) - if d.search_heading.startswith("Active with"): + if "with the IESG" in d.search_heading: res.append("1") else: res.append("0")