Commit Graph
90 Commits
Author SHA1 Message Date
Arpit Jalan 0a6b3857c5 FEATURE: Update India Diwali 2025 Holiday (#35354)
https://economictimes.indiatimes.com/news/new-updates/when-is-diwali-in-2025-is-deepawali-on-october-20-or-21-kashi-council-has-cleared-confusion-about-the-real-date/articleshow/124518482.cms
2025-10-14 10:34:02 +05:30
Alan Guo Xiang Tan 55b05c921b DEV: Add client settled checks for system tests (#35230)
This change seeks to improve the reliability of our system tests by
resolving the lack of consistency in the state of the client side
application between steps in a system test. This is achieved by patching
various action methods in `Capybara::Playwright::Node` and
`Capybara::Playwright::Browser` so that the methods execute an async
JavaScript function on the client side that waits for the client side
application to reach a settled state. A settled state is currently
defined as:

1. No inflight ajax requests. (_messageBus and presence requests are
excluded_)
2. 2 event cycles of the Javascript event loop has happened for for all
"click", "input", "mousedown", "keydown", "focusin", "focusout",
"touchstart", "change", "resize", "scroll" DOM events that fired.

For debugging purposes, a `--debug-client-settled` CLI flag has been
added to `bin/rspec`. When used, detailed debugging information will be
printed to the browser's console as well as to `stdout` of the
`bin/rspec` process.

This change was inspired by
https://evilmartians.com/chronicles/flaky-tests-be-gone-long-lasting-relief-chronic-ci-retry-irritation
and the https://github.com/makandra/capybara-lockstep rubygem.
2025-10-10 11:03:18 +08:00
Discourse Translator Bot 065b604655 Update translations (#35270) 2025-10-08 16:01:09 +02:00
Jarek Radosz 2914e7712a DEV: Remove unused service injections (#34750) 2025-10-08 13:31:41 +02:00
Kelv ac554f1f60 DEV: add ical format response for discourse-post-events index route (#35143)
Reverts the removal of this from
https://github.com/discourse/discourse-calendar/pull/231. This opens up
the relative url `/discourse-post-event/events.ics` for access to an
ical formatted response.

We also make available the `order` argument for this endpoint which
defaults to ascending order if there is no value or invalid value
passed. This maintains existing behaviour while allowing for users to
specify that they want most recent events first.
2025-10-07 10:19:34 +08:00
Jarek RadoszandLoïc Guitaut 71834c898f DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-10-06 16:11:01 +02:00
Discourse Translator Bot 5d239c5608 Update translations (#35139) 2025-10-03 15:55:36 +02:00
Jarek RadoszandLoïc Guitaut a54e3208cb DEV: Hand-pick Rails/WhereNot autofixes (#35117)
We can't enable `Rails/WhereNot` lint/autofix, because it would break
code that uses mini_sql instead of AR (which rubocop, and tbh also we,
can't easily differentiate)

Those are safe because they either:
* are executed in AR model scope definitions
* are clearly chained starting from a AR model
* are less-clearly chained, but still can be traced to a AR model/scope

---------

Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-10-03 13:29:22 +02:00
chapoiandMartin Brennan 759fc04041 UX: rework button classes (#34882)
Context: The `btn` mixin is used for every functional button, but this
includes button elements that are not, or should not be, styled like our
default or primary buttons.

To change how this works this commit:
* stripped down the mixin to the bare essentials, mainly limiting to the
properties that use variables.
* moved most things into the `btn` class
* moved some things into specific descriptive classes (default, danger,
success) such as border-radius
Example of button that does not need a border-radius and would benefit
from this:
<img width="464" height="184" alt="CleanShot 2025-09-19 at 12 56 04@2x"
src="https://github.com/user-attachments/assets/e908b2cf-971f-4c1f-aade-7492bad2f89c"
/>

* Deprecated…
  * FlatButton component
* btn-active: we should use the proper pseudoclass :active or a –-active
modifier in code if we need it
* btn-text: every button by default is a btn-text. We already have a
class to indicate when it isn’t (no-text)
* fixed btn-link property to make DButton component behave like an
inline link (no padding, link-styling)
* Since I moved styling from .btn, ths means every button now needs a
specific declaration. So I’ve added btn-default where necessary.
* Fixed btn-flat hover effect: The difference between btn-flat and
btn-transparent was getting very ambiguous. I’ve fixed the hover effect
for btn-flat so that the distinction is:
<img width="1094" height="408" alt="image"
src="https://github.com/user-attachments/assets/addf56a9-1f61-463d-abd9-5028a3b88fad"
/>
* Changed the custom icon colour from header icons so it follows the
normal btn-flat styling, the way the sidebar icon already was doing.
(Consistency)


**Other small button-related change along the way**
What | BC | AC |
|----| ----|--------|
Inconsistent save/cancel colours | <img width="1720" height="1084"
alt="CleanShot 2025-09-19 at 15 31 40@2x"
src="https://github.com/user-attachments/assets/227289c3-6ded-4633-868d-6e33c32d83c3"
/> | <img width="1720" height="1084" alt="CleanShot 2025-09-19 at 15 30
56@2x"
src="https://github.com/user-attachments/assets/b23f96c9-04f3-40ea-9fba-2be59eae8e64"
/> |

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2025-10-02 13:32:36 -06:00
Joffrey JAFFEUX 730a1ea9ec UX: hide time in month view on mobile (#35107)
We have limited space and removing the time in this case allows to have
more space for the text of the event.
2025-10-01 11:00:43 +02:00
Joffrey JAFFEUX 78a00e8414 FIX: force update size on full calendar (#35075)
We are not sure of the reasons but there are multiple similar (yet not
exactly the same) reports of resizing issues with calendar causing this
exact same `width: 0` state we have experienced.
2025-09-30 18:13:42 +02:00
Discourse Translator Bot 5fbadcc2ec Update translations (#35065) 2025-09-30 16:06:14 +02:00
Jarek RadoszandLoïc Guitaut e372355fd0 DEV: Clean up scope resolution operators in plugins (#34979)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-09-30 14:36:34 +02:00
Sérgio Saquetim 813b494730 DEV: Replace deprecated Ember's array filterBy with filter (#35018)
Replaces Ember's deprecated `filterBy` with the native JavaScript method
`filter`. This aligns with modern JavaScript practices, improves code
clarity, and prepares for future deprecations.

Changes involve various components, controllers, and models across the
codebase.
2025-09-29 16:42:38 -03:00
Discourse Translator Bot cb6a8a5cf1 Update translations (#35031) 2025-09-29 10:26:53 +02:00
Joffrey JAFFEUX da02ab094b FIX: do not hide time when overflowing in month view (#35016) 2025-09-27 00:17:44 +02:00
Sérgio Saquetim 14fef6598c DEV: Replace deprecated Ember's array sortBy with sort (#34998)
This Pull Request introduces changes that replace the use of .sortBy
with .sort combined with compare from @ember/utils. This update aims to
modernize and standardize sorting operations throughout the codebase.

**Main Changes:**

* Replaced .sortBy with .sort and compare in various components,
controllers, and services to improve sorting practices.
* Updated sorting logic to handle optional chaining (?.) for increased
robustness.
* Adjusted sorting logic, including reversing, in some cases for more
clarity and correctness.
* Added a new deprecation workflow entry to handle sortBy deprecation
logs (discourse.native-array-extensions.sortBy).
2025-09-26 13:38:26 -03:00
Jarek Radosz 08a741b817 DEV: Fix PostDestroyer deprecations in specs (#34986)
…and remove a stray `puts` in a spec
2025-09-26 09:53:17 +08:00
Jarek Radosz 2773ee4963 DEV: Fix random typos (#34987)
September 2025 edition
2025-09-26 09:52:28 +08:00
Discourse Translator Bot fe31f25ed9 Update translations (#34976) 2025-09-25 16:05:27 +02:00
David Taylor 6081bc2249 DEV: Standardize Ember route, controller and template naming (#34417)
For historical reasons, Discourse has a customized Ember resolver. This
had a much more fuzzy implementation of 'normalize' and 'findTemplate'
functions. This leniency meant that our file naming hasn't always
matched Ember conventions.

Standardizing our naming will make things easier to understand for
developers, and will make adoption of newer ecosystem tooling easier
(e.g. route-based bundle splitting in Embroider/vite)

This commit adds deprecations to the resolver when this leniency is
used, and uses a fully bespoke codemod to rename all of the affected
routes/controllers/templates in the Discourse core repository.
Backwards-compatibility is maintained for anyone looking up the old
names in the resolver.
2025-09-25 11:27:45 +01:00
Sérgio Saquetim 5b031945f7 DEV: Replace the use of Ember's .findBy for native methods on arrays (#34557)
Use the native array `.find` instead of Ember's `.findBy` which was deprecated.
2025-09-24 15:32:13 -03:00
Discourse Translator Bot e0b849beac Update translations (#34839) 2025-09-24 14:48:18 +02:00
Jarek Radosz 52e872961a DEV: Clean up requires (#34946)
1. remove unnecessary `.rb` filename suffixes from `require_relative`
calls
2. replace `require File.expand_path(File.dirname(__FILE__) + …` with
`require_relative`
3. remove `./` prefixes from `require_relative` calls
2025-09-24 12:00:22 +02:00
Martin Brennan 7daea6d77d UX: Use admin table classes for Calendar Holidays list (#34942)
Followup a5730bfe2f

Apply admin table UI guidelines, and convert
AdminHolidaysListItem to a glimmer component.
2025-09-24 17:13:50 +10:00
SamandMartin Brennan a5730bfe2f DEV: clean up events settings (#34856)
- rename from calendar -> calendar and events
- fix config for plugin to show a tab for settings

still needs some CSS adjustments but mostly there

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2025-09-23 08:48:07 +10:00
Joffrey JAFFEUX b8e86ceb23 FIX: disable category calendar when post event are disabled (#34897)
Disabling post event with category events set would cause an error when
visiting the category, this commit ensures it's not the case and adds a
test for it.

Also added tests to ensure we correctly render category calendar in
different outlets as the before-topic-list-body one was broken.
2025-09-22 17:05:19 +02:00
Joffrey JAFFEUX f6e71b463c PERF: correctly index event dates (#34877) 2025-09-19 17:41:57 +02:00
Joffrey JAFFEUX e9b4bfa87f FIX: supports description for post events in rich editor (#34873)
Prior to this fix events with a description wouldn't show in the
composer when they contain a description. This was particularly
problematic as saving the post in this state would remove the event.
2025-09-19 10:39:36 +02:00
Joffrey JAFFEUX 908371191f PERF: removes N+1 when loading events list (#34841)
There was two issues:
- using the `TopicListItemSerializer` was fetching way more than we need
and also expecting includes from other plugins (assign for example),
switching to our own dedicated serializer seems a better choice here
- event dates were not preloaded
- fixed a spec which was supposed to track N+1 but was commented

I also improved our fabricator to limit the boilerplate needed.

We might need few more indices to improve perf event more here but going
to merge this first.
2025-09-19 09:12:23 +02:00
Kelv 0fa102b838 UX: overhaul of GroupSelector with Floatkit (#34685)
This PR modernizes the GroupSelector component by migrating from the
legacy jQuery autocomplete to FloatKit’s DMultiSelect component.

### Changes
* Migrated GroupSelector from an Ember Classic component to Glimmer
component
* Replaced jQuery-based autocomplete with FloatKit’s DMultiSelect
component which handles search
* New scroll-into-view modifier for smooth keyboard navigation (can be
used later to replace d-autocomplete's similar functionality)
* Improved FloatKit's `size` middleware option handling to allow passing
through both minWidth and width props
* Selected items are dynamically removed from dropdown options (no
duplicates)
2025-09-18 15:33:52 +08:00
1983a44812 CHORE: Import holiday definition updates. (#34835)
The Discourse Calendar plugin includes a hard fork of the [holidays
gem](https://github.com/holidays/holidays/).

There have been some updates to the original gem since the fork, this
change pulls in the major updates.

---------

Co-authored-by: Ivan Kuchin <tadump+git@gmail.com>
Co-authored-by: Phil Peble <ppeble@activecampaign.com>
Co-authored-by: Claudio Rodrigo Pereyra Diaz <claudiorodrigo@pereyradiaz.com.ar>
Co-authored-by: Michael Smith <michael.smith076@msd.govt.nz>
Co-authored-by: Lairton Mendes <lairton.mendes@gmail.com>
Co-authored-by: Lars Aurbakken <Lars.Aurbakken@ist.com>
Co-authored-by: i2chris <35810281+i2chris@users.noreply.github.com>
Co-authored-by: Dennis van de Hoef <dennisvdhoef@gmail.com>
2025-09-17 16:07:06 +10:00
LincaandAlan Guo Xiang Tan eeeb7d302f DEV: rename topic_id to timerable_id for BaseTimer (#34667)
To prepare for the introduction of `CategoryDefaultTimer`, which allows
posts created in certain categories to have a default TopicTimer, we
need to rename the `topic_id` column to `timerable_id`.

---------

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2025-09-17 13:19:17 +08:00
Discourse Translator Bot ccf379900d Update translations (#34804) 2025-09-15 10:47:22 +02:00
Joffrey JAFFEUX dc8d00c950 FIX: ensures event serializer has tags info (#34801)
This was preventing the `map_events_to_color` site setting to work
correctly given we couldn't match on tag slug as it was not present.

This commit adds system specs and removes the js test as it was
misleading and incorrectly passing due to the fixture which couldn't
catch the issue in the serializer.
2025-09-15 07:51:42 +02:00
Joffrey JAFFEUX ed6beea336 UX: control event display through a site setting (#34795)
Allows admins to set the `calendar_event_display` site setting to decide
how full-calendar should render events.

It accepts the following values:
- auto
- block
- list-item

And will default to: auto
2025-09-13 11:35:52 +02:00
Joffrey JAFFEUX 79928d858a FIX: removes custom fc-past-event (#34796)
fullcalendar will add fc-event-past class by itself, this commit also
correctly reapplies the opacity on past events.
2025-09-13 11:22:17 +02:00
Discourse Translator Bot 3a8a9f27ce Update translations (#34745) 2025-09-12 16:17:25 +02:00
Gary Pendergast 8990c973ec FIX: Define the typical AFL Grand Final date. (#34768)
The AFL Grand Final is typically help on the last Saturday of September,
though there are occasional exceptions. Since 2015, the Friday before
the Grand Final is a public holiday in Victoria, Australia.

This change defines the typical date for the public holiday, but allows
exceptions to be defined where necessary.
2025-09-11 11:21:31 +10:00
Joffrey JAFFEUX db974047e4 FIX: ensures category calendar is querying a date range (#34764)
We were loading all events and not just the displayed range for category
calendar, which would load too many events and mostly expired events.
2025-09-08 17:01:21 +02:00
Discourse Translator Bot 06b9718717 Update translations (#34723) 2025-09-04 12:27:34 +02:00
Discourse Translator Bot 95ea149548 Update translations (#34698) 2025-09-03 15:32:48 +02:00
Discourse Translator Bot 5678d1fe83 Update translations (#34682) 2025-09-02 15:44:12 +02:00
0ccb0c3c8c FEATURE: allow picking first day of week in calendar (#34670)
Allow picking Saturday,Sunday or Monday as first day of week. 

Keeps current default and adds extensive testing.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Martin Brennan <martin@discourse.org>
2025-09-02 12:44:50 +02:00
Sam 0d9be3d0bf FIX: use user timezone when creating new events (#34675) 2025-09-02 10:31:06 +02:00
SamandJoffrey JAFFEUX ea9f2f532b FEATURE: introduce max attendees for events (#34313)
Allows to set the max attendees of an event. When an event is full you
can only mark yourself as interested or not going. The going button will
be disabled.

Maximum attendees can be defined in the post builder:
<img width="569" height="106" alt="Screenshot 2025-09-01 at 20 57 16"
src="https://github.com/user-attachments/assets/bf61cd57-d35e-44a7-8d05-263ee9cd7df0"
/>

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-09-01 22:56:19 +02:00
Penar Musaraj 1c5de45a77 FIX: Include subcategories in upcoming events list, add after param (#34640)
Addresses two issues. On sites with many old events, we would not show
the correct items because the query would return the older events first.

Adds `includeSubcategories` parameter to include events from
subcategories in the list.

No tests for now, we might refactor this component very soon.
2025-09-01 16:33:49 +02:00
Joffrey JAFFEUX b636cdcbe6 FIX: compute correct date with local time (#34623)
We were not correctly computing the dates when the option showLocalTime
is enabled on an event. In this case we need to generate a floating time
without a zone in the date.

This commit also refactors the serializers to avoid duplication.
2025-09-01 11:46:34 +02:00
Discourse Translator Bot 7f07453157 Update translations (#34633) 2025-08-29 17:24:43 +02:00
Joffrey JAFFEUX e8e0ea8ee3 FIX: ensures events have correct duration (#34621)
rrule doesn't support duration so we have to ensure we can communicate
the duration to the frontend.

We were also making a mistake for the end date of non recurring events.
2025-08-28 15:51:31 -04:00