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 [Event Creation/Edition] Add possibility to add types to events #318

Merged
merged 26 commits into from
Dec 18, 2024

Conversation

AlouchLaBouche
Copy link
Collaborator

This PR adds the possibility to add types to events ! This can be done during the Event creation process or when you edit an Event. This feature is reminiscent of the user interests, as they serve practically the same purpose, but for two different objects.
This Feature is especially useful as it is necessary to add event types for the custom recommendation algorithm to work (Which will function on the basis of matching interests and types to compute a score for each event in regard to each user and then sorting the list of events).

Therefore this PR adds:

  • A couple of new Interests for the user to choose from.
  • Multiple new Event Types.
  • The possibility to add/modify event types for each event (this was previously impossible).
  • UI tests to ensure functionality.

AlouchLaBouche and others added 25 commits December 11, 2024 10:39
@AlouchLaBouche AlouchLaBouche marked this pull request as ready for review December 18, 2024 19:32
Copy link
Collaborator

@oskar-codes oskar-codes left a comment

Choose a reason for hiding this comment

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

Phenomenal pull requests, your contributions are exemplary, keep it up 🚀

Comment on lines +78 to +104
enum class EventType(val color: Color, val text: Int) {
FESTIVAL(EventColors.Festival, R.string.event_type_festival), // + Music and Festivals
APERITIF(EventColors.Aperitif, R.string.event_type_aperitif), // + Food and Apéro
NIGHT_PARTY(EventColors.NightParty, R.string.event_type_night_party), // + Music and Festivals
JAM(EventColors.Jam, R.string.event_type_jam), // + Music and Art
NETWORKING(EventColors.Networking, R.string.event_type_networking), // + Apéro and Networking
SPORT_TOURNAMENT(EventColors.SportTournament, R.string.event_type_sport_tournament), // + Sports
SPORT_DISCOVERY(
EventColors.SportDiscovery, R.string.event_type_sport_discovery), // + Sports, Socialising
TRIP(EventColors.Trip, R.string.event_type_trip), // + Travel, Culture
LAN(EventColors.Lan, R.string.event_type_lan), // + Gaming
FILM_PROJECTION(
EventColors.FilmProjection, R.string.event_type_film_projection), // + Art, Culture
FOREIGN_CULTURE_DISCOVERY(
EventColors.ForeignCultureDiscovery,
R.string.event_type_foreign_culture_discovery), // + Culture, Literature
TECH_PRESENTATION(
EventColors.TechPresentation, R.string.event_type_tech_presentation), // + Tech, Science
SCIENCE_FARE(EventColors.ScienceFare, R.string.event_type_science_fare), // + Science, Tech
FOOD_DISTRIBUTION(EventColors.FoodDistribution, R.string.event_type_food_distribuition), // + Food
ART_CONVENTION(
EventColors.ArtConvention, R.string.event_type_art_convention), // + Art, Literature
MANIFESTATION(
EventColors.Manifestation, R.string.event_type_manifestation), // + Culture, Socialising
BOARD_GAMES(EventColors.BoardGames, R.string.event_type_board_games), // + Gaming, Socialising
GROUP_STUDY(EventColors.GroupStudy, R.string.event_type_group_study), // + Science, Tech
OTHER(EventColors.Other, R.string.event_type_other)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great work on extracting these strings, it's much appreciated

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, for my own understanding, what do the comments indicate ? Is it the associated user interests ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need to remove them, but yes it is the "potential matches" with the user interests that can be used with the custom recommendation system

Comment on lines -182 to 184
fun AssociationChips(
associations: List<Pair<Association, MutableState<Boolean>>>,
fun <T> Chips(
items: List<Pair<T, MutableState<Boolean>>>,
getName: (T) -> String,
) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very clever use of genericity, well done 🚀

EventTypeOverlayRow(
pair,
onChange = {
isError.value = copiedTypes.count({ it.second.value }) > 3
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider extracting the value 3 into a constant to make the code more understandable and maintainable.

Copy link
Collaborator Author

@AlouchLaBouche AlouchLaBouche Dec 18, 2024

Choose a reason for hiding this comment

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

never (i'll do it as a Chrismas present)

HorizontalDivider(
modifier =
Modifier.testTag(
EventTypeOverlayTestTags.DIVIDER + "$index"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can replace this by the shorter:

EventTypeOverlayTestTags.DIVIDER + index

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good spot !

@AlouchLaBouche AlouchLaBouche merged commit 701b1cc into main Dec 18, 2024
3 checks passed
@AlouchLaBouche AlouchLaBouche deleted the feature/event_types branch December 18, 2024 20:49
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