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/filter by associations #368

Merged
merged 7 commits into from
May 30, 2024
Merged

Conversation

Greenade
Copy link
Contributor

make it possible to filter by an association you follow through the dropdown menu in the search sheet

@Greenade Greenade added this to the Milestone 4 milestone May 30, 2024
@Greenade Greenade requested a review from srsingh04 May 30, 2024 09:28
@Greenade Greenade self-assigned this May 30, 2024
@Greenade Greenade force-pushed the feature/filter-by-associations branch from 268d62e to 27e3e31 Compare May 30, 2024 09:29
srsingh04
srsingh04 previously approved these changes May 30, 2024
Copy link
Contributor

@srsingh04 srsingh04 left a comment

Choose a reason for hiding this comment

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

Thank you for making the changes. Have added some minor suggestions for the code; ready to be merged nonetheless.

!_filtersContainer.value.classChecked ||
_semester.value == "" ||
event.tags.any { tag ->
tag.name.lowercase() == _semester.value.lowercase()
}
}
.filter { event ->
// filter by association
_selectedAssociation.value == -1 ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Knitpick: -1 can be defined as a private constant and then used here instead of directly using the value.

@@ -310,7 +332,8 @@ constructor(
* the default one, the search mode is on.
*/
private fun updateSearchMode() {
_searchMode.value = _filtersContainer.value != defaultFiltersContainer
_searchMode.value =
_filtersContainer.value != defaultFiltersContainer || _selectedAssociation.value != -1
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, the magic value -1 can be used in as a constant.

@Greenade Greenade force-pushed the feature/filter-by-associations branch from 6da05cf to 5ad9f78 Compare May 30, 2024 18:32
@Greenade Greenade enabled auto-merge (rebase) May 30, 2024 18:33
Copy link

@srsingh04 srsingh04 self-requested a review May 30, 2024 19:16
Copy link
Contributor

@srsingh04 srsingh04 left a comment

Choose a reason for hiding this comment

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

Nice! Thank you for the changes and explanations!

@srsingh04 srsingh04 self-requested a review May 30, 2024 19:16
Copy link
Contributor

@srsingh04 srsingh04 left a comment

Choose a reason for hiding this comment

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

Ready to be merged

@Greenade Greenade merged commit 8955b2e into main May 30, 2024
2 checks passed
@Greenade Greenade deleted the feature/filter-by-associations branch May 30, 2024 19:17
@Greenade Greenade linked an issue May 31, 2024 that may be closed by this pull request
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.

Filter the homescreen by association (to see an association events)
2 participants