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

Feature/add filter by text value feature #1

Merged
merged 11 commits into from
Jul 17, 2020

Conversation

xurxodev
Copy link

@xurxodev xurxodev commented Nov 26, 2019

📌 References

⚙️ branches

app:
Origin: feature/add_filter_by_text_value_feature Target: 2.0.0_beta
dhis2-android-SDK:
Origin: 056d6e33d3204f8514bf438bc3af6876feeb9a4e
dhis2-rule-engine:
Origin: master

🎩 What is the goal?

Add a filter by value (only for text data elements).

📝 How is it being implemented?

  • I have not modified the SDK, I have create previously a query by value against directly the database in ProgramEventDetailRepository and then I have concatenated byUid filter to old filters.
  • I have added a new method in this repository to retrieve text data elements by program.
  • I have modified related to filters presentation classes (FilterManager, presenter, activities, fragments, adapters, layouts) to add filter by value

Note: Filters is for all screens because the FilterManager is a singleton. But the value filter for the moment is only for program events, then filter value is cleared when you navigate to the previous screen.

For success build It's neccessary add this build gradle to dhis2-rule-engine:

apply plugin: 'java'

dependencies {
    testImplementation 'junit:junit:4.12'
    testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.11.1'
    testImplementation group: 'org.mockito', name: 'mockito-all', version: '1.8.4'
    testImplementation "com.google.truth:truth:0.44"
    testImplementation group: 'nl.jqno.equalsverifier', name: 'equalsverifier', version: '3.1.9'

    implementation 'com.google.code.findbugs:jsr305:3.0.2'
    implementation 'com.google.guava:guava:24.1-android'
    compileOnly "com.google.auto.value:auto-value:1.5.2"
    annotationProcessor "com.google.auto.value:auto-value:1.5.2"
    implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1'
    implementation group: 'commons-logging', name: 'commons-logging', version: '1.2'
    implementation group: 'org.apache.commons', name: 'commons-jexl', version: '2.1.1'
}

💥 How can it be tested?

Use case 1: - Navigate to events for program Yaws - case register (Yaws/003) then create value filter and should work and increment text value filter counter and general filter counter.
Use case 2: - When you navigate back to the first screen, the value filter should be cleared
Use case 3: - When you have all filters and click on clear filters, the value filter should be cleared like the rest.
Use case 3: - When you have a text value filter and remove the text, the filter counters should be cleared.

💾 Requires DB migration?

  • Nope, we can just merge this branch.
  • Yes, but we need to apply it before merging this branch.
  • Yes, it's already applied.

🎨 UI changes?

  • Nope, the UI remains as beautiful as it was before!
  • Yeap, here you have some screenshots-

device-2019-11-26-071146

xurxodev pushed a commit that referenced this pull request Mar 16, 2020
ifoche pushed a commit that referenced this pull request May 27, 2020
Copy link
Member

@ifoche ifoche left a comment

Choose a reason for hiding this comment

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

thanks @xurxodev

@ifoche ifoche merged commit 7eac1fb into 2.0.0_beta Jul 17, 2020
@ifoche ifoche deleted the feature/add_filter_by_text_value_feature branch July 17, 2020 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants