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

Add event_type field to Events, and render tag in Event cards #2366

Merged
merged 3 commits into from
Apr 30, 2024

Conversation

csaltachin
Copy link
Contributor

@csaltachin csaltachin commented Apr 20, 2024

Addresses #2361. This PR:

  • adds a new event_type field to the types t and RecurringEvent.t (and their respective metadata types) in tool/ood-gen/lib/event.ml,
  • updates the Event module signature in src/ocamlorg_data/data.mli,
  • adds an event_type value to the entries in data/events/recurring.yml and the data/events/*.md files, and
  • makes a first attempt at rendering a tag in Event cards (for both upcoming and recurring events) on the Events page:
    (expand image)

Some notes:

  • Entries in recurring.yml must always specify an event_type value. *.md files can omit them, but only if they have a linked recurring event.
  • An upcoming event's event_type value is populated from either its *.md metadata, or its linked recurring event (if there is one). If these two sources specify different event types, or if neither specifies one, it is an error (and an exception is raised in tool/ood-gen/lib/event.ml when that happens).
  • The event type tags in src/ocamlorg_frontend/pages/events.eml use the tag colors from the Community pages design draft.
  • Do we also want to render these tags in other pages, e.g. the Upcoming Events section of the Community landing page?

- For a recurring event, we use the event_type value from its YAML
  entry.
- For an upcoming event, we use either the event_type value from its MD
  metadata, or the value from its linked recurring event (if any). If
  neither specifies an event type, or if they specify different types,
  we throw.
Copy link
Collaborator

@sabine sabine left a comment

Choose a reason for hiding this comment

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

Hey @csaltachin, this is awesome! Literally no suggestions for improvements here. ✨ ❤️

On the question of whether we want to render the tags on other pages as well that display events: Yes, I think we do want to consolidate the event card to be a component that is used in different places. It can be a different PR because I am merging this here just now!

@sabine sabine merged commit 6d320bb into ocaml:main Apr 30, 2024
3 checks passed
@csaltachin csaltachin deleted the add-event-type branch May 22, 2024 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants