Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[B5] Support for migrating report views to Bootstrap 5 #35648

Merged
merged 29 commits into from
Jan 29, 2025
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
92dad95
add utils for bootstrap 5 paths
biyeun May 13, 2024
1b593e9
add ability to set a report to use_bootstrap5
biyeun May 13, 2024
cef9291
pass use_bootstrap5 status to filters so the right template is chosen
biyeun May 13, 2024
eeb8ca5
create utility to get filter class individually
biyeun Jan 21, 2025
850fa06
B5: add report debug tools and way to track completion
biyeun May 13, 2024
9cca827
update bootstrap 5 migration guide for migrating report views
biyeun May 13, 2024
bb6a172
datatables_config (B5) - update how datatables gets imported
biyeun Jan 20, 2025
74f5f6d
update datatables_config (B5) to work with datatables 1.10+
biyeun Jan 20, 2025
a357483
loading template no longer supported in datatables 1.10+
biyeun Jan 20, 2025
b57aa60
add todo about custom sort for future investigation
biyeun Jan 20, 2025
a859093
update how reports handles datatables server side params after 1.10
biyeun Jan 8, 2025
3ff68d0
update the data returned by reports view to datatables
biyeun May 13, 2024
6997dfc
update how sorting block in generated for datatables > 1.10
biyeun May 13, 2024
2196bc7
update request parameter fetching for reports using Datatables 1.10+
biyeun Jan 13, 2025
34b094d
Merge branch 'master' of github.com:dimagi/commcare-hq into bmb/b5-re…
biyeun Jan 28, 2025
691d460
update method name to be clearer
biyeun Jan 28, 2025
b564d74
use get_bootstrap5_path on class variables that were missed
biyeun Jan 28, 2025
8070d78
fix typo: progres > progress
biyeun Jan 28, 2025
51da542
fix typo: list OF filters
biyeun Jan 28, 2025
836c7e6
removing client-side custom sort overrides because datatables 1.10+ s…
biyeun Jan 28, 2025
4ce3d85
add todo note aobut request_params versus request.GET
biyeun Jan 28, 2025
dd18ef4
split 'reports/async/basic.html' to bootstrap 3 and bootstrap 5 versions
biyeun Jan 28, 2025
4820131
update bootstrap3 path to bootstrap 5 in reports/async/bootstrap5/bas…
biyeun Jan 28, 2025
b356d1e
switch between default_path templates for bootstrap 3 and 5 reports
biyeun Jan 28, 2025
079d6a1
make sure DataTablesColumn has a bootstrap 5 version
biyeun Jan 28, 2025
3362e88
migrate bootstrap 5 template for DataTablesColumn
biyeun Jan 28, 2025
73ef95a
update sorting block to reference DataTablesColumn instance, as original
biyeun Jan 28, 2025
ca9c100
add column and sort checks to debug and completion tool
biyeun Jan 28, 2025
7cca4df
"Bootstrap 5 Migration - Rebuilt diffs"
biyeun Jan 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions corehq/apps/reports/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,19 @@ def _sanitize_col(col):
return col


def get_filter_class(field, failhard=False):
if isinstance(field, str):
klass = to_function(field, failhard=failhard)
else:
klass = field
return klass
Comment on lines +71 to +76
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that field is currently only either a string or a class? If so, the parameter name field seems a bit misleading. Just making sure that we don't need to catch the possibility of field being something else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's called field in the method it was extracted from. It only has that one use case, and the use case in our debug tools. no we don't need to catch other possibilities



def get_filter_classes(fields, request, domain, timezone, use_bootstrap5=False):
filters = []
fields = fields
for field in fields or []:
if isinstance(field, str):
klass = to_function(field, failhard=True)
else:
klass = field
klass = get_filter_class(field, failhard=True)
filters.append(
klass(request, domain, timezone, use_bootstrap5=use_bootstrap5)
)
Expand Down