Skip to content

Commit

Permalink
"Bootstrap 5 Migration - Rebuilt diffs"
Browse files Browse the repository at this point in the history
  • Loading branch information
biyeun committed Jan 22, 2025
1 parent 4845ebf commit 92e5677
Show file tree
Hide file tree
Showing 3 changed files with 938 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,83 @@
---
+++
@@ -1,8 +1,8 @@
@@ -1,45 +1,41 @@
-hqDefine("reports/js/bootstrap3/base", [
+hqDefine("reports/js/bootstrap5/base", [
'jquery',
'hqwebapp/js/initial_page_data',
- 'jquery',
- 'hqwebapp/js/initial_page_data',
- 'reports/js/filters/bootstrap3/main',
- 'reports/js/bootstrap3/report_config_models',
+ 'reports/js/filters/bootstrap5/main',
+ 'reports/js/bootstrap5/report_config_models',
'reports/js/bootstrap3/tabular',
'commcarehq',
], function (
@@ -36,7 +36,7 @@
reportConfigsView.setConfigBeingViewed(reportConfigModels.reportConfig(defaultConfig));
}
- 'reports/js/bootstrap3/tabular',
- 'commcarehq',
-], function (
- $,
- initialPageData,
- filtersMain,
- reportConfigModels
-) {
- $(function () {
- filtersMain.init();
+import 'commcarehq';

- var defaultConfig = initialPageData.get('default_config') || {};
- if (initialPageData.get('has_datespan')) {
- defaultConfig.date_range = 'last7';
- } else {
- defaultConfig.date_range = null;
- }
- defaultConfig.has_ucr_datespan = false;
- defaultConfig.datespan_filters = [];
- defaultConfig.datespan_slug = null;
+import $ from 'jquery';

- var $savedReports = $("#savedReports");
- if ($savedReports.length) {
- var reportConfigsView = reportConfigModels.reportConfigsViewModel({
- filterForm: $("#reportFilters"),
- items: initialPageData.get('report_configs'),
- defaultItem: defaultConfig,
- saveUrl: initialPageData.reverse("add_report_config"),
- });
- $savedReports.koApplyBindings(reportConfigsView);
- reportConfigsView.setConfigBeingViewed(reportConfigModels.reportConfig(defaultConfig));
- }
+import initialPageData from 'hqwebapp/js/initial_page_data';
+import filtersMain from 'reports/js/filters/bootstrap5/main';
+import reportConfigModels from 'reports/js/bootstrap5/report_config_models';

- $('#email-enabled').tooltip({
+ $('#email-enabled').tooltip({ /* todo B5: plugin:tooltip */
placement: 'right',
html: true,
title: gettext("You can email a saved version<br />of this report."),
- placement: 'right',
- html: true,
- title: gettext("You can email a saved version<br />of this report."),
+import 'reports/js/bootstrap3/tabular';
+
+$(function () {
+ filtersMain.init();
+
+ var defaultConfig = initialPageData.get('default_config') || {};
+ if (initialPageData.get('has_datespan')) {
+ defaultConfig.date_range = 'last7';
+ } else {
+ defaultConfig.date_range = null;
+ }
+ defaultConfig.has_ucr_datespan = false;
+ defaultConfig.datespan_filters = [];
+ defaultConfig.datespan_slug = null;
+
+ var $savedReports = $("#savedReports");
+ if ($savedReports.length) {
+ var reportConfigsView = reportConfigModels.reportConfigsViewModel({
+ filterForm: $("#reportFilters"),
+ items: initialPageData.get('report_configs'),
+ defaultItem: defaultConfig,
+ saveUrl: initialPageData.reverse("add_report_config"),
});
+ $savedReports.koApplyBindings(reportConfigsView);
+ reportConfigsView.setConfigBeingViewed(reportConfigModels.reportConfig(defaultConfig));
+ }
+
+ $('#email-enabled').tooltip({ /* todo B5: plugin:tooltip */
+ placement: 'right',
+ html: true,
+ title: gettext("You can email a saved version<br />of this report."),
});
});
Loading

0 comments on commit 92e5677

Please sign in to comment.