From 14ebd46bf56e0154a034d0be9ea6b15ba7a9b854 Mon Sep 17 00:00:00 2001 From: Jing Cheng Date: Fri, 29 Nov 2024 11:29:30 -0500 Subject: [PATCH 1/4] Updated view to use B5 template --- corehq/apps/domain/views/internal.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/corehq/apps/domain/views/internal.py b/corehq/apps/domain/views/internal.py index d4044a973a2b..b908a0c27f8c 100644 --- a/corehq/apps/domain/views/internal.py +++ b/corehq/apps/domain/views/internal.py @@ -41,7 +41,7 @@ BaseAdminProjectSettingsView, BaseProjectSettingsView, ) -from corehq.apps.hqwebapp.decorators import use_jquery_ui, use_multiselect +from corehq.apps.hqwebapp.decorators import use_bootstrap5, use_jquery_ui, use_multiselect from corehq.apps.hqwebapp.tasks import send_html_email_async, send_mail_async from corehq.apps.hqwebapp.views import BasePageView from corehq.apps.receiverwrapper.rate_limiter import domain_case_rate_limiter, submission_rate_limiter @@ -286,10 +286,11 @@ def page_context(self): @method_decorator(always_allow_project_access, name='dispatch') @method_decorator(require_superuser, name='dispatch') +@method_decorator(use_bootstrap5, name='dispatch') class ProjectLimitsView(BaseAdminProjectSettingsView): urlname = 'internal_project_limits_summary' page_title = gettext_lazy("Project Limits") - template_name = 'domain/admin/bootstrap3/project_limits.html' + template_name = 'domain/admin/bootstrap5/project_limits.html' @property def page_context(self): From 2cfb950ed660ff3cc595a5a3e218ffdded325ccc Mon Sep 17 00:00:00 2001 From: Jing Cheng Date: Fri, 29 Nov 2024 13:27:21 -0500 Subject: [PATCH 2/4] Addressed TODOs in template --- .../admin/partials/bootstrap5/project_limits_table.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/corehq/apps/domain/templates/domain/admin/partials/bootstrap5/project_limits_table.html b/corehq/apps/domain/templates/domain/admin/partials/bootstrap5/project_limits_table.html index 6cb3dcc1263e..e5f0426735e1 100644 --- a/corehq/apps/domain/templates/domain/admin/partials/bootstrap5/project_limits_table.html +++ b/corehq/apps/domain/templates/domain/admin/partials/bootstrap5/project_limits_table.html @@ -23,8 +23,8 @@

{{ header }}

{{ rate_info.key }} {{ rate_info.percent_usage }}% -
{# todo B5: css-progress #} -
{# todo B5: inline-style #} +
+
{{ rate_info.current_usage }} From b1fb8224d447ac43157b415a4549c736c24a2b06 Mon Sep 17 00:00:00 2001 From: Jing Cheng Date: Fri, 29 Nov 2024 18:45:41 +0000 Subject: [PATCH 3/4] "Bootstrap 5 Migration - Marked template 'domain/admin/project_limits.html' as complete and un-split files." --- .../domain/admin/bootstrap3/project_limits.html | 10 ---------- .../domain/admin/{bootstrap5 => }/project_limits.html | 0 corehq/apps/domain/views/internal.py | 2 +- .../utils/bootstrap/status/bootstrap3_to_5.json | 1 + 4 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 corehq/apps/domain/templates/domain/admin/bootstrap3/project_limits.html rename corehq/apps/domain/templates/domain/admin/{bootstrap5 => }/project_limits.html (100%) diff --git a/corehq/apps/domain/templates/domain/admin/bootstrap3/project_limits.html b/corehq/apps/domain/templates/domain/admin/bootstrap3/project_limits.html deleted file mode 100644 index c41d0d1377a8..000000000000 --- a/corehq/apps/domain/templates/domain/admin/bootstrap3/project_limits.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "hqwebapp/bootstrap3/base_section.html" %} -{% load hq_shared_tags %} - -{% block page_content %} - - {% initial_page_data 'domain' domain %} - - {% include "domain/admin/partials/bootstrap3/project_limits_table.html" %} - -{% endblock %} diff --git a/corehq/apps/domain/templates/domain/admin/bootstrap5/project_limits.html b/corehq/apps/domain/templates/domain/admin/project_limits.html similarity index 100% rename from corehq/apps/domain/templates/domain/admin/bootstrap5/project_limits.html rename to corehq/apps/domain/templates/domain/admin/project_limits.html diff --git a/corehq/apps/domain/views/internal.py b/corehq/apps/domain/views/internal.py index b908a0c27f8c..0c7885e09ec8 100644 --- a/corehq/apps/domain/views/internal.py +++ b/corehq/apps/domain/views/internal.py @@ -290,7 +290,7 @@ def page_context(self): class ProjectLimitsView(BaseAdminProjectSettingsView): urlname = 'internal_project_limits_summary' page_title = gettext_lazy("Project Limits") - template_name = 'domain/admin/bootstrap5/project_limits.html' + template_name = 'domain/admin/project_limits.html' @property def page_context(self): diff --git a/corehq/apps/hqwebapp/utils/bootstrap/status/bootstrap3_to_5.json b/corehq/apps/hqwebapp/utils/bootstrap/status/bootstrap3_to_5.json index abeaa43e7602..3238e494f7eb 100644 --- a/corehq/apps/hqwebapp/utils/bootstrap/status/bootstrap3_to_5.json +++ b/corehq/apps/hqwebapp/utils/bootstrap/status/bootstrap3_to_5.json @@ -57,6 +57,7 @@ "admin/case_search.html", "admin/commtrack_settings.html", "admin/partials/case_search_templates.html", + "admin/project_limits.html", "admin/sms_settings.html" ] }, From 9c6bbc2e6e1e76100f2fd73580fb06249e4fc40b Mon Sep 17 00:00:00 2001 From: Jing Cheng Date: Mon, 2 Dec 2024 17:38:03 +0000 Subject: [PATCH 4/4] "Bootstrap 5 Migration - Rebuilt diffs" --- .../partials/project_limits_table.html.diff.txt | 8 +++----- .../domain/admin/project_limits.html.diff.txt | 15 --------------- 2 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/domain/admin/project_limits.html.diff.txt diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/domain/admin/partials/project_limits_table.html.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/domain/admin/partials/project_limits_table.html.diff.txt index 47b3f6b62c59..cc6062565a21 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/domain/admin/partials/project_limits_table.html.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/domain/admin/partials/project_limits_table.html.diff.txt @@ -9,14 +9,12 @@ {% for header, rate_infos in project_limits %}

{{ header }}

-@@ -23,8 +23,8 @@ +@@ -23,7 +23,7 @@ - diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/domain/admin/project_limits.html.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/domain/admin/project_limits.html.diff.txt deleted file mode 100644 index 4409c60d9cae..000000000000 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/domain/admin/project_limits.html.diff.txt +++ /dev/null @@ -1,15 +0,0 @@ ---- -+++ -@@ -1,10 +1,10 @@ --{% extends "hqwebapp/bootstrap3/base_section.html" %} -+{% extends "hqwebapp/bootstrap5/base_section.html" %} - {% load hq_shared_tags %} - - {% block page_content %} - - {% initial_page_data 'domain' domain %} - -- {% include "domain/admin/partials/bootstrap3/project_limits_table.html" %} -+ {% include "domain/admin/partials/bootstrap5/project_limits_table.html" %} - - {% endblock %}
{{ rate_info.key }} {{ rate_info.percent_usage }}% -
--
-+
{# todo B5: css-progress #} -+
{# todo B5: inline-style #} ++
+
{{ rate_info.current_usage }}