Commit Graph

53602 Commits

Author SHA1 Message Date
Angus McLeod
7dc552c9cc
DEV: Add import_embed_unlisted site setting (#26222) 2024-03-27 08:57:43 -04:00
Osama Sayegh
f79f9e236a
FIX: Descriptions not showing for some site setting types (#26399)
Descriptions for the `category-list`, `file-size-restriction` and `file-types-list` site/theme settings aren't rendered due to a bug that was introduced when those components were migrated to Glimmer components. This commit fixes the bug which is that arguments passed to .gjs components should be accessed as `@argument` and not `this.arugment` inside the `<template>` tag.
2024-03-27 15:48:48 +03:00
Joffrey JAFFEUX
2146ab492b
DEV: applies body-scroll-lock on select-kit (#26397)
This will prevent any scrolling issues with sk when on mobile, especially on iOS and in modals.

Prior to this fix, scrolling could sometimes stop working in dropdowns.
2024-03-27 13:33:21 +01:00
Loïc Guitaut
e911362864 DEV: Use Chrome in system specs
The version of Chromium we have in our images (120) is relatively
unstable and our system specs break regularly.

This patch makes sure Chrome is used instead for system specs.
2024-03-27 12:19:55 +01:00
Osama Sayegh
0b34b4cbe9
DEV: Better error message when user is not allowed to user tags (#26380)
When a topic fails to be created due to the user not having permission to add tags to the topic, the error message that you get is `There was an error tagging the topic` which is very generic and doesn't explain where/what the problem is. This commit adds a clearer error message for this scenario.
2024-03-27 12:57:10 +03:00
Osama Sayegh
72c4709a5a
FIX: Skip tags-related validations when the skip_validations option is present (#26379)
The `TopicCreator` class has a `skip_validations` option that can force-create a topic without performing permission checks or validation rules. However, at the moment it doesn't skip validations that are related to tags, so topics that are created by the system or by some scrip can still fail if they use tags. This commit makes the `TopicCreator` class skip all tags-related checks if the `skip_validations` is specified.

Internal topic: t/124280.
2024-03-27 12:56:21 +03:00
dependabot[bot]
260b2a7450
Build(deps): Bump net-smtp from 0.4.0.1 to 0.5.0 (#26381)
Bumps [net-smtp](https://github.com/ruby/net-smtp) from 0.4.0.1 to 0.5.0.
- [Release notes](https://github.com/ruby/net-smtp/releases)
- [Changelog](https://github.com/ruby/net-smtp/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/net-smtp/compare/v0.4.0.1...v0.5.0)

---
updated-dependencies:
- dependency-name: net-smtp
  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-03-27 10:53:04 +01:00
Joffrey JAFFEUX
6f694d9d1b
DEV: adds a has-preloaded-chat-channels body-class (#26394)
This class should help makes tests more reliable by ensuring we are in a known state.
2024-03-27 10:39:07 +01:00
David Taylor
1cc8c72a98
DEV: Consolidate experimental 'Link' header implementations (#26377)
This commit removes the 'experimental_preconnect_link_header' site setting, and the 'preload_link_header' site setting, and introduces two new global settings: early_hint_header_mode and early_hint_header_name.

We don't actually send 103 Early Hint responses from Discourse. However, upstream proxies can be configured to cache a response header from the app and use that to send an Early Hint response to future clients.

- `early_hint_header_mode` specifies the mode for the early hint header. Can be nil (disabled), "preconnect" (lists just CDN domains) or "preload" (lists all assets).
- `early_hint_header_name` specifies which header name to use for the early hint. Defaults to "Link", but can be changed to support different proxy mechanisms.
2024-03-27 09:06:50 +00:00
David Battersby
23fc0fb078
FIX: allow direct message when max dm users set to 1 (#26392)
Why this change?
When the site setting for chat_max_direct_message_users is set to 1, it is expected that users can have a 1:1 chat with other users. However, since the current user is counting as 1 user it makes starting a new chat impossible.

This change hands this validation off to DirectMessageChannel::MaxUsersExcessPolicy which handles the count correctly by filtering out the current user.
2024-03-27 15:59:12 +08:00
Joffrey JAFFEUX
f9eae75972
DEV: improves keyboard sizing (#26372)
This commit is making the following changes:

- replaces `mobile-keyboard` initializer and `chat-vh` with a new template-less component: `d-vh`
- ensures body scroll lock is released when page/tab focus changes
- correctly locks body on chat channels and chat threads when composer is focused
- removes `bodyScrollFix` as we now use body scroll lock
- `onViewportResize` has been debounced to ensure it's not a bad performance vector
- adds a reverse option do body scroll lock, this is made to support reversed scroll areas (like chat channels and threads)

---------

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2024-03-27 08:50:32 +01:00
Kris
9baa820d53
UX: add collabsible headings to theme objects editor, adjust styles (#26383)
This adds collapsible headings to child lists, and adjusts the layout to utilize the available space.
2024-03-27 13:59:01 +08:00
Krzysztof Kotlarek
0932b146d9
FEATURE: the ability to expand/collapse all admin sections (#26358)
By default, admin sections should be collapsed.
In addition, a button to expand/collapse all sections has been added.
2024-03-27 14:42:06 +11:00
Martin Brennan
8e08a3b31f
DEV: Use caller for plugin_file_from_fixtures (#26387)
Followup 0bbca318f2,
rather than making developers provide the plugin path
name (which may not always be the same depending on
dir names and git cloning etc) we can infer the plugin
dir from the caller in plugin_file_from_fixtures
2024-03-27 14:12:51 +11:00
Alan Guo Xiang Tan
476d91d233
DEV: Change category type to categories type for theme object schema (#26339)
Why this change?

This is a follow-up to 86b2e3aa3e.

Basically, we want to allow people to select more than 1 category as well.

What does this change do?

1. Change `type: category` to `type: categories` and support `min` and `max`
   validations for `type: categories`.

2. Fix the `<SchemaThemeSetting::Types::Categories>` component to support the
   `min` and `max` validations and switch it to use the `<CategorySelector>` component
   instead of the `<CategoryChooser>` component which only supports selecting one category.
2024-03-27 10:54:30 +08:00
Alan Guo Xiang Tan
0df50a7e5d
DEV: Use the right number of cores for bundle install in tests workflow (#26389)
Why this change?

We run on different runners depending on the scenario. We should use the
right number of parallel jobs for bundle install based on the number of
CPU cores the runner has.
2024-03-27 10:19:09 +08:00
Ted Johansson
5875b25e68
DEV: Add the ability for problem checks to specify 'max blips' (#26388)
This was originally introduced in #26071, but that PR was closed, because the requirements changed. This PR lifts only the relevant parts, since they are a prerequisite for the new admin notice system.
2024-03-27 10:07:56 +08:00
Daniel Waterworth
cc8f0a79e2
PERF: Replace posts reply_to_post_number index (#26385)
post_number is a sequence per topic, so it doesn't make sense to have an
index on only reply_to_post_number without also including the topic_id.
2024-03-27 09:56:29 +08:00
Alan Guo Xiang Tan
957b945d25
DEV: Improve output of maxminddb:refresh (#26386)
Why this change?

We want to know when nothing was downloaded because stuff has been
cached on disk
2024-03-27 09:50:49 +08:00
Sam
e765e84941
DEV: allow developers to use HTTPS if they wish (#26384)
Warning is getting tiring on local and I have https://l.discourse working just fine (tm)
2024-03-27 10:48:04 +11:00
Sam
e3a0faefc5
FEATURE: allow re-scoping chat user search via a plugin (#26361)
This enables the following in Discourse AI

```
 plugin.register_modifier(:chat_allowed_bot_user_ids) do |user_ids, guardian|
  if guardian.user
    mentionables = AiPersona.mentionables(user: guardian.user)
    allowed_bot_ids = mentionables.map { |mentionable| mentionable[:user_id] }
    user_ids.concat(allowed_bot_ids)
  end
  user_ids
end
```

some bots that are id < 0 need to be discoverable in search otherwise people can not talk to them.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2024-03-27 08:55:53 +11:00
Michael Brown
680f1ff19c FIX: Add content-type header to rate limiter error
It's best to always set a content-type header and one was missing here.
2024-03-26 12:39:42 -04:00
Daniel Waterworth
bf35928a14
DEV: Set category on embeddable-host component instead of rest object (#26374)
The rest object doesn't need the whole serialized category.
2024-03-26 11:16:07 -05:00
David Taylor
312a5ead1f
DEV: Add Google-InspectionTool as a crawler user agent (#26375)
This user-agent is sent when URLs are inspected via the UI of Google's search console. It makes sense for us to serve it the same content as other bots, including GoogleBot.
2024-03-26 15:56:36 +00:00
Discourse Translator Bot
f2a781bcd0
Update translations (#26368) 2024-03-26 16:30:01 +01:00
David Taylor
a8d20f92fb
FEATURE: Add page number to page titles for crawlers (#26367)
At the moment, all topic `?page=` views are served with exactly identical page titles. If you search for something which is mentioned many times in the same Discourse topic, this makes for some very hard-to-understand search results! All the result titles are exactly the same, with no indication of why there are multiple results showing.

This commit adds a `- Page #` suffix to the titles in this situation. This lines up with our existing strategy for topic-list pagination.
2024-03-26 15:19:00 +00:00
David Taylor
3329484e2d
FEATURE: Simplify crawler content for non-canonical post URLs (#26324)
When crawlers visit a post-specific URL like `/t/-/{topic-id}/{post-number}`, we use the canonical to direct them to the appropriate crawler-optimised paginated view (e.g. `?page=3`).

However, analysis of google results shows that the post-specific URLs are still being included in the index. Google doesn't tell us exactly why this is happening. However, as a general rule, 'A large portion of the duplicate page's content should be present on the canonical version'.

In our previous implementation, this wasn't 100% true all the time. That's because a request for a post-specific URL would include posts 'surrounding' that post, and won't exactly conform to the page boundaries which are used in the canonical version of the page. Essentially: in some cases, the content of the post-specific pages would include many posts which were not present on the canonical paginated version.

This commit aims to resolve that problem by simplifying the implementation. Instead of rendering posts surrounding the target post_number, we will only render the target post, and include a link to 'show post in topic'. With this new implementation, 100% of the post-specific page content will be present on the canonical paginated version, which will hopefully mean google reduces their  indexing of the non-canonical post-specific pages.
2024-03-26 15:18:46 +00:00
Joffrey JAFFEUX
58990fb00f
FIX: calendar options part 2 (#26371)
This part of the commit has been mistakenly forgotten from bddc41b7ad
2024-03-26 15:19:02 +01:00
Joffrey JAFFEUX
bddc41b7ad
FIX: correctly pass down calendar options (#26370)
Prior to this fix the options were not passed down when the user had no default calendar.

No test as it's mostly an interaction between discourse-calendar and core which is hard to test.
2024-03-26 15:09:05 +01:00
Loïc Guitaut
9c9526f0a8 DEV: Use Nimbus font instead of Helvetica
To generate letter avatars, we’re currently using the ImageMagick suite
and we’re using the Helvetica font family. However, that font isn’t
shipped anymore in the latest stable version of Debian (Bookworm).
Instead it seems to have been replaced by the Nimbus font. The rendering
is extremely similar (not to say it’s the same thing) so it shouldn’t be
noticeable.

That change is necessary for us to upgrade our docker images to Debian
Bookworm.
2024-03-26 14:42:40 +01:00
Joffrey JAFFEUX
f350cea5d2
DEV: introduces waitForClosedKeyboard (#26363)
This lib will allow us to wait for a keyboard state change. Not waiting for the keyboard to be closed could cause issues when showing a modal at the same time on iOS for example.

Example usage:
- blurSomeInput()
- await waitForClosedKeyboard(this)
- showSomeModal()

Note that this actual behavior has been baked in modals when we call show so you don't have to call the lib yourself.
2024-03-26 13:09:59 +01:00
Jarek Radosz
01c11dff91
DEV: Silence the output of migration specs (#26365)
(plus fix the typo in the filename)
2024-03-26 11:32:44 +01:00
Jarek Radosz
4c860995e0
DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00
Martin Brennan
5adfb299ac
DEV: Change QUnit reporters to dot (#26360)
This is so the CI output on GitHub actions isn't showing
tons and tons of unnecessary log data every time you want
to see the important thing, which is the actual test failure.
2024-03-26 16:54:22 +10:00
Martin Brennan
0bbca318f2
DEV: Add plugin_file_from_fixtures helper (#26359)
This allows plugins to also easily read fixture
files for tests, rather than having to do stuff
like this:

```
File.open(File.join(__dir__, "../../../fixtures/100x100.jpg"))
```
2024-03-26 16:17:51 +10:00
Alan Guo Xiang Tan
ef99b97ea7
DEV: Load theme objects typed setting metadata when routing to editor (#26354)
Why this change?

Previously, we were preloading the necessary metadata for
`adminCustomizeThemes.show.schema` route in the
`adminCustomizeThemes.show` route. This is wasteful because we're
loading data upfront when the objects setting editor may not be used.

This change also lays the ground work for a future commit where we need
to be shipping down additional metadata which may further add to the
payload.
2024-03-26 14:02:05 +08:00
Alan Guo Xiang Tan
fbde7f8bc1
UX: Fix position of characters count on objects setting input field (#26357) 2024-03-26 12:54:04 +08:00
Alan Guo Xiang Tan
ef895f1c32
DEV: Drop documentation format on CI (#26356)
Why this change?

The output is too verbose and prevents us from quickly identifying tests
failures. Now that our tests are way more stable and less flaky, we can
drop the documentation format since we do not need it for debugging
purposes that often anymore
2024-03-26 12:03:55 +08:00
Ted Johansson
5ee23fc394
DEV: Make all admins TL4 in tests (#25435)
Make admins TL4 by default in tests, foregoing the need to call refresh_auto_groups on them.
2024-03-26 11:41:12 +08:00
Sérgio Saquetim
d9179468e4
DEV: Adds click_ok method on system spec dialog component (#26355) 2024-03-25 22:14:26 -03:00
Tobias Eigen
91dadd3647
DEV: Fix links in admin getting started guide (#26347)
I fixed some links in the admin getting started guide, and changed the way internal links to categories are handled so they will work in other language locales besides US english.
2024-03-26 08:30:51 +08:00
Jan Cernik
532639f636
UX: Add threads fab icon (#26349) 2024-03-26 08:30:27 +08:00
Jay Pfaffman
63f6c1e81a
FIX: Allow redirect when downloading maxmind database (#26333)
Per https://dev.maxmind.com/geoip/release-notes/2024#presigned-urls-for-database-downloads 

MaxMind users who download databases should make sure that their HTTP client follows redirects and there are no proxy or firewall settings that would block requests to the host we are redirecting to.
2024-03-26 09:39:09 +11:00
Joffrey JAFFEUX
2a1b675af7
FIX: attempts to update select-kit on keyboard (#26345)
Prior to this change the dropdown could appear offscreen due to its position not being updated after the appearance of the keyboard.
2024-03-25 22:58:11 +01:00
dependabot[bot]
285306ff3f
Build(deps-dev): Bump puppeteer-core from 22.5.0 to 22.6.1 (#26353)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from 22.5.0 to 22.6.1.
- [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.5.0...puppeteer-core-v22.6.1)

---
updated-dependencies:
- dependency-name: puppeteer-core
  dependency-type: direct:development
  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-03-25 22:55:54 +01:00
dependabot[bot]
1e4e6f89cc
Build(deps-dev): Bump @glint/environment-ember-template-imports (#26352)
Bumps [@glint/environment-ember-template-imports](https://github.com/typed-ember/glint) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/typed-ember/glint/releases)
- [Changelog](https://github.com/typed-ember/glint/blob/main/.release-it.yml)
- [Commits](https://github.com/typed-ember/glint/compare/1.3.0...1.4.0)

---
updated-dependencies:
- dependency-name: "@glint/environment-ember-template-imports"
  dependency-type: direct:development
  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-03-25 22:45:41 +01:00
dependabot[bot]
72bac7eace
Build(deps): Bump @glimmer/syntax from 0.90.1 to 0.91.0 (#26351)
Bumps [@glimmer/syntax](https://github.com/glimmerjs/glimmer-vm) from 0.90.1 to 0.91.0.
- [Release notes](https://github.com/glimmerjs/glimmer-vm/releases)
- [Changelog](https://github.com/glimmerjs/glimmer-vm/blob/main/CHANGELOG.md)
- [Commits](https://github.com/glimmerjs/glimmer-vm/compare/v0.90.1...v0.91.0)

---
updated-dependencies:
- dependency-name: "@glimmer/syntax"
  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-03-25 22:45:22 +01:00
dependabot[bot]
26c5419538
Build(deps-dev): Bump parallel_tests from 4.5.2 to 4.6.0 (#26350)
Bumps [parallel_tests](https://github.com/grosser/parallel_tests) from 4.5.2 to 4.6.0.
- [Changelog](https://github.com/grosser/parallel_tests/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grosser/parallel_tests/compare/v4.5.2...v4.6.0)

---
updated-dependencies:
- dependency-name: parallel_tests
  dependency-type: direct:development
  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-03-25 22:36:47 +01:00
Blake Erickson
ce037f9962
DEV: Bulk Actions Dropdown Plugin API (#26224)
Adds a plugin api for the bulk actions dropdown.

Co-authored-by: Martin Brennan <martin@discourse.org>
2024-03-25 14:44:38 -06:00
dependabot[bot]
df10c0b3d0
Build(deps-dev): Bump express from 4.19.1 to 4.19.2 (#26348)
Bumps [express](https://github.com/expressjs/express) from 4.19.1 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.1...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 21:31:40 +01:00