Commit Graph

58166 Commits

Author SHA1 Message Date
39f4485939 FIX: Don't attach images that aren't rendered in the digest e-mail (#31525)
When secure uploads are enabled, we need to send images that are rendered in the digest e-mail as attachments. Before this change, we would indiscriminately attach all images in the relevant topic's first post, whether they were rendered the e-mail body or not.

This change fixes that by only attaching images that are referenced in the e-mail body.
2025-02-27 11:41:17 +08:00
38de3d7bd1 DEV: Prevent crawlers from loading search results. (#31535)
This change detects if a crawler is trying to load a search results page, and returns a simple response that should indicate to them that there's no content of interest available there.
2025-02-27 14:34:19 +11:00
e5684def38 FIX: Revert "DEV: delete PasswordValidation mixin (#31520)" (#31536)
This reverts commit fbe5a9c71096dde8d7d59a0b2bec932b22c38a05.

I missed one area outside of core where this mixin is being used.
2025-02-27 10:17:37 +08:00
30c559f670 Build(deps): Bump cgi from 0.4.1 to 0.4.2 (#31534)
Bumps [cgi](https://github.com/ruby/cgi) from 0.4.1 to 0.4.2.
- [Release notes](https://github.com/ruby/cgi/releases)
- [Commits](https://github.com/ruby/cgi/compare/v0.4.1...v0.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 01:12:04 +01:00
fb7ada2f67 Build(deps): Bump uri from 1.0.2 to 1.0.3 (#31531)
Bumps [uri](https://github.com/ruby/uri) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/ruby/uri/releases)
- [Commits](https://github.com/ruby/uri/compare/v1.0.2...v1.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 01:11:37 +01:00
9d895e5bad Build(deps-dev): Bump lefthook from 1.11.1 to 1.11.2 (#31532)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.11.1
to 1.11.2.
- [Release notes](https://github.com/evilmartians/lefthook/releases)
-
[Changelog](https://github.com/evilmartians/lefthook/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/evilmartians/lefthook/compare/v1.11.1...v1.11.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 01:11:03 +01:00
8abe5c6eac Build(deps-dev): Bump rubocop from 1.72.2 to 1.73.0 (#31533)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.72.2 to
1.73.0.
- [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.72.2...v1.73.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 01:10:49 +01:00
0af0087c77 DEV: Adds empty device screenshot workflow file (#31521)
This is for continued experimentation in
https://github.com/discourse/discourse/pull/31410,
GitHub does not react to the issue_comment event unless the workflow
file is in main already,
see
https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#issue_comment

This workflow is a noop, it will be actually written/tested
in the linked PR
2025-02-27 10:07:29 +10:00
71c6f70e9e Update INSTALL.md (#31097)
Added blurb and link to official hosting at the top
2025-02-27 00:21:38 +01:00
a9928e8a71 Update LICENSE (#31217)
Updated the copyright in the LICENSE file to match with https://github.com/discourse/discourse-plugin-skeleton/blob/main/LICENSE

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-02-27 00:16:59 +01:00
c72922cfc7 DEV: Add emoji-picker-filter-container plugin outlet (#30976)
With the emoji picker unified
(https://github.com/discourse/discourse/pull/28277), there is no longer
a footer, including the previous plugin outlet.

This PR moves the plugin outlet at the top.

Usage example: [Emoji Fluff
TC](https://meta.discourse.org/t/emoji-fluff/339163)

Before: 

![image](https://github.com/user-attachments/assets/6274dfa6-386e-4387-9377-8ab13256528c)
After: 

![image](https://github.com/user-attachments/assets/f4f02ec1-797e-4066-837d-b436c7ad3061)
2025-02-26 23:58:50 +01:00
d0c61f790a Switch [details] to <details> to show the dropdown in ADMIN-QUICK-START-GUIDE.md (#29702)
Previously, this guide was using [details][/details] for dropdowns, but
the dropdowns did not show. I have switched it to <details></details> so
that the dropdown is showing in `ADMIN-QUICK-START-GUIDE.md`.
No tests required since this is not a code fix.

Before:
<img width="651" alt="image"
src="https://github.com/user-attachments/assets/5b4f43e8-54f2-4145-87f5-70897393e686">
<br>
<img width="699" alt="image"
src="https://github.com/user-attachments/assets/88f74299-62bf-4499-a270-5f796118e9e3">

After:
<img width="664" alt="image"
src="https://github.com/user-attachments/assets/5eb5a58a-2c80-4556-a676-e80972a73b0e">
<br>
<img width="696" alt="image"
src="https://github.com/user-attachments/assets/0cbabfd6-fe4d-46c5-a881-921dec1ad22a">
2025-02-26 16:07:04 -05:00
a65133af07 DEV: Correct truth-helper exports (#31528)
In modern embroider, `app-js` files need to be exported by the module.

We need to keep the separate `app/` directory because this v2 addon
doesn't have a build step, and therefore the relative imports in the
`src/helpers` files would break if loaded as-is into the app bundle.
2025-02-26 17:50:29 +00:00
55d0951ccc DEV: Hide non-en locale files in IDE search (#31527)
These files are managed automatically via crowdin, so they should never
be edited locally. Adding them to `.ignore` will stop them polluting
search results in IDEs which support `.ignore` (e.g. VSCode)
2025-02-26 17:24:03 +00:00
0cab9603ca DEV: Add missing broccoli-filter dependency of discourse-hbr (#31526) 2025-02-26 16:25:19 +00:00
ffdc97f372 DEV: Move desktop-specific admin styles to admin css bundle (#31524)
Having them under `desktop/` means they're loaded for all users. Better
to put them in the admin-only bundle, and scope with `.desktop-view`
2025-02-26 13:39:52 +00:00
3d515b9dd8 DEV: calendar control for form-kit (#31506)
This commit introduces a new `Calendar` control for form-kit. This
control will render a date picker and a time input. On mobile the date
picker will be replaced by a native input of type date.

The following validation options have also been added:
- `dateAfterOrEqual`
- `dateBeforeOrEqual`

The control has two options:

- `includeTime` - show or hide the time input (default true)
- `expandedDatePickerOnDesktop` - show an expanded datepicker on
desktop, or not (default true)
2025-02-26 11:23:07 +01:00
699541af75 FEATURE: limits post created edited trigger to a group (#31523)
This commit allows admins to limit the post created/edited trigger
execution to a specific post user group.

It's for example useful if you want to auto tag all the topics created
by member of a specific group.
2025-02-26 10:52:40 +01:00
fbe5a9c710 DEV: delete PasswordValidation mixin (#31520)
This removes the PasswordValidation mixin that is no longer used
anywhere else.
2025-02-26 11:36:34 +08:00
ed1543455d FIX: Allow oneboxes with no description (#31518)
This behaviour was allowed in
cb82dce86a
but then inexplicably removed a few months later in
https://github.com/discourse/onebox/pull/448, but showing
title-only oneboxes is valid. The original Meta topic that
this was discussed in was
https://meta.discourse.org/t/abc-news-not-oneboxing-due-to-missing-description/155933
.

This commit re-introduces allowing this behaviour to avoid the need for
a plugin,
c.f. https://meta.discourse.org/t/allow-title-only-onebox/354306

For example
<https://en-americas-support.nintendo.com/app/answers/detail/a_id/67660>

This commit also unhides onebox descriptions in chat, it's not
clear why they were ever hidden in the first place
2025-02-26 13:16:51 +10:00
e6df4b6c49 DEV: replace passwordValidation mixin in CreateAccount modal component (#31444)
This introduces a helper class for password validation logic, and
replaces the mixin in the create-account modal component class. All
properties that impact password validation in that class are also
converted to autotracked properties and getters - the 1 remaining mixin
here (UserFields) doesn't reference properties through `this.model` so
no need to make changes in that mixin.
2025-02-26 10:45:46 +08:00
Sam
48bfa202e0 PERF: improve performance of username mover (#31517)
Always double check we are going to need to
rewrite a json object prior to doing the work

Pathological cases such a Null could end up
doing JSON rewrites on the  most of the notification
table
2025-02-26 11:07:49 +11:00
57a0bfaef1 Build(deps-dev): Bump lefthook from 1.11.0 to 1.11.1 (#31514)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.11.0
to 1.11.1.
- [Release notes](https://github.com/evilmartians/lefthook/releases)
-
[Changelog](https://github.com/evilmartians/lefthook/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/evilmartians/lefthook/compare/v1.11.0...v1.11.1)

---------

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-02-25 23:02:35 +01:00
ae21f232a1 Build(deps-dev): Bump @swc/core from 1.10.18 to 1.11.1 (#31513)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.10.18 to
1.11.1.
- [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.10.18...v1.11.1)

---------

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-02-25 23:02:25 +01:00
0123345f06 Build(deps): Bump oj from 3.16.9 to 3.16.10 (#31511)
Bumps [oj](https://github.com/ohler55/oj) from 3.16.9 to 3.16.10.
- [Release notes](https://github.com/ohler55/oj/releases)
- [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/ohler55/oj/compare/v3.16.9...v3.16.10)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 22:43:18 +01:00
dae4f170c2 Build(deps-dev): Bump rubocop-ast from 1.38.0 to 1.38.1 (#31510)
Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.38.0
to 1.38.1.
- [Release notes](https://github.com/rubocop/rubocop-ast/releases)
-
[Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop-ast/compare/v1.38.0...v1.38.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 22:43:09 +01:00
26b0428837 FIX: exclude links from hidden posts in user summary (#31504)
Ref - https://meta.discourse.org/t/-/353878
2025-02-25 12:56:16 -05:00
74374e21a8 DEV: Add correct-scroll-position behavior transformer (#31486)
Add `correct-scroll-position` behavior transformer
2025-02-25 11:16:10 -06:00
f498c3b3e8 FIX: do not add _pm suffix to locale key when email is from system user (#31505)
See
https://meta.discourse.org/t/email-footer-says-visit-message-to-respond-to-no-names-after-to/354359

There may be a deeper root issue somewhere further up the stack, but
this change ensures we always use the `visit_link_to_respond` locale key
when the PM is from `system`. Seems cleaner than copy that says `to
respond to system`.

Before

![CleanShot 2025-02-25 at 10 38
44@2x](https://github.com/user-attachments/assets/ef12a957-72f7-418e-a109-448384e32def)

After

![CleanShot 2025-02-25 at 10 38
25@2x](https://github.com/user-attachments/assets/d8359812-63c5-444a-b36a-75a2e0bcfbb0)
2025-02-25 11:37:52 -05:00
1d7663d63c FEATURE: Allow chat incoming webhooks to work without .json extension (#31497)
This provides a slightly nicer-looking URL, and also helps when external
systems have strict validations on the webhook URL.
2025-02-25 15:04:57 +00:00
61d8cce569 Update translations (#31501) 2025-02-25 15:11:27 +01:00
3d5a1858e5 FIX: exclude bots of inaccessible/unreachable mentions (#31458)
It will prevent to show a notice saying the bot is not part of the
channel.

---------

Co-authored-by: Martin Brennan <mjrbrennan@gmail.com>
2025-02-25 10:19:51 +01:00
3a8e078116 FIX: Use []() Markdown syntax for links instead of <> for narrative bot (#31496)
In one of the discourse narrative bot tutorial steps, we show the user a
few links and ask them to copy one and paste it in a reply to teach them
about oneboxes. In order to prevent the links from getting oneboxed in
the bot's post, we enclose them in `<>` which makes the links render
as-is without oneboxing.

However, if an admin attempts to customize via site texts the tutorial
step about onebox, the links enclosed in `<>` get removed completely
from the step content because they're interpreted as HTML tags when the
text override goes through sanitization (see [relevant
code](424da95128/app/models/translation_override.rb (L73-L74))).

To prevent that, this commit changes the default content for the onebox step
to use the `[]()` syntax which doesn't get sanitized and also doesn't
get oneboxed.

Internal topic: t/147912.
2025-02-25 11:51:15 +03:00
8cacb9800d DEV: Remove deprecated AuthProvider attributes (#31443)
A number of attributes on AuthProvider are deprecated for and were marked for removal in 2.9.0.

This PR removes them.
2025-02-25 16:40:35 +08:00
424da95128 DEV: Fix username/name mapping for Discord auth (#31494)
Previously we were applying the Discord username to both the name and
the username fields in Discourse.

Supersedes https://github.com/discourse/discourse/pull/30994
2025-02-25 17:33:26 +11:00
209d289772 FIX: No method error in WebhooksController#sendgrid (#31495)
When an email is sent by sendgrid to an email address with an invalid
host, the webhook payload does not contain the "status" field:

```
[
  {
    "bounce_classification": "Unclassified",
    "email": "noemail@this.does.not.exist.tld",
    "event": "bounce",
    "reason": "unable to get mx info: failed to get IPs from PTR record: lookup <nil>: unrecognized address",
    "sg_event_id": "Ym91bmNlLTQtNTA0ODUxOTUtZXVvMmlLeGRTYXlQRjRZRTQtLUk3QS0w",
    "sg_message_id": "euo2iKxdSayPF4YE4--I7A.recvd-5f54b5d587-pczjm-1-67BADEEA-6.0",
    "smtp-id": "<870b3a2a-160c-4fc8-bc9a-bd0d5b943b81@forum.umbraco.com>",
    "timestamp": 1740300320,
    "tls": 0,
    "type": "blocked"
  }
]
```

When the `status` field is missing, it results in a `NoMethodError
(undefined method `[]' for nil:NilClass)`
error in the controller method. In this commit, we will specifically
handle the webhook event from sendgrid when the email address's domain
is invalid.

Co-Authored-By: @nul800sebastiaan
2025-02-25 13:08:59 +08:00
b02e87b8c4 DEV: Introduce ColorPaletteEditor component (#31328)
As part of the theme/color palette overhaul project, we're redesigning
the UI for the editing color palettes. This commit introduces a new
`ColorPaletteEditor` component that encapsulates all the logic and
interface for editing color palettes in the redesigned admin interface.
This component isn't used anywhere at this moment, but it will be once
we start introducing the rest of the redesigned interface.
2025-02-25 07:58:04 +03:00
f1a892a64e FIX: include silence_reason when admin sees user (#31493)
Small regression created in this PR
https://github.com/discourse/discourse/pull/30635

The reason is included only when `include_silence_reason` option is
included.
2025-02-25 14:14:33 +11:00
f591083407 PERF: Set cluster_concurrency for Jobs::UpdateUsername to 1 (#31492)
This optimization is similar to the optimization applied in
eb603b246bad6df964b179a047a63e2b7894be8a. As part of the
`UserAnonymizer#make_anonymous` method call, the `Jobs::UpdateUsername`
sidekiq job is enqueued and this job runs many expensive and hard to
optimize SQL queries. Hence, we are restricting the
`cluster_concurrency` for
the sidekiq job to `1` to prevent the database from being overloaded in
the event that many users are being anonymized in a short period of
time.
2025-02-25 10:47:51 +08:00
4eed96f511 FIX: Discobot onebox step sometimes not working (#31472)
This issue was found via Discobot. In part of the tutorial
for Discobot, it asks for a URL on one line so it can demonstrate
how oneboxes work.

The way it does this when the user replies is to cook the
post raw and check if there is a cached onebox for the URL
in the post. However, if you reply really fast to Discobot
with the URL without waiting for the onebox to appear in the
composer preview, it's not cached by the time we do this
check in the Discobot code.

This commit fixes the issue by following a more simplified
approach, where we check for the existence of one of the
following links from the onebox instructions:

```
https://en.wikipedia.org/wiki/Inherently_funny_word
https://en.wikipedia.org/wiki/Death_by_coconut
https://en.wikipedia.org/wiki/Calculator_spelling
```

This will fall down if someone customizes the onebox
step text, or if the user uses a different link instead,
but we are willing to accept that risk at this time to simplify things.
2025-02-25 12:41:37 +10:00
ae5ad250f6 DEV: Extract out html cleanup so it can be used on other types of cooked content (#31385)
`PrettyText.cook` does two things: 1️⃣ convert raw to cooked, 2️⃣
partial sanitisation.

This commit splits the 2️⃣ up so that it can be applied to other cooked
content.
2025-02-25 10:36:36 +08:00
d4e5d63d7e DEV: Fix command error message formatting (#31491)
a follow up to 51b0903f514c3c22569401e74ebd1215c317d787
2025-02-25 02:28:01 +01:00
51b0903f51 DEV: Add command to execute_command errors (#31490) 2025-02-25 00:49:11 +01:00
3d2a6322d0 DEV: Update lint-configs and auto-fix issues (#31485) 2025-02-24 23:32:31 +01:00
2561f4f431 Build(deps-dev): Bump puppeteer-core from 24.2.1 to 24.3.0 (#31487)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from
24.2.1 to 24.3.0.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
-
[Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v24.2.1...puppeteer-core-v24.3.0)

---------

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-02-24 23:21:06 +01:00
109fc428d8 DEV: Clear extra-locales cache between tests (#31488) 2025-02-24 22:10:43 +00:00
db3db9fe41 DEV: Log site setting changes from the rails console (#31353)
When using the rails console to change site settings log them to the
staff actions logs so that there is a record.
2025-02-24 14:57:01 -07:00
f744852f10 Build(deps-dev): Bump rubocop-rails from 2.30.1 to 2.30.2 (#31484)
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from
2.30.1 to 2.30.2.
- [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.1...v2.30.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 22:27:03 +01:00
7b6284d6f2 Build(deps): Bump version_gem from 1.1.5 to 1.1.6 (#31483)
Bumps [version_gem](https://gitlab.com/oauth-xx/version_gem) from 1.1.5
to 1.1.6.
-
[Changelog](https://gitlab.com/oauth-xx/version_gem/blob/1.1-stable/CHANGELOG.md)
-
[Commits](https://gitlab.com/oauth-xx/version_gem/compare/v1.1.5...v1.1.6)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 22:26:54 +01:00
7e37aa007f Build(deps): Bump excon from 1.2.3 to 1.2.4 (#31482)
Bumps [excon](https://github.com/excon/excon) from 1.2.3 to 1.2.4.
- [Changelog](https://github.com/excon/excon/blob/master/changelog.txt)
- [Commits](https://github.com/excon/excon/compare/v1.2.3...v1.2.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 22:26:44 +01:00