Skip to content

Commit

Permalink
refactor documentation and names
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff authored and aaxelb committed Oct 1, 2024
1 parent b0288f0 commit 44dd395
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
9 changes: 0 additions & 9 deletions api/institutions/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion api/institutions/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
re_path(r'^(?P<institution_id>\w+)/relationships/registrations/$', views.InstitutionRegistrationsRelationship.as_view(), name=views.InstitutionRegistrationsRelationship.view_name),
re_path(r'^(?P<institution_id>\w+)/relationships/nodes/$', views.InstitutionNodesRelationship.as_view(), name=views.InstitutionNodesRelationship.view_name),
re_path(r'^(?P<institution_id>\w+)/users/$', views.InstitutionUserList.as_view(), name=views.InstitutionUserList.view_name),
re_path(r'^(?P<institution_id>\w+)/metrics/summary/$', views.institution_summary_metrics_list_view, name=views.institution_summary_metrics_list_view.view_name),
re_path(r'^(?P<institution_id>\w+)/metrics/summary/$', views.institution_summary_metrics_detail_view, name=views.institution_summary_metrics_detail_view.view_name),
re_path(r'^(?P<institution_id>\w+)/metrics/departments/$', views.InstitutionDepartmentList.as_view(), name=views.InstitutionDepartmentList.view_name),
re_path(r'^(?P<institution_id>\w+)/metrics/users/$', views.institution_user_metrics_list_view, name=views.institution_user_metrics_list_view.view_name),
]
10 changes: 5 additions & 5 deletions api/institutions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 44dd395

Please sign in to comment.