Commit Graph

32637 Commits

Author SHA1 Message Date
David Taylor
a4aebc83ac
DEV: Add simple test for json-schema-editor and remove extra await (#27827)
Followup to ce3d91f422
2024-07-10 12:22:31 +01:00
David Taylor
ce3d91f422
DEV: Load @json-editor/json-editor using webpack async import (#27773) 2024-07-10 11:15:42 +01:00
Loïc Guitaut
8b067230ef DEV: Fix a missing dependency to @messageformat/core 2024-07-10 10:59:00 +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
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
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
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
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
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
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
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
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
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
Jarek Radosz
ae79ba1447
DEV: Simplify breadcrumbs by using path arg (#27744)
Example:

```hbs
<DBreadcrumbItem
  @path="/admin/plugins/{{@plugin.name}}"
  @label={{@plugin.nameTitleized}}
/>
```

Using `@path` instead of `@route`+`@model` combo makes it impossible to pass temporarily unresolvable routes.

This fixes a bug with navigating from a model-based route to a parent route.
2024-07-08 17:55:03 +02:00
David Taylor
49f6e1133a
DEV: Drop Ember 'barrel file' import (#27769)
`import Ember from "Ember"` will be deprecated in an upcoming version of Ember
2024-07-08 13:16:34 +01:00
dependabot[bot]
63b4c6426e
Build(deps-dev): Bump @ember/string from 3.1.1 to 4.0.0 (#27750)
Bumps [@ember/string](https://github.com/emberjs/ember-string) from 3.1.1 to 4.0.0.
- [Release notes](https://github.com/emberjs/ember-string/releases)
- [Changelog](https://github.com/emberjs/ember-string/blob/master/CHANGELOG.md)
- [Commits](https://github.com/emberjs/ember-string/commits)

---
updated-dependencies:
- dependency-name: "@ember/string"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 11:24:27 +01:00
dependabot[bot]
b1726e1a18
Build(deps): Bump highlight.js from 11.9.0 to 11.10.0 (#27752)
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 11.9.0 to 11.10.0.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/main/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/11.9.0...11.10.0)

---
updated-dependencies:
- dependency-name: highlight.js
  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-08 11:23:00 +01:00
dependabot[bot]
d9885181ce
Build(deps): Bump @highlightjs/cdn-assets from 11.9.0 to 11.10.0 (#27753)
Bumps [@highlightjs/cdn-assets](https://github.com/highlightjs/highlight.js) from 11.9.0 to 11.10.0.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/main/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/11.9.0...11.10.0)

---
updated-dependencies:
- dependency-name: "@highlightjs/cdn-assets"
  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-08 11:22:41 +01:00
Kelv
17aa831337
DEV: replace imagemagick convert commands with magick (#27767) 2024-07-08 16:55:59 +08:00
Martin Brennan
b46e1fe2aa
DEV: Renaming TopicsController defer track visit (#27761)
Followup to 527f02e99f,
I had to introduce defer_track_visit_v2 because discourse-docs
relied on defer_track_visit. Now that discourse-docs
is using the new method as of
discourse/discourse-docs@0d9365571b,
we can rename it in core. Then we will need one more PR
in both core and docs to remove usage of the "v2" method.
2024-07-08 16:00:20 +10:00
Alan Guo Xiang Tan
c3598847fe
DEV: Truncate user agent string when it is too long instead of null (#27758)
This is a follow up to 005f623c42 where
we want to truncate the user agent string instead of nulling out the
column when the user agent string is too low. By truncating, we still
get to retain information that can still be useful.
2024-07-08 13:58:20 +08:00
Martin Brennan
df6f950200
DEV: Hide admin Moderation Flags UI behind feature flag for now (#27756)
Adds experimental_flags_admin_page_enabled_groups (default "")
to remove the Moderation Flags link from the admin sidebar for now,
there are still a few bugfixes that need to be done before we
are comfortable with turning this on more widely. This is
a _temporary_ flag, we will be removing this once the feature
is more stable.
2024-07-08 11:09:30 +10:00
dependabot[bot]
04c2b54423
Build(deps-dev): Bump glob from 10.4.2 to 10.4.3 (#27751)
Bumps [glob](https://github.com/isaacs/node-glob) from 10.4.2 to 10.4.3.
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v10.4.2...v10.4.3)

---
updated-dependencies:
- dependency-name: glob
  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-08 08:40:31 +08:00
Vinoth Kannan
52a047a8be
UX: plugins may have underscore in the name (#27749)
For example, https://github.com/discourse/docker_manager
2024-07-07 21:43:11 +05:30
Sérgio Saquetim
6022cc2af8
DEV: Escape the sidebar filter and admin sidebar no results description (#27746) 2024-07-05 17:54:22 -03:00
Jarek Radosz
dd30463276
DEV: Use async/await in admin route model fns (#27745) 2024-07-05 22:25:42 +02:00
Isaac Janzen
005f623c42
DEV: Add user_agent column to search_logs (#27742)
Add a new column - `user_agent` - to the `SearchLog` table. 

This column can be null as we are only allowing a the user-agent string to have a max length of 2000 characters. In the case the user-agent string surpasses the max characters allowed, we simply nullify the value, and save/write the log as normal.
2024-07-05 14:05:00 -05:00
Sérgio Saquetim
b36cbc7d21
DEV: Untangle the admin sidebar from the sidebar code (#27640) 2024-07-05 13:11:15 -03:00
David Battersby
640dccd224
FIX: show primary user group options to members in account prefs (#27664)
The user serializer groups method previously relied on the members_visible_groups to determine groups that the user should be able to see, however this setting was intended for visibility of group members (which is entirely different).

The result of this could be seen when choosing a primary group from user preferences -> account, due to the serializer the group name was not visible when members_visible_groups was set to owners.
2024-07-05 19:43:50 +04:00
dependabot[bot]
3b4ac6833c
Build(deps-dev): Bump ember-modifier from 4.1.0 to 4.2.0 (#27717)
Bumps [ember-modifier](https://github.com/ember-modifier/ember-modifier) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/ember-modifier/ember-modifier/releases)
- [Changelog](https://github.com/ember-modifier/ember-modifier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ember-modifier/ember-modifier/compare/v4.1.0...v4.2.0)

---
updated-dependencies:
- dependency-name: ember-modifier
  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-05 15:25:46 +02:00