34946 Commits

Author SHA1 Message Date
Gary Pendergast
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
Martin Brennan
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
Krzysztof Kotlarek
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
Ted Johansson
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
Jarek Radosz
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
Jarek Radosz
28e00d9bfe
DEV: Update lint-configs and autofix issues (#31620)
This updates us to Prettier 3.x
2025-03-05 01:20:16 +01:00
dependabot[bot]
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
dependabot[bot]
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
Kris
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
Guhyoun Nam
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
David Taylor
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
David Taylor
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
Jarek Radosz
3160ad8fb0
DEV: Convert d-button test classes to native syntax (#31622) 2025-03-04 18:44:07 +01:00
Jarek Radosz
150edff1cf
DEV: Use an inline require to avoid a circular import (#31615) 2025-03-04 17:34:44 +01:00
Jarek Radosz
b0cf0f89be
DEV: Inline the test templates (#31614)
in preparation for running the gjs codemod
2025-03-04 17:34:22 +01:00
Jarek Radosz
5aa47a26ee
DEV: Remove unused modal code (#31613) 2025-03-04 17:24:17 +01:00
Renato Atilio
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
Renato Atilio
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
Renato Atilio
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
Renato Atilio
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
Renato Atilio
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
Renato Atilio
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
Renato Atilio
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
Renato Atilio
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
Joffrey JAFFEUX
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
Renato Atilio
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
Ted Johansson
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
Kelv
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
Ted Johansson
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
Ted Johansson
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
Gary Pendergast
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
Martin Brennan
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
Keegan George
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
Krzysztof Kotlarek
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
Krzysztof Kotlarek
64683389a2
UX: rich text for review_process_description (#31594)
In this PR, information about the review process was added to the flag
modal - https://github.com/discourse/discourse/pull/31300

Admins would like to use HTML tags to customise it even more.
2025-03-04 10:34:02 +11:00
Jarek Radosz
4ed7a88a94
UX: Fix notifications tracking buttons styling (#31592)
A follow up to c95c3c4311a7af461e23f18a2aad6f6e68414560
2025-03-03 23:33:49 +01:00
Joffrey JAFFEUX
f2bf669dc2
DEV: aliases should be considered as existing (#31589)
Before this commit doing: `Emoji.exists?(some_alias)` would return
false. The only important thing in emoji is to never remove an emoji
code which has been used by users but changing the name of an emoji and
keeping old name as an alias should not break the application in any
way, this commit should ensure this is true.
2025-03-03 20:17:49 +01:00
David Taylor
85406d9475
DEV: Resolve flaky terser spec (#31588) 2025-03-03 18:40:44 +00:00
Osama Sayegh
49902a0cc3
FIX: Correct translation key for admin color palettes page heading (#31587) 2025-03-03 20:12:55 +03:00
Jarek Radosz
454dd1ea51
DEV: Change glimmer_topic_list_mode to enabled by default (#31585)
https://meta.discourse.org/t/343404
2025-03-03 18:07:15 +01:00
Joffrey JAFFEUX
d456e83adc
DEV: bump discourse-emojis gem (#31583)
This should fix an issue with a 100 emoji alias. 100 should now be
considered as the top level emoji name and hundred_points an alias.

Other renames are also part of this gem bump: sweat_smile, grin, ...
2025-03-03 17:39:55 +01:00
dependabot[bot]
4a05f3198d
Build(deps-dev): Bump @ember/render-modifiers from 2.1.0 to 3.0.0 (#31569)
Bumps
[@ember/render-modifiers](https://github.com/emberjs/ember-render-modifiers)
from 2.1.0 to 3.0.0.
- [Release
notes](https://github.com/emberjs/ember-render-modifiers/releases)
-
[Changelog](https://github.com/emberjs/ember-render-modifiers/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/emberjs/ember-render-modifiers/compare/v2.1.0...v3.0.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-03-03 16:58:56 +01:00
dependabot[bot]
8165de9483
Build(deps-dev): Bump @swc/core from 1.11.4 to 1.11.5 (#31571)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.4 to
1.11.5.
- [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.4...v1.11.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:29:06 +01:00
dependabot[bot]
6da6809014
Build(deps): Bump @faker-js/faker from 9.5.0 to 9.5.1 (#31573)
Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 9.5.0 to
9.5.1.
- [Release notes](https://github.com/faker-js/faker/releases)
- [Changelog](https://github.com/faker-js/faker/blob/next/CHANGELOG.md)
- [Commits](https://github.com/faker-js/faker/compare/v9.5.0...v9.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:06:03 +01:00
dependabot[bot]
7cbd7ad39c
Build(deps): Bump core-js from 3.40.0 to 3.41.0 (#31572)
Bumps
[core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js)
from 3.40.0 to 3.41.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
-
[Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/zloirock/core-js/commits/v3.41.0/packages/core-js)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:05:35 +01:00
dependabot[bot]
077393fb59
Build(deps-dev): Bump ember-async-data from 1.0.3 to 2.0.0 (#31570)
Bumps
[ember-async-data](https://github.com/tracked-tools/ember-async-data)
from 1.0.3 to 2.0.0.
- [Release
notes](https://github.com/tracked-tools/ember-async-data/releases)
-
[Changelog](https://github.com/tracked-tools/ember-async-data/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tracked-tools/ember-async-data/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:03:31 +01:00
Joffrey JAFFEUX
80625f6c1c
DEV: explicit json for emojis/search-aliases (#31582)
Adds `.json` a suffix everywhere and makes it clear that's it's a json
route.

Also adds a missing spec for this endpoint and updates the underlying
discourse-emojis gem for better symlinking
2025-03-03 15:21:16 +01:00
David Taylor
1bd61630ef
UX: Simplify admin theme editor (#31561)
- Hide seldom-used fields behind an 'advanced' checkbox. This replaces
the old 'only show edited' checkbox, since the number of fields shown by
default is now so small that 'only show edited' isn't useful.
Mobile/desktop targets are included in that list because we now
recommend people use CSS breakpoints for handling different device
sizes.

- Update names & descriptions of fields to be more descriptive

- Show the descriptions of fields at the top of the editor. Previously
they were only shown as tooltips.

Before:
<img width="1109" alt="SCR-20250228-lunn"
src="https://github.com/user-attachments/assets/8faebba1-39c1-491a-b236-411cfb6d9c74"
/>

After, default view:
<img width="1102" alt="SCR-20250303-kayr"
src="https://github.com/user-attachments/assets/1e483845-613f-44d6-83d6-ade628251fe5"
/>

After, advanced view:
<img width="1122" alt="SCR-20250303-kazn"
src="https://github.com/user-attachments/assets/45b8933d-2271-42ba-b5b4-81b326709adb"
/>
2025-03-03 12:20:11 +00:00
Joffrey JAFFEUX
d38acc5df1
DEV: discourse-emojis gem (#31408)
This commit moves most of emoji logic into the discourse-emojis gem:
https://github.com/discourse/discourse-emojis/

Most notably:
- images are now symlinked from the gem
- the gem provides path to the json files

Search aliases have also been made asynchronous and memoized. When you
will search for an emoji we will now load the aliases and store the list
for future use.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-03-03 13:09:08 +01:00
Hugh Lashbrooke
a5c21a92b2
UX: Add recommended image size for category logos (#31574)
This adds a description to the category logo image fields that informs users of the recommended image aspect ratio and minimum size to upload.
2025-03-03 20:53:36 +11:00