Commit Graph

54929 Commits

Author SHA1 Message Date
Loïc Guitaut
8b067230ef DEV: Fix a missing dependency to @messageformat/core 2024-07-10 10:59:00 +02:00
Régis Hanol
758b9dd0ba
FEATURE: email attachments in a details (#27804)
This change how we present attachments from incoming emails to now be "hidden" in a "[details]" so they don't "hang" at the end of the post.

This is especially useful when using Discourse as a support tool where email is the main communication channel. For various reasons, images are often duplicated by email user agents, and hiding them behind the details block help keep the conversation focused on the isssue at hand.

Internal ref t/122333
2024-07-10 09:59:27 +02:00
Loïc Guitaut
301713ef96 DEV: Upgrade the MessageFormat library (JS)
This patch upgrades the MessageFormat library to version 3.3.0 from
0.1.5.

Our `I18n.messageFormat` method signature is unchanged, and now uses the
new API under the hood.

We don’t need dedicated locale files for handling pluralization rules
anymore as everything is now included by the library itself.

The compilation of the messages now happens through our
`messageformat-wrapper` gem. It then outputs an ES module that includes
all its needed dependencies.

Most of the changes happen in `JsLocaleHelper` and in the `ExtraLocales`
controller.

A new method called `.output_MF` has been introduced in
`JsLocaleHelper`. It handles all the fetching, compiling and
transpiling to generate the proper MF messages in JS. Overrides and
fallbacks are also handled directly in this method.

The other main change is that now the MF translations are served through
the `ExtraLocales` controller instead of being statically compiled in a
JS file, then having to patch the messages using overrides and
fallbacks. Now the MF translations are just another bundle that is
created on the fly and cached by the client.
2024-07-10 09:51:25 +02:00
Bianca Nenciu
6591a0654b
FIX: Destroy Drafts when increasing sequences (#27739)
Drafts used to be deleted instead of being destroyed. The callbacks that
clean up the upload references were not being called. As a result, the
upload references were not cleaned up and uploads were not deleted
either. This has been partially fixed in 9655bf3e.
2024-07-10 10:43:11 +03:00
Ted Johansson
acc8b46d51
FIX: Make category filter in review page clearable (#27820)
On the review page, once you select a category to filter by, while you can still change the category, you can not clear it.

After this commit, we pass the "clearable" select-kit option through.
2024-07-10 15:24:01 +08:00
Alan Guo Xiang Tan
c9775d5f72
DEV: Apply Logster.store.ignore to DiscourseLogstashLogger as well (#27819)
This commit updates `DiscourseLogstashLogger#add_with_opts` to avoid
logging messages that matches regexp patterns configured in
`Logster.store.ignore`. Those error logs are mostly triggered by clients
and do not serve any useful purpose.
2024-07-10 13:51:42 +08:00
Martin Brennan
d4c603984f
DEV: Make sure header hidden buttons are valid (#27818)
Followup 0434112aa7,
we introduced HideApplicationHeaderButtons there
but didn't validate the buttons passed to it. With this
commit we do, and send an error to the browser console
if an invalid one is used.
2024-07-10 15:50:22 +10:00
Ted Johansson
e364ed2ad1
FIX: Disallow all client-side routing when action is required (#27817)
When a user action is required and enforced, such as filling up newly added required fields or adding a 2FA method, we disable routing on the client-side. However, this could be bypassed by first loading an always allowed page, such as /faq and then client-side routing away from there.

This commit fixes that by 1) moving the logic for checking if routing is restricted and if a given path is allowed into a service and 2) hoisting the willTransition hook into the application router and use the newly created service to check whether to abort transitions or not.
2024-07-10 13:33:52 +08:00
Alan Guo Xiang Tan
3fee52eae3
PERF: Update docker:test to run QUnit with more cores if available (#27816)
This commit updates the `docker:test` rake task to run core and plugin
QUnit tests in parallel using half the number of available CPU
processors to speed up time it takes to run the tests on hardware with
more CPU cores.

Before this commit, core QUnit tests ran by the `docker:test` rake task was capped at 3 parallel
processes while plugin QUnit tests was not ran in parallel.
2024-07-10 11:27:20 +08:00
Alan Guo Xiang Tan
b4b7fa17af
DEV: Add exception class/message to DiscourseLogstashLogger take 2 (#27815)
This is the second take of af2bd4cc50 to
account for messages which contains newlines.
2024-07-10 11:04:17 +08:00
Alan Guo Xiang Tan
0b64cb9d8c
Revert "DEV: Remove git_version from DiscourseLogstashLogger log event (#27730)" (#27814)
This reverts commit bb0daa33cd.

This commit was not causing the problems we thought it was.
2024-07-10 10:36:22 +08:00
Martin Brennan
54fba2005f
DEV: Remove findBy usage in admin-sidebar (#27813)
We prefer not to use these Ember array extensions anymore
2024-07-10 11:58:52 +10:00
Martin Brennan
eca4ed8f80
DEV: Remove old defer_track_visit_v2 method (#27812)
Followup b46e1fe2aa
2024-07-10 11:40:45 +10:00
Alan Guo Xiang Tan
af2bd4cc50
DEV: Add exception class and message fields to DiscourseLogstashLogger (#27787)
This commit updates `DiscourseLogstashlogger` to add the
`exception_class` and `exception_message` field to the log line when the
`progname` of the log message is `web-exception` which is Logster's
logging of exceptions during a web request.

The `exception_class` and `exception_message` fields allows consumers of
the logs to easily group logs together.
2024-07-10 08:54:39 +08:00
dependabot[bot]
7049838673
Build(deps-dev): Bump sass from 1.77.6 to 1.77.7 (#27809)
Bumps [sass](https://github.com/sass/dart-sass) from 1.77.6 to 1.77.7.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.77.6...1.77.7)

---
updated-dependencies:
- dependency-name: sass
  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-07-10 08:53:51 +08:00
Martin Brennan
560e8aff75
FEATURE: Allow oneboxing private GitHub URLs (#27705)
This commit adds the ability to onebox private GitHub
commits, pull requests, issues, blobs, and actions using
a new `github_onebox_access_token` site setting. The token
must be set up in correctly to have access to the repos needed.

To do this successfully with the Oneboxer, we need to skip
redirects on the github.com host, otherwise we get a 404
on the URL before it is translated into a GitHub API URL
and has the appropriate headers added.
2024-07-10 09:39:31 +10:00
Martin Brennan
8c038d9498
FIX: Smart list jankiness in Chrome and fix for Firefox (#27762)
Last week I disabled smart lists in Firefox in 2ab4913d13.

This week the same issue presented itself in Chrome. Turns out,
the list modification was still not firing at the right time
in the event chain. I investigated and it looks as though
`beforeinput` is a better fit, since:

> This allows web apps to override text edit behavior before the browser
modifies the DOM tree, and provides more control over input events to
improve performance.

c.f. https://developer.mozilla.org/en-US/docs/Web/API/Element/beforeinput_event
and https://webkit.org/blog/7358/enhanced-editing-with-input-events/
and https://www.w3.org/TR/uievents/#events-keyboard-event-order

The order of keyboard events is `keydown` -> `beforeinput` -> `input` -> `keyup`

I changed to detect the event type of `insertLineBreak` which is
not always consistently true in `input` events. If it's true when
`beforeinput` is fired then we go ahead with the smart list when
`input` fires.
2024-07-10 09:31:16 +10:00
Jarek Radosz
0165460626
FIX: Scroll to top shortcut regressed in b757275 (#27807) 2024-07-10 00:19:45 +02:00
Sérgio Saquetim
08891ccf06
DEV: Escape the filter in the admin sidebar no results message (#27806) 2024-07-09 19:15:10 -03:00
Sérgio Saquetim
bbd67eff08
DEV: Improve the sidebar section expansion handling (#27805)
Handles the cases where the sections titles are Unicode only strings, allowing them to be expanded separately if the Unicode string contains letters.

Also prevents a sidebar section with the header hidden to be displayed collapsed.
2024-07-09 18:32:29 -03:00
Discourse Translator Bot
dd67375de7
Update translations (#27790) 2024-07-09 23:12:03 +02:00
carson chang
e4b223af6f
UX: Remove "Dismiss notifications" autofocus (#27798)
* UX: Remove "Dismiss notifications" autofocus

* Linting: Remove newline
2024-07-09 13:47:33 -07:00
Joffrey JAFFEUX
56cd318728
DEV: removes unused badge-selector (#27803) 2024-07-09 21:06:13 +02:00
Joffrey JAFFEUX
5fc7c79d8e
DEV: migrate backup-codes to gjs (#27801)
Co-authored-by: Keegan George <kgeorge13@gmail.com>
2024-07-09 21:02:16 +02:00
Joffrey JAFFEUX
8cc1d9771b
DEV: migrate ignored-user-list to gjs (#27800)
I removed the `this.saving` behavior part as it's not really useful and was not working as expected anyways.
2024-07-09 20:06:18 +02:00
Joffrey JAFFEUX
ea822de9e2
DEV: migrate generated-invite-link to gjs (#27799) 2024-07-09 19:56:45 +02:00
Joffrey JAFFEUX
a60e1b35ed
DEV: migrate CdnImg to gjs (#27797) 2024-07-09 19:05:30 +02:00
Joffrey JAFFEUX
c080ac0094
FIX: show too long message error on client (#27794)
Prior to this fix we would show the message after a round trip to the server. If you had a too long message error, at this point your input would be empty and we would show an error in chat. It's important to have this server side safety net, but we can have a better UX by showing an error on the frontend before sending the message, that way you can correct your message before sending it and not lose it.
2024-07-09 18:34:35 +02:00
Joffrey JAFFEUX
866f6b910b
DEV: migrates group-activity-filter to gjs (#27796) 2024-07-09 18:34:18 +02:00
Martin Brennan
7a7bdc9be5
FEATURE: Use group based setting for unsafe-none COOP (#27783)
Followup 3ff7ce78e7

Basing this setting on referrer was too brittle --
the referrer header can easily be ommitted or changed.
Instead, for the small amount of use cases that this
site setting serves, we can use a group-based setting
instead, changing it to `cross_origin_opener_unsafe_none_groups`
instead.
2024-07-09 11:25:49 -05:00
Guhyoun Nam
a01be4150a
DEV: Specs for redeliver_web_hook_events job (#27779)
It is a PR to add a spec for checking redeliver_web_hook_events job not to delete webhook event in process.
2024-07-09 10:35:10 -05:00
Jarek Radosz
d7d3555378
DEV: Add d-button-action-string deprecation to admin warnings (#27792) 2024-07-09 17:13:36 +02:00
Jarek Radosz
df7a7a8c71
UX: Insert a space before the featured link on mobile topic list view (glimmer) (#27793)
A followup to 16a8a31c52
2024-07-09 17:13:29 +02:00
Natalie Tay
27eea3250c
DEV: Fix deprecation typo (#27789) 2024-07-09 17:46:10 +08:00
David Taylor
a461eaddc3
DEV: Refactor ace-editor loading and bump to latest version (#27772)
- Delete vendored copy
- Create a JS entrypoint under `static/` which imports all the modes/themes/extensions we need
- Create an async `load-ace-editor` entrypoint
- Update `<AceEditor` component to use the new entrypoint
- De-jquery-ify `<AceEditor`
- Bump `v1.4.13` -> `v1.35.2`
2024-07-09 10:09:30 +01:00
Régis Hanol
0846862cb5
FIX: deleted topic author in crawler view (#27788)
When a crawler visits a topic that has a deleted author, it would error because the `show.html.erb` view was expecting a user to be always present.

This ensure we don't render the "author" meta data when the author of the topic has been deleted.

Internal ref t/132508
2024-07-09 10:44:03 +02:00
David Battersby
f44ec18fd2
DEV: update base url links to respect subfolder installs (#27740)
This change eliminates a couple of instances where subfolder urls are badly formatted, in most cases we can use Discourse.base_url_no_prefix to prevent adding the subfolder to the base url.
2024-07-09 12:42:38 +04:00
Martin Brennan
e58cf24fcc
FEATURE: Topic view stats report (#27760)
Adds a report to show the top 100 most viewed topics in a date range,
combining logged in and anonymous views. Can be filtered by category.

This is a followup to 527f02e99f
and d1191b7f5f. We are also going to
be able to see this data in a new topic map, but this admin report
helps to see an overview across the forum for a date range.
2024-07-09 15:39:10 +10:00
Alan Guo Xiang Tan
86e5f46175
DEV: Add hidden s3_inventory_bucket_region site setting (#27786)
This commit adds a hidden `s3_inventory_bucket_region` site setting to
specify the region of the `s3_inventory_bucket` when the `S3Inventory`
class initializes an instance of the `S3Helper`. By default, the
`S3Helper` class uses the value of the `s3_region` site setting but the
region of the `s3_inventory_bucket` is not always the same as the
`s3_region` configured.
2024-07-09 12:03:43 +08:00
Martin Brennan
7111d5e4bf
DEV: Fix flaky admin confirmation spec (#27784)
Waiting for the dialog to close was not enough,
need to wait for the overridden indicator to
show on the site setting.
2024-07-09 12:05:31 +10:00
Alan Guo Xiang Tan
c0ac15575f
DEV: Drop logging_provider site setting (#27785)
This site setting has always been experimental and hidden since it was
added 7 years ago. Drop it to simplify the way we enable logging in a
logstash friendly way.
2024-07-09 10:00:44 +08:00
Alan Guo Xiang Tan
3aaece3235
DEV: Unsubscribe from ActionView log events when lograge is enabled. (#27763)
This commit updates the `101-lograge` initializer to unsubscribe from
log events logged by `ActionView::LogSubscriber`. This is what the `lograge`
gem has been doing but its implementation is not compatible with Rails
7.1 and we started getting noise in our logs when lograge is enabled.
2024-07-09 09:25:46 +08:00
dependabot[bot]
1461dfded3
Build(deps-dev): Bump websocket from 1.2.10 to 1.2.11 (#27780)
Bumps [websocket](https://github.com/imanel/websocket-ruby) from 1.2.10 to 1.2.11.
- [Release notes](https://github.com/imanel/websocket-ruby/releases)
- [Changelog](https://github.com/imanel/websocket-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/imanel/websocket-ruby/compare/v1.2.10...v1.2.11)

---
updated-dependencies:
- dependency-name: websocket
  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-07-09 08:49:15 +08:00
dependabot[bot]
92f665eb3d
Build(deps): Bump excon from 0.110.0 to 0.111.0 (#27782)
Bumps [excon](https://github.com/excon/excon) from 0.110.0 to 0.111.0.
- [Changelog](https://github.com/excon/excon/blob/master/changelog.txt)
- [Commits](https://github.com/excon/excon/compare/v0.110.0...v0.111.0)

---
updated-dependencies:
- dependency-name: excon
  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-07-09 08:48:44 +08:00
dependabot[bot]
c7fa24800b
Build(deps-dev): Bump lefthook from 1.6.18 to 1.7.1 (#27777)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.6.18 to 1.7.1.
- [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.18...v1.7.1)

---
updated-dependencies:
- dependency-name: lefthook
  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-07-09 00:31:56 +02:00
Kris
4ee64ad168
UX: fix card positioning, allow shrink-to-fit (#27774) 2024-07-08 17:30:43 -04:00
Guhyoun Nam
784c04ea81
FEATURE: Add Mechanism to redeliver all failed webhook events (#27609)
Background:
In order to redrive failed webhook events, an operator has to go through and click on each. This PR is adding a mechanism to retry all failed events to help resolve issues quickly once the underlying failure has been resolved.

What is the change?:
Previously, we had to redeliver each webhook event. This merge is adding a 'Redeliver Failed' button next to the webhook event filter to redeliver all failed events. If there is no failed webhook events to redeliver, 'Redeliver Failed' gets disabled. If you click it, a window pops up to confirm the operator. Failed webhook events will be added to the queue and webhook event list will show the redelivering progress. Every minute, a job will be ran to go through 20 events to redeliver. Every hour, a job will cleanup the redelivering events which have been stored more than 8 hours.
2024-07-08 15:43:16 -05:00
Arkshine
16a8a31c52
UX: Insert a space before the featured link on mobile topic list view (#27747) 2024-07-08 14:05:29 -04:00
Kris
79c1d23591
UX: add max-width to social auth section (#27771) 2024-07-08 13:20:18 -04:00
Daniel Waterworth
069a0bd6ee
DEV: Add force option to discourse remap command (#27770) 2024-07-08 11:01:06 -05:00