From 7c9a8e5d9242152d679057d33f22faf8d008c773 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Thu, 30 Jan 2025 15:15:58 -0500 Subject: [PATCH 01/19] notifications app --- .../js/bootstrap3/notifications_service.js | 10 ++++------ .../js/bootstrap3/notifications_service_main.js | 2 +- .../js/bootstrap5/notifications_service.js | 10 ++++------ .../js/bootstrap5/notifications_service_main.js | 2 +- .../static/notifications/js/manage_notifications.js | 2 +- .../spec/bootstrap3/NotificationsService.spec.mo.js | 2 +- .../spec/bootstrap5/NotificationsService.spec.mo.js | 2 +- 7 files changed, 13 insertions(+), 17 deletions(-) diff --git a/corehq/apps/notifications/static/notifications/js/bootstrap3/notifications_service.js b/corehq/apps/notifications/static/notifications/js/bootstrap3/notifications_service.js index 3a2b21d3a861..0046359bbc1a 100644 --- a/corehq/apps/notifications/static/notifications/js/bootstrap3/notifications_service.js +++ b/corehq/apps/notifications/static/notifications/js/bootstrap3/notifications_service.js @@ -16,10 +16,8 @@ hqDefine('notifications/js/bootstrap3/notifications_service', [ ko, _, RMI, - kissmetrics + kissmetrics, ) { - 'use strict'; - // Workaround for non-RequireJS pages: when `define` doesn't exist, RMI is just a global variable. RMI = RMI || window.RMI; @@ -59,7 +57,7 @@ hqDefine('notifications/js/bootstrap3/notifications_service', [ if (self.isFeature()) { kissmetrics.track.event("Notifications tab - Clicked notifications tab - " + "Clicked on Case Sharing text link", - {email: data.email, domain: data.domain}); + {email: data.email, domain: data.domain}); } }); self.isRead(true); @@ -81,9 +79,9 @@ hqDefine('notifications/js/bootstrap3/notifications_service', [ self.hasUnreadFeatureNotification = ko.computed(function () { return _.some(self.notifications(), function (note) { - return !note.isRead() && (note.type() === 'feat_basic' || note.type() === 'feat_pro') + return !note.isRead() && (note.type() === 'feat_basic' || note.type() === 'feat_pro'); }); - }) + }); self.seen = ko.computed(function () { if (self.hasUnreadFeatureNotification()) { diff --git a/corehq/apps/notifications/static/notifications/js/bootstrap3/notifications_service_main.js b/corehq/apps/notifications/static/notifications/js/bootstrap3/notifications_service_main.js index 9b865e42fc0f..4c0f4a09747f 100644 --- a/corehq/apps/notifications/static/notifications/js/bootstrap3/notifications_service_main.js +++ b/corehq/apps/notifications/static/notifications/js/bootstrap3/notifications_service_main.js @@ -11,7 +11,7 @@ hqDefine('notifications/js/bootstrap3/notifications_service_main', [ $, initialPageData, notificationsService, - googleAnalytics + googleAnalytics, ) { var initNotifications = function () { var csrfToken = $("#csrfTokenContainer").val(); diff --git a/corehq/apps/notifications/static/notifications/js/bootstrap5/notifications_service.js b/corehq/apps/notifications/static/notifications/js/bootstrap5/notifications_service.js index 141ad9607510..6e1659ca116d 100644 --- a/corehq/apps/notifications/static/notifications/js/bootstrap5/notifications_service.js +++ b/corehq/apps/notifications/static/notifications/js/bootstrap5/notifications_service.js @@ -16,10 +16,8 @@ hqDefine('notifications/js/bootstrap5/notifications_service', [ ko, _, RMI, - kissmetrics + kissmetrics, ) { - 'use strict'; - // Workaround for non-RequireJS pages: when `define` doesn't exist, RMI is just a global variable. RMI = RMI || window.RMI; @@ -59,7 +57,7 @@ hqDefine('notifications/js/bootstrap5/notifications_service', [ if (self.isFeature()) { kissmetrics.track.event("Notifications tab - Clicked notifications tab - " + "Clicked on Case Sharing text link", - {email: data.email, domain: data.domain}); + {email: data.email, domain: data.domain}); } }); self.isRead(true); @@ -81,9 +79,9 @@ hqDefine('notifications/js/bootstrap5/notifications_service', [ self.hasUnreadFeatureNotification = ko.computed(function () { return _.some(self.notifications(), function (note) { - return !note.isRead() && (note.type() === 'feat_basic' || note.type() === 'feat_pro') + return !note.isRead() && (note.type() === 'feat_basic' || note.type() === 'feat_pro'); }); - }) + }); self.seen = ko.computed(function () { if (self.hasUnreadFeatureNotification()) { diff --git a/corehq/apps/notifications/static/notifications/js/bootstrap5/notifications_service_main.js b/corehq/apps/notifications/static/notifications/js/bootstrap5/notifications_service_main.js index 3ebcba625d46..841ea01f5f70 100644 --- a/corehq/apps/notifications/static/notifications/js/bootstrap5/notifications_service_main.js +++ b/corehq/apps/notifications/static/notifications/js/bootstrap5/notifications_service_main.js @@ -11,7 +11,7 @@ hqDefine('notifications/js/bootstrap5/notifications_service_main', [ $, initialPageData, notificationsService, - googleAnalytics + googleAnalytics, ) { var initNotifications = function () { var csrfToken = $("#csrfTokenContainer").val(); diff --git a/corehq/apps/notifications/static/notifications/js/manage_notifications.js b/corehq/apps/notifications/static/notifications/js/manage_notifications.js index 539c39b2e19f..34cc7a6c639b 100644 --- a/corehq/apps/notifications/static/notifications/js/manage_notifications.js +++ b/corehq/apps/notifications/static/notifications/js/manage_notifications.js @@ -4,7 +4,7 @@ hqDefine('notifications/js/manage_notifications', [ 'commcarehq', ], function ( $, - initialPageData + initialPageData, ) { $(function () { $('#ko-alert-container').koApplyBindings({ diff --git a/corehq/apps/notifications/static/notifications/spec/bootstrap3/NotificationsService.spec.mo.js b/corehq/apps/notifications/static/notifications/spec/bootstrap3/NotificationsService.spec.mo.js index 343d9da5bfb6..cec86509400e 100644 --- a/corehq/apps/notifications/static/notifications/spec/bootstrap3/NotificationsService.spec.mo.js +++ b/corehq/apps/notifications/static/notifications/spec/bootstrap3/NotificationsService.spec.mo.js @@ -5,7 +5,7 @@ hqDefine("notifications/spec/bootstrap3/NotificationsService.spec.mo", [ ], function ( $, sinon, - notifications + notifications, ) { describe('NotificationsService Unit Tests', function () { var fakeRMIUrl = '/fake/rmi', diff --git a/corehq/apps/notifications/static/notifications/spec/bootstrap5/NotificationsService.spec.mo.js b/corehq/apps/notifications/static/notifications/spec/bootstrap5/NotificationsService.spec.mo.js index 7e10db7ae786..03aff0ff5eaa 100644 --- a/corehq/apps/notifications/static/notifications/spec/bootstrap5/NotificationsService.spec.mo.js +++ b/corehq/apps/notifications/static/notifications/spec/bootstrap5/NotificationsService.spec.mo.js @@ -5,7 +5,7 @@ hqDefine("notifications/spec/bootstrap5/NotificationsService.spec.mo", [ ], function ( $, sinon, - notifications + notifications, ) { describe('NotificationsService Unit Tests', function () { var fakeRMIUrl = '/fake/rmi', From dd4c600d8158b01823d608983b423827a80f0733 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Thu, 30 Jan 2025 15:16:10 -0500 Subject: [PATCH 02/19] prototype app --- .../static/prototype/js/example/knockout_pagination.js | 2 +- .../prototype/static/prototype/js/webpack/bootstrap3_amd.js | 2 +- .../prototype/static/prototype/js/webpack/bootstrap5_amd.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 c0101cfb3150..702b9637675f 100644 --- a/corehq/apps/prototype/static/prototype/js/example/knockout_pagination.js +++ b/corehq/apps/prototype/static/prototype/js/example/knockout_pagination.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine("prototype/js/example/knockout_pagination",[ 'jquery', diff --git a/corehq/apps/prototype/static/prototype/js/webpack/bootstrap3_amd.js b/corehq/apps/prototype/static/prototype/js/webpack/bootstrap3_amd.js index 9f1b337113a7..670cdfaa1eac 100644 --- a/corehq/apps/prototype/static/prototype/js/webpack/bootstrap3_amd.js +++ b/corehq/apps/prototype/static/prototype/js/webpack/bootstrap3_amd.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine("prototype/js/webpack/bootstrap3_amd",[ 'jquery', diff --git a/corehq/apps/prototype/static/prototype/js/webpack/bootstrap5_amd.js b/corehq/apps/prototype/static/prototype/js/webpack/bootstrap5_amd.js index 322a07a880a1..0e1a2e2e39e0 100644 --- a/corehq/apps/prototype/static/prototype/js/webpack/bootstrap5_amd.js +++ b/corehq/apps/prototype/static/prototype/js/webpack/bootstrap5_amd.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine("prototype/js/webpack/bootstrap5_amd",[ 'jquery', From 4a7cb5ab5ef985d60868e0743ef984d6b64e71f4 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Thu, 30 Jan 2025 15:16:40 -0500 Subject: [PATCH 03/19] styleguide app --- .../static/styleguide/js_examples/crispy_forms_knockout.js | 2 -- .../js_examples/crispy_forms_knockout_validation.js | 2 -- .../static/styleguide/js_examples/multiselect_crispy.js | 2 +- corehq/apps/styleguide/static/styleguide/main.js | 5 ++--- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/corehq/apps/styleguide/static/styleguide/js_examples/crispy_forms_knockout.js b/corehq/apps/styleguide/static/styleguide/js_examples/crispy_forms_knockout.js index 58f3c27f0aee..8520d0db22bf 100644 --- a/corehq/apps/styleguide/static/styleguide/js_examples/crispy_forms_knockout.js +++ b/corehq/apps/styleguide/static/styleguide/js_examples/crispy_forms_knockout.js @@ -1,6 +1,4 @@ $(function () { - 'use strict'; - let ExampleFormModel = function () { let self = {}; self.fullName = ko.observable(); diff --git a/corehq/apps/styleguide/static/styleguide/js_examples/crispy_forms_knockout_validation.js b/corehq/apps/styleguide/static/styleguide/js_examples/crispy_forms_knockout_validation.js index bc3f2ce4c679..27bd9d511b20 100644 --- a/corehq/apps/styleguide/static/styleguide/js_examples/crispy_forms_knockout_validation.js +++ b/corehq/apps/styleguide/static/styleguide/js_examples/crispy_forms_knockout_validation.js @@ -1,6 +1,4 @@ $(function () { - 'use strict'; - let UserModel = function () { let self = {}, _rateLimit = { diff --git a/corehq/apps/styleguide/static/styleguide/js_examples/multiselect_crispy.js b/corehq/apps/styleguide/static/styleguide/js_examples/multiselect_crispy.js index ab46fc801a20..2109255f5cc4 100644 --- a/corehq/apps/styleguide/static/styleguide/js_examples/multiselect_crispy.js +++ b/corehq/apps/styleguide/static/styleguide/js_examples/multiselect_crispy.js @@ -1,5 +1,5 @@ $(function () { - let teamListener = function() { + let teamListener = function () { console.log("Triggered willSelectAllListener"); }; diff --git a/corehq/apps/styleguide/static/styleguide/main.js b/corehq/apps/styleguide/static/styleguide/main.js index 131391408f82..7e94f75c8835 100644 --- a/corehq/apps/styleguide/static/styleguide/main.js +++ b/corehq/apps/styleguide/static/styleguide/main.js @@ -1,5 +1,4 @@ $(function () { - 'use strict'; let initialPageData = hqImport("hqwebapp/js/initial_page_data"); ace.config.set('basePath', initialPageData.get('ace_base_path')); _.each(["python", "html", "js", "django"], function (lang) { @@ -23,11 +22,11 @@ $(function () { _.each(["h2", "h3", "h4"], function (header) { $(header).each(function () { let headerId = $(this).attr('id'); - if (headerId === undefined) return; + if (headerId === undefined) {return;} let $copyLinkToSection = $('').append($('')); $(this).addClass('d-inline-block pe-3').after( - $copyLinkToSection + $copyLinkToSection, ); new bootstrap.Tooltip($copyLinkToSection.get(0), { title: "Click to copy link to section.", From c7e2da5e3d0ade10564af873b798a5de3b2616ec Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Thu, 30 Jan 2025 15:17:18 -0500 Subject: [PATCH 04/19] reports_core app --- .../reports_core/static/reports_core/js/bootstrap3/maps.js | 4 ++-- .../reports_core/static/reports_core/js/bootstrap5/maps.js | 4 ++-- corehq/apps/reports_core/static/reports_core/js/charts.js | 2 +- .../static/reports_core/spec/choice_list_utils_spec.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/corehq/apps/reports_core/static/reports_core/js/bootstrap3/maps.js b/corehq/apps/reports_core/static/reports_core/js/bootstrap3/maps.js index f24435b3970a..0ac9367464a9 100644 --- a/corehq/apps/reports_core/static/reports_core/js/bootstrap3/maps.js +++ b/corehq/apps/reports_core/static/reports_core/js/bootstrap3/maps.js @@ -7,7 +7,7 @@ hqDefine('reports_core/js/bootstrap3/maps', [ $, _, mapsUtils, - L + L, ) { // Reset images needed for map markers, which don't play well with webpack. // See https://github.com/Leaflet/Leaflet/issues/4968#issuecomment-483402699 @@ -64,7 +64,7 @@ hqDefine('reports_core/js/bootstrap3/maps', [ L.control.scale({position: 'bottomright'}).addTo(privates.map); L.control.zoom({ - position: 'bottomright' + position: 'bottomright', }).addTo(privates.map); $('#zoomtofit').css('display', 'block'); } else { diff --git a/corehq/apps/reports_core/static/reports_core/js/bootstrap5/maps.js b/corehq/apps/reports_core/static/reports_core/js/bootstrap5/maps.js index 48d16d2f251a..ff4b16a0da0c 100644 --- a/corehq/apps/reports_core/static/reports_core/js/bootstrap5/maps.js +++ b/corehq/apps/reports_core/static/reports_core/js/bootstrap5/maps.js @@ -7,7 +7,7 @@ hqDefine('reports_core/js/bootstrap5/maps', [ $, _, mapsUtils, - L + L, ) { // Reset images needed for map markers, which don't play well with webpack. // See https://github.com/Leaflet/Leaflet/issues/4968#issuecomment-483402699 @@ -64,7 +64,7 @@ hqDefine('reports_core/js/bootstrap5/maps', [ L.control.scale({position: 'bottomright'}).addTo(privates.map); L.control.zoom({ - position: 'bottomright' + position: 'bottomright', }).addTo(privates.map); $('#zoomtofit').css('display', 'block'); } else { diff --git a/corehq/apps/reports_core/static/reports_core/js/charts.js b/corehq/apps/reports_core/static/reports_core/js/charts.js index 115ccbdd611a..7f93d4a04936 100644 --- a/corehq/apps/reports_core/static/reports_core/js/charts.js +++ b/corehq/apps/reports_core/static/reports_core/js/charts.js @@ -9,7 +9,7 @@ hqDefine('reports_core/js/charts', [ $, _, d3, - nv + nv, ) { var fn = {}; var renderPie = function (config, data, svgSelector) { diff --git a/corehq/apps/reports_core/static/reports_core/spec/choice_list_utils_spec.js b/corehq/apps/reports_core/static/reports_core/spec/choice_list_utils_spec.js index c335b0c7ba56..7caace6d9755 100644 --- a/corehq/apps/reports_core/static/reports_core/spec/choice_list_utils_spec.js +++ b/corehq/apps/reports_core/static/reports_core/spec/choice_list_utils_spec.js @@ -1,7 +1,7 @@ hqDefine("reports_core/spec/choice_list_utils_spec", [ "reports_core/js/choice_list_utils", ], function ( - utils + utils, ) { describe('choiceListUtils', function () { it('Correctly formats select2 data', function () { From 7d542093aef6bc7e699c6e40374f240ead3c98c5 Mon Sep 17 00:00:00 2001 From: Jenny Schweers Date: Thu, 30 Jan 2025 15:20:45 -0500 Subject: [PATCH 05/19] hqwebapp app --- .../apps/hqwebapp/static/hqwebapp/js/500.js | 2 +- .../apps/hqwebapp/static/hqwebapp/js/atwho.js | 2 +- .../hqwebapp/static/hqwebapp/js/base_ace.js | 2 +- .../hqwebapp/js/bootstrap3/alert_user.js | 6 +- .../js/bootstrap3/crud_paginated_list.js | 7 +- .../js/bootstrap3/crud_paginated_list_init.js | 4 +- .../hqwebapp/js/bootstrap3/downgrade_modal.js | 2 +- .../hqwebapp/js/bootstrap3/email-request.js | 4 +- .../hqwebapp/js/bootstrap3/hq.helpers.js | 2 +- .../hqwebapp/js/bootstrap3/inactivity.js | 6 +- .../js/bootstrap3/knockout_bindings.ko.js | 11 +- .../static/hqwebapp/js/bootstrap3/main.js | 14 +-- .../bootstrap3/mobile_experience_warning.js | 4 +- .../hqwebapp/js/bootstrap3/prepaid_modal.js | 2 +- .../js/bootstrap3/requirejs_config.js | 2 +- .../hqwebapp/js/bootstrap3/rollout_modal.js | 2 +- .../hqwebapp/js/bootstrap3/sticky_tabs.js | 2 +- .../hqwebapp/js/bootstrap3/ui-element.js | 3 - .../hqwebapp/js/bootstrap3/validators.ko.js | 4 +- .../static/hqwebapp/js/bootstrap3/widgets.js | 4 +- .../hqwebapp/js/bootstrap5/alert_user.js | 6 +- .../js/bootstrap5/crud_paginated_list.js | 7 +- .../js/bootstrap5/crud_paginated_list_init.js | 4 +- .../hqwebapp/js/bootstrap5/downgrade_modal.js | 2 +- .../hqwebapp/js/bootstrap5/email-request.js | 6 +- .../hqwebapp/js/bootstrap5/hq.helpers.js | 2 +- .../hqwebapp/js/bootstrap5/inactivity.js | 4 +- .../js/bootstrap5/knockout_bindings.ko.js | 11 +- .../static/hqwebapp/js/bootstrap5/main.js | 15 +-- .../bootstrap5/mobile_experience_warning.js | 4 +- .../hqwebapp/js/bootstrap5/prepaid_modal.js | 2 +- .../js/bootstrap5/requirejs_config.js | 2 +- .../hqwebapp/js/bootstrap5/rollout_modal.js | 2 +- .../hqwebapp/js/bootstrap5/sticky_tabs.js | 4 +- .../hqwebapp/js/bootstrap5/ui-element.js | 3 - .../hqwebapp/js/bootstrap5/validators.ko.js | 8 +- .../static/hqwebapp/js/bootstrap5/widgets.js | 4 +- .../static/hqwebapp/js/bulk_upload_file.js | 3 +- .../hqwebapp/static/hqwebapp/js/captcha.js | 6 +- .../static/hqwebapp/js/components.ko.js | 2 +- .../js/components/bootstrap3/feedback.js | 4 +- .../js/components/bootstrap5/feedback.js | 2 +- .../hqwebapp/js/components/inline_edit.js | 4 +- .../hqwebapp/js/components/pagination.js | 6 +- .../hqwebapp/js/components/search_box.js | 4 +- .../hqwebapp/js/components/select_toggle.js | 4 +- .../hqwebapp/js/daterangepicker.config.js | 8 +- .../hqwebapp/js/hq_extensions.jquery.js | 1 - .../hqwebapp/static/hqwebapp/js/htmx_base.js | 6 +- .../static/hqwebapp/js/htmx_utils/errors.js | 2 +- .../static/hqwebapp/js/initial_page_data.js | 2 +- .../static/hqwebapp/js/key-value-mapping.js | 2 +- .../knockout_mapping.ko.min.js | 103 +++++++++++++++--- .../static/hqwebapp/js/maintenance_alerts.js | 2 +- .../static/hqwebapp/js/multiselect_utils.js | 12 +- .../hqwebapp/js/password_validators.ko.js | 4 +- .../hqwebapp/static/hqwebapp/js/privileges.js | 4 +- .../static/hqwebapp/js/resource_versions.js | 2 +- .../static/hqwebapp/js/select2_handler.js | 3 +- .../js/select2_knockout_bindings.ko.js | 4 +- .../hqwebapp/js/select_2_ajax_widget.js | 2 +- .../apps/hqwebapp/static/hqwebapp/js/soil.js | 4 +- .../static/hqwebapp/js/sso_inactivity.js | 2 +- .../static/hqwebapp/js/tempus_dominus.js | 6 +- .../hqwebapp/static/hqwebapp/js/toggles.js | 6 +- .../bootstrap3/ui-element-checkbox.js | 8 +- .../bootstrap3/ui-element-input-map.js | 4 +- .../bootstrap3/ui-element-input.js | 6 +- .../bootstrap3/ui-element-key-val-list.js | 4 +- .../bootstrap3/ui-element-key-val-mapping.js | 2 +- .../bootstrap3/ui-element-select.js | 4 +- .../bootstrap5/ui-element-checkbox.js | 8 +- .../bootstrap5/ui-element-input-map.js | 4 +- .../bootstrap5/ui-element-input.js | 6 +- .../bootstrap5/ui-element-key-val-list.js | 6 +- .../bootstrap5/ui-element-key-val-mapping.js | 2 +- .../bootstrap5/ui-element-select.js | 4 +- .../ui_elements/ui-element-langcode-button.js | 2 +- .../static/hqwebapp/js/utils/email.js | 2 +- .../hqwebapp/spec/assert_properties_spec.js | 2 +- .../spec/bootstrap3/inactivity_spec.js | 2 +- .../hqwebapp/spec/bootstrap3/widgets_spec.js | 2 +- .../spec/bootstrap5/inactivity_spec.js | 2 +- .../hqwebapp/spec/bootstrap5/widgets_spec.js | 2 +- .../static/hqwebapp/spec/urllib_spec.js | 4 +- 85 files changed, 246 insertions(+), 211 deletions(-) diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/500.js b/corehq/apps/hqwebapp/static/hqwebapp/js/500.js index 12dfaa11cc1a..81d2716ac2d6 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/500.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/500.js @@ -6,7 +6,7 @@ hqDefine("hqwebapp/js/500",[ $(function () { new bootstrap.Popover('#sad-danny', { title: gettext("This is Danny, one of our best developers."), - content: gettext("Danny is pretty sad that you had to encounter this issue. He's making sure it gets fixed as soon as possible.") + content: gettext("Danny is pretty sad that you had to encounter this issue. He's making sure it gets fixed as soon as possible."), }); $('#refresh').click(function () { window.location.reload(true); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/atwho.js b/corehq/apps/hqwebapp/static/hqwebapp/js/atwho.js index d15abb125209..02eb4e083678 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/atwho.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/atwho.js @@ -6,7 +6,7 @@ hqDefine('hqwebapp/js/atwho', [ ], function ( ko, - _ + _, ) { var _init = function ($input, options, afterInsert, replaceValue) { $input.atwho(options).on("inserted.atwho", function () { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/base_ace.js b/corehq/apps/hqwebapp/static/hqwebapp/js/base_ace.js index 312bd9c2206d..2336394a4fb3 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/base_ace.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/base_ace.js @@ -9,7 +9,7 @@ hqDefine('hqwebapp/js/base_ace', [ _, ko, ace, - initialPageData + initialPageData, ) { var self = {}; self.editor = []; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/alert_user.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/alert_user.js index 35654dacde46..6ebaf09365e2 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/alert_user.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/alert_user.js @@ -20,13 +20,13 @@ hqDefine("hqwebapp/js/bootstrap3/alert_user", [ ], function ( $, - ko + ko, ) { var MessageAlert = function (message, tags, fadeOut) { var self = { "message": ko.observable(message), "alert_class": ko.observable( - "alert fade in message-alert" + "alert fade in message-alert", ), }; if (tags) { @@ -40,7 +40,7 @@ function ( clearTimeout(self.timer); self.timer = setTimeout(removeAlertTimerFunc(self), 5000); } - } + }; return self; }; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list.js index 7cb43ea9e5c3..31df2f5d9adf 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list.js @@ -7,16 +7,15 @@ hqDefine("hqwebapp/js/bootstrap3/crud_paginated_list", [ ], function ( $, ko, - _ + _, ) { var CRUDPaginatedListModel = function ( total, pageLimit, currentPage, options, - paginatedItem + paginatedItem, ) { - 'use strict'; options = options || {}; var self = {}; @@ -114,7 +113,7 @@ hqDefine("hqwebapp/js/bootstrap3/crud_paginated_list", [ data.paginatedList, function (listItem) { return self.PaginatedItem(listItem, self.initRow); - } + }, )); self.deletedList([]); self.newList([]); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list_init.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list_init.js index 408cde784ad8..11bf6b18dedb 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list_init.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list_init.js @@ -8,7 +8,7 @@ hqDefine("hqwebapp/js/bootstrap3/crud_paginated_list_init", [ $, ko, initialPageData, - CRUDPaginatedList + CRUDPaginatedList, ) { var paginatedListModel = CRUDPaginatedList.CRUDPaginatedListModel( initialPageData.get('total'), @@ -19,7 +19,7 @@ hqDefine("hqwebapp/js/bootstrap3/crud_paginated_list_init", [ allowItemCreation: initialPageData.get('allow_item_creation'), createItemForm: initialPageData.get('create_item_form'), createItemFormClass: initialPageData.get('create_item_form_class'), - } + }, ); $(function () { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/downgrade_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/downgrade_modal.js index 906b82a8602b..82335601fc87 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/downgrade_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/downgrade_modal.js @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/bootstrap3/downgrade_modal", [ ], function ( kissmetrics, initialPageData, - $ + $, ) { function snooze(slug, domain) { $.cookie(cookieName(slug, domain), true, { expires: 1, path: '/', secure: initialPageData.get('secure_cookies') }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/email-request.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/email-request.js index a8f004e8684c..c989fb85bd42 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/email-request.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/email-request.js @@ -130,14 +130,14 @@ hqDefine('hqwebapp/js/bootstrap3/email-request', [ if (issueReportModal.length) { issueReportModal.koApplyBindings(new EmailRequest( "modalReportIssue", - "hqwebapp-bugReportForm" + "hqwebapp-bugReportForm", )); } const featureRequestModal = $("#modalSolutionsFeatureRequest"); if (featureRequestModal.length) { featureRequestModal.koApplyBindings(new EmailRequest( "modalSolutionsFeatureRequest", - "hqwebapp-requestReportForm" + "hqwebapp-requestReportForm", )); } }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/hq.helpers.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/hq.helpers.js index 2ec600963bf9..ef57d8c75b7f 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/hq.helpers.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/hq.helpers.js @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/bootstrap3/hq.helpers", [ $, ko, _, - googleAnalytics + googleAnalytics, ) { // disable-on-submit is a class for form submit buttons so they're automatically disabled when the form is submitted $(document).on('submit', 'form', function (ev) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/inactivity.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/inactivity.js index 06d055a8d36e..6d22e8dc9cac 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/inactivity.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/inactivity.js @@ -11,7 +11,7 @@ hqDefine('hqwebapp/js/bootstrap3/inactivity', [ $, _, assertProperties, - initialPageData + initialPageData, ) { var log = function (message) { console.log("[" + (new Date()).toLocaleTimeString() + "] " + message); // eslint-disable-line no-console @@ -147,7 +147,7 @@ hqDefine('hqwebapp/js/bootstrap3/inactivity', [ selectedAppId = urlParams.appId; } } catch (error) { - log("Could not parse app id out of " + window.location.hash) + log("Could not parse app id out of " + window.location.hash); return; } var domain = initialPageData.get('domain'); @@ -161,7 +161,7 @@ hqDefine('hqwebapp/js/bootstrap3/inactivity', [ success: function (data) { log( "ping_login response: " + (data.success ? "User is logged in" : "User is logged out") - + ", " + (data.new_app_version_available ? "new app version available" : "no new app version") + + ", " + (data.new_app_version_available ? "new app version available" : "no new app version"), ); if (!data.success) { _.each($(".select2-hidden-accessible"), function (el) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/knockout_bindings.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/knockout_bindings.ko.js index 9e04b2d399e2..fcefdfb26f46 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/knockout_bindings.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/knockout_bindings.ko.js @@ -6,7 +6,7 @@ hqDefine("hqwebapp/js/bootstrap3/knockout_bindings.ko", [ ], function ( $, _, - ko + ko, ) { // Need this due to https://github.com/knockout/knockout/pull/2324 // so that ko.bindingHandlers.foreach.update works properly @@ -16,10 +16,7 @@ hqDefine("hqwebapp/js/bootstrap3/knockout_bindings.ko", [ ko.bindingHandlers.hqbSubmitReady = { update: function (element, valueAccessor) { var value = (valueAccessor()) ? valueAccessor()() : null; - if (value) - $(element).addClass("btn-primary").removeClass("disabled"); - else - $(element).addClass("disabled").removeClass("btn-primary"); + if (value) {$(element).addClass("btn-primary").removeClass("disabled");} else {$(element).addClass("disabled").removeClass("btn-primary");} }, }; @@ -122,7 +119,7 @@ hqDefine("hqwebapp/js/bootstrap3/knockout_bindings.ko", [ "NOT UPDATING THE SORT OF THE ACTUAL LIST! " + "Did you forget to add `attr: {'data-order': _sortableOrder}` " + "to the data-bind attribute of your main sorting " + - "element?" + "element?", ); return; } @@ -190,7 +187,7 @@ hqDefine("hqwebapp/js/bootstrap3/knockout_bindings.ko", [ var list = ko.bindingHandlers.multirow_sortable.getList(valueAccessor); var forceUpdate = function () { ko.bindingHandlers.multirow_sortable.update( - element, valueAccessor, allBindingsAccessor, viewModel, bindingContext + element, valueAccessor, allBindingsAccessor, viewModel, bindingContext, ); }; list.subscribe(forceUpdate); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/main.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/main.js index 432d0d9158a3..9569f4b51e1c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/main.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/main.js @@ -15,10 +15,9 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ modernizr, initialPageData, alertUser, - googleAnalytics + googleAnalytics, ) { var eventize = function (that) { - 'use strict'; var events = {}; that.on = function (tag, callback) { if (events[tag] === undefined) { @@ -40,12 +39,11 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ }; var makeHqHelp = function (opts, wrap) { - 'use strict'; wrap = wrap === undefined ? true : wrap; var el = $( '' + '', ); _.each(['content', 'title', 'html', 'placement', 'container'], function (attr) { $('a', el).data(attr, opts[attr]); @@ -57,7 +55,6 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ }; var transformHelpTemplate = function ($template, wrap) { - 'use strict'; if ($template.data()) { var $help = makeHqHelp($template.data(), wrap); $help.insertAfter($template); @@ -104,8 +101,6 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ ko.virtualElements.allowedBindings.allowDescendantBindings = true; var initBlock = function ($elem) { - 'use strict'; - $('.submit').click(function (e) { var $form = $(this).closest('.form, form'), data = $form.find('[name]').serialize(), @@ -126,7 +121,6 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ }; var updateDOM = function (update) { - 'use strict'; var key; for (key in update) { if (_.has(update, key)) { @@ -136,7 +130,6 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ }; var makeSaveButton = function (messageStrings, cssClass, barClass) { - 'use strict'; var BAR_STATE = { SAVE: 'savebtn-bar-save', SAVING: 'savebtn-bar-saving', @@ -380,7 +373,6 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ }; $(function () { - 'use strict'; $(window).on('beforeunload', beforeUnloadCallback); initBlock($("body")); @@ -430,7 +422,7 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ } else { setUpAlert(alert, closedAlerts, alertCookie); } - } + }, ); } diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/mobile_experience_warning.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/mobile_experience_warning.js index ccd686a3ef47..504c1d32f0a8 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/mobile_experience_warning.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/mobile_experience_warning.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/bootstrap3/mobile_experience_warning', [ "jquery", "hqwebapp/js/initial_page_data", @@ -7,7 +7,7 @@ hqDefine('hqwebapp/js/bootstrap3/mobile_experience_warning', [ ], function ( $, initialPageData, - kissmetrix + kissmetrix, ) { $(function () { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/prepaid_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/prepaid_modal.js index e74cebea245c..38e92c5ef3a2 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/prepaid_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/prepaid_modal.js @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/bootstrap3/prepaid_modal", [ ], function ( kissmetrics, initialPageData, - $ + $, ) { function snooze(slug, domain) { $.cookie(cookieName(slug, domain), true, { expires: 30, path: '/', secure: initialPageData.get('secure_cookies') }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/requirejs_config.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/requirejs_config.js index eee2ead479c2..73ee3ac8b7b5 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/requirejs_config.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/requirejs_config.js @@ -1,4 +1,4 @@ -"use strict"; + requirejs.config({ baseUrl: '/static/', paths: { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/rollout_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/rollout_modal.js index 71b9b5cc3fa5..4e1c62ba8695 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/rollout_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/rollout_modal.js @@ -12,7 +12,7 @@ hqDefine("hqwebapp/js/bootstrap3/rollout_modal", [ alertUser, initialPageData, googleAnalytics, - kissmetricsAnalytics + kissmetricsAnalytics, ) { var _trackSoftRollout = googleAnalytics.trackCategory("Soft Rollout"); function snooze(slug) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/sticky_tabs.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/sticky_tabs.js index d8da44ac533b..ac2fc4da6f4c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/sticky_tabs.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/sticky_tabs.js @@ -6,7 +6,7 @@ hqDefine("hqwebapp/js/bootstrap3/sticky_tabs", [ "jquery", "bootstrap", // needed for $.tab ], function ( - $ + $, ) { var getHash = function () { if (window.location.hash) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/ui-element.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/ui-element.js index c01dd2cc02a2..f2511f96a080 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/ui-element.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/ui-element.js @@ -1,7 +1,4 @@ -/* globals hqImport, hqDefine */ - hqDefine('hqwebapp/js/bootstrap3/ui-element', function () { - 'use strict'; var module = {}; module.input = function (value) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/validators.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/validators.ko.js index 1f7ff498edfc..0d7aae67ef8c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/validators.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/validators.ko.js @@ -4,11 +4,11 @@ hqDefine("hqwebapp/js/bootstrap3/validators.ko", [ 'knockout-validation/dist/knockout.validation.min', // needed for ko.validation ], function ( $, - ko + ko, ) { ko.validation.rules['emailRFC2822'] = { validator: function (val) { - if (val === undefined || val.length === 0) return true; // do separate validation for required + if (val === undefined || val.length === 0) {return true;} // do separate validation for required var re = /(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/; return re.test(val || '') && val.indexOf(' ') < 0; }, diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/widgets.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/widgets.js index 8c55247e67c6..dcbf7b7723c0 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/widgets.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/widgets.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine("hqwebapp/js/bootstrap3/widgets",[ 'jquery', 'underscore', @@ -10,7 +10,7 @@ hqDefine("hqwebapp/js/bootstrap3/widgets",[ ], function ($, _, MapboxGeocoder, initialPageData) { var init = function () { var MAPBOX_ACCESS_TOKEN = initialPageData.get( - "mapbox_access_token" + "mapbox_access_token", ); // .hqwebapp-select2 is a basic select2-based dropdown or multiselect _.each($(".hqwebapp-select2"), function (element) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/alert_user.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/alert_user.js index 0a49aa895943..723e1d0ffbd6 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/alert_user.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/alert_user.js @@ -1,4 +1,4 @@ -"use strict"; + /* This is the knockout-based, javascript analog of messages in Django. @@ -21,13 +21,13 @@ hqDefine("hqwebapp/js/bootstrap5/alert_user", [ ], function ( $, - ko + ko, ) { var MessageAlert = function (message, tags, fadeOut) { var self = { "message": ko.observable(message), "alert_class": ko.observable( - "alert alert-dismissible message-alert mt-3 mb-2" + "alert alert-dismissible message-alert mt-3 mb-2", ), }; if (tags) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list.js index 2f60ffa30e9e..08c2f0d62e07 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list.js @@ -9,16 +9,15 @@ hqDefine("hqwebapp/js/bootstrap5/crud_paginated_list", [ $, ko, _, - bootstrap + bootstrap, ) { var CRUDPaginatedListModel = function ( total, pageLimit, currentPage, options, - paginatedItem + paginatedItem, ) { - 'use strict'; options = options || {}; var self = {}; @@ -116,7 +115,7 @@ hqDefine("hqwebapp/js/bootstrap5/crud_paginated_list", [ data.paginatedList, function (listItem) { return self.PaginatedItem(listItem, self.initRow); - } + }, )); self.deletedList([]); self.newList([]); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list_init.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list_init.js index cbc4aa2f98f3..c1b9004738f6 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list_init.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list_init.js @@ -8,7 +8,7 @@ hqDefine("hqwebapp/js/bootstrap5/crud_paginated_list_init", [ $, ko, initialPageData, - CRUDPaginatedList + CRUDPaginatedList, ) { var paginatedListModel = CRUDPaginatedList.CRUDPaginatedListModel( initialPageData.get('total'), @@ -19,7 +19,7 @@ hqDefine("hqwebapp/js/bootstrap5/crud_paginated_list_init", [ allowItemCreation: initialPageData.get('allow_item_creation'), createItemForm: initialPageData.get('create_item_form'), createItemFormClass: initialPageData.get('create_item_form_class'), - } + }, ); $(function () { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/downgrade_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/downgrade_modal.js index 20cd598b7be8..084ba91329fd 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/downgrade_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/downgrade_modal.js @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/bootstrap5/downgrade_modal", [ ], function ( kissmetrics, initialPageData, - $ + $, ) { function snooze(slug, domain) { $.cookie(cookieName(slug, domain), true, { expires: 1, path: '/', secure: initialPageData.get('secure_cookies') }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/email-request.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/email-request.js index 05e0021a4bcf..d81cfa98f3f8 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/email-request.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/email-request.js @@ -4,8 +4,6 @@ hqDefine('hqwebapp/js/bootstrap5/email-request', [ "es6!hqwebapp/js/bootstrap5_loader", "hqwebapp/js/bootstrap5/hq.helpers", ], function ($, ko, bootstrap) { - 'use strict'; - var EmailRequest = function (modalId, formId) { let self = {}; @@ -133,14 +131,14 @@ hqDefine('hqwebapp/js/bootstrap5/email-request', [ if (issueReportModal.length) { issueReportModal.koApplyBindings(new EmailRequest( "modalReportIssue", - "hqwebapp-bugReportForm" + "hqwebapp-bugReportForm", )); } const featureRequestModal = $("#modalSolutionsFeatureRequest"); if (featureRequestModal.length) { featureRequestModal.koApplyBindings(new EmailRequest( "modalSolutionsFeatureRequest", - "hqwebapp-requestReportForm" + "hqwebapp-requestReportForm", )); } }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/hq.helpers.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/hq.helpers.js index 4ded285f7893..cf802851a31f 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/hq.helpers.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/hq.helpers.js @@ -10,7 +10,7 @@ hqDefine("hqwebapp/js/bootstrap5/hq.helpers", [ ko, _, googleAnalytics, - bootstrap + bootstrap, ) { // disable-on-submit is a class for form submit buttons so they're automatically disabled when the form is submitted $(document).on('submit', 'form', function (ev) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/inactivity.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/inactivity.js index c97ca8511c57..1a5d8c4f0e75 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/inactivity.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/inactivity.js @@ -13,7 +13,7 @@ hqDefine('hqwebapp/js/bootstrap5/inactivity', [ _, bootstrap, assertProperties, - initialPageData + initialPageData, ) { var log = function (message) { console.log("[" + (new Date()).toLocaleTimeString() + "] " + message); // eslint-disable-line no-console @@ -213,7 +213,7 @@ hqDefine('hqwebapp/js/bootstrap5/inactivity', [ success: function (data) { log( "ping_login response: " + (data.success ? "User is logged in" : "User is logged out") - + ", " + (data.new_app_version_available ? "new app version available" : "no new app version") + + ", " + (data.new_app_version_available ? "new app version available" : "no new app version"), ); $button.enableButton(); var error = ""; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/knockout_bindings.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/knockout_bindings.ko.js index 6ef647991a8b..3051862afa3a 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/knockout_bindings.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/knockout_bindings.ko.js @@ -8,7 +8,7 @@ hqDefine("hqwebapp/js/bootstrap5/knockout_bindings.ko", [ $, _, ko, - bootstrap + bootstrap, ) { // Need this due to https://github.com/knockout/knockout/pull/2324 // so that ko.bindingHandlers.foreach.update works properly @@ -18,10 +18,7 @@ hqDefine("hqwebapp/js/bootstrap5/knockout_bindings.ko", [ ko.bindingHandlers.hqbSubmitReady = { update: function (element, valueAccessor) { var value = (valueAccessor()) ? valueAccessor()() : null; - if (value) - $(element).addClass("btn-primary").removeClass("disabled"); - else - $(element).addClass("disabled").removeClass("btn-primary"); + if (value) {$(element).addClass("btn-primary").removeClass("disabled");} else {$(element).addClass("disabled").removeClass("btn-primary");} }, }; @@ -124,7 +121,7 @@ hqDefine("hqwebapp/js/bootstrap5/knockout_bindings.ko", [ "NOT UPDATING THE SORT OF THE ACTUAL LIST! " + "Did you forget to add `attr: {'data-order': _sortableOrder}` " + "to the data-bind attribute of your main sorting " + - "element?" + "element?", ); return; } @@ -192,7 +189,7 @@ hqDefine("hqwebapp/js/bootstrap5/knockout_bindings.ko", [ var list = ko.bindingHandlers.multirow_sortable.getList(valueAccessor); var forceUpdate = function () { ko.bindingHandlers.multirow_sortable.update( - element, valueAccessor, allBindingsAccessor, viewModel, bindingContext + element, valueAccessor, allBindingsAccessor, viewModel, bindingContext, ); }; list.subscribe(forceUpdate); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/main.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/main.js index 48c6b5cb583d..af862a6c1d81 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/main.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/main.js @@ -17,10 +17,9 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ initialPageData, alertUser, googleAnalytics, - bootstrap + bootstrap, ) { var eventize = function (that) { - 'use strict'; var events = {}; that.on = function (tag, callback) { if (events[tag] === undefined) { @@ -42,12 +41,11 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ }; var makeHqHelp = function (opts, wrap) { - 'use strict'; wrap = wrap === undefined ? true : wrap; var el = $( '
' + '' + - '
' + '', ); _.each(['content', 'title', 'html', 'placement', 'container'], function (attr) { $('a', el).attr('data-bs-' + attr, opts[attr]); @@ -59,7 +57,6 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ }; var transformHelpTemplate = function ($template, wrap) { - 'use strict'; if ($template.data()) { var $help = makeHqHelp($template.data(), wrap); $help.insertAfter($template); @@ -106,7 +103,6 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ ko.virtualElements.allowedBindings.allowDescendantBindings = true; var initBlock = function ($elem) { - 'use strict'; $('.submit').click(function (e) { var $form = $(this).closest('.form, form'), @@ -126,7 +122,6 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ }; var updateDOM = function (update) { - 'use strict'; var key; for (key in update) { if (update.hasOwnProperty(key)) { @@ -136,7 +131,6 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ }; var makeSaveButton = function (messageStrings, cssClass, barClass) { - 'use strict'; var BAR_STATE = { SAVE: 'savebtn-bar-save', SAVING: 'savebtn-bar-saving', @@ -257,7 +251,7 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ if (lastParent) { var stillAttached = lastParent.tagName.toLowerCase() == 'html'; if (button.state !== 'saved' && stillAttached) { - if ($('.js-unhide-on-unsaved').length > 0) $('.js-unhide-on-unsaved').removeClass('hide'); + if ($('.js-unhide-on-unsaved').length > 0) {$('.js-unhide-on-unsaved').removeClass('hide');} return options.unsavedMessage || ""; } } @@ -378,7 +372,6 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ }; $(function () { - 'use strict'; $(window).on('beforeunload', beforeUnloadCallback); initBlock($("body")); @@ -433,7 +426,7 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ } else { setUpAlert(alert, closedAlerts, alertCookie); } - } + }, ); } diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/mobile_experience_warning.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/mobile_experience_warning.js index 856ac6ba39a5..5af681a69f0c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/mobile_experience_warning.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/mobile_experience_warning.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/bootstrap5/mobile_experience_warning', [ "jquery", "hqwebapp/js/initial_page_data", @@ -9,7 +9,7 @@ hqDefine('hqwebapp/js/bootstrap5/mobile_experience_warning', [ $, initialPageData, kissmetrix, - bootstrap + bootstrap, ) { $(function () { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/prepaid_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/prepaid_modal.js index 1d2c26294396..be4b79a4ecb4 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/prepaid_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/prepaid_modal.js @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/bootstrap5/prepaid_modal", [ ], function ( kissmetrics, initialPageData, - $ + $, ) { function snooze(slug, domain) { $.cookie(cookieName(slug, domain), true, { expires: 30, path: '/', secure: initialPageData.get('secure_cookies') }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/requirejs_config.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/requirejs_config.js index dc0c1680b65a..a0fa63c50c80 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/requirejs_config.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/requirejs_config.js @@ -1,4 +1,4 @@ -"use strict"; + requirejs.config({ baseUrl: '/static/', paths: { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/rollout_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/rollout_modal.js index d95567a48839..36795d60f458 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/rollout_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/rollout_modal.js @@ -12,7 +12,7 @@ hqDefine("hqwebapp/js/bootstrap5/rollout_modal", [ alertUser, initialPageData, googleAnalytics, - kissmetricsAnalytics + kissmetricsAnalytics, ) { var _trackSoftRollout = googleAnalytics.trackCategory("Soft Rollout"); function snooze(slug) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/sticky_tabs.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/sticky_tabs.js index 815d29c65dbc..d4b982b78139 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/sticky_tabs.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/sticky_tabs.js @@ -6,7 +6,7 @@ hqDefine("hqwebapp/js/bootstrap5/sticky_tabs", [ "jquery", "es6!hqwebapp/js/bootstrap5_loader", // needed for $.tab ], function ( - $, bootstrap + $, bootstrap, ) { var getHash = function () { if (window.location.hash) { @@ -25,7 +25,7 @@ hqDefine("hqwebapp/js/bootstrap5/sticky_tabs", [ tabController; // make sure we don't treat all anchor tags as a sticky tab - if ($tabFromUrl && $tabFromUrl.parents('.sticky-tabs').length === 0) return; + if ($tabFromUrl && $tabFromUrl.parents('.sticky-tabs').length === 0) {return;} if ($tabFromUrl && $tabFromUrl.length) { tabController = new bootstrap.Tab($tabFromUrl); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/ui-element.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/ui-element.js index 22fefeb42c40..c10b72757a83 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/ui-element.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/ui-element.js @@ -1,7 +1,4 @@ -/* globals hqImport, hqDefine */ - hqDefine('hqwebapp/js/bootstrap5/ui-element', function () { - 'use strict'; var module = {}; module.input = function (value) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/validators.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/validators.ko.js index 4581636d9ce1..9e45539420ad 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/validators.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/validators.ko.js @@ -4,10 +4,8 @@ hqDefine("hqwebapp/js/bootstrap5/validators.ko", [ 'knockout-validation/dist/knockout.validation.min', // needed for ko.validation ], function ( $, - ko + ko, ) { - 'use strict'; - ko.validation.init({ errorMessageClass: 'invalid-feedback', errorElementClass: 'is-invalid', @@ -17,7 +15,7 @@ hqDefine("hqwebapp/js/bootstrap5/validators.ko", [ ko.validation.rules['emailRFC2822'] = { validator: function (val) { - if (val === undefined || val.length === 0) return true; // do separate validation for required + if (val === undefined || val.length === 0) {return true;} // do separate validation for required var re = /(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/; return re.test(val || '') && val.indexOf(' ') < 0; }, @@ -67,7 +65,7 @@ hqDefine("hqwebapp/js/bootstrap5/validators.ko", [ if (options.delayedValidator === undefined) { isValid = options.validator.isValid(); isValidating = options.validator.isValidating !== undefined && options.validator.isValidating(); - if (isValid !== undefined && !isValid) $(element).addClass('is-invalid'); + if (isValid !== undefined && !isValid) {$(element).addClass('is-invalid');} } else { isValidating = options.validator.isValid() && options.delayedValidator.isValidating(); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/widgets.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/widgets.js index 102dd7422e5c..834d35fdcdba 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/widgets.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/widgets.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine("hqwebapp/js/bootstrap5/widgets",[ 'jquery', 'underscore', @@ -10,7 +10,7 @@ hqDefine("hqwebapp/js/bootstrap5/widgets",[ ], function ($, _, MapboxGeocoder, initialPageData, tempusDominus) { var init = function () { var MAPBOX_ACCESS_TOKEN = initialPageData.get( - "mapbox_access_token" + "mapbox_access_token", ); // .hqwebapp-select2 is a basic select2-based dropdown or multiselect _.each($(".hqwebapp-select2"), function (element) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bulk_upload_file.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bulk_upload_file.js index 33aaf98a4baf..1ec0a75f8096 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bulk_upload_file.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bulk_upload_file.js @@ -4,10 +4,9 @@ hqDefine("hqwebapp/js/bulk_upload_file", [ "commcarehq", ], function ( $, - ko + ko, ) { $(function () { - "use strict"; var $form = $("#bulk_upload_form"); if ($form.length) { $form.koApplyBindings({ diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/captcha.js b/corehq/apps/hqwebapp/static/hqwebapp/js/captcha.js index 0ef7e5441ffd..a9f07bdf8335 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/captcha.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/captcha.js @@ -1,14 +1,14 @@ -'use strict'; + hqDefine("hqwebapp/js/captcha", [ 'jquery', ],function ( - $ + $, ) { $(function () { // http://stackoverflow.com/a/20371801 $('img.captcha').after( $(' ') + ''), ); $('.captcha-refresh').click(function () { var $form = $(this).parent().closest('form'); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components.ko.js index 8e60ba56c22d..fa103b56b28d 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components.ko.js @@ -3,7 +3,7 @@ hqDefine("hqwebapp/js/components.ko", [ 'knockout', ], function ( $, - ko + ko, ) { return { register: function (name, component) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap3/feedback.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap3/feedback.js index 9beadc6bfc20..edabcf20b6e9 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap3/feedback.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap3/feedback.js @@ -1,4 +1,4 @@ -'use strict'; + /** * Knockout Feedback Component * @@ -24,7 +24,7 @@ hqDefine('hqwebapp/js/components/bootstrap3/feedback', [ $, _, initialPageData, - koComponents + koComponents, ) { const component = { viewModel: function (params) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap5/feedback.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap5/feedback.js index 43f258e96864..a1afcd5c9d20 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap5/feedback.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap5/feedback.js @@ -1,4 +1,4 @@ -'use strict'; + /** * Knockout Feedback Component * diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/inline_edit.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/inline_edit.js index 5b89d0c0bf1e..605c629bf28c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/inline_edit.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/inline_edit.js @@ -1,4 +1,4 @@ -'use strict'; + /* * Component for an inline editing widget: a piece of text that, when clicked on, turns into an input (textarea or * text input). The input is accompanied by a save button capable of saving the new value to the server via ajax. @@ -32,7 +32,7 @@ hqDefine('hqwebapp/js/components/inline_edit', [ ko, _, DOMPurify, - koComponents + koComponents, ) { const component = { viewModel: function (params) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/pagination.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/pagination.js index e1e010581144..e6a83ed62896 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/pagination.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/pagination.js @@ -1,4 +1,4 @@ -'use strict'; + /** * Knockout Pagination Component * @@ -39,7 +39,7 @@ hqDefine('hqwebapp/js/components/pagination', [ ko, _, initialPageData, - koComponents + koComponents, ) { const component = { viewModel: function (params) { @@ -97,7 +97,7 @@ hqDefine('hqwebapp/js/components/pagination', [ self.itemsText = ko.computed(function () { var lastItem = Math.min(self.currentPage() * self.perPage(), self.totalItems()); return _.template( - params.itemsTextTemplate || gettext('Showing <%- firstItem %> to <%- lastItem %> of <%- maxItems %> entries') + params.itemsTextTemplate || gettext('Showing <%- firstItem %> to <%- lastItem %> of <%- maxItems %> entries'), )({ firstItem: self.totalItems() > 0 ? ((self.currentPage() - 1) * self.perPage()) + 1 : 0, lastItem: isNaN(lastItem) ? 1 : lastItem, diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/search_box.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/search_box.js index 136df83ffdd5..b62a351c8d8e 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/search_box.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/search_box.js @@ -1,4 +1,4 @@ -'use strict'; + /* * Component for displaying a search box. Almost certainly included within a a larger knockout template. * @@ -20,7 +20,7 @@ hqDefine('hqwebapp/js/components/search_box', [ $, ko, _, - koComponents + koComponents, ) { const component = { viewModel: function (params) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/select_toggle.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/select_toggle.js index 8f94749ac062..ec5aafef6e58 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/select_toggle.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/select_toggle.js @@ -1,4 +1,4 @@ -'use strict'; + /* * Component for displaying a selection as a set of buttons. * Creates an invisible ' + - '' + '', ); return input({ searchInputId: inputId, @@ -85,12 +85,12 @@ hqDefine('hqwebapp/js/multiselect_utils', [ selectableHeader: _renderHeader( selectableHeaderTitle, _renderAction(selectAllId, defaultBtnClass, 'fa fa-plus', gettext("Add All"), disableModifyAllActions), - _renderSearch(searchSelectableId, searchItemTitle) + _renderSearch(searchSelectableId, searchItemTitle), ), selectionHeader: _renderHeader( selectedHeaderTitle, _renderAction(removeAllId, defaultBtnClass, 'fa fa-remove', gettext("Remove All"), disableModifyAllActions), - _renderSearch(searchSelectedId, searchItemTitle) + _renderSearch(searchSelectedId, searchItemTitle), ), afterInit: function () { var that = this, diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/password_validators.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/password_validators.ko.js index 3c071f642cf2..f7487ca2405e 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/password_validators.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/password_validators.ko.js @@ -1,11 +1,11 @@ -'use strict'; + hqDefine('hqwebapp/js/password_validators.ko', [ 'knockout', 'zxcvbn/dist/zxcvbn', 'knockout-validation/dist/knockout.validation.min', // needed for ko.validation ], function ( ko, - zxcvbn + zxcvbn, ) { ko.validation.rules['zxcvbnPassword'] = { validator: function (val, minScore, penalizedWords) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/privileges.js b/corehq/apps/hqwebapp/static/hqwebapp/js/privileges.js index 99d09353d642..0570a5b731c9 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/privileges.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/privileges.js @@ -1,10 +1,10 @@ -'use strict'; + hqDefine('hqwebapp/js/privileges', [ 'underscore', 'hqwebapp/js/initial_page_data', ], function ( _, - initialPageData + initialPageData, ) { var privilegePresent = function (allPrivileges, privilegeName) { return allPrivileges.includes(privilegeName); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/resource_versions.js b/corehq/apps/hqwebapp/static/hqwebapp/js/resource_versions.js index 7fa772abe5ca..86ffaab2cd68 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/resource_versions.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/resource_versions.js @@ -1,4 +1,4 @@ -'use strict'; + requirejs.config({ paths: { // This file gets auto-generated during deploy. diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/select2_handler.js b/corehq/apps/hqwebapp/static/hqwebapp/js/select2_handler.js index 836a05c3f0c6..eddc93e59556 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/select2_handler.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/select2_handler.js @@ -6,12 +6,11 @@ hqDefine("hqwebapp/js/select2_handler", [ ], function ( $, ko, - _ + _, ) { var baseSelect2Handler = function (options) { // For use with BaseAsyncHandler // todo: documentation (biyeun) - 'use strict'; var self = {}; self.fieldName = options.fieldName; self.placeholder = options.placeholder; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/select2_knockout_bindings.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/select2_knockout_bindings.ko.js index f5d2094e1cb1..d7cec1197e94 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/select2_knockout_bindings.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/select2_knockout_bindings.ko.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine("hqwebapp/js/select2_knockout_bindings.ko", [ 'jquery', 'underscore', @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/select2_knockout_bindings.ko", [ $, _, ko, - DOMPurify + DOMPurify, ) { /** * Converts the bound element to a select2 widget, using the element's existing diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/select_2_ajax_widget.js b/corehq/apps/hqwebapp/static/hqwebapp/js/select_2_ajax_widget.js index 2c3186b789d1..a27d85b273f8 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/select_2_ajax_widget.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/select_2_ajax_widget.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine("hqwebapp/js/select_2_ajax_widget", [ 'jquery', 'underscore', diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/soil.js b/corehq/apps/hqwebapp/static/hqwebapp/js/soil.js index 849397e49026..98077d444c07 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/soil.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/soil.js @@ -1,11 +1,11 @@ -"use strict"; + hqDefine("hqwebapp/js/soil", [ "jquery", "hqwebapp/js/initial_page_data", "commcarehq", ], function ( $, - initialPageData + initialPageData, ) { $(function () { var downloadId = initialPageData.get("download_id"), diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/sso_inactivity.js b/corehq/apps/hqwebapp/static/hqwebapp/js/sso_inactivity.js index 97dbaa858996..246c5210c7ed 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/sso_inactivity.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/sso_inactivity.js @@ -1,4 +1,4 @@ -"use strict"; + /* * Handles communication about the status of SSO login after the inactivity * timer has requested a re-login diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/tempus_dominus.js b/corehq/apps/hqwebapp/static/hqwebapp/js/tempus_dominus.js index 18f0e5485531..c2e8acb75161 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/tempus_dominus.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/tempus_dominus.js @@ -1,4 +1,4 @@ -"use strict"; + /** * This replaces hqwebapp/js/daterangepicker.config, which is tied to bootstrap3 * @@ -14,7 +14,7 @@ hqDefine("hqwebapp/js/tempus_dominus", [ _, Popper, tempusDominus, - initialPageData + initialPageData, ) { // https://github.com/Eonasdan/tempus-dominus/discussions/2698 if (!window.USE_WEBPACK) { @@ -76,7 +76,7 @@ hqDefine("hqwebapp/js/tempus_dominus", [ localization: _.extend(defaultTranslations, { format: 'yyyy-MM-dd', }), - } + }, ); if (start && end) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/toggles.js b/corehq/apps/hqwebapp/static/hqwebapp/js/toggles.js index d408c5b36b37..534156a5ad82 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/toggles.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/toggles.js @@ -1,17 +1,17 @@ -"use strict"; + hqDefine('hqwebapp/js/toggles', [ 'underscore', 'hqwebapp/js/initial_page_data', ], function ( _, - initialPageData + initialPageData, ) { var genericToggleEnabled = function (allToggles, toggleName) { var value = allToggles[toggleName]; if (typeof value === 'undefined') { throw new Error( 'Toggle ' + toggleName + ' not recognized. Must be one of: \n\n' + - _.sortBy(_.keys(allToggles)).join("\n") + _.sortBy(_.keys(allToggles)).join("\n"), ); } return value; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox.js index 32d60c8b0552..86f7ed998b2a 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox.js @@ -1,10 +1,10 @@ -"use strict"; + hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox', [ 'jquery', 'hqwebapp/js/bootstrap3/main', ], function ( $, - hqMain + hqMain, ) { var module = {}; @@ -36,9 +36,9 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox', [ this.value = value; this.$edit_view.prop('checked', this.value); this.$noedit_view.removeClass( - this.value ? Checkbox.UNCHECKED : Checkbox.CHECKED + this.value ? Checkbox.UNCHECKED : Checkbox.CHECKED, ).addClass( - this.value ? Checkbox.CHECKED : Checkbox.UNCHECKED + this.value ? Checkbox.CHECKED : Checkbox.UNCHECKED, ); return this; } diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map.js index bf02fc35bc91..1055ed3f8b75 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map', [ 'jquery', 'underscore', @@ -8,7 +8,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map', [ $, _, hqMain, - DOMPurify + DOMPurify, ) { var module = {}; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input.js index 31fb28100d83..c4e411d53cb7 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input', [ 'jquery', 'hqwebapp/js/bootstrap3/main', @@ -6,7 +6,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input', [ ], function ( $, hqMain, - langcodeButton + langcodeButton, ) { var module = {}; @@ -59,7 +59,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input', [ this.ui.css("position", "relative"); var button = langcodeButton.new( $(''), - translated.lang + translated.lang, ); this.ui.append(button.button); this.setPlaceholderValue(translated.value); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list.js index cfa9cafbfdcb..3f935eb55b09 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list', [ 'jquery', 'underscore', @@ -8,7 +8,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list', [ $, _, hqMain, - uiInputMap + uiInputMap, ) { var module = {}; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-mapping.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-mapping.js index 89365cc19c89..22174e00b1b4 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-mapping.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-mapping.js @@ -1,4 +1,4 @@ -'use strict'; + /** Key-value mapping UI element. diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-select.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-select.js index 17048d84c5cf..6025a07fe57c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-select.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-select.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-select', [ 'jquery', 'underscore', @@ -6,7 +6,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-select', [ ], function ( $, _, - hqMain + hqMain, ) { var module = {}; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox.js index 8c01911fe01b..87b07af75336 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox.js @@ -1,10 +1,10 @@ -'use strict'; + hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox', [ 'jquery', 'hqwebapp/js/bootstrap5/main', ], function ( $, - hqMain + hqMain, ) { var module = {}; @@ -36,9 +36,9 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox', [ this.value = value; this.$edit_view.prop('checked', this.value); this.$noedit_view.removeClass( - this.value ? Checkbox.UNCHECKED : Checkbox.CHECKED + this.value ? Checkbox.UNCHECKED : Checkbox.CHECKED, ).addClass( - this.value ? Checkbox.CHECKED : Checkbox.UNCHECKED + this.value ? Checkbox.CHECKED : Checkbox.UNCHECKED, ); return this; } diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map.js index e2dea40700f6..2e3c19f1fe7e 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map', [ 'jquery', 'underscore', @@ -8,7 +8,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map', [ $, _, hqMain, - DOMPurify + DOMPurify, ) { var module = {}; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input.js index 0d69f66c7165..dbe54b86b4e0 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input', [ 'jquery', 'hqwebapp/js/bootstrap5/main', @@ -6,7 +6,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input', [ ], function ( $, hqMain, - langcodeButton + langcodeButton, ) { var module = {}; @@ -59,7 +59,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input', [ this.ui.css("position", "relative"); var button = langcodeButton.new( $(''), - translated.lang + translated.lang, ); this.ui.append(button.button); this.setPlaceholderValue(translated.value); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list.js index 4c9c8b75a161..8ba648860714 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list', [ 'jquery', 'underscore', @@ -8,7 +8,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list', [ $, _, hqMain, - uiInputMap + uiInputMap, ) { var module = {}; @@ -47,7 +47,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list', [ + '' + this.sub_title + '' - + '' + + '', ); var $modalEditor = $('
'), $modalBody = $('', ); _.each(['content', 'title', 'html', 'placement', 'container'], function (attr) { - $('a', el).data(attr, opts[attr]); @@ -39,7 +37,15 @@ }); if (wrap) { el.hqHelp(); -@@ -115,8 +117,6 @@ +@@ -101,6 +103,7 @@ + ko.virtualElements.allowedBindings.allowDescendantBindings = true; + + var initBlock = function ($elem) { ++ + $('.submit').click(function (e) { + var $form = $(this).closest('.form, form'), + data = $form.find('[name]').serialize(), +@@ -110,8 +113,6 @@ $.postGo(action, $.unparam(data)); }); @@ -48,8 +54,8 @@ $("input[type='text'], input[type='password'], textarea", $elem); $('.config', $elem).wrap('
').parent().addClass('container block ui-corner-all'); -@@ -129,7 +129,7 @@ - 'use strict'; +@@ -123,7 +124,7 @@ + var updateDOM = function (update) { var key; for (key in update) { - if (_.has(update, key)) { @@ -57,7 +63,7 @@ $(key).text(update[key]).val(update[key]); } } -@@ -161,7 +161,7 @@ +@@ -154,7 +155,7 @@ }).addClass(cssClass), $saving: $('
').text(SaveButton.message.SAVING).addClass('btn btn-primary disabled'), $saved: $('
').text(SaveButton.message.SAVED).addClass('btn btn-primary disabled'), @@ -66,7 +72,7 @@ setStateWhenReady: function (state) { if (this.state === 'saving') { this.nextState = state; -@@ -179,7 +179,7 @@ +@@ -172,7 +173,7 @@ this.$saved.detach(); this.$retry.detach(); var buttonUi = this.ui; @@ -75,7 +81,7 @@ buttonUi.removeClass(v); }); if (state === 'save') { -@@ -207,7 +207,7 @@ +@@ -200,7 +201,7 @@ $.ajaxSettings.beforeSend(jqXHR, settings); beforeSend.apply(this, arguments); }; @@ -84,7 +90,7 @@ that.setState(that.nextState); success.apply(this, arguments); }; -@@ -255,11 +255,9 @@ +@@ -248,11 +249,9 @@ $(window).on('beforeunload', function () { var lastParent = button.ui.parents()[button.ui.parents().length - 1]; if (lastParent) { @@ -94,11 +100,11 @@ - if ($('.js-unhide-on-unsaved').length > 0) { - $('.js-unhide-on-unsaved').removeClass('hide'); - } -+ if ($('.js-unhide-on-unsaved').length > 0) $('.js-unhide-on-unsaved').removeClass('hide'); ++ if ($('.js-unhide-on-unsaved').length > 0) {$('.js-unhide-on-unsaved').removeClass('hide');} return options.unsavedMessage || ""; } } -@@ -384,7 +382,12 @@ +@@ -376,7 +375,12 @@ $(window).on('beforeunload', beforeUnloadCallback); initBlock($("body")); @@ -112,7 +118,7 @@ $(document).on('click', '.track-usage-link', function (e) { var $link = $(e.currentTarget), -@@ -460,8 +463,13 @@ +@@ -452,8 +456,13 @@ // EULA modal var eulaCookie = "gdpr_rollout"; if (!$.cookie(eulaCookie)) { @@ -128,7 +134,7 @@ $("body").addClass("has-eula"); $("#eula-agree").click(function () { $(this).disableButton(); -@@ -469,7 +477,7 @@ +@@ -461,7 +470,7 @@ url: initialPageData.reverse("agree_to_eula"), method: "POST", success: function () { @@ -137,7 +143,7 @@ $("body").removeClass("has-eula"); }, error: function (xhr) { -@@ -485,21 +493,22 @@ +@@ -477,21 +486,22 @@ }, }); }); diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/mobile_experience_warning.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/mobile_experience_warning.js.diff.txt index f9a06bfadac4..3d81ce4bd06b 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/mobile_experience_warning.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/mobile_experience_warning.js.diff.txt @@ -1,7 +1,7 @@ --- +++ @@ -1,47 +1,47 @@ - 'use strict'; + -hqDefine('hqwebapp/js/bootstrap3/mobile_experience_warning', [ +hqDefine('hqwebapp/js/bootstrap5/mobile_experience_warning', [ "jquery", @@ -12,9 +12,8 @@ ], function ( $, initialPageData, -- kissmetrix -+ kissmetrix, -+ bootstrap + kissmetrix, ++ bootstrap, ) { $(function () { diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/sticky_tabs.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/sticky_tabs.js.diff.txt index ac0ebb20ea8a..06d308a39169 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/sticky_tabs.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/sticky_tabs.js.diff.txt @@ -10,8 +10,8 @@ - "bootstrap", // needed for $.tab + "es6!hqwebapp/js/bootstrap5_loader", // needed for $.tab ], function ( -- $ -+ $, bootstrap +- $, ++ $, bootstrap, ) { var getHash = function () { if (window.location.hash) { @@ -31,7 +31,7 @@ + tabController; + + // make sure we don't treat all anchor tags as a sticky tab -+ if ($tabFromUrl && $tabFromUrl.parents('.sticky-tabs').length === 0) return; ++ if ($tabFromUrl && $tabFromUrl.parents('.sticky-tabs').length === 0) {return;} if ($tabFromUrl && $tabFromUrl.length) { - $tabFromUrl.tab('show'); diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-checkbox.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-checkbox.js.diff.txt index f4fee0f8d1a1..4af3e0322b27 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-checkbox.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-checkbox.js.diff.txt @@ -1,13 +1,12 @@ --- +++ @@ -1,7 +1,7 @@ --"use strict"; + -hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox', [ -+'use strict'; +hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox', [ 'jquery', - 'hqwebapp/js/bootstrap3/main', + 'hqwebapp/js/bootstrap5/main', ], function ( $, - hqMain + hqMain, diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input-map.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input-map.js.diff.txt index d93b9e838810..212668e80385 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input-map.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input-map.js.diff.txt @@ -1,9 +1,8 @@ --- +++ @@ -1,8 +1,8 @@ --"use strict"; + -hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map', [ -+'use strict'; +hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map', [ 'jquery', 'underscore', diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input.js.diff.txt index 16f98f9209fd..987578aeb6fa 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input.js.diff.txt @@ -1,9 +1,8 @@ --- +++ @@ -1,7 +1,7 @@ --"use strict"; + -hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input', [ -+'use strict'; +hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input', [ 'jquery', - 'hqwebapp/js/bootstrap3/main', diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-key-val-list.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-key-val-list.js.diff.txt index 9c81f8641a2a..b74ba7c3ac51 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-key-val-list.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-key-val-list.js.diff.txt @@ -1,9 +1,8 @@ --- +++ @@ -1,9 +1,9 @@ --"use strict"; + -hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list', [ -+'use strict'; +hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list', [ 'jquery', 'underscore', @@ -47,7 +46,7 @@ + + '' + + this.sub_title + + '' -+ + '
' ++ + '
', + ); + var $modalEditor = $('
'), $modalBody = $('