When converting widgets to Glimmer and modernizing the plugin, there were some small leftovers.
status wasn’t tracked, so the UI didn’t update
raw_invitees should be camelCase now
custom_fields should be camelCase, and setting it was not working
Prior to this fix when computing the next event date we were resetting the status of every invitees. The status will now only be reset for non going users.
Following the key change in d31933bf49 this has been broken.
This commit also hides the section if `sort_categories_by_event_start_date_enabled` AND `disable_resorting_on_categories_enabled` are not enabled, prior to this change we would just show the title, with no checkbox to check.
This commit has 3 parts:
- Ensuring than when attempting to join a event we return an invitee even if the user was already part of the event, before we would return null which would have required a special handling. In this case we were just adding a null invitee.
- Ensures invitees/suggestedUsers/sampleInvitees use tracked properties correctly. And do not require to manually create a TrackedArray, the model should always handle this implementation detail.
- When joining an event we were pushing the watchingInvitee to the sampleInvitees even when the watchingInvitee was null, which would create an error.
This could happen during a server error for example. Ideally we should ensure the post event doesn't disappear on such error, but at least for now we avoid the crash.
Various events in the life of this plugin have caused an over complicated key and duplicated keys. This commits attempts to regroup everything related to discourse_post_event under a top level `discourse_post_event` key, removes the `event_ui` level as it's not very clear, technically everything is UI. And finally attempts to remove the duplicates.
Interested and not going are generally not used.
To avoid adding this clutter to the UI we now suppress this.
Sites wishing to have these buttons can amend the `event_participation_buttons` site setting
Also:
- Add a show participants button even if there are no participants (so admins can populate events)
- Fix localization for event participation
- Allow toggling attendance by pressing the same button
- Removes leave event button from the dropdown menu
- Refactors outlets to allow maximum flexibility
---------
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
This commit is making two major changes:
- Move all the post event widgets code to glimmer
- Implement tracked models to ensure reactivity, many paths didn't have real reactivity atm and were mostly working by luck or the fact that widgets re-render a lot
---------
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Previously event editors could remove people from an event but had no way
of acting on behalf of users in the event and adding them.
That meant that for events to properly show up in agenda and so on a user
must actively click a button.
In some cases (company ran events) the event manager may prefer controlling
attendance.
* FIX: shows category calendar on hot/latest
The previous URL parsing code was not resilient to these paths, we now use the router to recognize these paths and extract the params we need.
* linting
* Update category_calendar_spec.rb
This codepath was buggy when the title was ending with digits and moreover it's usefulness was debatable given post events support showing the date in the topic list; you shouldn't need to have the date in the title itself.