Commit Graph

53814 Commits

Author SHA1 Message Date
Gerhard Schlager
82c62fe44f
DEV: Correctly pluralize error messages (#26469) 2024-04-04 15:02:09 +02:00
Jan Cernik
79cf7c0935
DEV: Convert mobile chat message actions to a modal (#26436) 2024-04-04 09:25:52 -03:00
Joffrey JAFFEUX
f45d96ebf4
DEV: fix flakey spec (#26513)
The fix is to actually wait for the bottom arrow to show before appending a new message, otherwise sometimes it goes too fast, and we create a new message while the scroll has not ended yet, making the arrow not visible yet.

This commit also uses this opportunity to move from `50.times.map {}` to `Fabricate.times(50, ...)` in this spec file.
2024-04-04 13:39:49 +02:00
David Taylor
0ad4034c58
DEV: Add a note about the version bump rake tasks (#26512) 2024-04-04 11:59:29 +01:00
David Taylor
37ae1708a5
UX: Stop avatar flicker when opening user menu on Safari (#26511)
When opening the user menu, we display old cached data, and then replace it with fresh data immediately afterwards. The vast majority of the time the data is unchanged, and so there is no visible change. When rendering HTML elements directly, Ember realizes that there is no change, and does not make any changes to the DOM. Great!

However, our `avatar` helper returns a blob of HTML. With raw HTML, Ember does not make any attempt to 'diff' the existing DOM. Instead, it replaces the old string with the new string. That can be a little wasteful, but normally it's not a big deal. But, when it comes to `<img lazy="lazy"`, re-rendering the `img` element causes a visible flicker in Safari.

To work around that, this commit replaces the `{{avatar}}` helper with an ember-rendered `<img` element. Now that Ember is responsible for rendering, it can detect there is no real change to the attributes and skip it, thereby avoiding the flicker.

If we find ourselves doing this more frequently, we may want to consider creating an `<Avatar` component. But for now, I think it's simple enough to justify building the `<img` manually in this case.
2024-04-04 11:46:38 +01:00
Selase Krakani
eda4b12260
DEV: Add form template support for composer's openNewTopic action (#26489)
* DEV: Spike form template support for composer's openNewTopic

* DEV: Add tests
2024-04-04 10:25:22 +00:00
Bianca Nenciu
52aefa720d
FIX: Load category before opening composer (#26493)
The "new topic" route can open the composer with a category preselected.
This commit ensures that the category is loaded before the composer is
opened.
2024-04-04 10:28:48 +03:00
Alan Guo Xiang Tan
339893812b
FIX: Input fields not displaying when adding a object to empty setting (#26509)
Why this change?

Prior to this change, the input fields were not displaying when adding
an object to a objects typed theme setting which has a default value of
`[]`. This is because the `fields` getter was not being recomputed.
2024-04-04 15:27:48 +08:00
Alan Guo Xiang Tan
a440e15291
DEV: Remove experimental_objects_type_for_theme_settings site setting (#26507)
Why this change?

Objects type for theme settings is no longer considered experimental so
we are dropping the site setting.
2024-04-04 12:01:31 +08:00
Jarek Radosz
49409f4985
DEV: Use the release version of sprockets (#26490) 2024-04-04 10:58:19 +08:00
Tobias Eigen
bc06aab4c4
renamed upgrade to update (#26498)
The "upgrade"page has been renamed to "update". See for context: https://meta.discourse.org/t/new-change-upgrade-page-is-now-the-update-page/302276?u=tobiaseigen
2024-04-04 09:45:57 +08:00
Tobias Eigen
f40d94af89
updated bootstrap site setting to refer to getting started button (#26505)
To remove the Getting Started button manually, you have to disable bootstrap mode by setting bootstrap_mode_min_users to 0. I clarified this in the description for the setting.
2024-04-03 16:58:02 -07:00
dependabot[bot]
ef9f52783f
Build(deps-dev): Bump parallel_tests from 4.6.0 to 4.6.1 (#26501)
Bumps [parallel_tests](https://github.com/grosser/parallel_tests) from 4.6.0 to 4.6.1.
- [Changelog](https://github.com/grosser/parallel_tests/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grosser/parallel_tests/compare/v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: parallel_tests
  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-04-03 23:47:21 +02:00
dependabot[bot]
de76214f71
Build(deps): Bump the babel group with 2 updates (#26502)
Bumps the babel group with 2 updates: [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) and [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/core` from 7.24.3 to 7.24.4
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.4/packages/babel-core)

Updates `@babel/standalone` from 7.24.3 to 7.24.4
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.4/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: babel
- dependency-name: "@babel/standalone"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: babel
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 23:47:13 +02:00
dependabot[bot]
7dd2480a6b
Build(deps): Bump terser from 5.30.2 to 5.30.3 (#26503)
Bumps [terser](https://github.com/terser/terser) from 5.30.2 to 5.30.3.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.30.2...v5.30.3)

---
updated-dependencies:
- dependency-name: terser
  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-04-03 23:47:05 +02:00
Gerhard Schlager
689d2754f6
DEV: Bump the version to 3.3.0.beta2-dev (#26499)
This was accidentally omitted during the beta1 release process
2024-04-03 22:08:04 +01:00
Isaac Janzen
db10dd5319
PERF: Improve performance of most_replied_to_users (#26373)
This PR improves the performance of the `most_replied_to_users` method on the `UserSummary` model.

### Old Query
```ruby
    post_query
      .joins(
        "JOIN posts replies ON posts.topic_id = replies.topic_id AND posts.reply_to_post_number = replies.post_number",
      )
      # We are removing replies by @user, but we can simplify this by getting the using the user_id on the posts.
      .where("replies.user_id <> ?", @user.id)
      .group("replies.user_id")
      .order("COUNT(*) DESC")
      .limit(MAX_SUMMARY_RESULTS)
      .pluck("replies.user_id, COUNT(*)")
      .each { |r| replied_users[r[0]] = r[1] }
```
 
### Old Query with corrections

```ruby
post_query
  .joins(
    "JOIN posts replies ON posts.topic_id = replies.topic_id AND replies.reply_to_post_number = posts.post_number",
  )
  # Remove replies by @user but instead look on loaded posts (we do this so we don't count self replies)
  .where("replies.user_id <> posts.user_id")
  .group("replies.user_id")
  .order("COUNT(*) DESC")
  .limit(MAX_SUMMARY_RESULTS)
  .pluck("replies.user_id, COUNT(*)")
  .each { |r| replied_users[r[0]] = r[1] }
```

### New Query
```ruby
    post_query
      .joins(
        "JOIN posts replies ON posts.topic_id = replies.topic_id AND posts.reply_to_post_number = replies.post_number",
      )
      # Only include regular posts in our joins, this makes sure we don't have the bloat of loading private messages
      .joins(
        "JOIN topics ON replies.topic_id = topics.id AND topics.archetype <> 'private_message'",
      )
      # Only include visible post types, so exclude posts like whispers, etc
      .joins(
        "AND replies.post_type IN (#{Topic.visible_post_types(@user, include_moderator_actions: false).join(",")})",
      )
      .where("replies.user_id <> posts.user_id")
      .group("replies.user_id")
      .order("COUNT(*) DESC")
      .limit(MAX_SUMMARY_RESULTS)
      .pluck("replies.user_id, COUNT(*)")
      .each { |r| replied_users[r[0]] = r[1] }
```

# Conclusion

`most_replied_to_users` was untested, so I introduced a test for the logic, and have confirmed that it passes on both the new query **AND** the old query. 

Thank you @danielwaterworth for the debugging assistance.
2024-04-03 14:20:54 -06:00
Vinoth Kannan
9dc6325821
DEV: add logo URL and locale details to the Discover stats. (#26320)
We will be collecting the logo URL and the site's default locale values along with existing basic details to display the site on the Discourse Discover listing page. It will be included only if the site is opted-in by enabling the "`include_in_discourse_discover`" site setting.

Also, we no longer going to use `about.json` and `site/statistics.json` endpoints retrieve these data. We will be using only the `site/basic-info.json` endpoint.
2024-04-04 00:22:28 +05:30
Gerhard Schlager
3e0898e498
DEV: Add "automation" plugin to Crowdin (#26497) 2024-04-03 20:00:42 +02:00
Penar Musaraj
8e10a8a5e2
DEV: Update copy for topic timeline tip (#26494) 2024-04-03 13:55:05 -04:00
Arpit Jalan
1785eb8f88
FIX: add home-logo outlet args to non glimmer version (#26495)
* FIX: add home-logo outlet args to non glimmer version

* fix linting
2024-04-03 21:44:32 +05:30
Penar Musaraj
c4e8221d7e
UX: Improvements to user tips (#26480)
- Add a "Skip tips" button to first notification tip
- Add a "Skip tips" button to the admin guide tip
- Fixes the timeline tip showing when no timeline was present
- Fixes post menu tip showing when no "..." button is present
- Adds system tests
- Marks each tip as seen as soon as it is displayed so that refreshing,
clicking outside, etc. won't show it again
- Change just above means we no longer need a MessageBus track

Co-authored-by: Bianca Nenciu <nbianca@users.noreply.github.com>
2024-04-03 11:43:56 -04:00
Osama Sayegh
3d4faf3272
FEATURE: Merge discourse-automation (#26432)
Automation (previously known as discourse-automation) is now a core plugin.
2024-04-03 18:20:43 +03:00
Bianca Nenciu
2190c9b957
DEV: Make category object more Ember friendly (#26342)
Some of the properties, like 'categoriesById', 'parentCategory' and
'subcategories', were updated manually when categories were loaded.
This was not ideal because it required a lot of code to keep the
objects in sync and some of the properties were not updated correctly.
2024-04-03 17:34:28 +03:00
David Taylor
929b4f89d6
DEV: Send proper 'stop' notification in turbo_rspec (#26488)
Doesn't actually seem to be used by any of our formatters, but let's send the proper data anyway for future-proofing. Followup to ff6cb1bc05 and 8098876bfa
2024-04-03 14:00:47 +01:00
Bianca Nenciu
b09558ae2d
DEV: Use Category.findById instead of Array.find (#26445)
Category.findById uses a Map to look up categories by ID which makes it
faster and preferable over Site.categories.find.
2024-04-03 15:51:05 +03:00
David Taylor
ff6cb1bc05
DEV: Fix turbo_rspec formatters by sending real 'Start' notification (#26487) 2024-04-03 13:27:39 +01:00
David Taylor
8098876bfa
DEV: Restore RSpec 'documentation' output, but collapse in CI (#26485)
This reverts commit ef895f1c32 and 57df0d526e, but adds GitHub actions line grouping to the verbose output to reduce scrolling.
2024-04-03 10:54:55 +01:00
Régis Hanol
c5f1fc3a08
DEV: replace diffhtml with morphlex (#26138)
morphlex is ~20% the size of diffhtml and provides a 2-6x speedup depending on diff size.

See t/113634/13 for benchmarks.
2024-04-03 11:27:45 +02:00
David Taylor
1e42e86601
DEV: Restore qunit 'tap' reporter, but collapse verbose output in CI (#26484)
This reverts commit 5adfb299ac, but uses GitHub actions grouping to achieve the same result: less scrolling to see failures.
2024-04-03 10:22:20 +01:00
Arpit Jalan
b38750d3be
FEATURE: add args to home-logo plugin outlet (#26486) 2024-04-03 14:50:45 +05:30
dependabot[bot]
876ab8dbe8
Build(deps-dev): Bump puppeteer-core from 22.6.1 to 22.6.2 (#26477)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from 22.6.1 to 22.6.2.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json)
- [Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v22.6.1...puppeteer-core-v22.6.2)

---
updated-dependencies:
- dependency-name: puppeteer-core
  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-04-03 11:13:58 +02:00
Alan Guo Xiang Tan
0eda1c96f1
FIX: Ensure Theme#settings are instances of ThemeSettings (#26481)
Why this change?

Instead of dealing with a generic object for `Theme#settings`, we want
to always be dealing with `ThemeSettings` objects.` Previously, we
converted the generic objects to `ThemeSettings` objects in the theme's
adapter `afterFindAll` function. This is not correct because updating
or saving the theme individual reverted the `Theme#settings` back to an
array of generic object.

To fix this problem, the proper way with our REST models is to overwrite
the static `munge` method and create `ThemeSettings` instances there.
2024-04-03 13:10:47 +08:00
Krzysztof Kotlarek
ba04fc6a01
FEATURE: ignore manually deactivated users when purging (#26478)
When a user is manually deactivated, they should not be deleted by our background job that purges inactive users.

In addition, site settings keywords should accept an array of keywords.
2024-04-03 14:06:31 +11:00
Alan Guo Xiang Tan
477a67e4fb
DEV: Fix flaky system test (#26479)
Why this change?

`expect(page.title).to starts_with("...")` does not rely on capybara
waiters. This commit switches us to use `have_title` instead which will
rely on Capybara waiters.
2024-04-03 10:04:48 +08:00
dependabot[bot]
9c9374f060
Build(deps): Bump sprockets from f4d3dae to 0487291 (#26426)
Bumps [sprockets](https://github.com/rails/sprockets) from `f4d3dae` to `0487291`.
- [Release notes](https://github.com/rails/sprockets/releases)
- [Commits](f4d3dae71e...0487291ad2)

---
updated-dependencies:
- dependency-name: sprockets
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 07:20:38 +08:00
dependabot[bot]
a0a7f5557d
Build(deps): Bump terser from 5.30.1 to 5.30.2 (#26475)
Bumps [terser](https://github.com/terser/terser) from 5.30.1 to 5.30.2.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.30.1...v5.30.2)

---
updated-dependencies:
- dependency-name: terser
  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-04-03 07:14:09 +08:00
dependabot[bot]
cebfd939e8
Build(deps): Bump public_suffix from 5.0.4 to 5.0.5 (#26472)
Bumps [public_suffix](https://github.com/weppos/publicsuffix-ruby) from 5.0.4 to 5.0.5.
- [Changelog](https://github.com/weppos/publicsuffix-ruby/blob/main/CHANGELOG.md)
- [Commits](https://github.com/weppos/publicsuffix-ruby/compare/v5.0.4...v5.0.5)

---
updated-dependencies:
- dependency-name: public_suffix
  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-04-03 07:13:55 +08:00
dependabot[bot]
4486248cac
Build(deps): Bump rake from 13.1.0 to 13.2.0 (#26473)
Bumps [rake](https://github.com/ruby/rake) from 13.1.0 to 13.2.0.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v13.1.0...v13.2.0)

---
updated-dependencies:
- dependency-name: rake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 07:06:52 +08:00
dependabot[bot]
a5832a7bac
Build(deps-dev): Bump lefthook from 1.6.7 to 1.6.8 (#26476)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.6.7 to 1.6.8.
- [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.6.7...v1.6.8)

---
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-04-03 07:06:41 +08:00
Kris
b35da59865
UX: adjustments for experimental bulk select menu (#26474) 2024-04-02 18:01:21 -04:00
Blake Erickson
8b1b368693
DEV: Document basic-info endpoint (#26471) 2024-04-02 14:53:19 -06:00
Mark VanLandingham
797ab30d95
DEV: Modifier to add params to TopicsController redirect url (#26470) 2024-04-02 15:35:44 -05:00
Discourse Translator Bot
51006b5591
Update translations (#26463) 2024-04-02 18:19:46 +02:00
David Taylor
f2e7909a80
DEV: Rename components GlimmerHeader -> Header (#26466)
Originally we planned to do this rename after dropping the old widget implementation. However, as we continue rolling out the update, there is a risk that people will start depending on the component names (e.g. for modifyClass) so it seems best to make the rename now to reduce risk later.
2024-04-02 16:55:49 +01:00
Joffrey JAFFEUX
bd85dc40a0
UX: changes defer copy to mark unread (#26468) 2024-04-02 17:45:11 +02:00
Penar Musaraj
1eb70973a2
DEV: allow themes to render their own custom homepage (#26291)
This PR adds a theme modifier and route so that custom themes can opt to show their own homepage. See PR description for example usage.
2024-04-02 11:05:08 -04:00
Gerhard Schlager
7eec13375d
DEV: Add strings from "discourse-lazy-videos" to Crowdin (#26461) 2024-04-02 16:43:33 +02:00
Vinoth Kannan
cd43985de0
UX: rename the word "Upgrade" to "Update" in the UI. (#26396)
In this PR, all references in the UI to the word "`upgrade`" are changed to "`update`". This is to differentiate the update process in self-hosted sites from the plan "upgrade" process in hosted sites.

Follow-up to the PR: https://github.com/discourse/docker_manager/pull/208
2024-04-02 20:04:37 +05:30
Joffrey JAFFEUX
c76b10ec22
UX: tweaks enable defer setting copy (#26465) 2024-04-02 15:44:25 +02:00