Commit Graph

1164 Commits

Author SHA1 Message Date
Jarek Radosz 43e97c16e5
DEV: Deprecate the plugin (#768) 2025-07-15 13:10:03 +01:00
Discourse Translator Bot 8581b71c50
Update translations (#766) 2025-07-09 15:27:05 +02:00
Lilly e4c4933d95
Update Zimbabwe holidays (#765)
* Update Zimbabwe holidays

fix Heroe's Day and Defence Forces day

re: https://dev.discourse.org/t/zimbabwe-calendar-definitions/157783

* Update Zimbabwe definitions

re: https://dev.discourse.org/t/zimbabwe-calendar-definitions/157783/3

* Update tests

update tests for heroes day and defence forces day
2025-07-08 07:14:40 -07:00
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
Discourse Translator Bot cb21706035
Update translations (#762) 2025-07-02 22:36:33 +02:00
Joffrey JAFFEUX 7383bfb788
FIX: broken test due to user timezone (#763)
The commit d878317c5f set the calendar timezone to the user’s timezone when available and as result broke this test.
2025-07-02 14:59:26 +02:00
Joffrey JAFFEUX d878317c5f
UX: displays event local time in calendar (#757) 2025-07-02 13:38:09 +02:00
Martin Brennan a034764920
FIX: Destroy calendar popover on navigation (#761)
This fixes an issue where we would show the popover for
a calendar event, but then not destroy it when navigating
to another page, which meant it ended up stuck in the top
left of the page.

This brings the behavior in line with other places we do
`destroyPopover()`, like when the mouse leaves the event
element.
2025-06-27 17:20:17 +10:00
Sam 35b70ace7e
DEV: skip flakey spec (#760) 2025-06-27 15:29:46 +10:00
Kris 197aa5bd1f
FIX: use correct property for sidebar icon (#759) 2025-06-26 17:01:12 -04:00
Joffrey JAFFEUX 811a729d19
FIX: correctly display single digit event in safari (#756)
We were building the list of events by using the non padded day as key, eg:

```
{ 3: { ... }, 16: { ... } }
```

Which we would then use to construct a date and would end up doing something like:

```
moment("2025-07-3").format()
```

It was working in most browsers, but safari was not accepting it and would display an `invalid date` error.

The fix is using a padded day as key that will ensure consistent behavior.

No test as it's browser specific behavior.
2025-06-25 23:05:14 +02:00
Joffrey JAFFEUX 0162ed5797
FIX: ensures UpcomingEventsCalendar can be used alone (#755)
This is a recent regression due to bdf8869a01

I wanted to write a test, but this is non trivial given this is a standalone component. We also have other internal repos testing this behavior (how I discovered the regression). Will try to have  a test for this one later.
2025-06-25 17:38:43 +02:00
Yuriy Kurant d06761b6fe
FIX: escapes localization for double quotes (#754)
- DRY date formatting for start/end datetimes
- escape double quotes for German locale
2025-06-25 20:00:15 +08:00
Joffrey JAFFEUX 6c5b8ba2bb
FIX: uses Unicode escape sequence for a standard double quote (#753)
Attempts to wrap format in standard ASCII double quotes (") and prevent the browser from substituting them with language-specific typographic quotes, such as the German „ (low-9) and “ (left double).
2025-06-25 11:33:52 +02: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
Discourse Translator Bot 781ecefc62
Update translations (#751) 2025-06-24 16:29:08 +02:00
Joffrey JAFFEUX 03508c2e2e
UX: smart format dates (#745)
This PR overhauls the way event dates are rendered by applying context-aware formatting rules:

* Single-day events only show times when appropriate, hiding “12:00 AM” for events without endDate.
* Multi-day ranges omit redundant parts (e.g. for the current year) and include weekday/month/day when needed.

### Impact
* Improves readability of event dates across the app
* Reduces visual noise by hiding redundant date/time fragments
* Ensures consistency with user expectations around relative dates

---------

Co-authored-by: Yuriy Kurant <yuriy@discourse.org>
2025-06-24 11:47:13 +08:00
Kris 5ea2f0d7e1
UX: add calendar icon for sidebar (#748) 2025-06-23 17:00:40 -04:00
Yuriy Kurant f50f18b4dc
fix: id holidays: adds missing years to cn_new_lunar_day (#750)
* fix: id holidays: adds missing years to cn_new_lunar_day

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-06-20 20:49:49 +08:00
Discourse Translator Bot 84a002594d
Update translations (#747) 2025-06-17 23:07:37 +02:00
Discourse Translator Bot 87b1873874
Update translations (#743) 2025-06-10 23:27:43 +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
Jarek Radosz 514bc98319
DEV: [gjs-codemod] Convert all templates to gjs (#729) 2025-06-06 11:45:25 +01:00
Lilly bd6e307214
Add Zimbabwe definitions (#740)
* Create Zimbabwe definitions file

Add a draft zw.yaml file for Zimbabwe

* Update for Zimbabwe 

add holiday region and timezone

* Update for Zimbabwe

add Zimbabwe locale zw

* Update index.yaml for z

* Fix syntax

add missing comma to line 274

* Update tests

simplify the tests so only one per holiday

* Fix syntax

replace backtic with single closing quote on line 86

* Add generated Ruby files for Zimbabwe holidays
2025-06-03 14:24:18 -07:00
Discourse Translator Bot da1b327d55
Update translations (#738) 2025-06-03 17:37:08 +02:00
David Taylor 4d0af68ec8
FIX: nbsp handling in group-timezones (#739)
Since it was converted to Glimmer, the nbsp html entity is being escaped by ember before rendering. We can use a unicode literal instead.

Followup to d471bbdf9a
2025-06-03 15:39:58 +01:00
Joffrey JAFFEUX 8e4396c38b
UX: better copy (#737)
It was not clear to the user that the until date would be included.
2025-06-03 11:49:27 +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
Selase Krakani 5bebd6779b
DEV Add Ghana Eid-Ul-Adha holiday for 2025 (#733)
See https://www.mint.gov.gh/declaration-of-friday-6th-june-2025-as-a-public-holiday/
2025-06-02 14:08:16 +00: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
Osama Sayegh 660ce54375
Add upcoming Saudi holidays (Eid Al Adha) (#734)
The 5th of June to the 8th of June of 2025 is a public holiday in Saudi Arabia as per https://holidayapi.com/countries/sa/2025.
2025-06-02 13:43:08 +03:00
David Taylor da13f6fc01
FIX: Remove hard dependency on Chat plugin (#732)
When chat is disabled, these JS modules will not be available
2025-05-28 18:51:46 +01: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
Yuriy Kurant 5f1cf802dd
DEV: update Indonesia holidays 2025 (#725)
* DEV: updates Indonesia holidays 2025
* DEV: copies cn_new_lunar_day from hk.yaml
* DEV: copies Vietnamese lunar data for Indonesian
2025-05-13 19:00:53 +08: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
Alan Guo Xiang Tan 5f87c53fe9
DEV: Add polling day for Singapore (#722) 2025-04-22 12:08:03 +08:00
David Taylor f10b3a399a
DEV: Remove legacy topic-list code (#718) 2025-04-14 14:39:00 +01:00
Joffrey JAFFEUX 8d09cf8503
DEV: update regions (#717) 2025-04-10 17:44:21 +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
Régis Hanol 743db6fe5d
FIX: remove double quotes `"` character when building the event's mar… (#716)
This is not the best UX as user might enter an event name with double quotes and they'll be deleted once they click save. But at least it won't break their event because the double quote breaks the BBCode/Markdown.

A proper fix would be to manipulate an AST instead of using regular expressions on a a string.

Meta - https://meta.discourse.org/t/-/360010
2025-04-09 12:33:21 +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
Joffrey JAFFEUX cbebb8da6f
FEATURE: adds support for event preview in rich editor (#708)
Adds support to parsing/serializing/displaying an event preview representation for the rich editor view.

Co-authored-by: Renato Atilio <renato@discourse.org>
2025-03-28 17:14:02 -03: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
Selase Krakani d1413cb6d1
DEV: Add 2025 Ghana Eid-Ul-Fitr holidays (#710)
Add 2025-03-31 and 2025-04-01 as holidays per https://www.mint.gov.gh/declaration-of-monday-31st-march-2025-and-tuesday-1st-april-2025-as-public-holidays/
2025-03-26 16:04:03 +00: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