From f8031272d0405df7ce97655e18dc860263b52567 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Mon, 28 Oct 2024 21:09:24 -0400 Subject: [PATCH 01/19] Migrated builds app to webpack --- corehq/apps/builds/static/builds/js/edit_builds.js | 1 + corehq/apps/builds/templates/builds/edit_menu.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/corehq/apps/builds/static/builds/js/edit_builds.js b/corehq/apps/builds/static/builds/js/edit_builds.js index 8455e61beaea..4aaa1064064b 100644 --- a/corehq/apps/builds/static/builds/js/edit_builds.js +++ b/corehq/apps/builds/static/builds/js/edit_builds.js @@ -4,6 +4,7 @@ hqDefine('builds/js/edit_builds', [ 'underscore', 'knockout', 'hqwebapp/js/initial_page_data', + 'commcarehq', ], function ($, _, ko, initialPageData) { var doc = initialPageData.get('doc'); diff --git a/corehq/apps/builds/templates/builds/edit_menu.html b/corehq/apps/builds/templates/builds/edit_menu.html index 9326d528f37a..cc4079175e94 100644 --- a/corehq/apps/builds/templates/builds/edit_menu.html +++ b/corehq/apps/builds/templates/builds/edit_menu.html @@ -3,7 +3,7 @@ {% load compress %} {% load i18n %} -{% requirejs_main_b5 'builds/js/edit_builds' %} +{% js_entry 'builds/js/edit_builds' %} {% block page_title %} {% trans "Editing CommCare Builds" %} From 7844885e0d47fb6b545f69fdf88873acdfb76ef9 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Tue, 29 Oct 2024 08:19:44 -0400 Subject: [PATCH 02/19] Migrated manage notifications page to bootstrap 5 This is to avoid needing to split the notifications/js/manage_notifications fiel into a B3 and B5 version. The notifications app will be split between B3 and B5 for the entire bootstrap migration, because global_notifications.html is part of HQ's base template so it needs both a B3 and B5 version until B3 is totally gone. But the management page is just an admin page that can be migrated, with the B3 version deleted. --- corehq/apps/notifications/forms.py | 44 ++++++++----------- .../bootstrap5/manage_notifications.html | 14 +++--- corehq/apps/notifications/views.py | 4 +- 3 files changed, 27 insertions(+), 35 deletions(-) diff --git a/corehq/apps/notifications/forms.py b/corehq/apps/notifications/forms.py index bc81ba323839..eaf8f38cf050 100644 --- a/corehq/apps/notifications/forms.py +++ b/corehq/apps/notifications/forms.py @@ -6,9 +6,9 @@ from crispy_forms import bootstrap as twbscrispy from crispy_forms import layout as crispy -from crispy_forms.helper import FormHelper from corehq.apps.hqwebapp import crispy as hqcrispy +from corehq.apps.hqwebapp.widgets import BootstrapCheckboxInput from .models import NOTIFICATION_TYPES, Notification @@ -27,8 +27,11 @@ class NotificationCreationForm(forms.Form): choices=NOTIFICATION_TYPES, ) domain_specific = forms.BooleanField( - label=gettext_lazy("This notification is not for all domains"), - required=False + label=gettext_lazy("Domain-specific"), + required=False, + widget=BootstrapCheckboxInput( + inline_label=gettext_lazy("This notification is not for all domains"), + ), ) domains = SimpleArrayField( base_field=forms.CharField(), @@ -42,37 +45,28 @@ class NotificationCreationForm(forms.Form): def __init__(self, *args, **kwargs): from corehq.apps.notifications.views import ManageNotificationView super(NotificationCreationForm, self).__init__(*args, **kwargs) - self.helper = FormHelper() + self.helper = hqcrispy.HQFormHelper() self.helper.form_method = 'POST' - self.helper.form_class = 'form-horizontal' self.helper.form_action = '#' - self.helper.label_class = 'col-sm-3 col-md-2' - self.helper.field_class = 'col-sm-9 col-md-8 col-lg-6' - self.helper.layout = crispy.Layout( crispy.Field('content'), crispy.Field('url'), crispy.Field('type'), - hqcrispy.B3MultiField( - "Domain Specific", - crispy.Field('domain_specific') - ), + twbscrispy.PrependedText('domain_specific', ''), crispy.Field('domains'), - hqcrispy.FormActions( - twbscrispy.StrictButton( - _("Submit Information"), - type="submit", - css_class="btn btn-primary", - name="submit", - ), - hqcrispy.LinkButton( - _("Cancel"), - reverse(ManageNotificationView.urlname), - css_class="btn btn-default", - name="cancel", - ), + twbscrispy.StrictButton( + _("Submit Information"), + type="submit", + css_class="btn btn-primary", + name="submit", + ), + hqcrispy.LinkButton( + _("Cancel"), + reverse(ManageNotificationView.urlname), + css_class="btn btn-outline-primary", + name="cancel", ), ) diff --git a/corehq/apps/notifications/templates/notifications/bootstrap5/manage_notifications.html b/corehq/apps/notifications/templates/notifications/bootstrap5/manage_notifications.html index e863f9fcfae4..f8ca041f3d6d 100644 --- a/corehq/apps/notifications/templates/notifications/bootstrap5/manage_notifications.html +++ b/corehq/apps/notifications/templates/notifications/bootstrap5/manage_notifications.html @@ -7,25 +7,21 @@ {% block page_content %} {% initial_page_data 'alerts' alerts %}
-
{# todo B5: css:panel #} +
-

- Create Notification -

+ Create Notification

Enter notification text below and preview in the table below. Notifications will not be public until the "activate notification" button is pressed.

- {% crispy form %} {# todo B5: check crispy #} + {% crispy form %}
-
{# todo B5: css:panel #} +
-

- Current Notifications -

+ Current Notifications
diff --git a/corehq/apps/notifications/views.py b/corehq/apps/notifications/views.py index 050db634e7d2..1293a5394c85 100644 --- a/corehq/apps/notifications/views.py +++ b/corehq/apps/notifications/views.py @@ -12,6 +12,7 @@ from corehq.apps.accounting.models import Subscription, SoftwarePlanEdition, SubscriptionType from corehq.apps.domain.decorators import login_required, require_superuser from corehq.apps.groups.models import Group +from corehq.apps.hqwebapp.decorators import use_bootstrap5 from corehq.apps.hqwebapp.views import BasePageView from corehq.apps.notifications.forms import NotificationCreationForm from corehq.apps.notifications.models import ( @@ -115,9 +116,10 @@ def dismiss_ui_notify(self, in_data): class ManageNotificationView(BasePageView): urlname = 'manage_notifications' page_title = gettext_noop("Manage Notification") - template_name = 'notifications/bootstrap3/manage_notifications.html' + template_name = 'notifications/bootstrap5/manage_notifications.html' @method_decorator(require_superuser) + @method_decorator(use_bootstrap5) def dispatch(self, request, *args, **kwargs): return super(ManageNotificationView, self).dispatch(request, *args, **kwargs) From 541210a4f3d0b43b94a819b6cf3777381fc055b9 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Tue, 29 Oct 2024 12:22:52 +0000 Subject: [PATCH 03/19] "Bootstrap 5 Migration - Marked template 'notifications/manage_notifications.html' as complete and un-split files." --- .../bootstrap/status/bootstrap3_to_5.json | 5 +- .../bootstrap3/manage_notifications.html | 69 ------------------- .../manage_notifications.html | 0 corehq/apps/notifications/views.py | 2 +- 4 files changed, 5 insertions(+), 71 deletions(-) delete mode 100644 corehq/apps/notifications/templates/notifications/bootstrap3/manage_notifications.html rename corehq/apps/notifications/templates/notifications/{bootstrap5 => }/manage_notifications.html (100%) 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 6e1dd5a57825..d2f84045acc1 100644 --- a/corehq/apps/hqwebapp/utils/bootstrap/status/bootstrap3_to_5.json +++ b/corehq/apps/hqwebapp/utils/bootstrap/status/bootstrap3_to_5.json @@ -95,7 +95,10 @@ "is_complete": true }, "notifications": { - "in_progress": true + "in_progress": true, + "templates": [ + "manage_notifications.html" + ] }, "reminders": { "is_complete": true diff --git a/corehq/apps/notifications/templates/notifications/bootstrap3/manage_notifications.html b/corehq/apps/notifications/templates/notifications/bootstrap3/manage_notifications.html deleted file mode 100644 index 8f291406bf38..000000000000 --- a/corehq/apps/notifications/templates/notifications/bootstrap3/manage_notifications.html +++ /dev/null @@ -1,69 +0,0 @@ -{% extends 'hqwebapp/bootstrap3/base_page.html' %} -{% load hq_shared_tags %} -{% load crispy_forms_tags %} - -{% requirejs_main 'notifications/js/manage_notifications' %} - -{% block page_content %} - {% initial_page_data 'alerts' alerts %} -
-
-
-

- Create Notification -

-
-
-

- Enter notification text below and preview in the table below. Notifications will not be public until the - "activate notification" button is pressed. -

- {% crispy form %} -
-
-
-
-

- Current Notifications -

-
-
-
- - - - - - - - - - - - - - - - - - - - -
Activated OnContentURLTypeActivate/DeactivateRemove
-
- {% csrf_token %} - - - -
-
-
- {% csrf_token %} - - -
-
-
-
-
-{% endblock %} diff --git a/corehq/apps/notifications/templates/notifications/bootstrap5/manage_notifications.html b/corehq/apps/notifications/templates/notifications/manage_notifications.html similarity index 100% rename from corehq/apps/notifications/templates/notifications/bootstrap5/manage_notifications.html rename to corehq/apps/notifications/templates/notifications/manage_notifications.html diff --git a/corehq/apps/notifications/views.py b/corehq/apps/notifications/views.py index 1293a5394c85..bf030af28ca2 100644 --- a/corehq/apps/notifications/views.py +++ b/corehq/apps/notifications/views.py @@ -116,7 +116,7 @@ def dismiss_ui_notify(self, in_data): class ManageNotificationView(BasePageView): urlname = 'manage_notifications' page_title = gettext_noop("Manage Notification") - template_name = 'notifications/bootstrap5/manage_notifications.html' + template_name = 'notifications/manage_notifications.html' @method_decorator(require_superuser) @method_decorator(use_bootstrap5) From a18e5f58c122223a56a3e25e5d3437c4b891d84e Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Tue, 29 Oct 2024 12:23:23 +0000 Subject: [PATCH 04/19] "Bootstrap 5 Migration - Rebuilt diffs" --- .../manage_notifications.html.diff.txt | 64 ------------------- 1 file changed, 64 deletions(-) delete mode 100644 corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/notifications/manage_notifications.html.diff.txt diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/notifications/manage_notifications.html.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/notifications/manage_notifications.html.diff.txt deleted file mode 100644 index d8b7cb1423ed..000000000000 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/notifications/manage_notifications.html.diff.txt +++ /dev/null @@ -1,64 +0,0 @@ ---- -+++ -@@ -1,33 +1,33 @@ --{% extends 'hqwebapp/bootstrap3/base_page.html' %} -+{% extends 'hqwebapp/bootstrap5/base_page.html' %} - {% load hq_shared_tags %} - {% load crispy_forms_tags %} - --{% requirejs_main 'notifications/js/manage_notifications' %} -+{% requirejs_main_b5 'notifications/js/manage_notifications' %} - - {% block page_content %} - {% initial_page_data 'alerts' alerts %} -
--
--
--

-+
{# todo B5: css:panel #} -+
-+

- Create Notification -

-
--
-+
-

- Enter notification text below and preview in the table below. Notifications will not be public until the - "activate notification" button is pressed. -

-- {% crispy form %} -+ {% crispy form %} {# todo B5: check crispy #} -
-
--
--
--

-+
{# todo B5: css:panel #} -+
-+

- Current Notifications -

-
--
-+
- - - -@@ -50,14 +50,14 @@ - {% csrf_token %} - - -- -+ - - - - From f47a50fb9b681c4879fc6ef5a4dceb1229919ac7 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Tue, 29 Oct 2024 08:27:32 -0400 Subject: [PATCH 05/19] Migrated notifications app to webpack --- .../static/notifications/js/manage_notifications.js | 1 + .../templates/notifications/manage_notifications.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/corehq/apps/notifications/static/notifications/js/manage_notifications.js b/corehq/apps/notifications/static/notifications/js/manage_notifications.js index 9e2ba5c862be..539c39b2e19f 100644 --- a/corehq/apps/notifications/static/notifications/js/manage_notifications.js +++ b/corehq/apps/notifications/static/notifications/js/manage_notifications.js @@ -1,6 +1,7 @@ hqDefine('notifications/js/manage_notifications', [ 'jquery', 'hqwebapp/js/initial_page_data', + 'commcarehq', ], function ( $, initialPageData diff --git a/corehq/apps/notifications/templates/notifications/manage_notifications.html b/corehq/apps/notifications/templates/notifications/manage_notifications.html index f8ca041f3d6d..168aa05971c2 100644 --- a/corehq/apps/notifications/templates/notifications/manage_notifications.html +++ b/corehq/apps/notifications/templates/notifications/manage_notifications.html @@ -2,7 +2,7 @@ {% load hq_shared_tags %} {% load crispy_forms_tags %} -{% requirejs_main_b5 'notifications/js/manage_notifications' %} +{% js_entry 'notifications/js/manage_notifications' %} {% block page_content %} {% initial_page_data 'alerts' alerts %} From abdfa23cdbf94a6b2033f2d2998a7e1b0a8f675c Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Tue, 29 Oct 2024 13:25:12 -0400 Subject: [PATCH 06/19] Migrated hqadmin app to webpack --- corehq/apps/hqadmin/static/hqadmin/js/admin_restore.js | 1 + corehq/apps/hqadmin/static/hqadmin/js/app_build_timings.js | 1 + corehq/apps/hqadmin/static/hqadmin/js/raw_doc.js | 3 ++- corehq/apps/hqadmin/static/hqadmin/js/system_info.js | 1 + corehq/apps/hqadmin/templates/hqadmin/admin_restore.html | 2 +- corehq/apps/hqadmin/templates/hqadmin/app_build_timings.html | 2 +- corehq/apps/hqadmin/templates/hqadmin/raw_doc.html | 2 +- corehq/apps/hqadmin/templates/hqadmin/system_info.html | 2 +- 8 files changed, 9 insertions(+), 5 deletions(-) diff --git a/corehq/apps/hqadmin/static/hqadmin/js/admin_restore.js b/corehq/apps/hqadmin/static/hqadmin/js/admin_restore.js index c315200c36b2..61b7adf5d778 100644 --- a/corehq/apps/hqadmin/static/hqadmin/js/admin_restore.js +++ b/corehq/apps/hqadmin/static/hqadmin/js/admin_restore.js @@ -2,6 +2,7 @@ hqDefine('hqadmin/js/admin_restore',[ "jquery", "hqwebapp/js/base_ace", "jquery-treetable/jquery.treetable", + "commcarehq_b3", ],function ($, baseAce) { $(function () { $("#timingTable").treetable(); diff --git a/corehq/apps/hqadmin/static/hqadmin/js/app_build_timings.js b/corehq/apps/hqadmin/static/hqadmin/js/app_build_timings.js index d4521b7c9f12..d40d74a93019 100644 --- a/corehq/apps/hqadmin/static/hqadmin/js/app_build_timings.js +++ b/corehq/apps/hqadmin/static/hqadmin/js/app_build_timings.js @@ -1,6 +1,7 @@ hqDefine('hqadmin/js/app_build_timings', [ "jquery", "jquery-treetable/jquery.treetable", + "commcarehq_b3", ], function ($) { $(function () { $("#timingTable").treetable({ diff --git a/corehq/apps/hqadmin/static/hqadmin/js/raw_doc.js b/corehq/apps/hqadmin/static/hqadmin/js/raw_doc.js index 7e8ccb76ca11..ee99a1532548 100644 --- a/corehq/apps/hqadmin/static/hqadmin/js/raw_doc.js +++ b/corehq/apps/hqadmin/static/hqadmin/js/raw_doc.js @@ -2,7 +2,8 @@ hqDefine('hqadmin/js/raw_doc', [ 'jquery', 'underscore', 'hqwebapp/js/initial_page_data', - "hqwebapp/js/base_ace", + 'hqwebapp/js/base_ace', + 'commcarehq_b3', ], function ($, _, intialPageData, baseAce) { $(function () { var allDatabase = intialPageData.get('all_databases').map(function (database) { diff --git a/corehq/apps/hqadmin/static/hqadmin/js/system_info.js b/corehq/apps/hqadmin/static/hqadmin/js/system_info.js index a7b71ed4039c..39047d676d06 100644 --- a/corehq/apps/hqadmin/static/hqadmin/js/system_info.js +++ b/corehq/apps/hqadmin/static/hqadmin/js/system_info.js @@ -4,6 +4,7 @@ hqDefine('hqadmin/js/system_info', [ 'underscore', 'hqwebapp/js/initial_page_data', 'hqwebapp/js/bootstrap3/alert_user', + 'commcarehq_b3', ], function ( $, ko, diff --git a/corehq/apps/hqadmin/templates/hqadmin/admin_restore.html b/corehq/apps/hqadmin/templates/hqadmin/admin_restore.html index 281e92d759e4..2f3609bc0757 100644 --- a/corehq/apps/hqadmin/templates/hqadmin/admin_restore.html +++ b/corehq/apps/hqadmin/templates/hqadmin/admin_restore.html @@ -8,7 +8,7 @@ {% endblock stylesheets %} -{% requirejs_main 'hqadmin/js/admin_restore' %} +{% js_entry_b3 'hqadmin/js/admin_restore' %} {% block content %}
diff --git a/corehq/apps/hqadmin/templates/hqadmin/app_build_timings.html b/corehq/apps/hqadmin/templates/hqadmin/app_build_timings.html index c33e33f2f608..5e9941de5c6e 100644 --- a/corehq/apps/hqadmin/templates/hqadmin/app_build_timings.html +++ b/corehq/apps/hqadmin/templates/hqadmin/app_build_timings.html @@ -8,7 +8,7 @@ {% endblock stylesheets %} -{% requirejs_main 'hqadmin/js/app_build_timings' %} +{% js_entry_b3 'hqadmin/js/app_build_timings' %} {% block content %}
diff --git a/corehq/apps/hqadmin/templates/hqadmin/raw_doc.html b/corehq/apps/hqadmin/templates/hqadmin/raw_doc.html index 0a5b660cfdf6..471e7ffe0a46 100644 --- a/corehq/apps/hqadmin/templates/hqadmin/raw_doc.html +++ b/corehq/apps/hqadmin/templates/hqadmin/raw_doc.html @@ -4,7 +4,7 @@ {% block title %}Doc {{ doc_id }} ({{ doc_type }}){% endblock %} {% block js %}{{ block.super }} - {% requirejs_main 'hqadmin/js/raw_doc' %} + {% js_entry_b3 'hqadmin/js/raw_doc' %} {% endblock %} diff --git a/corehq/apps/hqadmin/templates/hqadmin/system_info.html b/corehq/apps/hqadmin/templates/hqadmin/system_info.html index 5598f2da0e76..4d4b6de6c945 100644 --- a/corehq/apps/hqadmin/templates/hqadmin/system_info.html +++ b/corehq/apps/hqadmin/templates/hqadmin/system_info.html @@ -3,7 +3,7 @@ {% load i18n %} {% load humanize %} -{% requirejs_main 'hqadmin/js/system_info' %} +{% js_entry_b3 'hqadmin/js/system_info' %} {% block reportcontent %} {% initial_page_data "celery_update" celery_update %} From 3c5ba9c2b323a5aa20b8fa07849c678452ffdab9 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Tue, 29 Oct 2024 13:26:09 -0400 Subject: [PATCH 07/19] Removed unused template and js This view was removed in https://github.com/dimagi/commcare-hq/pull/29510 --- .../static/hqadmin/js/authenticate_as.js | 21 ---------------- .../templates/hqadmin/authenticate_as.html | 25 ------------------- 2 files changed, 46 deletions(-) delete mode 100644 corehq/apps/hqadmin/static/hqadmin/js/authenticate_as.js delete mode 100644 corehq/apps/hqadmin/templates/hqadmin/authenticate_as.html diff --git a/corehq/apps/hqadmin/static/hqadmin/js/authenticate_as.js b/corehq/apps/hqadmin/static/hqadmin/js/authenticate_as.js deleted file mode 100644 index a7a5b3e9432e..000000000000 --- a/corehq/apps/hqadmin/static/hqadmin/js/authenticate_as.js +++ /dev/null @@ -1,21 +0,0 @@ -hqDefine('hqadmin/js/authenticate_as', [ - 'jquery', - 'hqwebapp/js/initial_page_data', -], function ( - $, - initialPageData -) { - $(function () { - $('#id_username, #id_domain').change(function () { - var username = $('#id_username').val(), - domain = $('#id_domain').val(); - // add username and domain to get those tracked in auditsaudau - var action = initialPageData.get('url') + username + '/'; - if (domain) { - action += domain + '/'; - } - - $('#auth-as-form').attr('action', action); - }); - }); -}); diff --git a/corehq/apps/hqadmin/templates/hqadmin/authenticate_as.html b/corehq/apps/hqadmin/templates/hqadmin/authenticate_as.html deleted file mode 100644 index 2ebacc40301f..000000000000 --- a/corehq/apps/hqadmin/templates/hqadmin/authenticate_as.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "hqwebapp/bootstrap3/base_section.html" %} -{% load crispy_forms_tags %} -{% load hq_shared_tags %} -{% load i18n %} - -{% requirejs_main 'hqadmin/js/authenticate_as' %} - -{% block page_content %} - {% initial_page_data "url" root_page_url %} -
-
-

{{ current_page.title }}

-

- {% blocktrans %} - Use this form to log in as a mobile user. - You can fill out the fully qualified username of - a mobile worker in the username box - (<username>@<domain>.commcarehq.org) - or fill the username and domain. - {% endblocktrans %} -

- {% crispy form %} -
-
-{% endblock %} From 846358214a5b8b1327b803e33dcebb585fa0c314 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Tue, 29 Oct 2024 13:39:36 -0400 Subject: [PATCH 08/19] Migrated generic_inbound app to webpack --- .../generic_inbound/static/generic_inbound/js/api_edit.js | 1 + .../generic_inbound/static/generic_inbound/js/api_list.js | 1 + .../generic_inbound/templates/generic_inbound/api_edit.html | 2 +- .../generic_inbound/templates/generic_inbound/api_list.html | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/corehq/motech/generic_inbound/static/generic_inbound/js/api_edit.js b/corehq/motech/generic_inbound/static/generic_inbound/js/api_edit.js index 0adc195ae37b..9f01f3bc3e42 100644 --- a/corehq/motech/generic_inbound/static/generic_inbound/js/api_edit.js +++ b/corehq/motech/generic_inbound/static/generic_inbound/js/api_edit.js @@ -4,6 +4,7 @@ hqDefine('generic_inbound/js/api_edit', [ 'hqwebapp/js/initial_page_data', 'generic_inbound/js/manage_links', 'generic_inbound/js/copy_data', + 'commcarehq', ], function (_, ko, initialPageData, manageLinks) { const VALIDATION_DEFAULTS = { diff --git a/corehq/motech/generic_inbound/static/generic_inbound/js/api_list.js b/corehq/motech/generic_inbound/static/generic_inbound/js/api_list.js index 0f0cf29df166..3e264cad3a37 100644 --- a/corehq/motech/generic_inbound/static/generic_inbound/js/api_list.js +++ b/corehq/motech/generic_inbound/static/generic_inbound/js/api_list.js @@ -2,6 +2,7 @@ hqDefine('generic_inbound/js/api_list', [ "hqwebapp/js/bootstrap5/crud_paginated_list_init", "generic_inbound/js/copy_data", "generic_inbound/js/manage_links", + "commcarehq", ], function () { // used to include the copy_data and manage_links JS module diff --git a/corehq/motech/generic_inbound/templates/generic_inbound/api_edit.html b/corehq/motech/generic_inbound/templates/generic_inbound/api_edit.html index dba8ee7b82ea..2aafb4d9619e 100644 --- a/corehq/motech/generic_inbound/templates/generic_inbound/api_edit.html +++ b/corehq/motech/generic_inbound/templates/generic_inbound/api_edit.html @@ -3,7 +3,7 @@ {% load crispy_forms_tags %} {% load hq_shared_tags %} -{% requirejs_main_b5 "generic_inbound/js/api_edit" %} +{% js_entry "generic_inbound/js/api_edit" %} {% block page_title %}{{ page_title }}{% endblock %} {% block page_content %} diff --git a/corehq/motech/generic_inbound/templates/generic_inbound/api_list.html b/corehq/motech/generic_inbound/templates/generic_inbound/api_list.html index 0668825f7677..5f62bcb3dd6c 100644 --- a/corehq/motech/generic_inbound/templates/generic_inbound/api_list.html +++ b/corehq/motech/generic_inbound/templates/generic_inbound/api_list.html @@ -2,7 +2,7 @@ {% load i18n %} {% load hq_shared_tags %} -{% requirejs_main_b5 "generic_inbound/js/api_list" %} +{% js_entry "generic_inbound/js/api_list" %} {% block page_title %}{{ current_page.title }}{% endblock %} From dcfe22ea7ff63a603f126890885a46c30c88d882 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Wed, 30 Oct 2024 08:24:40 -0400 Subject: [PATCH 09/19] Migrated products and programs apps to webpack --- .../commtrack/static/commtrack/js/products_and_programs_main.js | 1 + corehq/apps/products/templates/products/manage/product.html | 2 +- corehq/apps/products/templates/products/manage/products.html | 2 +- corehq/apps/programs/templates/programs/manage/program.html | 2 +- corehq/apps/programs/templates/programs/manage/programs.html | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/corehq/apps/commtrack/static/commtrack/js/products_and_programs_main.js b/corehq/apps/commtrack/static/commtrack/js/products_and_programs_main.js index 9abc0cd1db53..2a90b778a8d6 100644 --- a/corehq/apps/commtrack/static/commtrack/js/products_and_programs_main.js +++ b/corehq/apps/commtrack/static/commtrack/js/products_and_programs_main.js @@ -7,6 +7,7 @@ hqDefine('commtrack/js/products_and_programs_main', [ 'es6!hqwebapp/js/bootstrap5_loader', 'commtrack/js/base_list_view_model', 'hqwebapp/js/bootstrap5/widgets', // "Additional Information" on product page uses a .hqwebapp-select2 + 'commcarehq', ], function ( $, ko, diff --git a/corehq/apps/products/templates/products/manage/product.html b/corehq/apps/products/templates/products/manage/product.html index 175cfa6d3d17..81788fea6bc2 100644 --- a/corehq/apps/products/templates/products/manage/product.html +++ b/corehq/apps/products/templates/products/manage/product.html @@ -3,7 +3,7 @@ {% load crispy_forms_tags %} {% load i18n %} -{% requirejs_main_b5 'commtrack/js/products_and_programs_main' %} +{% js_entry 'commtrack/js/products_and_programs_main' %} {% block page_content %}
diff --git a/corehq/apps/products/templates/products/manage/products.html b/corehq/apps/products/templates/products/manage/products.html index 7788a284f111..b20c58a87e11 100644 --- a/corehq/apps/products/templates/products/manage/products.html +++ b/corehq/apps/products/templates/products/manage/products.html @@ -3,7 +3,7 @@ {% load hq_shared_tags %} {% load compress %} -{% requirejs_main_b5 'commtrack/js/products_and_programs_main' %} +{% js_entry 'commtrack/js/products_and_programs_main' %} {% block page_content %} {% initial_page_data 'program_product_options' program_product_options %} diff --git a/corehq/apps/programs/templates/programs/manage/program.html b/corehq/apps/programs/templates/programs/manage/program.html index 45af7e03ff0d..bfd7e535b2b0 100644 --- a/corehq/apps/programs/templates/programs/manage/program.html +++ b/corehq/apps/programs/templates/programs/manage/program.html @@ -4,7 +4,7 @@ {% load i18n %} {% load compress %} -{% requirejs_main_b5 'commtrack/js/products_and_programs_main' %} +{% js_entry 'commtrack/js/products_and_programs_main' %} {% block page_content %} {% initial_page_data 'program_product_options' program_product_options %} diff --git a/corehq/apps/programs/templates/programs/manage/programs.html b/corehq/apps/programs/templates/programs/manage/programs.html index 612e07282bfc..382de1678f5d 100644 --- a/corehq/apps/programs/templates/programs/manage/programs.html +++ b/corehq/apps/programs/templates/programs/manage/programs.html @@ -3,7 +3,7 @@ {% load hq_shared_tags %} {% load compress %} -{% requirejs_main_b5 'commtrack/js/products_and_programs_main' %} +{% js_entry 'commtrack/js/products_and_programs_main' %} {% block page_content %} {% initial_page_data 'program_product_options' program_product_options %} From db6291e99c17439a1c33b43d0abf14380a9e9d1c Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Wed, 30 Oct 2024 08:48:02 -0400 Subject: [PATCH 10/19] Migrated prototype app to webpack --- .../static/prototype/js/example/knockout_pagination.js | 1 + .../templates/prototype/example/knockout_pagination.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/corehq/apps/prototype/static/prototype/js/example/knockout_pagination.js b/corehq/apps/prototype/static/prototype/js/example/knockout_pagination.js index c650dbce52d5..c0101cfb3150 100644 --- a/corehq/apps/prototype/static/prototype/js/example/knockout_pagination.js +++ b/corehq/apps/prototype/static/prototype/js/example/knockout_pagination.js @@ -6,6 +6,7 @@ hqDefine("prototype/js/example/knockout_pagination",[ 'underscore', 'hqwebapp/js/initial_page_data', "hqwebapp/js/components/pagination", + 'commcarehq', ], function ($, ko, _, initialPageData) { $(function () { let rowData = function (data) { diff --git a/corehq/apps/prototype/templates/prototype/example/knockout_pagination.html b/corehq/apps/prototype/templates/prototype/example/knockout_pagination.html index 2a557268c678..629112ea4c9c 100644 --- a/corehq/apps/prototype/templates/prototype/example/knockout_pagination.html +++ b/corehq/apps/prototype/templates/prototype/example/knockout_pagination.html @@ -2,7 +2,7 @@ {% load i18n %} {% load hq_shared_tags %} -{% requirejs_main_b5 "prototype/js/example/knockout_pagination" %} +{% js_entry "prototype/js/example/knockout_pagination" %} {% block content %} From 05d9410e17ab7762af9aa6d69fe88da03f04773c Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Wed, 30 Oct 2024 08:50:10 -0400 Subject: [PATCH 11/19] Migrated openmrs app to webpack --- corehq/motech/openmrs/static/openmrs/js/openmrs_importers.js | 1 + corehq/motech/openmrs/templates/openmrs/importers.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/corehq/motech/openmrs/static/openmrs/js/openmrs_importers.js b/corehq/motech/openmrs/static/openmrs/js/openmrs_importers.js index 41aa976551b2..eafab94928fc 100644 --- a/corehq/motech/openmrs/static/openmrs/js/openmrs_importers.js +++ b/corehq/motech/openmrs/static/openmrs/js/openmrs_importers.js @@ -5,6 +5,7 @@ hqDefine('openmrs/js/openmrs_importers', [ 'hqwebapp/js/initial_page_data', 'hqwebapp/js/bootstrap5/alert_user', 'hqwebapp/js/base_ace', + 'commcarehq', ], function ( $, _, diff --git a/corehq/motech/openmrs/templates/openmrs/importers.html b/corehq/motech/openmrs/templates/openmrs/importers.html index eb10f7c406f9..10359c02c139 100644 --- a/corehq/motech/openmrs/templates/openmrs/importers.html +++ b/corehq/motech/openmrs/templates/openmrs/importers.html @@ -4,7 +4,7 @@ {% load i18n %} {% block title %}OpenMRS Importers{% endblock %} -{% requirejs_main_b5 'openmrs/js/openmrs_importers' %} +{% js_entry 'openmrs/js/openmrs_importers' %} {% block page_content %} From b56498c2f3f2ece7cc388c93b09597ea66da1149 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Wed, 30 Oct 2024 08:54:13 -0400 Subject: [PATCH 12/19] Migrated integration app to webpack --- corehq/apps/integration/static/integration/js/biometric.js | 1 + .../static/integration/js/dialer/domain_dialer_main.js | 1 + corehq/apps/integration/templates/integration/biometric.html | 2 +- .../apps/integration/templates/integration/web_app_dialer.html | 2 +- .../templates/integration/web_app_integration_err.html | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/corehq/apps/integration/static/integration/js/biometric.js b/corehq/apps/integration/static/integration/js/biometric.js index 2e98643a0ca6..4c211db44dde 100644 --- a/corehq/apps/integration/static/integration/js/biometric.js +++ b/corehq/apps/integration/static/integration/js/biometric.js @@ -2,6 +2,7 @@ hqDefine('integration/js/biometric', [ 'jquery', 'hqwebapp/js/initial_page_data', 'integration/js/simprints', + 'commcarehq', ], function ( $, initialPageData, diff --git a/corehq/apps/integration/static/integration/js/dialer/domain_dialer_main.js b/corehq/apps/integration/static/integration/js/dialer/domain_dialer_main.js index 06965b264102..a9f6971bc986 100644 --- a/corehq/apps/integration/static/integration/js/dialer/domain_dialer_main.js +++ b/corehq/apps/integration/static/integration/js/dialer/domain_dialer_main.js @@ -9,6 +9,7 @@ hqDefine("integration/js/dialer/domain_dialer_main", [ "detectrtc/DetectRTC", "integration/js/dialer/amazon-connect-min", "integration/js/dialer/connect-streams-min", + "commcarehq", ], function ( initialPageData, dialer_utils diff --git a/corehq/apps/integration/templates/integration/biometric.html b/corehq/apps/integration/templates/integration/biometric.html index 20a047183963..738ee9adf7bf 100644 --- a/corehq/apps/integration/templates/integration/biometric.html +++ b/corehq/apps/integration/templates/integration/biometric.html @@ -3,7 +3,7 @@ {% load hq_shared_tags %} {% load crispy_forms_tags %} -{% requirejs_main_b5 'integration/js/biometric' %} +{% js_entry 'integration/js/biometric' %} {% block page_content %} {% initial_page_data 'simprintsFormData' simprints_form.initial_data %} diff --git a/corehq/apps/integration/templates/integration/web_app_dialer.html b/corehq/apps/integration/templates/integration/web_app_dialer.html index bee9c68001a9..bc2177fccfd6 100644 --- a/corehq/apps/integration/templates/integration/web_app_dialer.html +++ b/corehq/apps/integration/templates/integration/web_app_dialer.html @@ -2,7 +2,7 @@ {% load i18n %} {% load hq_shared_tags %} {% load compress %} -{% requirejs_main_b5 "integration/js/dialer/domain_dialer_main" %} +{% js_entry "integration/js/dialer/domain_dialer_main" %} {% block stylesheets %} {{ block.super }} diff --git a/corehq/apps/integration/templates/integration/web_app_integration_err.html b/corehq/apps/integration/templates/integration/web_app_integration_err.html index 84bcd0ac82f7..db5e89b33dda 100644 --- a/corehq/apps/integration/templates/integration/web_app_integration_err.html +++ b/corehq/apps/integration/templates/integration/web_app_integration_err.html @@ -2,7 +2,7 @@ {% load i18n %} {% load hq_shared_tags %} {% load compress %} -{% requirejs_main_b5 "integration/js/dialer/domain_dialer_main" %} +{% js_entry "integration/js/dialer/domain_dialer_main" %} {% block stylesheets %} {{ block.super }} From 99047386115ea319c9c93c48a788761c789dfb55 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Wed, 30 Oct 2024 09:01:56 -0400 Subject: [PATCH 13/19] Migrated motech.motech app to webpack Skipping repeaters/js/add_form_repeater which is having issues because it depends on the locations app, perhaps because that app isn't yet migrated. --- corehq/motech/static/motech/js/connection_settings.js | 1 + corehq/motech/static/motech/js/connection_settings_detail.js | 1 + corehq/motech/templates/motech/connection_settings.html | 2 +- corehq/motech/templates/motech/connection_settings_detail.html | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/corehq/motech/static/motech/js/connection_settings.js b/corehq/motech/static/motech/js/connection_settings.js index 9403ef22a06d..ecf1471f388f 100644 --- a/corehq/motech/static/motech/js/connection_settings.js +++ b/corehq/motech/static/motech/js/connection_settings.js @@ -2,6 +2,7 @@ hqDefine("motech/js/connection_settings", [ "hqwebapp/js/bootstrap5/crud_paginated_list_init", "hqwebapp/js/bootstrap5/widgets", + "commcarehq", ], function () { // No page-specific logic, just need to collect the dependencies above }); diff --git a/corehq/motech/static/motech/js/connection_settings_detail.js b/corehq/motech/static/motech/js/connection_settings_detail.js index 9ee53aef816f..ff1dfcb82887 100644 --- a/corehq/motech/static/motech/js/connection_settings_detail.js +++ b/corehq/motech/static/motech/js/connection_settings_detail.js @@ -3,6 +3,7 @@ hqDefine("motech/js/connection_settings_detail", [ 'jquery', 'underscore', 'hqwebapp/js/initial_page_data', + 'commcarehq', ], function ( $, _, diff --git a/corehq/motech/templates/motech/connection_settings.html b/corehq/motech/templates/motech/connection_settings.html index 7aff8e2b6b50..623b46952476 100644 --- a/corehq/motech/templates/motech/connection_settings.html +++ b/corehq/motech/templates/motech/connection_settings.html @@ -2,7 +2,7 @@ {% load i18n %} {% load hq_shared_tags %} -{% requirejs_main_b5 "motech/js/connection_settings" %} +{% js_entry "motech/js/connection_settings" %} {% block pagination_header %}

{% trans "Connection Settings" %}

diff --git a/corehq/motech/templates/motech/connection_settings_detail.html b/corehq/motech/templates/motech/connection_settings_detail.html index c0db6bb5e7bd..11b36a287021 100644 --- a/corehq/motech/templates/motech/connection_settings_detail.html +++ b/corehq/motech/templates/motech/connection_settings_detail.html @@ -3,7 +3,7 @@ {% load hq_shared_tags %} {% load crispy_forms_tags %} -{% requirejs_main_b5 "motech/js/connection_settings_detail" %} +{% js_entry "motech/js/connection_settings_detail" %} {% block page_content %} {% registerurl "test_connection_settings" domain %} From 5b31da047da20d762452ec8ad3f058f88212f44d Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Wed, 30 Oct 2024 10:09:48 -0400 Subject: [PATCH 14/19] Migrated dhis2 app to webpack --- corehq/motech/dhis2/static/dhis2/js/dataset_map.js | 1 + corehq/motech/dhis2/static/dhis2/js/dataset_map_create.js | 1 + corehq/motech/dhis2/static/dhis2/js/dataset_map_json.js | 1 + corehq/motech/dhis2/static/dhis2/js/dataset_map_update.js | 1 + corehq/motech/dhis2/static/dhis2/js/dhis2_entity_config.js | 1 + corehq/motech/dhis2/static/dhis2/js/dhis2_events_config.js | 1 + corehq/motech/dhis2/templates/dhis2/dataset_map_create.html | 2 +- corehq/motech/dhis2/templates/dhis2/dataset_map_json.html | 2 +- corehq/motech/dhis2/templates/dhis2/dataset_map_list.html | 2 +- corehq/motech/dhis2/templates/dhis2/dataset_map_update.html | 2 +- corehq/motech/dhis2/templates/dhis2/dhis2_entity_config.html | 2 +- corehq/motech/dhis2/templates/dhis2/dhis2_events_config.html | 2 +- 12 files changed, 12 insertions(+), 6 deletions(-) diff --git a/corehq/motech/dhis2/static/dhis2/js/dataset_map.js b/corehq/motech/dhis2/static/dhis2/js/dataset_map.js index 392b9fba7a19..a5b9faf4ae6a 100644 --- a/corehq/motech/dhis2/static/dhis2/js/dataset_map.js +++ b/corehq/motech/dhis2/static/dhis2/js/dataset_map.js @@ -4,6 +4,7 @@ hqDefine("dhis2/js/dataset_map", [ "hqwebapp/js/initial_page_data", "hqwebapp/js/bootstrap5/crud_paginated_list_init", "hqwebapp/js/bootstrap5/widgets", + "commcarehq", ], function ( $, _, diff --git a/corehq/motech/dhis2/static/dhis2/js/dataset_map_create.js b/corehq/motech/dhis2/static/dhis2/js/dataset_map_create.js index def693942dbf..25c55d64c7af 100644 --- a/corehq/motech/dhis2/static/dhis2/js/dataset_map_create.js +++ b/corehq/motech/dhis2/static/dhis2/js/dataset_map_create.js @@ -1,6 +1,7 @@ hqDefine("dhis2/js/dataset_map_create", [ "jquery", "hqwebapp/js/bootstrap5/widgets", + "commcarehq", ], function ($) { function showCompleteDateColumnInput(shouldShow) { var label = $('label[for="id_complete_date_column"]').addClass("d-none"); diff --git a/corehq/motech/dhis2/static/dhis2/js/dataset_map_json.js b/corehq/motech/dhis2/static/dhis2/js/dataset_map_json.js index e15962316b57..91622c6b750b 100644 --- a/corehq/motech/dhis2/static/dhis2/js/dataset_map_json.js +++ b/corehq/motech/dhis2/static/dhis2/js/dataset_map_json.js @@ -6,6 +6,7 @@ hqDefine('dhis2/js/dataset_map_json', [ 'hqwebapp/js/bootstrap5/alert_user', 'hqwebapp/js/base_ace', 'dhis2/js/json_syntax_parse', + 'commcarehq', ], function ( $, _, diff --git a/corehq/motech/dhis2/static/dhis2/js/dataset_map_update.js b/corehq/motech/dhis2/static/dhis2/js/dataset_map_update.js index 87eea5fb2824..7d971078c656 100644 --- a/corehq/motech/dhis2/static/dhis2/js/dataset_map_update.js +++ b/corehq/motech/dhis2/static/dhis2/js/dataset_map_update.js @@ -2,6 +2,7 @@ hqDefine("dhis2/js/dataset_map_update", [ "jquery", "hqwebapp/js/bootstrap5/crud_paginated_list_init", "hqwebapp/js/bootstrap5/widgets", + "commcarehq", ], function ($) { function showCompleteDateColumnInput(shouldShow) { var label = $('label[for="id_complete_date_column"]').addClass("d-none"); diff --git a/corehq/motech/dhis2/static/dhis2/js/dhis2_entity_config.js b/corehq/motech/dhis2/static/dhis2/js/dhis2_entity_config.js index 3b05405f2759..7645a286d2e8 100644 --- a/corehq/motech/dhis2/static/dhis2/js/dhis2_entity_config.js +++ b/corehq/motech/dhis2/static/dhis2/js/dhis2_entity_config.js @@ -6,6 +6,7 @@ hqDefine('dhis2/js/dhis2_entity_config', [ 'hqwebapp/js/bootstrap5/alert_user', 'hqwebapp/js/base_ace', 'dhis2/js/json_syntax_parse', + 'commcarehq', ], function ( $, _, diff --git a/corehq/motech/dhis2/static/dhis2/js/dhis2_events_config.js b/corehq/motech/dhis2/static/dhis2/js/dhis2_events_config.js index 7e2f5d4a32b4..b2f233f0d9f8 100644 --- a/corehq/motech/dhis2/static/dhis2/js/dhis2_events_config.js +++ b/corehq/motech/dhis2/static/dhis2/js/dhis2_events_config.js @@ -6,6 +6,7 @@ hqDefine('dhis2/js/dhis2_events_config', [ 'hqwebapp/js/bootstrap5/alert_user', 'hqwebapp/js/base_ace', 'dhis2/js/json_syntax_parse', + 'commcarehq', ], function ( $, _, diff --git a/corehq/motech/dhis2/templates/dhis2/dataset_map_create.html b/corehq/motech/dhis2/templates/dhis2/dataset_map_create.html index f1e1ecf888cb..4fe6be7b694b 100644 --- a/corehq/motech/dhis2/templates/dhis2/dataset_map_create.html +++ b/corehq/motech/dhis2/templates/dhis2/dataset_map_create.html @@ -3,7 +3,7 @@ {% load hq_shared_tags %} {% load crispy_forms_tags %} -{% requirejs_main_b5 "dhis2/js/dataset_map_create" %} +{% js_entry "dhis2/js/dataset_map_create" %} {% block page_content %}

{% trans "Add DataSet Map" %}

diff --git a/corehq/motech/dhis2/templates/dhis2/dataset_map_json.html b/corehq/motech/dhis2/templates/dhis2/dataset_map_json.html index 71b78ed8e091..b69d15786bab 100644 --- a/corehq/motech/dhis2/templates/dhis2/dataset_map_json.html +++ b/corehq/motech/dhis2/templates/dhis2/dataset_map_json.html @@ -13,7 +13,7 @@ {% endcompress %} {% endblock %} -{% requirejs_main_b5 "dhis2/js/dataset_map_json" %} +{% js_entry "dhis2/js/dataset_map_json" %} {% block page_content %} {% initial_page_data 'dataset_map' dataset_map %} diff --git a/corehq/motech/dhis2/templates/dhis2/dataset_map_list.html b/corehq/motech/dhis2/templates/dhis2/dataset_map_list.html index c7bfead2e6d5..8443f5b611f9 100644 --- a/corehq/motech/dhis2/templates/dhis2/dataset_map_list.html +++ b/corehq/motech/dhis2/templates/dhis2/dataset_map_list.html @@ -2,7 +2,7 @@ {% load i18n %} {% load hq_shared_tags %} -{% requirejs_main_b5 "dhis2/js/dataset_map" %} +{% js_entry "dhis2/js/dataset_map" %} {% block pagination_header %} {% registerurl "send_dataset_now" domain "---" %} diff --git a/corehq/motech/dhis2/templates/dhis2/dataset_map_update.html b/corehq/motech/dhis2/templates/dhis2/dataset_map_update.html index 6e837f377024..08d96d8b52b8 100644 --- a/corehq/motech/dhis2/templates/dhis2/dataset_map_update.html +++ b/corehq/motech/dhis2/templates/dhis2/dataset_map_update.html @@ -3,7 +3,7 @@ {% load hq_shared_tags %} {% load crispy_forms_tags %} -{% requirejs_main_b5 "dhis2/js/dataset_map_update" %} +{% js_entry "dhis2/js/dataset_map_update" %} {% block pagination_header %} {% registerurl "send_dataset_now" domain dataset_map_id %} diff --git a/corehq/motech/dhis2/templates/dhis2/dhis2_entity_config.html b/corehq/motech/dhis2/templates/dhis2/dhis2_entity_config.html index 690d9d54e40c..421b129072b0 100644 --- a/corehq/motech/dhis2/templates/dhis2/dhis2_entity_config.html +++ b/corehq/motech/dhis2/templates/dhis2/dhis2_entity_config.html @@ -6,7 +6,7 @@ {% block title %}{% trans "Edit Configuration" %}{% endblock %} -{% requirejs_main_b5 'dhis2/js/dhis2_entity_config' %} +{% js_entry 'dhis2/js/dhis2_entity_config' %} {% block page_content %} {% initial_page_data 'case_configs' case_configs %} diff --git a/corehq/motech/dhis2/templates/dhis2/dhis2_events_config.html b/corehq/motech/dhis2/templates/dhis2/dhis2_events_config.html index aa9d260e69fa..37e81d1cd0b7 100644 --- a/corehq/motech/dhis2/templates/dhis2/dhis2_events_config.html +++ b/corehq/motech/dhis2/templates/dhis2/dhis2_events_config.html @@ -6,7 +6,7 @@ {% block title %}Edit Config : DHIS2 :: {% endblock %} -{% requirejs_main_b5 'dhis2/js/dhis2_events_config' %} +{% js_entry 'dhis2/js/dhis2_events_config' %} {% block page_content %} {% initial_page_data 'form_configs' form_configs %} From c5f708a205f4bdd351ba0ab0abc1479fcd81908b Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Wed, 30 Oct 2024 12:39:58 -0400 Subject: [PATCH 15/19] Migrated telerivet app to webpack --- .../telerivet/static/telerivet/js/telerivet_setup.js | 1 + .../telerivet/templates/telerivet/telerivet_setup.html | 2 +- webpack/appPaths.js | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/corehq/messaging/smsbackends/telerivet/static/telerivet/js/telerivet_setup.js b/corehq/messaging/smsbackends/telerivet/static/telerivet/js/telerivet_setup.js index 537a7b1b6ef5..89cac42d47a8 100644 --- a/corehq/messaging/smsbackends/telerivet/static/telerivet/js/telerivet_setup.js +++ b/corehq/messaging/smsbackends/telerivet/static/telerivet/js/telerivet_setup.js @@ -1,6 +1,7 @@ hqDefine("telerivet/js/telerivet_setup", [ 'knockout', 'hqwebapp/js/initial_page_data', + 'commcarehq_b3', ], function ( ko, initialPageData diff --git a/corehq/messaging/smsbackends/telerivet/templates/telerivet/telerivet_setup.html b/corehq/messaging/smsbackends/telerivet/templates/telerivet/telerivet_setup.html index 95f00f2a5953..12cde66932fd 100644 --- a/corehq/messaging/smsbackends/telerivet/templates/telerivet/telerivet_setup.html +++ b/corehq/messaging/smsbackends/telerivet/templates/telerivet/telerivet_setup.html @@ -3,7 +3,7 @@ {% load hq_shared_tags %} {% load crispy_forms_tags %} -{% requirejs_main 'telerivet/js/telerivet_setup' %} +{% js_entry_b3 'telerivet/js/telerivet_setup' %} {% block page_content %} diff --git a/webpack/appPaths.js b/webpack/appPaths.js index 9d15f5a236e8..70b0f98e9df3 100644 --- a/webpack/appPaths.js +++ b/webpack/appPaths.js @@ -8,6 +8,7 @@ const BUILD_ARTIFACTS_DIR = path.resolve(__dirname, '_build'); const TEMPLATES_DIR = 'templates'; const APPS_PATH = path.resolve(__BASE, 'corehq', 'apps'); const EX_SUBMODULES_PATH = path.resolve(__BASE, 'corehq', 'ex-submodules'); +const MESSAGING_PATH = path.resolve(__BASE, 'corehq', 'messaging'); const MOTECH_PATH = path.resolve(__BASE, 'corehq', 'motech'); const CUSTOM_PATH = path.resolve(__BASE, 'custom'); @@ -15,6 +16,7 @@ const nonStandardAppPaths = { "case": path.resolve(EX_SUBMODULES_PATH, 'casexml', 'apps', 'case'), "soil": path.resolve(EX_SUBMODULES_PATH, 'soil'), "motech": MOTECH_PATH, + "telerivet": path.resolve(MESSAGING_PATH, 'smsbackends', 'telerivet'), // motech apps: "dhis2": path.resolve(MOTECH_PATH, 'dhis2'), "generic_inbound": path.resolve(MOTECH_PATH, 'generic_inbound'), From e03f0126fb295df32d505784427e53fb520a33d3 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Wed, 30 Oct 2024 13:18:59 -0400 Subject: [PATCH 16/19] Partially migrated accounting app to webpack --- corehq/apps/accounting/static/accounting/js/widgets.js | 1 + .../templates/accounting/trigger_accounting_tests.html | 2 +- .../accounting/templates/accounting/trigger_bookkeeper.html | 2 +- .../templates/accounting/trigger_customer_invoice.html | 2 +- .../apps/accounting/templates/accounting/trigger_invoice.html | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/corehq/apps/accounting/static/accounting/js/widgets.js b/corehq/apps/accounting/static/accounting/js/widgets.js index 3a7f3bb3644a..0bf26c21fd54 100644 --- a/corehq/apps/accounting/static/accounting/js/widgets.js +++ b/corehq/apps/accounting/static/accounting/js/widgets.js @@ -5,6 +5,7 @@ hqDefine('accounting/js/widgets', [ 'underscore', 'hqwebapp/js/utils/email', 'select2/dist/js/select2.full.min', + 'commcarehq_b3', ], function ( $, ko, diff --git a/corehq/apps/accounting/templates/accounting/trigger_accounting_tests.html b/corehq/apps/accounting/templates/accounting/trigger_accounting_tests.html index 30a64420e52b..0cdd13d996f0 100644 --- a/corehq/apps/accounting/templates/accounting/trigger_accounting_tests.html +++ b/corehq/apps/accounting/templates/accounting/trigger_accounting_tests.html @@ -2,7 +2,7 @@ {% load crispy_forms_tags %} {% load hq_shared_tags %} -{% requirejs_main "accounting/js/widgets" %} +{% js_entry_b3 "accounting/js/widgets" %} {% block page_content %} {% crispy trigger_form %} diff --git a/corehq/apps/accounting/templates/accounting/trigger_bookkeeper.html b/corehq/apps/accounting/templates/accounting/trigger_bookkeeper.html index 7772b5dbdc82..d8a1e13122e0 100644 --- a/corehq/apps/accounting/templates/accounting/trigger_bookkeeper.html +++ b/corehq/apps/accounting/templates/accounting/trigger_bookkeeper.html @@ -2,7 +2,7 @@ {% load crispy_forms_tags %} {% load hq_shared_tags %} -{% requirejs_main "accounting/js/widgets" %} +{% js_entry_b3 "accounting/js/widgets" %} {% block page_content %} {% crispy trigger_email_form %} diff --git a/corehq/apps/accounting/templates/accounting/trigger_customer_invoice.html b/corehq/apps/accounting/templates/accounting/trigger_customer_invoice.html index 4ef4f459acc4..5acee69b0985 100644 --- a/corehq/apps/accounting/templates/accounting/trigger_customer_invoice.html +++ b/corehq/apps/accounting/templates/accounting/trigger_customer_invoice.html @@ -2,7 +2,7 @@ {% load crispy_forms_tags %} {% load hq_shared_tags %} -{% requirejs_main "accounting/js/widgets" %} +{% js_entry_b3 "accounting/js/widgets" %} {% block page_content %} {% crispy trigger_customer_form %} diff --git a/corehq/apps/accounting/templates/accounting/trigger_invoice.html b/corehq/apps/accounting/templates/accounting/trigger_invoice.html index 30a64420e52b..0cdd13d996f0 100644 --- a/corehq/apps/accounting/templates/accounting/trigger_invoice.html +++ b/corehq/apps/accounting/templates/accounting/trigger_invoice.html @@ -2,7 +2,7 @@ {% load crispy_forms_tags %} {% load hq_shared_tags %} -{% requirejs_main "accounting/js/widgets" %} +{% js_entry_b3 "accounting/js/widgets" %} {% block page_content %} {% crispy trigger_form %} From 7d93b5c5c351cd62d99274abb54c8ed960eb5002 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Wed, 30 Oct 2024 19:05:24 -0400 Subject: [PATCH 17/19] Updated tests to build webpack before python tests This is necessary for view tests, such as TestDataSetMapUpdateView. --- docker/run.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docker/run.sh b/docker/run.sh index 85bf0d6724fd..1070a181941c 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -55,9 +55,7 @@ function setup { -dname 'CN=Foo, OU=Bar, O=Bizzle, L=Bazzle, ST=Bingle, C=US' fi - if [ "$TEST" = "javascript" -o "$JS_SETUP" = "yes" ]; then - yarn install --progress=false --frozen-lockfile - fi + yarn install --progress=false --frozen-lockfile } function python_preheat { @@ -132,15 +130,16 @@ function run_tests { send_timing_metric_to_datadog "setup" $delta + logmsg INFO "Building Webpack" + chown -R cchq:cchq ./webpack + su cchq -c "yarn build" + log_group_begin "Django test suite: $TEST" now=$(date +%s) argv_str=$(printf ' %q' "$TEST" "$@") su cchq -c "/bin/bash ../run_tests $argv_str" 2>&1 log_group_end # only log group end on success (notice: `set -e`) if [ "$TEST" == "python-sharded-and-javascript" ]; then - logmsg INFO "Building Webpack" - chown -R cchq:cchq ./webpack - su cchq -c "yarn build" su cchq -c scripts/test-prod-entrypoints.sh scripts/test-make-requirements.sh scripts/test-serializer-pickle-files.sh From b7db61528e59c802047ade04f8ef249f5d09a62b Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Mon, 4 Nov 2024 13:23:05 -0500 Subject: [PATCH 18/19] Revert "Updated tests to build webpack before python tests" This reverts commit 7d93b5c5c351cd62d99274abb54c8ed960eb5002. --- docker/run.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docker/run.sh b/docker/run.sh index 1070a181941c..85bf0d6724fd 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -55,7 +55,9 @@ function setup { -dname 'CN=Foo, OU=Bar, O=Bizzle, L=Bazzle, ST=Bingle, C=US' fi - yarn install --progress=false --frozen-lockfile + if [ "$TEST" = "javascript" -o "$JS_SETUP" = "yes" ]; then + yarn install --progress=false --frozen-lockfile + fi } function python_preheat { @@ -130,16 +132,15 @@ function run_tests { send_timing_metric_to_datadog "setup" $delta - logmsg INFO "Building Webpack" - chown -R cchq:cchq ./webpack - su cchq -c "yarn build" - log_group_begin "Django test suite: $TEST" now=$(date +%s) argv_str=$(printf ' %q' "$TEST" "$@") su cchq -c "/bin/bash ../run_tests $argv_str" 2>&1 log_group_end # only log group end on success (notice: `set -e`) if [ "$TEST" == "python-sharded-and-javascript" ]; then + logmsg INFO "Building Webpack" + chown -R cchq:cchq ./webpack + su cchq -c "yarn build" su cchq -c scripts/test-prod-entrypoints.sh scripts/test-make-requirements.sh scripts/test-serializer-pickle-files.sh From 17619cca7e8e10168778cd9df7cc3145e373e30c Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Mon, 4 Nov 2024 13:29:28 -0500 Subject: [PATCH 19/19] Updated webpack_bundles template tag to do nothing during tests --- corehq/apps/hqwebapp/templatetags/hq_shared_tags.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/corehq/apps/hqwebapp/templatetags/hq_shared_tags.py b/corehq/apps/hqwebapp/templatetags/hq_shared_tags.py index 6ba871fa4a44..a0a13848f134 100644 --- a/corehq/apps/hqwebapp/templatetags/hq_shared_tags.py +++ b/corehq/apps/hqwebapp/templatetags/hq_shared_tags.py @@ -746,6 +746,9 @@ def __repr__(self): @register.filter def webpack_bundles(entry_name): + if settings.UNIT_TESTING: + return [] + from corehq.apps.hqwebapp.utils.webpack import get_webpack_manifest, WebpackManifestNotFoundError from corehq.apps.hqwebapp.utils.bootstrap import get_bootstrap_version, BOOTSTRAP_5, BOOTSTRAP_3 bootstrap_version = get_bootstrap_version()
-
- {% csrf_token %} - -- -+ -
-