1809 Commits

Author SHA1 Message Date
Martin Brennan
8ccb66a44a
FEATURE: Release admin search for all sites (#32327)
This commit removes the experimental setting controlling
admin search and releases it for all admins. This search
can be triggered with Ctrl+/ or Cmd+/

For more information see
https://meta.discourse.org/t/introducing-comprehensive-admin-search/360157
2025-04-16 16:26:53 +10:00
Krzysztof Kotlarek
14a42bdafe
FIX: incorrect flag message when en_GB language (#32191)
Currently, this is the order of i18n translate function:
1. Translation in required language;
2. Optional `defaultValue` provided;
3. Fallback to forum default language.

When admin set language as English GB, translation was not correctly
displayed as it went to step 2 and displayed `defaultValue` instead of
correct translation from default language.
2025-04-10 08:06:52 +08:00
Chris Alberti
3106c30f16
Added button to remove password from account (#32200)
Added button to remove password from account if user has a linked
external account or passkey

The button only displays if the user has at least one associated account
or a passkey set up. Uses the ConfirmSession dialog in addition to a
warning about deleting the password.

Users can still reset their password via the Reset Password button
(which will now display "Set Password" if they've removed it).

Also prevent user from removing their last remaining associated account
or passkey if they have no password set.

Replaces PR #31489 from my personal repo, with some fixes for conflicts
since then.
2025-04-09 09:32:51 -05:00
Osama Sayegh
ad0966afa9
FEATURE: Introduce new components listing page (#32164)
Follow-up to https://github.com/discourse/discourse/pull/31887

This commit introduces a new design for the components listing page, which
is not linked from anywhere in the UI at the moment, but it can be
accessed by heading to the `/admin/config/customize/components` path
directly. We'll make this new design available from the sidebar and
remove the old page once we've tested and validated the new design
internally.

Internal topic: t/146007.

---------

Co-authored-by: Ella <ella.estigoy@gmail.com>
2025-04-08 17:58:29 +03:00
Gabriel Grubba
a88d8a0393
FEATURE: prioritize the user who is getting the reply in the autocomplete (#32086)
When replying to a post, the user who is getting the reply should be
prioritized in the autocomplete

- Added in composer a getter for getting `.replyingToUser`
- Added in d-editor the reference to the user that is getting the
reply(`this.composer.replyingToUser`)
- Passed along the reference to the user that is getting the reply to
the user-search service as `replyingToUser`
- Controller `users_controller.rb` was modified to accept the `user_id`
parameter and pass it to the `UserSearch` model
- The `UserSearch` model was modified to accept the `user_id` parameter
and use it to prioritize the user that is getting the reply in the
autocomplete on the first time you call the autocomplete service and
while the username is included in the searched term
- Had to update the serializer to pass the id of the `replyingToUser`
from the post
2025-04-04 10:11:37 -03:00
Natalie Tay
aebb1f0968
DEV: Pass full model for tag to sidebar serializer (#32170)
We are currently only passing a few attributes of a tag when serializing
sidebar tags.

This commit passes the `Tag` into the serializer instead.
2025-04-04 16:29:57 +08:00
Gary Pendergast
33748895a9
FEATURE: Highlight watched words found in reviewables. (#32167)
This change highlights watched words found in any reviewable posts.
2025-04-04 17:26:14 +11:00
Gary Pendergast
b4cdc39e51
FEATURE: Allow rejected user details to be scrubbed (#31987)
When a site has the `must_approve_users` setting enabled, new user data is stored on the Reviewable model, including username, email, and any other data that is entered during signup. If the user is rejected, that data is retained, without a clear path to deleting it.

In order to allow data that could be PII to be removed, without breaking Discourse's audit and logging trails, this change scrubs the PII from the relevant `ReviewableUser` and `UserHistory` objects, replacing that data with who scrubbed it, and why.
2025-03-31 12:40:35 +11:00
Sérgio Saquetim
c671cfff84
DEV: Upgrade the post widgets to Glimmer components (#31375)
Co-authored-by: David Taylor <david@taylorhq.com>
2025-03-26 18:53:46 -03:00
David Battersby
d06c60ca7c
FEATURE: add icons and emojis to category (#31795)
This feature allow admins to personalize their communities by
associating emojis or icons with their site categories.

There are now 3 style types for categories:
- Square (the default)
- Emoji
- Icon

### How it looks 🎨 

Adding an icon:

<img width="502" alt="Category with an icon"
src="https://github.com/user-attachments/assets/8f711340-166e-4781-a7b7-7267469dbabd"
/>

Adding an emoji:

<img width="651" alt="Category with an emoji"
src="https://github.com/user-attachments/assets/588c38ce-c719-4ed5-83f9-f1e1cb52c929"
/>

Sidebar:

<img width="248" alt="Sidebar with emojis"
src="https://github.com/user-attachments/assets/cd03d591-6170-4515-998c-0cec20118568"
/>

Category menus:

<img width="621" alt="Screenshot 2025-03-13 at 10 32 30 AM"
src="https://github.com/user-attachments/assets/7d89797a-f69f-45e5-bf64-a92d4cff8753"
/>

Within posts/topics:

<img width="382" alt="Screenshot 2025-03-13 at 10 33 41 AM"
src="https://github.com/user-attachments/assets/b7b1a951-44c6-4a4f-82ad-8ee31ddd6061"
/>

Chat messages:

<img width="392" alt="Screenshot 2025-03-13 at 10 30 20 AM"
src="https://github.com/user-attachments/assets/126f8076-0ea3-4f19-8452-1041fd2af29f"
/>

Autocomplete:

<img width="390" alt="Screenshot 2025-03-13 at 10 29 53 AM"
src="https://github.com/user-attachments/assets/cad75669-225f-4b8e-a7b5-ae5aa8f1bcad"
/>

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-03-26 09:46:17 +04:00
Martin Brennan
e99ed81586
DEV: Serialize theme_id and colors for user selectable color palettes (#31972)
We currently have `user_color_schemes` serialized on the preloaded
`Site` object, but it's very lightweight, only having an ID and name.
It would be useful for some themes and also the user Interface
preferences tab to be able to access the colors for the color scheme,
as well as the theme it belongs to.

This commit expands the serializer to include these extra attributes.
This `user_color_schemes` key is already cached as a fragment, so this
shouldn't be too much extra burden to send to the client.
2025-03-25 16:31:28 +10:00
Roman Rizzi
9bc394191c
DEV: TopicListItemSerializer tells if topic is among the top 100 hottest topics (#31935) 2025-03-24 11:55:14 -05:00
Gary Pendergast
b77d0f7589
FEATURE: Sync Reviewable Status (#31901)
When multiple admins are working in the review queue, it's quite easy for two people to try and handle the same reviewable at the same time. This change addresses the two major situations where this can occur.

The `ReviewableClaimedTopic` model has been extended to allow the system to mark a reviewable as claimed as soon as the first moderator starts handling the reviewable, even when the `reviewable_claiming` setting is disabled. This ensures that reviewable actions with client-site activity (for example, `agree_and_suspend`) will lock the reviewable before another moderator starts working on it.

When someone handles handles a reviewable, we now use `MessageBus` to inform other moderators that it's changed. If any of the other moderator have that reviewable open (either individually, or on the list screen), it will automatically refresh that data.
2025-03-24 14:27:18 +11:00
Osama Sayegh
f7f7642ae0
UX: Improve naming for anonymous mode settings (#31832)
This PR renames a couple of settings related to anonymous mode:

1. `allow_anonymous_posting` → `allow_anonymous_mode`. This setting is
used as a switch for the entire anonymous mode feature, so it makes
sense to give it a generic name that better reflects what the setting
does.
2. `allow_anonymous_likes` → `allow_likes_in_anonymous_mode`. The new
name is clearer and will match a new setting that we'll add to allow
anonymous users to post in chat.

Internal topic: t/148088.
2025-03-21 04:54:06 +03:00
Gary Pendergast
9d14492f22
FIX: When displaying a reviewable, don't append the title to the content (#31851)
Follow up to e4401e587e98ac4020c2c4fd965e227146cf33d4.

In the previous change, when serialising a Reviewable post, we were appending the title to the post content whilst checking for watched word matches. This append action was acting upon the object itself, rather than just a copy of the string, causing the UI to display the title appended twice to the content.

Fortunately, since it was only happening in the serialiser, the incorrect data was never stored in the database, it was only happening when viewing the review queue.
2025-03-18 11:57:39 +11:00
Gary Pendergast
6cd282eeb3
FEATURE: Display a toast popup after completing a review action. (#31786)
When performing an action in the review queue, this change makes two improvements:

- The buttons on the reviewable item are disabled, so you can't accidentally multi-click.
- A toast is displayed when the action is complete, as a success indication.
2025-03-18 11:26:59 +11:00
Osama Sayegh
25e8b5af9f
FEATURE: Introduce new color palettes config area (#31742)
As part of the theme/color palette overhaul project, we're introducing a
new admin page for editing color palettes. The new page is located at
`/admin/config/colors/:id`. It's linked from anywhere, but it will be
linked in the sidebar as we progress more in the overhaul project.

Related PRs: https://github.com/discourse/discourse/pull/30893
https://github.com/discourse/discourse/pull/30915
https://github.com/discourse/discourse/pull/31328.

Internal topic: t/148628.
2025-03-12 16:57:31 +03:00
Ted Johansson
0dc39fd560
UX: Show scope mode in API key list (#31605)
**Note:** Do not merge before the backfill (#31606) is merged.

### What is this change?

We're now storing the selected API key scope mode in the back-end, and
can display it in the API key list.

**Screenshot:**

<img width="551" alt="Screenshot 2025-03-04 at 7 27 42 PM"
src="https://github.com/user-attachments/assets/9f234242-cfaa-4a2c-93e9-740770bd9944"
/>
2025-03-11 10:00:42 +08:00
Krzysztof Kotlarek
54771b5949
FIX: remove admin_sidebar_enabled_groups setting (#31693)
Old no sidebar admin panel is deprecated and admin sidebar is not
experimental anymore. Therefore, old setting should be deleted.
2025-03-11 11:41:38 +11:00
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
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
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
Arpit Jalan
9bb6d09d1a
DEV: implements register_modifier(:serialize_topic_op_likes_data) (#31376)
This commit will allow plugin developers to enable/disable the topic op
likes data in serializer.

Usage:

```
register_modifier(:serialize_topic_op_likes_data) { |enabled| true }
```
2025-02-21 22:43:49 +05:30
Martin Brennan
e26a1175d7
FEATURE: Initial version of experimental admin search (#31299)
This feature allows admins to find what they are
looking for in the admin interface via a search modal.
This replaces the admin sidebar filter
as the focus of the Ctrl+/ command, but the sidebar
filter can also still be used. Perhaps at some point
we may remove it or change the shortcut.

The search modal presents the following data for filtering:

* A list of all admin pages, the same as the sidebar,
   except also showing "third level" pages like
   "Email > Skipped"
* All site settings
* Themes
* Components
* Reports

Admins can also filter which types of items are shown in the modal,
for example hiding Settings if they know they are looking for a Page.

In this PR, I also have the following fixes:

* Site setting filters now clear when moving between
   filtered site setting pages, previously it was super
   sticky from Ember
* Many translations were moved around, instead of being
   in various namespaces for the sidebar links and the admin
   page titles and descriptions, now everything is under
   `admin.config` namespace, this makes it way easier to reuse
   this text for pages, search, and sidebar, and if you change it
   in one place then it is changed everywhere.

---------

Co-authored-by: Ella <ella.estigoy@gmail.com>
2025-02-21 11:59:24 +10:00
Gary Pendergast
29a8c6ee49
DEV: Add a new type_source field to the Reviewable model. (#31325)
This change adds a new `type_source` field to the `Reviewable` model, indicating whether the Reviewable type was registered by `core`, a plugin, or an `unknown` source.

When a plugin that registered a Reviewable type is disabled, this allows us to tell the user which plugin they need to re-enable to handle any orphan reviewable items.
2025-02-20 09:09:47 +11:00
benj
321a220b49
FIX: Post revision respects 'prioritize_full_name_in_ux' setting (#31293)
WIP

Before:
![Screenshot 2025-02-11 at 6 21
19 PM](https://github.com/user-attachments/assets/408b99a0-860a-47a0-a5e6-178583bcf17e)


After:
![Screenshot 2025-02-11 at 6 20
58 PM](https://github.com/user-attachments/assets/e70edb94-b927-43e7-99c4-23041759f47f)
2025-02-13 13:25:27 -06:00
Natalie Tay
5f00ae2ca9
DEV: Introduce plugin modifiers for post.cooked and topic.fancy_titles (#31261)
Related:
40fd82e2d1

This PR introduces three new plugin modifiers attached to 
- `basic_post_serializer.cooked`
- `basic_topic_serializer.fancy_title`
- `topic_view_serializer.fancy_title`

Implementation note: I had wanted to add them in the `Post` and `Topic`
models themselves, but they do not directly provide access to the
request's scope which is needed for the use case.
2025-02-14 00:19:50 +08:00
Blake Erickson
afda973070
FIX: User profile not loading with an empty export (#31290)
If a user has an export that doesn't have a file it can cause their
profile page to not load.
2025-02-11 16:18:06 -07:00
Osama Sayegh
4db3389f3d
FIX: Don't load all groups when rendering <GroupChooser /> (#31271)
In a few places throughout the app, when we render the `<GroupChooser
/>` component, we fetch the full groups list of the site from the
`/groups/search` endpoint. This is wasteful because the full groups list
is already included in the preloaded data that's sent to the client app
on the initial page load, so we can just use this preloaded list for
`<GroupChooser />` and we can avoid making an HTTP request.

Internal topic: t/147297.
2025-02-11 21:32:02 +03:00
Arpit Jalan
85a95e9aa1
FEATURE: add first_post_id to TopicListItemSerializer (#31254)
Will be used in this feature:
https://github.com/discourse/discourse-topic-cards/pull/36
2025-02-10 21:53:05 +05:30
Martin Brennan
52a50f1028
PERF: Admin plugin preload settings routes (#31215)
Followup 503f9b6f02ac5c4918d41611848c886b8755e5a0

This previous commit introduced an autogenerated
settings route for every plugin with more than one
setting defined. Plugins with only one setting
only have enabled_site_settings defined, which are
handled using the toggle in the admin plugin list,
so we don't need a dedicated setting page for them.

However in production this introduced a performance
issue, since we were looking through SiteSetting.all_settings
for every plugin, which could be quite slow in some
cases especially on our hosting.

Instead, we already have all the plugin settings cached
inside `SiteSetting.plugins`. We can instead use this to
count how many settings the plugin has, then if there is > 1
for a plugin we use the settings route. This is a much faster lookup
than
searching through SiteSetting.all_settings.
2025-02-07 11:23:43 +10:00
Arpit Jalan
aa222ef7b8
FEATURE: add first post likes data serializer (#31216)
This PR adds two attributes (`op_can_like` & `op_liked`) to
`TopicListItemSerializer`.

We've also added `serialize_topic_op_likes_data` theme modifier so that
these two attributes are only added when a theme or component needs this
data.
2025-02-06 20:50:30 +05:30
Ted Johansson
503f9b6f02
DEV: Use default admin routes for plugins with settings (#30941)
This change adds a sidebar link for each plugin that fulfils the following criteria:

- Does not have an explicit admin route defined in the plugin.
- Has at least one site setting (not including enabled/disabled.)

That sidebar link leads to the automatically generated plugin show settings page.
2025-02-04 14:57:28 +08:00
David Battersby
c64b5d6d7a
FEATURE: Multiple Draft Topics (#30790)
Allows users to save multiple topic and personal message drafts,
allowing more flexibility around content creation.

The "New Topic" button will now always start a fresh topic. Drafts can
be resumed from the drafts dropdown menu or using the "My Drafts" link
in the sidebar.

Since drafts require a unique `draft_key` and `user_id` combination, we
have updated the format of the draft key for both topics and personal
messages. They will now have a prefix like "new_topic_" or
"new_message_" with the timestamp of when the composer was first opened
appended.
2025-01-29 10:23:26 +04:00
Krzysztof Kotlarek
cfcc60f847
FEATURE: new fast_typing_threshold site setting (#30865)
Rename `min_first_post_typing_time` to `fast_typing_threshold` and
provide admin 4 options:
- disabled
- low - 1 second
- standard - 3 seconds
- high - 5 seconds

Related PRs:
- https://github.com/discourse/discourse-zoom/pull/112
2025-01-28 09:53:03 +11:00
Martin Brennan
1b9e2ff4f9
FEATURE: Add attribution to staff notice and rename functionality (#30920)
The name "Staff Notice" was not quite right since TL4 users
can also add these notices. This commit changes the wording to
"Official Notice".

In addition to this, currently you have to go look into the staff
action logs to see who is responsible for a notice. This commit
stores the ID of the user who created the notice, then shows this
information on each notice to staff users.

Finally, I migrated the ChangePostNoticeModal component to gjs.
2025-01-24 09:29:22 +10:00
Gary Pendergast
7fc8d74f3e
FEATURE: Allow admins to export users (#30918)
The GDPR requires all users to be able to export their data, or request an export of their data. This is fine for active users as we have a data export button on user profiles, but suspended users have no way of accessing the data export function, and the workaround for admins to export data for suspended users involves temporarily unsuspending them, then impersonating the user to export the data as them.

Since suspended users no longer have access to their account, we can safely assume that the export request will be coming via a medium outside of Discourse (eg, email). This change is built with this workflow in mind.

This change adds a new "User exports" section to the admin user page, allowing admins to start a new export, and to download the latest export file.
2025-01-24 08:13:25 +11:00
Keegan George
7b76d25946
DEV: Adopt post list component and new posts route front-end (#30604)
Recently we introduced a new `PostList` component (d886c55f63). In this update, we make broader adoption of this component. In particular, these areas include using the new component in the user activity stream pages, user's deleted posts, and pending posts page. This update also takes the existing `posts` route and adds a barebones front-end for it to view posts all in one page.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-01-23 10:20:45 -08:00
marstall
2663cb86ae
FEATURE: add new hidden site setting to show full names in user card
adds a hidden site setting, "prioritize_full_names_in_ux", whose effect is to prefer full names in user-menu notifications

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2025-01-23 12:26:59 -05:00
Régis Hanol
03119312b5
FIX: ensure GroupChooser works with localized group names (#30593)
The "Tag Groups Form" component was using group names to handle
permissions. This works just fine when the default locale is "English"
but breaks as soon as it's changed to a different locale.

The fix is to use the group id's for handling the permissions instead of
the group name.

Reported in https://meta.discourse.org/t/221849
2025-01-13 11:29:04 +01:00
Ted Johansson
590b3e11fb
DEV: Convert admin API keys to conform to UI guidelines (#30660)
Re-opening of #30096. It was reverted because it was missing a sidebar link to Webhooks in the admin panel.
2025-01-09 10:57:40 +08:00
Mark VanLandingham
4da7904ffd
REVERT: "DEV: Convert admin API keys to conform to UI guidelines"
This reverts commit d9ddc258089da0f6cd8cf75af385c8a59eeccac3.

I noticed that Webhook admin UI is now inaccessible through the subheader
2025-01-08 11:03:40 -06:00
Ted Johansson
d9ddc25808
DEV: Convert admin API keys to conform to UI guidelines (#30096)
This PR updates the admin API keys page to follow the Admin UI Guidelines. In addition it modernizes all the JavaScript involved in this admin area.
2025-01-08 18:11:38 +08:00
Sam
9cf78ba195
FEATURE: show silence reason when viewing silenced users (#30635)
This adds the Silence Reason column to silenced user lists.

This feature helps combat large spam attacks cause you can quickly see
why a user was silenced and then bulk act on all the silenced users
2025-01-08 16:04:19 +11:00
Osama Sayegh
4f9359d056
FIX: Name field should appear in the signup form for login-required sites (#30634)
Meta topic: https://meta.discourse.org/t/full-name-at-sign-up-went-missing/345662/17?u=osama

The preloaded `site` object for anons on login-required sites is a stripped down version of the full object with just a specific set of attributes and doesn't use the site serializer. This results in the `full_name_required_for_signup` and `full_name_visible_in_signup` attributes not making it to the client app when a login-required site is accessed by an anon, causing the name field in the signup form to not be rendered, even when it's required.

This commit includes those attributes in the stripped down version of the `site` object that's used for anons on login-required sites.
2025-01-08 03:49:34 +03:00
Osama Sayegh
e2129dc07c
FIX: Allow signups when full names are disabled (#30551)
Follow-up to 3187606d34

When the `enable_names` setting is false and the `full_name_requirement` setting is set to `required_at_signup`, the name field in the signup form should effectively be not required (and hidden). However, that is not actually the case at the moment because the `name-validation.js` mixin only checks for the `full_name_requirement` setting when determining whether the name field should block a new signup.

This commit fixes the issue by making the `full_name_required_for_signup` and `full_name_visible_in_signup` site attributes check for the `enable_names` setting themselves. This spares any consumers of these properties from having to remember to include a check for the `enable_names` setting.
2025-01-04 15:13:44 +03:00
Osama Sayegh
3187606d34
FEATURE: Add option to hide full name input at signup (#30471)
This commit replaces the `full_name_required` setting with a new `full_name_requirement` setting to allow more flexibility with the name field in the signup form. The new setting has 2 options, "Required at signup" and "Optional at signup", which are equivalent to the true/false possibilities of the old setting, and a third option "Hidden at signup" that hides the name field from the signup form, making it effectively optional too.

New sites will have the "Hidden at signup" option as the default option, and existing site will continue to use the option that maps to their current configuration.

Internal topic: t/136746.
2024-12-30 22:26:20 +03:00
David Taylor
d2979997e9
DEV: Introduce new 'glimmer topic list mode' site setting (#30375)
This replaces the previous group-based site setting
2024-12-19 17:38:35 +00:00
Krzysztof Kotlarek
95564a3df2 SECURITY: Moderators cannot see user emails.
Unless `moderators_view_emails` SiteSetting is enabled, moderators should not be able to discover users’ emails.
2024-12-19 13:13:18 -03:00
Sam
55a8184231
FEATURE: Reason and deleted content support in the review queue (#30295)
Add flag reason filter and improve handling of deleted content in review queue

This commit enhances the review queue with several key improvements:

1. Adds a new "Reason" filter to allow filtering flags by their score type
2. Improves UI for deleted content by:
   - Adding visual indication for deleted posts (red background)
   - Properly handling deleted content visibility for staff (category mods can not see deleted content)
3. Refactors reviewable score type handling for better code organization
4. Adds  tests for trashed topics/posts visibility

This change will help moderators more efficiently manage the review queue by
being able to focus on specific types of flags and better identify deleted
content.
2024-12-17 11:44:46 +11:00