- Migrated from annotate to annotaterb as the former is not maintained
anymore.
- Dropped our `fast_pluck` patch as the default `pluck` implementation
seems now faster.
Before this change, even if we were failing rspec tests due to
JS errors, they were not being shown in the "JS LOGS" backed
by the playwright logger in the failure message. Sometimes the
unhandled JS errors are the _cause_ of the failure, so it
is important to see them.
This is a follow-up to 38194c2aec.
In this change:
- Add JSDocs for the component.
- Add integration tests for the component.
- Standardise on passing a single `@score` parameter to the component,
rather than splitting out the parameters.
This commit refactors the `PostCookedHtml` and `PostQuotedContent`
components to enhance how quoted posts are rendered and decorated. It
introduces a new `className` prop for customizing the class of cooked
HTML, and ensures collapsed quote content is consistently decorated with
appropriate styles and structure.
Key changes:
- Adds a `className` argument to `PostCookedHtml`, allowing quoted
content to have a distinct class for easier styling.
- Updates `PostQuotedContent` to render collapsed and expanded quoted
content through `PostCookedHtml`, ensuring consistent decoration and
disabling selection barriers for quoted posts.
- Refines decorator application logic in `PostCookedHtml` to
conditionally apply selection barriers.
- Improves CSS by targeting quoted content within blockquotes, ensuring
top and bottom margins are correctly removed from child elements.
- Updates acceptance tests to support both classic and glimmer post
stream modes, verifying composer actions and quoted content behavior
across modes.
Previously, running qunit tests for a plugin would load the JS of all
installed plugins. This can be problematic because, depending on the
plugins installed in the current environment, there can be unexpected
interactions between the plugins.
This commit updates our qunit system to check the
`tests.requiredPlugins` list from the theme/plugin `about.json` file,
and only loads the listed plugins. This means that the environment is
much more consistent across CI and different development environments.
Alongside that change, this commit also:
- Starts storing the original `about.json` for themes in the database
- Improves qunit error handling when the test environment fails to boot
(e.g. there's a bad import in a plugin)
- Restores plugin CSS in theme qunit tests
- Migrates the `AvatarFlair` component from classic to Glimmer,
refactoring its implementation and template for improved maintainability
and performance.
- Updates the `PostAvatar` component to use the new value transformer
for avatar size.
- Registers the `"post-avatar-size"` value transformer in the
transformer registry.
- Adds comprehensive integration tests for both `AvatarFlair` and
`PostAvatar` components, ensuring correct behavior for icon/image
rendering, style application, and avatar size/template transformation.
---------
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
An existing codepath to bulk delete invites exists, but does not show
up. This commit fixes it and also fixes the old code's bug.
Specifically,
- `destroy_all_expired` endpoint only acts on the `current_user` which
is absolutely counter-intuitive, when a person visits another person’s
profile and is able to see the button, clicking it would delete their
own invites and not those of the profile they are visiting.
- In `UserInvitedShowController` the removedAll state is never set to
the original state, which results in the link being displayed in the
list when the new link expires, but the batch deletion cannot be
displayed unless the page is refreshed. It is replaced by a toast.
`rest_serializer` option allows the backend to send a single response
containing the main object plus all its related data, and the frontend
automatically reconstructs the full object graph with proper
relationships. It is using recurrence, and will automatically detect all
id/ids and try to hydrate them into the corresponding array using the
first part as the model type name.
The problem is that the previous algorithm would delete the source array
regardless of whether the hydration was successful. This caused arrays
such as sidebar_category_ids to be automatically deleted when
currentUser was part of the model.
This commit fixes the above problem by detecting whether the hydration
was successful
Currently if a post is written in Japanese (`ja`) and has been
translated to English (`en`), a British (`en_GB`) user will see the
Japanese post.
WIth this PR we normalize user locales so the best match would show
(`en` first, then `en_GB`, or `pt` and `pt_BR`).
Note: `LocaleNormalizer` is from discourse-ai and will be removed there.
A while back we replaced hard-coded #is_staff? checks with group based permissions.
The edit_post_allowed_groups setting has admins and moderators (i.e. staff) as mandatory values, and so we no longer need the explicit staff check.
A while back we replaced hard-coded #is_staff? checks with group based permissions.
The edit_post_allowed_groups setting has admins and moderators (i.e. staff) as mandatory values, and so we no longer need the explicit staff check.
In #33587 we moved PostGuardian related tests from guardian_spec to post_guardian_spec. When doing so we also added stubs for missing tests.
This PR implements those missing tests.
For now this commit is going to correctly ensure that when creating a
new event through the form builder we set the description as the body of
the event and not a property. This change allows us to have line breaks
in the description and is now correctly tested.
---------
Co-authored-by: Martin Brennan <martin@discourse.org>
Modifying site settings outside of an example (or `before/after` blocks)
results in corrupting those settings in the test database.
(the was issue introduced in e05ef50c70)
* relocated the border-radius to core, so it follows the variable
settings always, not just in Horizon
* changed the interaction-layout in Horizon for composer-chat where
* When opened, chat drawer will always be in front of composer, no
matter which mode (markdown, RTE, peek)
* When minimised, chat drawer will always be behind the composer
* also changed the color of the chat-drawer when minimised, to stand out
a bit more and to match the de-focussed grippie colour on composer.
* slight change in height of composer when minimised (40 -> 45px) to
match height of chat drawer when minimised
<img width="3452" height="1680" alt="CleanShot 2025-07-17 at 17 14
13@2x"
src="https://github.com/user-attachments/assets/c524b1d8-dab2-4e89-b971-a91be87cc50d"
/>
<img width="3452" height="1680" alt="CleanShot 2025-07-17 at 17 14
01@2x"
src="https://github.com/user-attachments/assets/cb8b38c2-32f4-43f7-bc90-c45c00d9f102"
/>
This fixes an issue identified in specs where the theme site setting
cache was not being set correctly when importing themes, leading
to an incomplete list of settings being sent down to the client
via the `themeSiteSettingOverrides` preload store.
For example, a theme might have something like this:
```
496=>{:enable_welcome_banner=>false}}
```
Which is missing the `search_experience` theme site setting.
We can address this properly by refreshing the SiteSetting theme
site setting cache after importing themes, ensuring that all
properties are correctly set.
`post_localizations` are preloaded, but using `find_by`, `exists?`, and
`count` will hit the db.
Use alternatives instead that can make use of the loaded records.
The discourse-upload-warning theme component is throwing this error in
its qunit tests because of a bug in the subscriptions plugin which is now in
core.
The subscriptions plugin shouldn't load this route if the subscriptions
plugin isn't enabled.
`Error: Unhandled request in test environment: /s/contributors (GET)`
fixes errors like:
```
Failed to handle exception in exception app middleware : NoMethodError : undefined method `ends_with?' for an instance of Integer
```