Commit Graph

58414 Commits

Author SHA1 Message Date
305039b1c3 DEV: ensure Rails application default headers are present in responses (#31619)
Follow up from https://github.com/discourse/discourse/pull/31559.

We expect some standard headers to be added from
`Rails.application.config.action_dispatch.default_headers` for
responses, however these were found to be removed in some error paths. 
For more detail on this behaviour, refer to https://github.com/discourse/discourse/pull/31619#issuecomment-2699644232.

This PR adds those headers back if they aren't there, with the caveats
that we don't add headers that are irrelevant for non-HTML responses,
and neither do we add X-Frame-Options which is intentionally removed for
embeddables.
2025-03-05 13:19:09 +08:00
63213398bf UX: Add left border to indented field and update caret for consistency (#31643)
* Added a subtle left border to the indented field to improve visual
hierarchy
* Updated the caret to align with other expandable elements for
consistency
2025-03-05 14:29:51 +11:00
e4401e587e FIX: Ensure queued posts with watched words are processed correctly. (#31641)
This change ensures that queued posts that have ended up in the review queue due to matched a watched word display correctly.

It also improves the data checking to ensure that any other reviewables with watched words don't break the review queue, either.
2025-03-05 13:59:42 +11:00
223b40de1c FEATURE: Store composer version and device info on post stat (#31600)
We are developing our new composer, and it would be useful
if we could know how posts are being created by members.

To this end, we are going to start storing the following
on post_stats, which are created at the same time as a post
is created:

* writing_device - Based on `BrowserDetection.device`, which in
  turn is based on user agent. Will store .e.g iphone, android,
  mac, windows etc.
* writing_user_agent - Stores the full user agent (truncated at
  400 chars) of the device/browser the member used to write the post.
* composer_version - Either `1` for our old composer, or
  `2` if the new rich composer is enabled in site settings and
  the user has toggled it on
2025-03-05 12:48:32 +10:00
702a2a9cbc UX: display html tags in silence reason (#31598)
Allow HTML tags in silence reason. Tags must be stripped for title
attribute.

Before

![image](https://github.com/user-attachments/assets/05d9819a-9dbf-46b2-b9c5-88187ca9af5b)


After
<img width="1079" alt="Screenshot 2025-03-04 at 11 39 05 am"
src="https://github.com/user-attachments/assets/2bb41deb-227c-47a8-b840-b0316a764252"
/>
<img width="1096" alt="Screenshot 2025-03-04 at 11 39 22 am"
src="https://github.com/user-attachments/assets/02e27fc0-317e-43df-bce8-6b68e48ac40e"
/>
2025-03-05 12:43:03 +11:00
828fcb1ad3 DEV: Add rake task to bulk delete posts (#31642)
Same as #31576, but in that one I added some support files that turned out to be unnecessary and broke the build. So this is the re-do. 🙏
2025-03-05 09:31:23 +08:00
Sam
503645dc34 DEV: bump to major release of mini_racer (#31640)
Only notable changes is that we added
internal support for TimeWithZone which
was absent from previous release

We also improved error messages for T_OBJECT
2025-03-05 12:06:36 +11:00
72ba574d6f DEV: Convert tests using the gjs codemod (#31625)
```sh
pnpm dlx @embroider/template-tag-codemod@alpha --relativeLocalPaths=false --nativeRouteTemplates=false --nativeLexicalThis=false --templateInsertion="end"
```
2025-03-05 01:37:30 +01:00
28e00d9bfe DEV: Update lint-configs and autofix issues (#31620)
This updates us to Prettier 3.x
2025-03-05 01:20:16 +01:00
f8b30ffd06 Build(deps-dev): Bump @swc/core from 1.11.5 to 1.11.7 (#31636)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.5 to
1.11.7.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/swc-project/swc/compare/v1.11.5...v1.11.7)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-05 00:26:30 +01:00
143550a93b Build(deps-dev): Bump babel-import-util from 3.0.0 to 3.0.1 (#31635)
Bumps [babel-import-util](https://github.com/ef4/babel-import-util) from
3.0.0 to 3.0.1.
- [Release notes](https://github.com/ef4/babel-import-util/releases)
-
[Changelog](https://github.com/ef4/babel-import-util/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ef4/babel-import-util/commits)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Discourse CI <ci@ci.invalid>
2025-03-05 00:03:22 +01:00
c1d9887ead FIX: only show small user list if users has length (#31631)
Need to check length here so we're not exposing the component when there
are no users, fixes:
https://meta.discourse.org/t/expanding-topic-actions-displays-who-liked-the-posts-but-nobody-has-liked-it/355225

follow-up to
5312550bf9
2025-03-04 16:50:41 -05:00
1e1fae38b5 Build(deps-dev): Bump parallel_tests from 4.9.1 to 5.0.0 (#31630)
Bumps [parallel_tests](https://github.com/grosser/parallel_tests) from
4.9.1 to 5.0.0.
-
[Changelog](https://github.com/grosser/parallel_tests/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/grosser/parallel_tests/compare/v4.9.1...v5.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 22:47:56 +01:00
ba3f1577d4 Build(deps-dev): Bump rubocop-discourse from 3.10.0 to 3.11.0 (#31627)
Bumps
[rubocop-discourse](https://github.com/discourse/rubocop-discourse) from
3.10.0 to 3.11.0.
-
[Commits](https://github.com/discourse/rubocop-discourse/compare/v3.10.0...v3.11.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 22:40:10 +01:00
1f93d3e36e Build(deps-dev): Bump rubocop-rails from 2.30.2 to 2.30.3 (#31628)
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from
2.30.2 to 2.30.3.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
-
[Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop-rails/compare/v2.30.2...v2.30.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 22:39:22 +01:00
b270d541ff Build(deps-dev): Bump rubocop from 1.73.1 to 1.73.2 (#31629)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.73.1 to
1.73.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
-
[Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop/compare/v1.73.1...v1.73.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 22:39:03 +01:00
2ab00c5b37 DEV: Add apply_modifier on group's mentionable scope (#31565)
This PR adds DiscoursePluginRegistry.apply_modifier on group's
mentionable scope.
2025-03-04 15:36:55 -06:00
d93f8c1d43 Build(deps): Bump rack from 2.2.11 to 2.2.12 (#31626)
Bumps [rack](https://github.com/rack/rack) from 2.2.11 to 2.2.12.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/v2.2.11...v2.2.12)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 22:35:17 +01:00
dde1b523b6 DEV: Update template-override deprecation (#31623)
- Update Meta topic URLs

- Add theme/plugin identification to deprecation

- Enable admin warning banner

- Enable overriding of gjs component templates, to unblock core upgrade
work between now and final removal of the template override feature

https://meta.discourse.org/t/355668
2025-03-04 18:49:49 +00:00
2041eaf89d DEV: Drop PluginOutlet parentView and DButton string actions (#31624)
These have been deprecated, with admin warnings, for some time
2025-03-04 18:48:56 +00:00
3160ad8fb0 DEV: Convert d-button test classes to native syntax (#31622) 2025-03-04 18:44:07 +01:00
150edff1cf DEV: Use an inline require to avoid a circular import (#31615) 2025-03-04 17:34:44 +01:00
b0cf0f89be DEV: Inline the test templates (#31614)
in preparation for running the gjs codemod
2025-03-04 17:34:22 +01:00
5aa47a26ee DEV: Remove unused modal code (#31613) 2025-03-04 17:24:17 +01:00
4b3044565d DEV: Check Gemfile.lock is up to date on CI 2025-03-04 16:29:50 +01:00
b467fe1347 Update translations (#31617) 2025-03-04 16:12:11 +01:00
9f51f64803 FEATURE: add table rich editor extension (#31153)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `table` node and its descendants – `table_head`, `table_body`,
`table_row`, `table_header_cell`, `table_cell` –, its Markdown
serializing/parsing logic, and a plugin to use the first body **row** of
a head-less table as the **header** when pasting `text/html`.
2025-03-04 11:45:19 -03:00
225f90b1c9 FEATURE: add strikethrough rich editor extension (#31152)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `strikethrough` mark, its Markdown serializing/parsing logic, and
a `~~text~~` input rule.
2025-03-04 11:42:42 -03:00
ddcbffc8c6 FEATURE: add quote rich editor extension (#31151)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `quote` node, its Markdown serializing/parsing logic, and a
plugin to select the node when the quote header is clicked.
2025-03-04 11:39:54 -03:00
7210d29c18 FEATURE: add link rich editor extension (#31150)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Replaces the ProseMirror's default `link` mark to support
Discourse-specific features, its Markdown serializing/parsing logic, a
`[caption](link)` input rule, and a plugin to auto-linkify URLs when
they're pasted as `text/plain` or `text/html`.
2025-03-04 11:37:09 -03:00
18a639916b FEATURE: add image rich editor extension (#31146)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds an `image` node, its Markdown serializing/parsing logic, and a
plugin to auto-resolve `upload://hash` short urls.
2025-03-04 11:34:19 -03:00
6168636de8 FEATURE: add emoji rich editor extension (#31144)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds an `emoji` node, its Markdown serializing/parsing logic, and input
rules for `:emoji:`s and `:-)` emoticon replacements.

[prosemirror-markdown's
heading](99b6f0a6c3/src/schema.ts (L30))
only allows `(text | image)*` content, we override it to allow `inline*`
to be compatible with all our inline (including emoji) nodes.
2025-03-04 11:31:47 -03:00
5a21f74716 FEATURE: add mention rich editor extension (#31142)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `mention` node, its Markdown serializing/parsing logic, and a
`@mention` input rule.
2025-03-04 11:20:44 -03:00
b43e465669 FEATURE: add hashtag rich editor extension (#31141)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `hashtag` node, its Markdown serializing/parsing logic, and a
`#hashtag` input rule.
2025-03-04 10:56:25 -03:00
02e471cc2a DEV: bump discourse-emojis 1.0.30 (#31609)
This update bring a few renames to avoid long names.
2025-03-04 14:53:47 +01:00
519be0f0b8 FEATURE: add underline rich editor extension (#31139)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds an `underline` mark, its Markdown serializing/parsing logic, an
`[u]` input rule, and a (Ctrl/Cmd)-U keymap.
2025-03-04 10:37:36 -03:00
0c818fea50 DEV: Relax Ruby version constraint to ~> 3.3 (#31610)
This change allows updates to any 3.x version, while still restricting
major updates to 4.x.
2025-03-04 14:23:49 +01:00
7d4e4e9422 Revert "DEV: Add rake task to bulk delete posts" (#31607)
Breaks the build. Need to update the spec.
2025-03-04 20:54:03 +08:00
1c4d2db0ea DEV: Remove password validation mixin (#31579)
This removes the PasswordValidation mixin that is no longer used
anywhere else.
2025-03-04 18:44:37 +08:00
42c4427cb1 DEV: Add rake task to bulk delete posts (#31576)
This PR adds a destroy:posts rake task that can be used to hard-delete a list of posts. Useful for dealing with large amounts of spam that has been soft deleted and needs to go.

Notes:

Works on both non-deleted and soft-deleted posts. (We might want to change this to work on only soft-deleted posts?)
Works exclusively on post IDs. We can't mix topic and post IDs as they might clash, and we have no way of resolving that ambiguity.
Accepts either a rake-style array of IDs or, more conveniently, you can pipe the argument in through STDIN.
Added a confirmation step since it's a fairly destructive operation.
2025-03-04 17:29:38 +08:00
06a0108a52 DEV: Store selected API key scope mode in the database table (#31601)
Currently, after creating an API key, there is no way in the UI to see what scope the key has. To do this we need to first store the selected scope mode when creating a new key.

In this PR we:

- Convert scope_mode from a transient attribute to a database backed enum.
- Ship the possible values through the javascript:update_constants rake task instead of hard coding in front-end.

In follow-up PRs we will:

- Backfill existing API keys based on their associated api_key_scopes records.
- Start showing the scope mode in the UI.
2025-03-04 16:41:43 +08:00
9abeff460c FEATURE: Display the Watched Words that caused a post to be flagged. (#31435)
When a post is flagged due to matching watched words, it can be difficult to know what you're looking for, particularly if you have a lot of watched words built up over a long period of time.

This change stores the list of matched words, and later displays them in the review queue, listing which Watched Words were responsible for the flag. Because watched words can change, this is recorded at the time the post is flagged. For posts that were flagged prior to this feature landing, it tries to guess the relevant words based on the current Watched Words set.
2025-03-04 17:22:12 +11:00
b329eac79a FIX: Handle href admin sidebar links better (#31575)
Admin sidebar links can have either a `href` or a
`route`, and the admin search was not handling
this properly. Also, we should always use `getURL()`
on the href in case the link is internal, for subfolder
sites.

This is hard to test right now, I plan on adding more extensive
links for admin-search-data-source in another PR.
2025-03-04 13:38:49 +10:00
879faa82b3 DEV: Add value transformer for admin reports show query params (#31597)
## 🔍 Overview
This update adds a new value transformer to the `queryParams` property
on the `AdminReportsShowController`. This is necessary so that plugins
can add additional `queryParams` to the route and have it reflected when
the route is transitioned.
2025-03-04 13:33:08 +11:00
c815294c57 DEV: Update gemfile.lock from ruby bump (#31599)
Followup 76e58a55edb18a22760273b8787240a18b7b2be3

Gemfile.lock wants the ruby version, and it's blocking
the build. Not sure why this didn't come up in the
original PR.

This is not a hard requirement, other ruby versions satisfying
~> 3.3.0 will still work
2025-03-04 11:58:13 +10:00
dbba838ef4 FEATURE: rebranded admin logos settings (#31554)
Redesigned page to update site logos. `AdminBrandingLogoFormComponent`
is attached to the old logos page and the new branding page. In the next
steps, branding will replace the logos page.

A new `AdminConfigAreaCardSection` component was added hidden and less
frequently used settings.

An image placeholder was also needed because many additional logos have
a fallback to the site logo.

Finally, `twitter_summary_large_image` was renamed to
`x_summary_large_image`.

Desktop
![localhost_4200_admin_config_branding
(4)](https://github.com/user-attachments/assets/b6ae5266-72f6-4582-b0ef-4d05545943e8)


Mobile
![localhost_4200_admin_config_branding(iPhone 12 Pro)
(3)](https://github.com/user-attachments/assets/bf329a5c-9ba0-4d88-b30d-e8f1feb02e31)
2025-03-04 12:51:27 +11:00
76e58a55ed DEV: Bump ruby version requirement to 3.3.0 (#31538)
This bumps the core ruby version requirement
to at least 3.3.0, and moves this version check
into the Gemfile per
https://bundler.io/guides/gemfile_ruby.html

We are doing this because generally our gems
are using a higher version, it's about time
for a bump anyway.
2025-03-04 12:23:32 +11:00
028a587363 Update INSTALL-cloud.md (#31500)
Include blurb about hosting.

Internal: /t/122265/
2025-03-03 17:33:11 -07:00
024d752083 DEV: Remove extraneous rubocop arguments (#31596)
1. `--parallel` is the default
2. it runs in the current directory by default
2025-03-04 01:28:26 +01:00
3aa383a4de UX: Tweak footnote button styling (#31595)
1. remove the margin (it's displayed inline with text, so having a left
margin didn't make sense)
2. use em unit in min-height
3. slighty tighten the button (inline padding 0.5em -> 0.4em) so it's
more proportional
2025-03-04 01:24:27 +01:00