Commit Graph

58889 Commits

Author SHA1 Message Date
a69a304f11 FEATURE: allow edit custom flags (#32344)
Allow admins to edit user custom flags. Because changing
name/description will update name/description for old reviewables,
warning has to be displayed.

Still, system flags can never be edited or deleted (only disabled).
2025-04-17 12:31:52 +08:00
f6eb2e083c DEV: Resolve flaky test due to regexp match (#32343)
The test being fixed in this commit was flaking with the following
error:

```
Capybara::Ambiguous:
  Ambiguous match, found 2 elements matching visible css ".stream-topic-title .title a[href*='/2']"
```

The regexp match on the `href` attribute has the potential to match
multiple elements if both urls contain the `/#{topic.id}` substring. For
example, both `/t/-/2/2` and `/t/-/1/2` will satisfy the regexp.
2025-04-17 09:32:22 +08:00
6028363de2 FIX: Remove hint for browser search shortcut (#32330)
Followup 735bef9ea0d497ae7e04bd4a104bd86e928fc472

Remove the tip in search for users to press Ctrl+F
again to do browser search, as this is no longer relevant
2025-04-17 10:22:40 +10:00
b724181bdf DEV: Update verbiage around remove password modal, swap button for a link (#32338)
Simplified the language around remove password to be more clear, swapped out the button for a link.
2025-04-16 14:37:54 -05:00
3d689bbbc2 DEV: Raise exception for deprecations in core stylesheets (#31894) 2025-04-16 16:36:41 +01:00
fec1ba0d73 DEV: Fix scss deprecation warning (#32325) 2025-04-16 11:34:30 -04:00
cb64b37070 UX: Add visual variation to theme screenshot placeholder (#32077)
This update adds randomized SVG placeholder designs for themes without
screenshots. Each placeholder pulls from the theme’s color palette to
give a better visual hint of what the theme might feel like.

There are a few different styles:
1. Envelope-style gradient – uses `tertiary`, `quaternary`, and
`highlight`
2. Soft blur gradient – uses `tertiary`, `quaternary`, and `highlight`
3. Mesh – uses `tertiary` and `secondary`
4. Layered waves – uses `tertiary`, `quaternary`, `highlight`, `danger`,
and `success`

The style is randomly picked per theme, so the grid looks more varied by
default.

<img width="1109" alt="image"
src="https://github.com/user-attachments/assets/5ede0ecf-a1e4-46c0-9fd2-bee4b6c672c2"
/>


Internal: /t/149935

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2025-04-16 05:21:45 -06:00
2da0804ef5 DEV: Drop wasm type override in nginx config (#32332)
This is already included in nginx's default set, and is currently
causing this message to be printed:

> nginx: [warn] duplicate extension "wasm", content type:
"application/wasm", previous content type: "application/wasm" in
/etc/nginx/conf.d/discourse.conf:4
2025-04-16 10:27:36 +01:00
b3389a4cc3 PERF: Set JOBS=1 for low memory build environment (#32326)
This restores the fix in ae2bc240af434168aeebe73d550b1c979ca3a29b
2025-04-16 10:14:23 +01:00
a6e35b0225 DEV: use native promise (#32331) 2025-04-16 10:17:02 +02:00
9b351614ea FIX: Set X-Robots-Tag header to prevent indexing of /safe-mode (#32329)
This change adds the `X-Robots-Tag` header to the `/safe-mode` response, discouraging search engines from including the page in their index.
2025-04-16 16:51:32 +10:00
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
c7d400eda2 FEATURE: Implement Form Template Preview (#32111)
![imagen](https://github.com/user-attachments/assets/db5cf334-6e92-40b6-b93a-5cfa12882e8f)
2025-04-15 23:52:02 -05:00
a6a85a0241 Build(deps): Bump ffi from 1.17.1 to 1.17.2 (#32322)
Bumps [ffi](https://github.com/ffi/ffi) from 1.17.1 to 1.17.2.
- [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ffi/ffi/compare/v1.17.1...v1.17.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-16 00:38:34 +02:00
30f328067c Build(deps): Bump version_gem from 1.1.6 to 1.1.7 (#32321)
Bumps [version_gem](https://gitlab.com/oauth-xx/version_gem) from 1.1.6
to 1.1.7.
-
[Changelog](https://gitlab.com/oauth-xx/version_gem/blob/main/CHANGELOG.md)
-
[Commits](https://gitlab.com/oauth-xx/version_gem/compare/v1.1.6...v1.1.7)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-16 00:38:21 +02:00
9145acce80 UX: Remove z-index (#32319) 2025-04-15 16:27:17 -05:00
e9b6dbe316 DEV: Passthrough attributes on TopicList component (#32318) 2025-04-15 21:27:40 +01:00
09747898d1 FIX: Fix meta data content modifier state leak (#32316)
It was using `<<` that caused the SiteSetting to get modified

Updated the spec to use the same pattern as other modifiers and used
`next` to return the correct value of the modifer
2025-04-15 14:32:35 -03:00
47a6a24372 UX: Adjust user-field labels (#32317) 2025-04-15 12:24:14 -05:00
3af7410264 DEV: Skip meta_data_content specs (#32315)
State seems to be leaking into other specs. Minimal repro:

```
bin/rspec --order defined spec/helpers/application_helper_spec.rb:783 spec/lib/wizard/wizard_builder_spec.rb:38
```

```
Failures:

  1) Wizard::Builder introduction should not prefill default site setting values
     Failure/Error: expect(description_field.value).to eq("")

       expected: ""
            got: " - modified by plugin"
```
2025-04-15 17:02:17 +01:00
375a36e2ef Don't require password to create users with previous authentication (#32201)
Don't require password to create users with previous authentication in
the session, regardless of email/email verification during user creation

Before my changes we were calling `user.password_required!` in
`UserAuthenticator.authenticated?` based on whether authentication
session data contained a matching email address and email verified
externally. I believe `authenticated?` is intended for our own email
validation during the activation process, but shouldn't be a gate for
password requirement.

Even when we were setting `user.password_required`, then during user
creation we were creating random passwords to get around the blank
password restriction when creating accounts with external auth.

After my change we can remove the random password creation because we no
longer require a password when the session has previous authentication
info at all.

Looks like this extra password requirement may have been introduced as a
side effect during a previous refactor of `UserController` here:
51eff92170
Before that change, password requirement was simply based on whether
session[:authentication] existed, but after that change it was based on
the email/email_valid fields as well.
2025-04-15 10:35:49 -05:00
f3d3c61754 PERF: Reuse existing core JS build where possible (#32311)
Building the Discourse JS app is very resource-intensive. This commit
introduces an `assemble_ember_build` script which will check the
existing content of the `dist/` directory and re-use the core build if
possible. Plugins will always be rebuilt.

For now, this functionality is only useful for multi-stage (i.e.
non-standard) Discourse deployments. But in future, this script may be
extended to pull the contents of the `dist/` directory from a remote
location.
2025-04-15 16:18:22 +01:00
02c5dd439b DEV: Add a post_owner_changed event (#32312)
This allows plugins to hook onto this event when post owner changes.
2025-04-15 22:26:44 +08:00
351a295846 DEV: Fix failing test after a rename (#32314) 2025-04-15 17:05:06 +03:00
b3bcc2c1d3 DEV: Fix github build (#32313) 2025-04-15 16:31:20 +03:00
0b8df4b833 UX: Use 'unused' instead of 'active' for components (#32284)
This commits changes the language for components that aren't used on any themes to be "used/unused" instead of "active/inactive" throughout the new components listing page.
2025-04-15 16:12:20 +03:00
5e8778ecf7 UX: Use core description of popular components when there's no description (#32286)
When an installed component doesn't have a description in its locale
files, we should fallback to the description that core has for the
component if it's one of the popular components that core features.
2025-04-15 16:07:22 +03:00
71b31604b5 PERF: Implement infinite scrolling for new components page (#32291)
On sites with many components, serializing and rendering all components
in one-go on a page can take quite a bit of time. The new components
listing page that was introduced in
https://github.com/discourse/discourse/pull/32164 currently loads all
components in one-go, so this commit implements infinite-scrolling
pagination for the page to address this performance issue for sites with
many components.
2025-04-15 16:05:10 +03:00
996a3493fe PERF: Prevent N+1 queries when loading theme/component descriptions (#32305)
Theme/component description is fetched via the `locale_fields` and
`theme_translation_overrides` associations on the `Theme` model. We're
currently not preloading these associations when serializing
themes/components, which causes an N+1 performance issue when accessing
the themes/components listing pages.
2025-04-15 16:02:41 +03:00
59ec86933a DEV: DMultiSelect (#32240)
The `DMultiSelect` component provides a customizable multi-select
dropdown with support for both mouse and keyboard interactions.

![Screenshot 2025-04-10 at 15 40
26](https://github.com/user-attachments/assets/277619db-6e56-4beb-8eda-f76360cd2ad8)

### Parameters

#### `@loadFn` (required)
An async function that returns the data to populate the dropdown
options.

```javascript
const loadFn = async () => {
  return [
    { id: 1, name: "Option 1" },
    { id: 2, name: "Option 2" },
  ];
};
```

#### `@compareFn`

A function used to determine equality between items. This is
particularly useful when working with complex objects. By default, `id`
will be used.

```javascript
const compareFn = (a, b) => {
  return a.name === b.name;
};
```

#### `@selection`
An array of pre-selected items that will be displayed as selected when
the component renders.

```javascript
const selection = [
  { id: 1, name: "Option 1" },
  { id: 2, name: "Option 2" },
];
```

#### `@label`
Text label displayed in the trigger element when no items are selected.

```javascript
@label="Select options"
```

### Named Blocks

#### :selection
Block for customizing how selected items appear in the trigger.

```javascript
<:selection as |result|>{{result.name}}</:selection>
```

#### :result
Block for customizing how items appear in the dropdown list.

```javascript
<:result as |result|>{{result.name}}</:result>
```

#### :result
Block for customizing how errors appear in the component.

```javascript
<:error as |error|>{{error}}</:error>
```

### Example Usage

```javascript
<DMultiSelect
  @loadFn={{this.loadOptions}}
  @selection={{this.selectedItems}}
  @compareFn={{this.compareItems}}
  @label="Select options">
  <:selection as |result|>{{result.name}}</:selection>
  <:result as |result|>{{result.name}}</:result>
  <:error as |error|>{{error}}</:error>
</DMultiSelect>
```

Co-Authored-By: Jordan Vidrine
<30537603+jordanvidrine@users.noreply.github.com>

---------

Co-authored-by: Jordan Vidrine <30537603+jordanvidrine@users.noreply.github.com>
2025-04-15 14:56:57 +02:00
4510d1ad46 DEV: Update site spec for unregistering modifiers (#32310)
Adding some changes to site.rb, and seeing this error:

```
     Failure/Error: raise "Clearing modifiers during a plugin spec run will affect all future specs. Use unregister_modifier instead."
```

This is a standalone PR to update the usage here so that my future PR
won't be affected.
2025-04-15 20:07:48 +08:00
c97425d22b Build(deps): Bump prosemirror-commands from 1.7.0 to 1.7.1 in the prosemirror group (#32272)
Bumps the prosemirror group with 1 update:
[prosemirror-commands](https://github.com/prosemirror/prosemirror-commands).


Updates `prosemirror-commands` from 1.7.0 to 1.7.1
-
[Changelog](https://github.com/ProseMirror/prosemirror-commands/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/prosemirror/prosemirror-commands/compare/1.7.0...1.7.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 13:44:11 +02:00
248e9a341f Build(deps-dev): Bump lefthook from 1.11.8 to 1.11.10 (#32298)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.11.8
to 1.11.10.
- [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.8...v1.11.10)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 13:37:40 +02:00
59a79de00e Build(deps-dev): Bump @swc/core from 1.11.18 to 1.11.21 (#32299)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.18 to
1.11.21.
- [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.18...v1.11.21)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 12:19:31 +02:00
ccf8ed5462 DEV: Fix linting (#32308) 2025-04-15 16:24:21 +08:00
9fa441cf19 Build(deps): Bump @faker-js/faker from 9.6.0 to 9.7.0 (#32275)
Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 9.6.0 to
9.7.0.
- [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.6.0...v9.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 17:14:22 +10:00
31877f646f DEV: Add toggleTagInfo to discovery-list-controls-above outlet (#32302) 2025-04-15 16:43:54 +10:00
e3c37f3f0b Add a plugin outlet to the login splash screen (#32271)
Adds a plugin outlet below the login buttons in the login-required
splash screen.

Use case: adding a custom footer to the splash screen with links to tos
and privacy policy.
2025-04-15 13:55:23 +08:00
cdd5fa5b1a Build(deps): Bump csv from 3.3.3 to 3.3.4 (#32276)
Bumps [csv](https://github.com/ruby/csv) from 3.3.3 to 3.3.4.
- [Release notes](https://github.com/ruby/csv/releases)
- [Changelog](https://github.com/ruby/csv/blob/main/NEWS.md)
- [Commits](https://github.com/ruby/csv/compare/v3.3.3...v3.3.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 13:54:09 +08:00
7cc46da442 Build(deps-dev): Bump rubocop-ast from 1.44.0 to 1.44.1 (#32277)
Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.44.0
to 1.44.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.44.0...v1.44.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 13:53:50 +08:00
f21b0fee14 Build(deps): Bump parallel from 1.26.3 to 1.27.0 (#32301)
Bumps [parallel](https://github.com/grosser/parallel) from 1.26.3 to
1.27.0.
-
[Commits](https://github.com/grosser/parallel/compare/v1.26.3...v1.27.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 13:53:27 +08:00
fc6aaa3e49 DEV: Wizard step tweaks (#32304)
This makes two tweaks to the setup wizard:

1. Move the branding (site logo) step to after styling (look & feel).
2. Remove the corporate (your organization) step.
2025-04-15 13:53:01 +08:00
735bef9ea0 UX: Remove Ctrl+F search shortcut (#32281)
This commit removes the Ctrl+F search shortcut, which hijacks the
browser search shortcut in Discourse. We are doing this because there
has been many years of complaints around this behaviour, and now that
we have the new header search it has become even more annoying.

We originally added this because we lazy load posts in a topic, and it
might not have been immediately clear to users that they are not
searching
all the posts in the topic when pressing Ctrl+F. However, that was 10+
years
ago, most people are very familiar with lazy loading now, it doesn't
make sense
to keep this additional hijack for this one topic use case.

Search is still accessible by pressing the `/` shortcut.
2025-04-15 15:14:54 +10:00
7a6006f7aa FIX: Escape regex symbols when replaceText is called for ProseMirror (#32280)
When we do replaceText in the ProseMirror TextManipulation lib,
we are creating a regex for the provided markdown. However this markdown
can have things like * (which is valid for a markdown list), which also
doubles as a regex symbol. We can escape the markdown provided to
the regex first to fix the issue.
2025-04-15 14:04:33 +10:00
077649fafd FIX: bugs with refresh page after save fonts (#32282)
It takes a moment to sync site settings. Therefore, it is better to pass
new values to `refreshPage` function.

Also, it was not working for some fonts like `JetBrains Mono`.
SiteSetting key is `jet_brains_mono` but font family value should be
`JetBrains Mono`.
2025-04-15 12:02:28 +08:00
8b9da12bf2 FIX: Wizard logo step JS error (#32303)
`PreviewBase#drawPills` expects a `homepageStyle` option, but on the logo wizard page we weren't passing any. In this change we pass one of the possible values: `hot`.
2025-04-15 10:54:46 +08:00
2cd82abbe3 Build(deps-dev): Bump parser from 3.3.7.4 to 3.3.8.0 (#32300)
Bumps [parser](https://github.com/whitequark/parser) from 3.3.7.4 to
3.3.8.0.
-
[Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 01:17:47 +02:00
c78a79bbf5 UX: keep content on rich editor footnote inputrule (#32296)
Instead of using the matched string, this PR uses the actual sliced
content from the ProseMirror document range as the content when creating
the footnote node.
2025-04-14 19:36:18 -03:00
79c642a446 UX: Quick mobile fix for quote styles (#32297) 2025-04-14 17:28:03 -05:00
d8d341ebf6 FIX: remove newline from rich editor's pasted img title/alt (#32295)
New lines on `alt`/`title` embedded media are not allowed, causing an
invalid serialized Markdown which is not supposed to contain new lines
for these attributes.

This PR removes them during HTML parsing – we are not creating this new
line scenario otherwise.
2025-04-14 19:24:21 -03:00