Skip to content

Conversation

@henrikmv
Copy link
Contributor

@henrikmv henrikmv commented Aug 1, 2025

DHIS2-18904

This pull request introduces support for empty value filtering in working list filters. It adds UI elements for users to filter for empty or non-empty values, and ensures correct conversion between client and API representations for these filters.

  • Added the emptyValueFilter feature flag and set its minimum supported version.

  • Added EmptyValueFilterCheckboxes component and supporting helpers to allow users to filter text fields by empty or non-empty values.

  • Updated conversion helpers to translate empty value filters between client and API formats for both Event and Tracker working lists.

  • Refined the text input handling to better manage Enter key events and value updates.

Note: The task has been split into two tickets to simplify implementation and review: one for creating the reusable "No value" component and applying it to the text filter, and another for extending it to other filter types.

@henrikmv henrikmv changed the title feat: [18904] Working List Filter for null and not null Values feat: [18904] Working List Filter component for null and not null Values Aug 1, 2025
@henrikmv henrikmv marked this pull request as ready for review August 1, 2025 14:49
@henrikmv henrikmv requested a review from a team as a code owner August 1, 2025 14:49
Copy link
Contributor

@simonadomnisoru simonadomnisoru left a comment

Choose a reason for hiding this comment

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

Hi @henrikmv. This is a great start, and it's good that you already separated the TEXT filter from the more complex ones 👍 . There are some other things that come to mind that we need to consider:

  • We should include a toggle feature to only display the null filter starting from version 2.42.
  • When a null filter is applied, the user should be able to save it via a POST request to the following three endpoints: /trackedEntityInstanceFilters, /programStageWorkingLists, and /eventFilters
  • When a null filter is applied, the user should also be able to update it via a PUT request to the same three endpoints.
  • When a stored WL containing a null filter is selected by the user, it should be loaded (GET request from the three endpoints mentioned above) and then applied to all three WL types.

@simonadomnisoru
Copy link
Contributor

Hi @henrikmv. Looks like we're heading in the right direction 👏 ! There are just a few more things I think we should look into:

  • Could we add Cypress test scenarios for this feature?
  • For the UI behavior: should the filter be applied immediately when the checkbox is clicked, or should the user explicitly click the Update button? (From a performance standpoint, how expensive is the !null filter in the backend? I have a feeling it could be fairly costly 🤔)
  • After refreshing the page, a stored working list containing a not null filter isn't being applied correctly. In Tracker WLs, it fails to load properly, and in Event WLs, a runtime error occurs. More details in the video below:
    https://github.com/user-attachments/assets/7e0eede6-baf3-4830-94f8-6217dc9ed1f8

Thanks!

@henrikmv henrikmv requested a review from JoakimSM August 15, 2025 10:05
Copy link
Contributor

@simonadomnisoru simonadomnisoru left a comment

Choose a reason for hiding this comment

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

Great progress on this feature, everything is working well now 👏 ! I’ve added a few small suggestions to improve the structure of the EmptyValue folder. Apart from that, do you think it would be relevant to add Cypress tests for this feature?

@henrikmv
Copy link
Contributor Author

Hi @simonadomnisoru, thanks for the review! The Cypress test will be implemented in https://dhis2.atlassian.net/browse/DHIS2-19972.

@github-actions
Copy link

github-actions bot commented Sep 2, 2025

Copy link
Contributor

@simonadomnisoru simonadomnisoru left a comment

Choose a reason for hiding this comment

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

Good job! 👏

@henrikmv henrikmv added testing and removed testing labels Sep 18, 2025
@henrikmv henrikmv added testing and removed testing labels Oct 15, 2025
@henrikmv henrikmv added testing and removed testing labels Oct 16, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 New issues
2 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@henrikmv henrikmv merged commit aea03d7 into master Oct 17, 2025
40 of 41 checks passed
@henrikmv henrikmv deleted the hv/feat/DHIS2-18904_AddNoValueToFilters branch October 17, 2025 06:42
dhis2-bot added a commit that referenced this pull request Oct 17, 2025
# [104.2.0](v104.1.2...v104.2.0) (2025-10-17)

### Features

* [18904] Working List Filter component for `null` and `not null` Values ([#4270](#4270)) ([aea03d7](aea03d7))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 104.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants