Commit Graph

56441 Commits

Author SHA1 Message Date
dependabot[bot]
0d63e60b1c
Build(deps-dev): Bump sqlite3 from 2.1.0 to 2.1.1 (#29349)
Bumps [sqlite3](https://github.com/sparklemotion/sqlite3-ruby) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/sparklemotion/sqlite3-ruby/releases)
- [Changelog](https://github.com/sparklemotion/sqlite3-ruby/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/sqlite3-ruby/compare/v2.1.0...v2.1.1)

---
updated-dependencies:
- dependency-name: sqlite3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-22 23:32:46 +02:00
Jarek Radosz
6a9af7c82f
FIX: Show the last rendered user-tip (#29346)
…or a tip with the highest priority.

This regressed in 597ef11195 where we got rid of `next()` calls, so we'd render the first tip we encounter.

The commit also adds a test and updates existing ones.
2024-10-22 22:41:29 +02:00
Renato Atilio
5d1e67b3e1
DEV: refactor textarea text manipulation mixin (#29294)
Refactor of the TextareaTextManipulation from a Mixin to a native class
2024-10-22 17:20:11 -03:00
Osama Sayegh
72f57524b4
UX: Add link to /about in the about config page (#29345)
This commit changes the description for the about config page so it contains a link to the /about page itself for easy access when editing the page.
2024-10-22 21:35:01 +03:00
Jan Cernik
68539f6084
DEV: More specs for chat excerpts (#29344) 2024-10-22 14:53:42 -03:00
Penar Musaraj
cbdab52056
DEV: restore custom route for custom homepage (#29343) 2024-10-22 13:17:36 -04:00
Jarek Radosz
b2167f7651
UX: Move "watching topic" user-tip to the other button (#29323)
Moves the user-tip from the topic-timeline notifications button to the one at the bottom of the topic page.

Three reasons:
1. new users are more likely to use the button that has the full text (and description) rather than the icon-only one
2. we hide the timeline button when scrolled all the way to the bottom of the page, and then the tip doesn't seems to be attached to anything
3. we might be removing the timeline button altogether in the near future
2024-10-22 18:54:18 +02:00
Jarek Radosz
f45559a8b3
DEV: Add priority to post menu user-tip (#29322)
…and spread out existing priorities
2024-10-22 18:51:19 +02:00
Osama Sayegh
91c674f0bc
FIX: Prevent 'NaN' display by hiding visitor stats on /about until they're ready (#29334)
The visitor stats on the /about page were previously showing as `NaN` immediately after enabling the `display_eu_visitor_stats` site setting because the stats for the /about page are cached and updated once every 30 minutes in a sidekiq job. The `NaN` would go away upon the next run of the relevant sidekiq job, but it's not good UX to display a cryptic `NaN` until the job runs. So, this commit ensures that the visitor stats is not displayed at all until the visitor stats is calculated and available.

Internal topic: t/128480.
2024-10-22 19:29:44 +03:00
David Taylor
856182c7c6
DEV: Update emoji-uploader uppy usage (#29340)
Also moves this component to the admin bundle. It is only used in the admin panel, and has dependencies on admin-specific i18n strings.
2024-10-22 17:07:16 +01:00
Loïc Guitaut
f79dd5c8b5 DEV: Stop injecting a service result object in the caller object
Currently, when calling a service with its block form, a `#result`
method is automatically created on the caller object. Even if it never
clashed so far, this could happen.

This patch removes that method, and instead use a more classical way of
doing things: the result object is now provided as an argument to the
main block. This means if we need to access the result object in an
outcome block, it will be done like this from now on:
```ruby
MyService.call(params) do |result|
  on_success do
    # do something with the result object
    do_something(result)
  end
end
```

In the same vein, this patch introduces the ability to match keys from
the result object in the outcome blocks, like we already do with step
definitions in a service. For example:
```ruby
on_success do |model:, contract:|
  do_something(model, contract)
end
```
Instead of
```ruby
on_success do
  do_something(result.model, result.contract)
end
```
2024-10-22 16:58:54 +02:00
Gerhard Schlager
07ff21d045
FIX: Restoring backup could fail due to missing discourse_functions (#29332)
Database dumps sometimes reference functions in the `discourse_functions` schema. It's possible that some of these functions have been dropped in a newer version of Discourse. In that case, restoring an older backup will fail with a `ERROR:  function discourse_functions.something_something() does not exist` error. The restore functionality contains a workaround for that problem, but it didn't work with functions created in plugin migrations.

This commit adds support for temporarily creating missing `discourse_functions` from plugins. And it adds a simple check if the DB migration file even contains the required `DROPPED_TABLES` or `DROPPED_COLUMNS` constant. We don't need to create an instance of the DB migration class unless one of those constants is used. This makes the restore slightly faster and works around a problem with migrations that execute without `up` or `down` methods (e.g. `BackfillChatChannelAndThreadLastMessageIdsPostMigrate`).
2024-10-22 16:13:01 +02:00
Keegan George
cf44502cdf
DEV: Improvements to auto grid images (#29317)
This PR is a follow-up to ea1473e532. When we initially added the experimental feature for automatically adding `[grid]` to images, we add the [grid] surrounding images after all the uploads have been completed.

This can lead to confusion when `[grid]` is delayed to be added in the composer, as users may try to add grid manually leading to breakage. This also leads to issues with Discourse AI's automatic image caption feature.

**In this PR**: we simply move the logic to be added when the images are uploaded and processing. This way, `[grid]` surrounding images is added immediately. We also apply a fix for an edge-case to prevent images from being wrapped in `[grid]` when they are already inside `[grid]` tags.
2024-10-22 06:53:09 -07:00
Discourse Translator Bot
28c5fb94d3
Update translations (#29335) 2024-10-22 22:44:33 +09:00
Jan Cernik
4254a686d5
FIX: Bring back the login-required page for fullpage login (#29316) 2024-10-22 10:05:23 -03:00
David Taylor
ad39688afa
DEV: Update avatar-uploader uppy usage (#29281) 2024-10-22 13:52:32 +01:00
Jarek Radosz
e27e89fbfb
DEV: Deprecate the unused version of debounce (#29324) 2024-10-22 11:34:57 +02:00
Jarek Radosz
b9ec9c7e4f
DEV: Update more asserts to qunit-dom (#29326)
regex find&replace + removing now-unused imports + manually fixing incorrect css selectors (that now got flagged 😌) + manually updating selectors that relied on jq
2024-10-22 11:34:23 +02:00
Loïc Guitaut
d991378218 DEV: Add comments in flags specs
Followup to https://github.com/discourse/discourse/pull/29325.

This patch adds comments to tell why we need to destroy created flags in
specs once the examples have run.
2024-10-22 10:54:26 +02:00
Ted Johansson
f31f8cc15f
FIX: Avoid duplicate problem admin notices (#29329)
As part of #29272 we made a unique index work on PG13 by introducing a dummy string to represent "NULL".

We missed one spot, leading to a potential for duplicate admin notices for problems without a target.

This fixes that.
2024-10-22 11:17:27 +08:00
chapoi
f8b0c33567
UX: fix footnote causing horizontal scroll on narrow screens (#29328) 2024-10-22 05:09:34 +02:00
Ted Johansson
63ed1b5bd7
DEV: Remove NULLS NOT DISTINCT from problem check trackers (#29327)
We added NULLS NOT DISTINCT to a unique index on problem_check_trackers.

This option is only available in PG15+. It does not in itself break PG13, but restoring a PG15+ backup to PG13 currently errors out. It seems this is an operation that's more common than we first thought.

This commit fixes that by removing the NULLS NOT DISTINCT.

We already have another, backwards-compatible approach to do the same thing in place, so this shouldn't change existing behaviour.
2024-10-22 10:47:24 +08:00
Krzysztof Kotlarek
44c8470813
FIX: flaky flags spec after refactoring (#29325)
The bug was introduced here https://github.com/discourse/discourse/pull/29258

It is very important for flags to reset to their original state because they are cached and shared between specs.
2024-10-22 13:18:57 +11:00
Kris
fa42565515
UX: fallback max-height for modal style (#29321) 2024-10-21 21:09:29 -04:00
chapoi
f9d86686ae
UX: DMenu modal add grip and min-height (#29309)
* UX: add min-height to DMenu modal

* UX: add grip handle
2024-10-22 11:22:20 +11:00
Ella E.
9e74095488
UX: improve layout for admin tables in mobile (#29320) 2024-10-21 18:19:21 -06:00
Martin Brennan
bd4e8422fe
FEATURE: Revive legacy pageview reports (#29308)
This commit brings back some reports hidden or changed
by the commit in 14b436923c if
the site setting `use_legacy_pageviews` is false.

* Unhide the old “Consolidated Pageviews” report and rename it
  to “Legacy Consolidated Pageviews”
* Add a legacy_page_view_total_reqs report called “Legacy Pageviews”,
  which calculates pageviews in the same way the old page_view_total_reqs
  report did.

This will allow admins to better compare old and new pageview
stats which are based on browser detection if they have switched
over to _not_ use legacy pageviews.
2024-10-22 10:06:22 +10:00
Krzysztof Kotlarek
433fadbd52
FEATURE: allow admins to enable announced experimental features (#29244)
Toggle the button to enable the experimental site setting from "What's new" announcement.

The toggle button is displayed when:
- site setting exists and is boolean;
- potentially required plugin is enabled.
2024-10-22 10:56:58 +11:00
Krzysztof Kotlarek
644e6c7f46
FEATURE: auto_action_type field for flags (#29306)
Allow admins to specify if the flag should be `auto_action_type`. If yes, then when an admin flags a post,  it is automatically actioned.

Meta: https://meta.discourse.org/t/allow-creation-of-custom-flags-which-auto-hide-content-similar-to-spam-and-inapproriate/329894
2024-10-22 10:56:31 +11:00
dependabot[bot]
08911eac8f
Build(deps): Bump ace-builds from 1.36.2 to 1.36.3 (#29319)
Bumps [ace-builds](https://github.com/ajaxorg/ace-builds) from 1.36.2 to 1.36.3.
- [Release notes](https://github.com/ajaxorg/ace-builds/releases)
- [Changelog](https://github.com/ajaxorg/ace-builds/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ajaxorg/ace-builds/compare/v1.36.2...v1.36.3)

---
updated-dependencies:
- dependency-name: ace-builds
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-22 00:00:36 +02:00
dependabot[bot]
56bff16bfd
Build(deps): Bump diffy from 3.4.2 to 3.4.3 (#29318)
Bumps [diffy](https://github.com/samg/diffy) from 3.4.2 to 3.4.3.
- [Changelog](https://github.com/samg/diffy/blob/main/CHANGELOG)
- [Commits](https://github.com/samg/diffy/commits)

---
updated-dependencies:
- dependency-name: diffy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 23:51:05 +02:00
Keegan George
ea1473e532
FEATURE: Automatically grid images when 3 or more image uploads (#29260)
This PR adds the feature where three or more image uploads in the composer will result in the images being surrounded by `[grid]` tags. This helps take advantage of the grid feature (https://github.com/discourse/discourse/pull/21513) and display images in a more appealing way immediately after upload.
2024-10-21 11:15:24 -07:00
Kris
4cb46ecb0f
DEV: allow optional modal height vars to be set (#29315) 2024-10-21 14:00:28 -04:00
Régis Hanol
88449541a5
FIX: participating users statistics... (#29293)
* FIX: participating users statistics...

... was (mis-)counting

- bots
- anonymous users
- suspended users

There's now a "valid_users" function that holds the AR query for valid users and which is used in all "users", "active_users", and "participating_users" queries.

Internal ref - t/138435
2024-10-21 18:18:42 +02:00
Jarek Radosz
481d0645a9
DEV: Convert topic-notifications-button to gjs (#29237) 2024-10-21 17:34:56 +02:00
Jarek Radosz
97be676b99
DEV: Fix workflow syntax (#29314)
A followup to 417e57d4ce
2024-10-21 15:53:52 +01:00
Loïc Guitaut
08e9364573 DEV: Refactor some services from chat
Extracted from https://github.com/discourse/discourse/pull/29129.

This patch makes the code more compliant with the upcoming service docs best practices.
2024-10-21 16:16:25 +02:00
David Taylor
43a0ea876a
DEV: Update watched-word-uploader uppy usage (#29280) 2024-10-21 15:09:14 +01:00
David Taylor
417e57d4ce
DEV: Correct flaky env from deb425f3 (#29312)
The env needs to be '1', not 'true'
2024-10-21 14:52:27 +01:00
David Taylor
4dabdd38db
DEV: Update create-invite-uploader uppy usage (#29282) 2024-10-21 14:42:48 +01:00
dependabot[bot]
c90fe2666f
Build(deps-dev): Bump lefthook from 1.7.21 to 1.7.22 (#29299)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.7.21 to 1.7.22.
- [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.7.21...v1.7.22)

---
updated-dependencies:
- dependency-name: lefthook
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 14:27:23 +02:00
dependabot[bot]
bf37ff193b
Build(deps-dev): Bump ruby-prof from 1.7.0 to 1.7.1 (#29303)
Bumps [ruby-prof](https://github.com/ruby-prof/ruby-prof) from 1.7.0 to 1.7.1.
- [Changelog](https://github.com/ruby-prof/ruby-prof/blob/master/CHANGES)
- [Commits](https://github.com/ruby-prof/ruby-prof/compare/1.7.0...1.7.1)

---
updated-dependencies:
- dependency-name: ruby-prof
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 14:07:47 +02:00
dependabot[bot]
154b017cbb
Build(deps-dev): Bump jsdoc from 4.0.3 to 4.0.4 (#29300)
Bumps [jsdoc](https://github.com/jsdoc/jsdoc) from 4.0.3 to 4.0.4.
- [Release notes](https://github.com/jsdoc/jsdoc/releases)
- [Changelog](https://github.com/jsdoc/jsdoc/blob/4.0.4/CHANGES.md)
- [Commits](https://github.com/jsdoc/jsdoc/compare/4.0.3...4.0.4)

---
updated-dependencies:
- dependency-name: jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 14:05:01 +02:00
David Taylor
deb425f3f6
DEV: Use flaky-test-retry in PRs as well (#29311)
The aim of the flaky-tests-rerun system is to reduce the amount of time developers have to spend manually restarting CI jobs. That means that, to get the benefit, we need to run it for PRs as well as on `main`.

Our internal reporting system only looks at the data from runs on `main`, so that it's not polluted by legitimately failing tests in PRs.
2024-10-21 13:02:20 +01:00
David Taylor
be5b35071b
DEV: UppyUpload improvements (#29279)
These tweaks will help adoption of the non-mixin-based uppy patterns.

- Add `type:`  to default arguments list
- Update pick-files-button to support explicit element registration
- Make `cancelSingleUpload` a public API, and add `cancelAllUploads`
- Remove `isDestroyed` logic - it doesn't do anything outside a component
- Add `@bind` to `setup()`
- Allow `additionalParams` to be a function
- Fix `autoStart` mixin shim
2024-10-21 13:00:54 +01:00
dependabot[bot]
4749d094a9
Build(deps-dev): Bump zeitwerk from 2.7.0 to 2.7.1 (#29302)
Bumps [zeitwerk](https://github.com/fxn/zeitwerk) from 2.7.0 to 2.7.1.
- [Changelog](https://github.com/fxn/zeitwerk/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fxn/zeitwerk/compare/v2.7.0...v2.7.1)

---
updated-dependencies:
- dependency-name: zeitwerk
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 12:37:32 +01:00
dependabot[bot]
8bfd84a4ae
Build(deps-dev): Bump rspec-core from 3.13.1 to 3.13.2 (#29304)
Bumps [rspec-core](https://github.com/rspec/rspec-core) from 3.13.1 to 3.13.2.
- [Release notes](https://github.com/rspec/rspec-core/releases)
- [Changelog](https://github.com/rspec/rspec-core/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-core/compare/v3.13.1...v3.13.2)

---
updated-dependencies:
- dependency-name: rspec-core
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 12:37:03 +01:00
David Taylor
b3b0695bb1
PERF: Optimize themes:update task (#29290)
- Add concurrency when running on multisite clusters (default 10, configurable via THEME_UPDATE_CONCURRENCY env)

- Add a version cache for the duration of the rake task. This avoids duplicating work when many sites in the cluster have the same theme installed, and it is already up-to-date

- Updates output to be more concurrent friendly (all `puts`, no `print`)
2024-10-21 12:36:40 +01:00
Osama Sayegh
a5497b74be
UX: Simplify invite modal (#28974)
This commit simplifies the initial state of the invite modal when it's opened to make it one click away from creating an invite link. The existing options/fields within the invite modal are still available, but are now hidden behind an advanced mode which can be enabled.

On the technical front, this PR also switches the invite modal to use our FormKit library.

Internal topic: t/134023.
2024-10-21 13:11:43 +03:00
Ted Johansson
b1321b985a
DEV: Allow enabling safe-mode even when missing required fields (#29310)
When a user is missing required fields, they are required to fill those up before continuing to interact with the forum. This applies to admins as well.

We keep a whitelist of paths that can still be visited in this mode: FAQ, About, 2FA setup, and any admin route for admins.

We concluded that admins should still be able to enable safe mode even with missing required fields. Since plugins etc. can potentially mess with the ability to fill those up.
2024-10-21 17:11:43 +08:00