Commit Graph

241 Commits

Author SHA1 Message Date
Loïc Guitaut 764e3061f5 DEV: Make specs compatible with upcoming Rails 8 upgrade
Rails 8 changes a bit how are handled time objects. When rendering them
to a string, they now always include their timezone even for UTC.
2025-07-08 15:26:10 +02:00
Renato Atilio b1ace0a19d
DEV: adjust tests to use d-menu toolbar options menu (#752) 2025-07-03 09:57:20 +10:00
Joffrey JAFFEUX d878317c5f
UX: displays event local time in calendar (#757) 2025-07-02 13:38:09 +02:00
Sam 35b70ace7e
DEV: skip flakey spec (#760) 2025-06-27 15:29:46 +10:00
Sam bdf8869a01
FEATURE: Add event location/description and "My Events" filter (#746)
This pull request introduces two major new features to the calendar plugin: the ability to add a location/description to an event, and a new "My Events" view on the upcoming events page.

### Event Location

You can now add a `location` to an event. This is a free-text field that can be used for a physical address, a URL, or any other location details.

*   A `location` field has been added to the event builder modal.
*   The location is displayed in the event details in the post, complete with a new "location-pin" icon. URLs within the location field are automatically linked.
*   This is supported by a database migration to add the `location` column, and updates to the event model, serializer, and parser.

### Event description 

You can now add a `description ` to an event. This is a free-text field that can be used to describe your event.

*   A `description` field has been added to the event builder modal.
*   The description  is displayed in the event details in the post, complete with a new "circle-info" icon. URLs within the location field are automatically linked. It supports linebreaks.
*   This is supported by a database migration to add the `description` column, and updates to the event model, serializer, and parser.

### "My Events" Filter

The `/upcoming-events` page now includes tabs to switch between "All events" and "My events".

*   The "My events" tab shows all upcoming events that the current user is "Going" to.
*   This creates a personalized calendar for users to easily see their own upcoming schedule.
*   A new `/upcoming-events/mine` route has been added, and the backend event finder now supports filtering by an `attending_user`.


### Other Improvements

*   The calendar view on the `/upcoming-events` page now defaults to a "list" view on mobile for a better experience.
*   The "Open Event" and "Close Event" actions now have a disabled/saving state to provide better feedback during the operation.
*   System tests have been added to cover the new functionality.
2025-06-25 10:20:38 +02:00
Sam 19f33f8ea9
FIX: account for local times when rendering blocks (#742)
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-06-10 18:07:14 +02:00
Joffrey JAFFEUX ae015fd694
FEATURE: show local timezone (#735)
When set to true `showLocalTime` will display the event dates using the timezone of the event. It's useful for local events and you have people looking at this event from a different timezone.

![Screenshot 2025-06-02 at 21 51 20](https://github.com/user-attachments/assets/cce939a0-37b6-4ad7-8688-21b25d360090)
2025-06-02 22:52:27 +02:00
Joffrey JAFFEUX 426c855e75
FIX: prevents double event and uses correct starts_at (#736)
- we were not applying the timezone for the list of upcoming events
- we would return the first event + the upcoming events, we now get all the events generate by RRule if this is a recurring event, and if it's not a recurring event we just return the event, instead of doing a dance where we would remove the first event from RRule but prepend the initial event on the frontend
2025-06-02 21:01:49 +02:00
Joffrey JAFFEUX f3d1143e42
FEATURE: support for recurrence_until (#730)
This parameter allows to define the end of the recurrence of an event. For example you can now define an event as every week on Monday, until the 12th of December 2028.

![Screenshot 2025-06-02 at 13 39 42](https://github.com/user-attachments/assets/2247c12a-1fdd-42b9-b015-e622148f2dc0)
2025-06-02 13:41:52 +02:00
David Taylor d471bbdf9a
DEV: Convert group timezones from widgets to glimmer (#731)
Also introduces a basic system spec for the feature (previously there was no test coverage of the frontend at all)
2025-05-28 11:36:13 +01:00
Sam 8152a0ca7c
FEATURE: optional attached chat channel for event (#728)
This defines a feature where event creators can opt for an associated chat channel
creation.

This is a staff only feature for now.

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-05-28 16:13:33 +10:00
Krzysztof Kotlarek 42d6ccf44d
FIX: allow create events for everyone group (#726)
When `discourse_post_event_allowed_on_groups` is set to `everyone`, everyone should be able to create post events.
2025-05-02 15:47:21 +08:00
Joffrey JAFFEUX 89a90d892f
DEV: fill in doesnt trigger key down/up/press events (#724)
This won't work in the future for playwright.
2025-04-25 18:27:04 +02:00
Joffrey JAFFEUX f874383526
DEV: ensures we are on correct page (#723)
Playwright will not accept this kind of specs as it's not reliable. You would potentially get this error:

```
     Playwright::Error:
       Element is not attached to the DOM
       Call log:
         - attempting click action
         -     - waiting for element to be visible, enabled and stable
```

What happens is that the ".nav-item_latest" would be present before navigation, and playwright would find it just before the page has loaded, the click though might happen right after page transition and the initial element wouldn't be attached to the dom anymore.
2025-04-25 17:21:19 +02:00
Loïc Guitaut 90313ae82a
DEV: Add system spec to check core features are working fine (#713) 2025-04-09 14:21:34 +02:00
David Taylor b023c4d2f2
DEV: Update spec in preparation for dropping glimmer_topic_list_mode (#714) 2025-04-03 15:50:08 +01:00
Alan Guo Xiang Tan 7674040f4f
DEV: Fix flaky test (#711)
When asserting against the database, we have to consider that
asynchronous nature of system test.
2025-03-28 16:42:09 +08:00
Juan David Martínez Cubillos 3d6b7ae482
DEV: Allow the 'UpcomingEventsCalendar' Component to be used outside of the 'PostEventUpcomingEventsIndexRoute' route (#706)
* DEV: Allow the 'UpcomingEventsCalendar' Component to be used outside of the 'PostEventUpcomingEventsIndexRoute' route

* add system test to upcoming events

* improved addRecurrentEvents function

* fixed flaky test
2025-03-25 10:31:57 -05:00
Alan Guo Xiang Tan 1c61e4324f
PERF: Fix N+1 problem on `DiscoursePostEvent::EventsController#index` (#698) 2025-03-10 15:27:55 +08:00
Arpit Jalan ece387e429
FIX: do not show 'send pm' button to the user who created the event (#690) 2025-02-12 18:31:59 +05:30
Bianca Nenciu 72aa6e1a9b
FIX: Allow events belonging to deleted users to be destroyed (#688)
`DiscourseCalendar::CreateHolidayEvents` periodically deletes holiday
events to recreate updated ones. If one of the events belonged to a user
that has been destroyed and if `enable_user_status` was enabled, the
`after_destroy` hook would raise an exception.
2025-02-10 19:16:27 +02:00
Jordan Vidrine 3007975b95
UX: Do not show participants in admin drop down menu for standalone events (#679) 2025-01-14 19:28:06 -06:00
David Taylor 0d13b05695
DEV: Force enable glimmer topic list in specs (#670)
Otherwise it'll fail if some other incompatible plugin is installed at the same time
2024-12-19 17:30:31 +00:00
David Taylor 602db39265
DEV: Update specs for core change (#669)
https://github.com/discourse/discourse/pull/30375
2024-12-19 17:17:41 +00:00
Joffrey JAFFEUX df7e7a9098
FIX: ensures bulk-invite is working properly (#666)
There was two bugs:
- naming of properties were incorrect s/is_private/isPrivate and s/is_public/isPublic
- a previous refactoring has used `=` for setter when it's an `EmberObject` and `set` should be used

This commit also adds a spec and page objects to ensure this modal is working as expected.
2024-12-10 14:57:46 +01:00
Jordan Vidrine 725ae51373
UX: Events UI Edits (#641)
This PR restyles the current events post UI:

Minimize size of invitee avatars
move CTA buttons to bottom
remove invitee header & show more button (show more is in ellipses drop down)
restyle border
restyle month & date size & spacing
increase font size for title
add "0 going" placeholder to prevent jumpiness when invitees are rendered

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2024-12-03 18:34:34 +01:00
Jarek Radosz 026d755c78
DEV: Use `topic-list-header-sortable-column` transformer (#651) 2024-12-02 14:40:53 +01:00
Alan Guo Xiang Tan a6d940770a
DEV: Bump rubocop-discourse to 3.8.0 (#643)
This commit resolves all `Lint/OrAssignmentToConstant` cop violations.
2024-11-15 06:43:27 +08:00
Renato Atilio b2fb2e4efc
FIX: regressions from modernization (#642)
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
2024-11-07 10:56:21 -03:00
Joffrey JAFFEUX 557d00b886
FEATURE: keeps going invitees for recurring events (#632)
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.
2024-10-25 09:23:16 +09:00
Joffrey JAFFEUX d31933bf49
DEV: moves translatations under discourse_post_event (#627)
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.
2024-10-23 14:06:09 +11:00
Joffrey JAFFEUX ee693e33b0
FIX: correctly render html of event title (#623)
This has been lost during the move to glimmer.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2024-10-22 23:18:15 +09:00
Joffrey JAFFEUX b4c4e4e0bc
DEV: migrate post event to glimmer (#615)
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>
2024-10-22 12:38:40 +09:00
Sam 647ba1ca7f
FEATURE: allow event editors to control list of users on the event (#614)
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.
2024-10-14 08:59:23 +11:00
Joffrey JAFFEUX 499f29a2a0
FIX: shows category calendar on hot/latest (#611)
* 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
2024-10-10 17:00:14 +11:00
Penar Musaraj 40d4c65efd
DEV: fix flakey post event spec (#596) 2024-08-08 15:44:22 -04:00
Régis Hanol 20a9fe4a39
FIX: BBCode parsing specs (#575)
Requires discourse/discourse#27173 to be merged.

Will add a `.discourse-compatibility` once merged.
2024-06-18 11:53:10 +02:00
Régis Hanol 62d7fffb5a
FIX: delete future holidays on region change (#571)
When a user changes their holiday region in their profile, we will automatically compute upcoming (6 months) holidays for their new regions. If the events are similar between the two regions, we automatically fix the region. But when they're drastically different, we just leaves the old holiday events be...

It's a somewhat rare event but is annoying enough that it warranted a proper fix.

This ensures we removes any "pre-loaded" holiday events that aren't in the regions the users have selected. That way, no more "fanthom" holidays from the previous region.

Internal ref - t/64785
2024-05-21 16:46:07 +02:00
Régis Hanol acb0681ff9
FEATURE: closed events (#564)
Adds support for "closed" events instead of just relying on the start & end dates.

An event might now be "expired" when it happened in the past.

An event might now also be "closed", if for whatever reasons, the author decides to "cancel" it.

Context - https://meta.discourse.org/t/when-closing-event-it-moves-it-to-todays-date-time/307292
2024-05-14 10:12:47 +02:00
Loïc Guitaut 665d35f914 DEV: Fix new Rubocop offenses 2024-03-05 16:54:54 +01:00
Natalie Tay 84ef46a38c
SECURITY: Hide invitees from users who are not allowed to see the event post (#544) 2024-02-22 11:32:47 +08:00
Natalie Tay dfc4fa15f3
SECURITY: Disallow self invite to private events (#543) 2024-02-21 15:36:36 +08:00
Martin Brennan 35d93e65f9
DEV: Add auto group refresh to specs (#542)
This is needed for the change in the core PR
https://github.com/discourse/discourse/pull/25602
2024-02-08 12:32:04 +10:00
Kris 2cf2c7b482
FIX: update test for holiday adjustments (#541) 2024-02-06 22:29:46 +01:00
Renato Atilio dea70ab377
FIX: convert emoji to unicode on event title (#530) 2024-01-29 11:50:50 -03:00
Ted Johansson b49e327f5c
DEV: Fix some TL group loading for admins in tests (#536) 2024-01-25 17:50:22 +10:00
Ted Johansson ee6ad02d0b
DEV: Exclude system users when serializing group timezones (#533)
The post_serializer_spec was calling Group.refresh_automatic_groups!(:admins), relying on that call booting system users from the group.

This change makes it so the implementation excludes any system users instead.
2024-01-25 07:42:46 +08:00
Renato Atilio 189846f980
DEV: fix another time dependent flaky test (#529) 2024-01-18 11:24:43 -03:00
Ted Johansson 82689c51bf
DEV: Fix time dependent flaky test (#528)
If event1 and event2 are fabricated in different second increments, this will flake. This PR provides explicit timestamps to the fabricated events.
2024-01-18 15:27:58 +08:00
Renato Atilio b622e0f200
FEATURE: support upcomingDays parameter on the upcoming events list (#524)
Adds a before parameter to the events endpoint and uses it through a upcomingDays parameter to the upcoming events list component – which can be used when adding it to the right sidebar blocks theme component.
2024-01-17 21:54:39 -03:00