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

[Data Cleaning] Add row + page selection state frontend #36120

Merged
merged 9 commits into from
Apr 1, 2025

Conversation

biyeun
Copy link
Member

@biyeun biyeun commented Mar 31, 2025

Technical Summary

review commit-by-commit please

This PR introduces the DataCleaningHtmxSelectionColumn, a subclass of CheckBoxColumn, which handles display of the selection checkbox in the data cleaning table view.

NOTE: There are several #todo placeholders in this PR where I will eventually add the backend logic to retrieve and update the actual BulkEditSession selected record(s) state by updating the related BulkEditRecord objects.

Additionally, I introduce the client-side selection state logic, maintained through an alpine model.

Single record selection, updating the row styling:
Screenshot 2025-03-31 at 8 34 31 PM

All record selection, updating the selection state of the header checkbox:
Screenshot 2025-03-31 at 8 34 00 PM
note: this PR does not include the functionality for clicking on the header checkbox to select all records on the page.

Related JIRA ticket

https://dimagi.atlassian.net/browse/SAAS-16863

Feature Flag

DATA_CLEANING_CASES

Safety Assurance

Safety story

only affects logic behind a feature flag. no production workflows are affected

Automated test coverage

most important logic is already tested

QA Plan

not yet

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@biyeun biyeun added the product/feature-flag Change will only affect users who have a specific feature flag enabled label Mar 31, 2025
{% if is_checked %}
checked="checked"
{% endif %}
name="selected_record"
Copy link
Contributor

Choose a reason for hiding this comment

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

I had thought this would be selected_case based on the previous commit. Is this overwriting selected_case?

Why do these checkboxes even need names?

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 is overriding it...I missed that. it should be {{column.name}}, i'll update that in the later commits.
the reason they need names...you shall soon see :) the select page action will gather the list of ids on that page using this name

Copy link
Member Author

Choose a reason for hiding this comment

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

ok turns out I don't want to use column.name, but the other commit is a bugfix if someone wants to use CaseSearchElasticRecord with the default CheckBoxColumn. It will throw an error without this.

Copy link
Contributor

Choose a reason for hiding this comment

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

aha, got it

id="{{ css_id }}"
class="form-check-input"
type="checkbox"
name="select_page"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: You might name this selected_page to better match selected_record and selected_case.

@biyeun biyeun merged commit 891cc20 into master Apr 1, 2025
14 checks passed
@biyeun biyeun deleted the bmb/dc/select-checkbox-column branch April 1, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product/feature-flag Change will only affect users who have a specific feature flag enabled
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants