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

Fix#3146 : Create a generic utility for filtering enums #5529

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

whyash8
Copy link

@whyash8 whyash8 commented Sep 6, 2024

This PR introduces a new utility function filterByEnumCondition to standardize filtering of enums across various parts of the oppia-android codebase. This utility function allows filtering of collections based on a condition applied to enum values.

Explanation

This PR introduces a new utility function filterByEnumCondition to standardize filtering of enums across various parts of the oppia-android codebase. This utility function allows filtering of collections based on a condition applied to enum values.

Key Changes:
Added Utility Function:
filterByEnumCondition: A generic function to filter a collection based on a condition applied to an enum extracted from each item in the collection.
Updated Existing Code:
Refactored code in getLeastRecentMetricLogIndex, getLeastRecentMediumPriorityEventIndex, and other methods to utilize the new filterByEnumCondition function.
Updated the calculation of completedChapterCount and inProgressChapterCount using the new utility function.
##Testing : Please help me to test the changes i have made . I have problems regarding that .

Essential Checklist

  • [ x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • [x ] Any changes to scripts/assets files have their rationale included in the PR explanation.
  • [x ] The PR follows the style guide.
  • [x ] The PR does not contain any unnecessary code changes from Android Studio (reference).
  • [ x] The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • [x ] The PR is assigned to the appropriate reviewers (reference).

…ring enums . I have changed the following files UserTypeitemsViewModel , PerformancemetricsController and TopicLessonsFragmentPresenter.The function i made is filterByEnumCondition - This function is used to filter thelist of items based on the enum condition.
@whyash8 whyash8 requested review from a team as code owners September 6, 2024 17:05
Copy link

github-actions bot commented Sep 6, 2024

Hi! @whyash8 Welcome to Oppia! Could you please follow the instructions here and sign the CLA Sheet to get started? You'll need to do this before we can accept your PR. Thanks!

@whyash8
Copy link
Author

whyash8 commented Sep 6, 2024

Please help me to make this PR work and review my changes.

@theMr17
Copy link
Collaborator

theMr17 commented Sep 7, 2024

Hi @whyash8, please make sure you have signed the CLA here - Individual CLA.

@whyash8
Copy link
Author

whyash8 commented Sep 7, 2024

I have signed the CLA !please help me to proceed further . thanks

@adhiamboperes
Copy link
Collaborator

Hi @whyash8, bazel tests are failing most likely because the new utility should be added as a dependency in app/BUILD.bazel.

To see the test failures, please read https://github.com/oppia/oppia-android/wiki/Static-Analysis-Checks#developer-video---understanding-ci-check-failures.

To fix the dependency problem, please look at the bazel file changes here for example: https://github.com/oppia/oppia-android/pull/5446/files

@whyash8
Copy link
Author

whyash8 commented Sep 18, 2024

I am building my oppia-android bazel in my ubuntu and i am getting this issue !! please help me to resolve it
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000600000000, 8589934592, 0) failed; error='Not enough space' (errno=12)
---8<---8<--- End of log ---8<---8<---
Target //:oppia failed to build

@adhiamboperes
Copy link
Collaborator

@theMr17, PTAL.

@theMr17
Copy link
Collaborator

theMr17 commented Sep 19, 2024

I am building my oppia-android bazel in my ubuntu and i am getting this issue !! please help me to resolve it OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000600000000, 8589934592, 0) failed; error='Not enough space' (errno=12) ---8<---8<--- End of log ---8<---8<--- Target //:oppia failed to build

@whyash8 This issue has been encountered before. Please refer to the latter part of the comment for more details: #4886 (comment).

Copy link

oppiabot bot commented Sep 26, 2024

Hi @whyash8, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Sep 26, 2024
@whyash8
Copy link
Author

whyash8 commented Sep 26, 2024

I have successfully build the bazel . But due to my university exams i will be able to continue after 3 days. Sorry for the inactivity.

@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Sep 26, 2024
Copy link

oppiabot bot commented Oct 3, 2024

Hi @whyash8, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Oct 3, 2024
@whyash8
Copy link
Author

whyash8 commented Oct 3, 2024

I am working on it!

@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Oct 3, 2024
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.

3 participants