From 44dd395f568fc0dae3da6f38ccf38ed1625218e9 Mon Sep 17 00:00:00 2001 From: John Tordoff <> Date: Tue, 1 Oct 2024 10:14:43 -0400 Subject: [PATCH] refactor documentation and names --- api/institutions/serializers.py | 9 --------- api/institutions/urls.py | 2 +- api/institutions/views.py | 10 +++++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/api/institutions/serializers.py b/api/institutions/serializers.py index ed7e34af91a..29c7c8b380a 100644 --- a/api/institutions/serializers.py +++ b/api/institutions/serializers.py @@ -364,15 +364,6 @@ class NewInstitutionSummaryMetricsSerializer(JSONAPISerializer): used only when the INSTITUTIONAL_DASHBOARD_2024 feature flag is active (and should be renamed without "New" when that flag is permanently active) - - Summary contains counts of - - Total users in the institution - - Total public project count for the institution - - Total private project count for the institution - - Total public registration count for the institution - - Total private registration count for the institution - - Total published preprint count for the institution - ''' class Meta: diff --git a/api/institutions/urls.py b/api/institutions/urls.py index 9daffa65f73..477fe8d9377 100644 --- a/api/institutions/urls.py +++ b/api/institutions/urls.py @@ -13,7 +13,7 @@ re_path(r'^(?P\w+)/relationships/registrations/$', views.InstitutionRegistrationsRelationship.as_view(), name=views.InstitutionRegistrationsRelationship.view_name), re_path(r'^(?P\w+)/relationships/nodes/$', views.InstitutionNodesRelationship.as_view(), name=views.InstitutionNodesRelationship.view_name), re_path(r'^(?P\w+)/users/$', views.InstitutionUserList.as_view(), name=views.InstitutionUserList.view_name), - re_path(r'^(?P\w+)/metrics/summary/$', views.institution_summary_metrics_list_view, name=views.institution_summary_metrics_list_view.view_name), + re_path(r'^(?P\w+)/metrics/summary/$', views.institution_summary_metrics_detail_view, name=views.institution_summary_metrics_detail_view.view_name), re_path(r'^(?P\w+)/metrics/departments/$', views.InstitutionDepartmentList.as_view(), name=views.InstitutionDepartmentList.view_name), re_path(r'^(?P\w+)/metrics/users/$', views.institution_user_metrics_list_view, name=views.institution_user_metrics_list_view.view_name), ] diff --git a/api/institutions/views.py b/api/institutions/views.py index b82aed38932..c13cb1f8d74 100644 --- a/api/institutions/views.py +++ b/api/institutions/views.py @@ -582,8 +582,8 @@ def get_default_search(self): ) -class _NewInstitutionSummaryMetricsList(JSONAPIBaseView, generics.RetrieveAPIView, InstitutionMixin): - '''list view for institution-summary metrics +class _NewInstitutionSummaryMetricsDetail(JSONAPIBaseView, generics.RetrieveAPIView, InstitutionMixin): + '''detail view for institution-summary metrics used only when the INSTITUTIONAL_DASHBOARD_2024 feature flag is active (and should be renamed without "New" when that flag is permanently active) @@ -621,12 +621,12 @@ def get_default_search(self): ) -institution_summary_metrics_list_view = toggle_view_by_flag( +institution_summary_metrics_detail_view = toggle_view_by_flag( flag_name=osf.features.INSTITUTIONAL_DASHBOARD_2024, old_view=_OldInstitutionSummaryMetrics.as_view(), - new_view=_NewInstitutionSummaryMetricsList.as_view(), + new_view=_NewInstitutionSummaryMetricsDetail.as_view(), ) -institution_summary_metrics_list_view.view_name = 'institution-summary-metrics' +institution_summary_metrics_detail_view.view_name = 'institution-summary-metrics' institution_user_metrics_list_view = toggle_view_by_flag(