diff --git a/HISTORY.rst b/HISTORY.rst
index 4e3d6e228..f4fc44141 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -39,7 +39,8 @@ End-User Summary
- Improving performance of case listing (#304)
- Adding shortcut buttons to phenotype annotation (#289)
- Fixing issue with multiple added variants (#283)
-- Implementing several usability improvements for clinvar submission editor (#286).
+- Implementing several usability improvements for clinvar submission editor (#286)
+- Make clinvar UI work with many annotations (#302)
Full Change List
================
@@ -81,6 +82,7 @@ Full Change List
- Adding shortcut buttons to phenotype annotation (#289)
- Fixing issue with multiple added variants (#283)
- Implementing several usability improvements for clinvar submission editor (#286).
+- Make clinvar UI work with many annotations by making it load them lazily for one case at a time (#302)
- Adding CI builds for Python 3.10 in Github actions, bumping numpy/pandas dependencies.
Dropping support for Python 3.7.
diff --git a/clinvar_export/tests/test_permissions_ajax.py b/clinvar_export/tests/test_permissions_ajax.py
index 8b5233542..97dcfca26 100644
--- a/clinvar_export/tests/test_permissions_ajax.py
+++ b/clinvar_export/tests/test_permissions_ajax.py
@@ -5,7 +5,7 @@
from projectroles.tests.test_permissions_api import TestProjectAPIPermissionBase
from geneinfo.tests.factories import HpoNameFactory, HpoFactory
-from variants.tests.factories import SmallVariantCommentFactory
+from variants.tests.factories import CaseFactory, SmallVariantCommentFactory
from .factories import (
SubmissionSetFactory,
SubmissionFactory,
@@ -18,6 +18,7 @@
SubmittingOrgFactory,
SubmitterFactory,
)
+from ..models import Family
class TestOrganisationAjaxViews(TestProjectAPIPermissionBase):
@@ -681,10 +682,16 @@ def test(self):
class TestAnnotatedSmallVariantsAjaxViews(TestProjectAPIPermissionBase):
"""Permission tests for the AJAX views for querying user-annotated small variants."""
+ def setUp(self):
+ super().setUp()
+ self.case = CaseFactory(project=self.project)
+ self.family = Family.objects.get_or_create_in_project(project=self.project, case=self.case)
+
def test(self):
SmallVariantCommentFactory()
url = reverse(
- "clinvar_export:user-annotations", kwargs={"project": self.project.sodar_uuid,},
+ "clinvar_export:user-annotations",
+ kwargs={"project": self.project.sodar_uuid, "family": self.family.sodar_uuid},
)
good_users = [
self.superuser,
diff --git a/clinvar_export/tests/test_views_ajax.py b/clinvar_export/tests/test_views_ajax.py
index deadb0239..d58b71ae7 100644
--- a/clinvar_export/tests/test_views_ajax.py
+++ b/clinvar_export/tests/test_views_ajax.py
@@ -876,6 +876,7 @@ class TestAnnotatedSmallVariantsAjaxViews(TestProjectAPIPermissionBase):
def setUp(self):
super().setUp()
self.case = CaseFactory(project=self.project)
+ self.family = Family.objects.get_or_create_in_project(project=self.project, case=self.case)
self.small_variant = SmallVariantFactory(case_id=self.case.id)
kwargs = {
key: getattr(self.small_variant, key)
@@ -887,7 +888,8 @@ def setUp(self):
def test_query(self):
url = reverse(
- "clinvar_export:user-annotations", kwargs={"project": self.project.sodar_uuid,},
+ "clinvar_export:user-annotations",
+ kwargs={"project": self.project.sodar_uuid, "family": self.family.sodar_uuid},
)
with self.login(self.contributor_as.user):
response = self.client.get(url)
diff --git a/clinvar_export/urls.py b/clinvar_export/urls.py
index 66a2414c6..d6059c068 100644
--- a/clinvar_export/urls.py
+++ b/clinvar_export/urls.py
@@ -102,7 +102,7 @@
name="query-hpo-term",
),
url(
- regex=r"^ajax/(?P