Commit Graph

22914 Commits

Author SHA1 Message Date
dependabot[bot]
1800ea57ae
Build(deps): Bump ember-resolver from 12.0.0 to 12.0.1 (#27432)
Bumps [ember-resolver](https://github.com/ember-cli/ember-resolver) from 12.0.0 to 12.0.1.
- [Release notes](https://github.com/ember-cli/ember-resolver/releases)
- [Changelog](https://github.com/ember-cli/ember-resolver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ember-cli/ember-resolver/compare/v12.0.0...v12.0.1)

---
updated-dependencies:
- dependency-name: ember-resolver
  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-06-12 00:49:16 +02:00
dependabot[bot]
48cb7cb1a7
Build(deps-dev): Bump the embroider group with 4 updates (#27428)
Bumps the embroider group with 4 updates: [@embroider/compat](https://github.com/embroider-build/embroider/tree/HEAD/packages/compat), [@embroider/core](https://github.com/embroider-build/embroider/tree/HEAD/packages/core), [@embroider/macros](https://github.com/embroider-build/embroider/tree/HEAD/packages/macros) and [@embroider/webpack](https://github.com/embroider-build/embroider/tree/HEAD/packages/webpack).


Updates `@embroider/compat` from 3.5.1 to 3.5.2
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/compat)

Updates `@embroider/core` from 3.4.10 to 3.4.11
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/core)

Updates `@embroider/macros` from 1.16.2 to 1.16.3
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/macros)

Updates `@embroider/webpack` from 4.0.1 to 4.0.2
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/webpack)

---
updated-dependencies:
- dependency-name: "@embroider/compat"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/macros"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/webpack"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-12 00:48:04 +02:00
dependabot[bot]
fd0a16ddb5
Build(deps-dev): Bump webpack from 5.91.0 to 5.92.0 (#27429)
Bumps [webpack](https://github.com/webpack/webpack) from 5.91.0 to 5.92.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.91.0...v5.92.0)

---
updated-dependencies:
- dependency-name: webpack
  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-06-12 00:46:44 +02:00
dependabot[bot]
ddd6919c7c
Build(deps-dev): Bump ember-qunit from 8.0.2 to 8.1.0 (#27430)
Bumps [ember-qunit](https://github.com/emberjs/ember-qunit) from 8.0.2 to 8.1.0.
- [Release notes](https://github.com/emberjs/ember-qunit/releases)
- [Commits](https://github.com/emberjs/ember-qunit/compare/v8.0.2...v8.1.0)

---
updated-dependencies:
- dependency-name: ember-qunit
  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-06-12 00:46:08 +02:00
Jarek Radosz
1ecfc397d3
FIX: Properly close user-card after page transition (#27423) 2024-06-11 20:00:20 +02:00
Kris
f95d80af26
UX: update "all tags" to "remove filter" for tag breadcrumb dropdown (#27424) 2024-06-11 13:21:09 -04:00
chapoi
dc2be1a9bd
UX: add active highlight for breadcrumb navigation (#27422) 2024-06-11 18:29:44 +02:00
Kris
e44025b687
UX: improve login modal on very narrow screens in desktop mode (#27405) 2024-06-11 09:53:58 -04:00
Jarek Radosz
b757275c1e
DEV: Remove modKeysPressed (#27408)
It was added when removing `{{action}}` modifiers from the app, but we already had `wantsNewWindow` so use that instead.
2024-06-11 13:59:59 +02:00
Martin Brennan
10b9a32abb
FIX: Message for bulk closing topics silently (#27400)
We were using `autoclose` as the topic status update
when silently closing topics using the bulk
actions (introduced in 0464ddcd9b).

However, this resulted in a message like this showing in
the topic as a small moderator post:

> This topic was automatically closed after X days.

This is not accurate, the topic was bulk closed by someone.
Instead, we can use `closed` as the status, and a more accurate

> Closed on DATE

message is used. `TopicStatusUpdater` needed an additional
option to keep the same "fake read" behaviour as autoclose
so we can keep the same functionality for silently closing
topics in bulk actions.
2024-06-11 09:36:54 +10:00
dependabot[bot]
eb6a12b920
Build(deps-dev): Bump ember-cli-app-version from 6.0.1 to 7.0.0 (#27407)
Bumps [ember-cli-app-version](https://github.com/ember-cli/ember-cli-app-version) from 6.0.1 to 7.0.0.
- [Release notes](https://github.com/ember-cli/ember-cli-app-version/releases)
- [Changelog](https://github.com/ember-cli/ember-cli-app-version/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ember-cli/ember-cli-app-version/compare/v6.0.1...v7.0.0)

---
updated-dependencies:
- dependency-name: ember-cli-app-version
  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-06-11 01:25:22 +02:00
Sérgio Saquetim
f846d2e8fd
DEV: Extract the contents of the home logo to a component (#27157)
This commit extracts the content of the `HomeLogo` to a standalone
component. This enables us to utilize the `home-logo-contents` plugin
outlet to render an alternative version of the logo using the new
component to reuse the rendering logic, but using alternative
properties. For example:

```js
  const logoSmallUrl = settings
  .theme_uploads["theme-alternative-logo-small"];
  const logoUrl = settings.theme_uploads["theme-alternative-logo"];
  const mobileLogoUrl = settings
  .theme_uploads["theme-alternative-logo"];

  api.renderInOutlet("home-logo-contents", <template>
    <HomeLogoContents
      @logoSmallUrl={{logoSmallUrl}}
      @logoUrl={{logoUrl}}
      @minimized={{@outletArgs.minimized}}
      @mobileLogoUrl={{mobileLogoUrl}}
      @showMobileLogo={{@outletArgs.showMobileLogo}}
      @title={{@outletArgs.title}}
    />
  </template>);
``
2024-06-10 15:35:08 -03:00
David Taylor
565c753dd2
DEV: @babel/plugin-proposal-decorators -> decorator-transforms (#27260)
decorator-transforms (https://github.com/ef4/decorator-transforms) is a modern replacement for babel's plugin-proposal-decorators. It provides a decorator implementation using modern browser features, without needing to enable babel's full suite of class feature transformations. This improves the developer experience and performance.

In local testing with Google's 'tachometer' tool, this reduces Discourse's 'init-to-render' time by around 3-4% (230ms -> 222ms).

It reduces our initial gzip'd JS payloads by 3.2% (2.43MB -> 2.35MB), or 7.5% (14.5MB -> 13.4MB) uncompressed.

This was previously reverted in 97847f6. This version includes a babel transformation which works around the bug in Safari <= 15.

For Cloudflare compatibility issues, check https://meta.discourse.org/t/311390
2024-06-10 15:51:48 +01:00
Jarek Radosz
c18e5d1698
DEV: Convert security-key-form to glimmer/gjs (#27364)
(`allowedCredentialIds` and `challenge` args were unused)
2024-06-10 15:06:48 +02:00
Jarek Radosz
42a529f9ae
PERF: Avoid excessive object creations in watched words (#27354)
Inline the helper functions, avoid creating and then immediately destructuring arrays, use complete strings instead of string interpolation, Map instead of a pojo.
2024-06-10 14:44:31 +02:00
dependabot[bot]
49aac85057
Build(deps): Bump ember-resolver from 11.0.1 to 12.0.0 (#27390)
Bumps [ember-resolver](https://github.com/ember-cli/ember-resolver) from 11.0.1 to 12.0.0.
- [Release notes](https://github.com/ember-cli/ember-resolver/releases)
- [Changelog](https://github.com/ember-cli/ember-resolver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ember-cli/ember-resolver/compare/v11.0.1...v12.0.0)

---
updated-dependencies:
- dependency-name: ember-resolver
  dependency-type: direct:production
  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-06-10 14:24:46 +02:00
Guhyoun Nam
c13f64d35b
FEATURE: Add Filter for Webhook Events by Status (#27332)
* FEATURE: Add Filter for Webhook Events by Status

* Fixing multiple issues

* Lint

* Fixing multiple issues

* Change the range of the status for webhook events
2024-06-07 10:26:00 -05:00
dependabot[bot]
066fa8e216
Build(deps-dev): Bump ember-cli from 5.8.1 to 5.9.0 (#27376)
Bumps [ember-cli](https://github.com/ember-cli/ember-cli) from 5.8.1 to 5.9.0.
- [Release notes](https://github.com/ember-cli/ember-cli/releases)
- [Changelog](https://github.com/ember-cli/ember-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ember-cli/ember-cli/compare/v5.8.1...v5.9.0)

---
updated-dependencies:
- dependency-name: ember-cli
  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-06-07 15:21:12 +02:00
dependabot[bot]
476d5febeb
Build(deps): Bump terser from 5.31.0 to 5.31.1 (#27377)
Bumps [terser](https://github.com/terser/terser) from 5.31.0 to 5.31.1.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.31.0...v5.31.1)

---
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-06-07 15:18:58 +02:00
Martin Brennan
aef3f17b56
DEV: A different approach to breadcrumbs (#27365)
Really fully authored by Jarek, I only made the PR :)

The `DBreadcrumbItem` and `DBreadcrumbContainer` components
introduced in 1239178f49 have
some limitations, mainly that the container has no awareness of
its items, so nothing that requires positional knowledge can
be used. This is needed to use `aria-current` on the last breadcrumb
item, see https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/examples/breadcrumb/.

We change `DBreadcrumbItem` to always be a link, removing
the need for `LinkTo`. Then, we introduce a service to keep
track of containers and items (since all items are rendered into
all containers) and make the item itself responsible for registering
to the service, and introduce the needed `aria-current` behaviour.

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-06-07 11:31:46 +10:00
Martin Brennan
36dbf06fe9
FEATURE: Use new topic bulk actions dropdown on search page (#27303)
We want to get rid of the old topic bulk actions modal
and use the new dropdown (currently gated behind
experimental_topic_bulk_actions_enabled_groups). To do
this we need to use the new dropdown in all places in the
UI.

This commit changes the full page search UI to use the new
topic bulk actions dropdown if experimental_topic_bulk_actions_enabled_groups
is enabled, and makes some minor refactors to make this work.
Also add a spec for both the old and new functionality.
2024-06-07 10:41:42 +10:00
Kris
0739431cc0
UX: create space for new topics banner on new, unread (#27374) 2024-06-06 18:04:27 -04:00
Isaac Janzen
69193c4bd5
DEV: Add a callback to the validation of user custom fields in the signup form (#27369)
# Description

Add `addCustomUserFieldValidationCallback` to the user fields validation mixin. This allows you to add a custom validation when checking the validity of custom user field values in the signup form on submit. 

```js
addCustomUserFieldValidationCallback((userField) => {
  if (userField.field.name === "my custom user field" && userField.value === "foo") {
    return EmberObject.create({
      failed: true,
      reason: I18n.t("value_can_not_be_foo"),
      element: userField.field.element,
    });
  }
});
```

In the case your custom validation deems an input value `failed`, you return an EmberObject with the fields `failed: true`, `reason`, and `element`.

```js
return EmberObject.create({
  failed: true,
  reason: I18n.t("value_can_not_be_foo"),
  element: userField.field.element,
});
```

which will then display your custom `reason` to the user attached to the given user custom field input and will not submit the signup form.

<img width="288" alt="Screenshot 2024-06-06 at 11 08 40 AM" src="https://github.com/discourse/discourse/assets/50783505/11168fb8-8806-43f0-9417-73991bbd1178">

# Other

- Add `addCustomUserFieldValidationCallback` to the plugin api
- Bump plugin api version
- Update plugin api changelog
- Add tests
2024-06-06 11:17:06 -06:00
Kris
dbd16776fa
UX: improve topic timeline date titles (#27351) 2024-06-06 11:27:12 -04:00
Jarek Radosz
46ab4f0c4a
DEV: Implement DeferredTrackedSet (#27372)
For cases where you'd be using a TrackedSet to render something and then modifying that set throughout the same render cycle. (specifically it will be used in #27365)
2024-06-06 15:59:20 +02:00
Osama Sayegh
ffec8163b0
DEV: Initial UI for admin config area for /about (#27340)
This commit introduces the initial UI for the admin config area for the /about page. The UI isn't wired and doesn't do anything yet, but we're going to iterate on it in future commits.

Internal topic: t/128544.
2024-06-06 16:07:08 +03:00
Alan Guo Xiang Tan
952f69ce60
FIX: User can't reset password with backup codes when only security key is enabled (#27368)
This commit fixes a problem where the user will not be able to reset
their password when they only have security keys and backup codes
configured.

This commit also makes the following changes/fixes:

1. Splits password reset system tests to
   `spec/system/forgot_password_spec.rb` instead of missing the system
   tests in `spec/system/login_spec.rb` which is mainly used to test
   the login flow.

2. Fixes a UX issue where the `Use backup codes` or `Use authenticator
   app` text is shown on the reset password form when the user does
   not have either backup codes or an authenticator app configured.
2024-06-06 14:30:42 +08:00
dependabot[bot]
4a1048f541
Build(deps): Bump the babel group with 2 updates (#27361)
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.6 to 7.24.7
- [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.7/packages/babel-core)

Updates `@babel/standalone` from 7.24.6 to 7.24.7
- [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.7/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-06-06 01:46:03 +02:00
Jan Cernik
343430fe77
FIX: password reset with security key (#27358)
This regressed in 0434112.

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2024-06-05 20:26:22 -03:00
Joffrey JAFFEUX
729063e485
FIX: ensures invalid OTP blocks submit (#27352) 2024-06-05 14:45:16 -04:00
Jarek Radosz
fb812a48ab
DEV: Fix invalid hbs syntax in tests (#27348)
Followup to 26198fb328

also removes superfluous whitespace
2024-06-05 14:08:15 +02:00
Jarek Radosz
26198fb328
DEV: Fix incorrect hbs syntax in tests (#27345) 2024-06-05 13:28:22 +02:00
Martin Brennan
748240ce3b
FIX: Pluralisation for short password count (#27342)
Followup 0434112aa7,
when I introduced the pluralisation for the
password.too_short message I didn't change the
key name to `count`, which is necessary.
2024-06-05 16:20:48 +10:00
Martin Brennan
0434112aa7
UX: Streamline reset password page (#27341)
This commit includes various UX improvements to the reset
password page:

* Introduce a `hide-application-header-buttons` helper to do the following:
  * Hide Sign Up and Log In buttons, they are not necessary on this flow
  * Hide the sidebar, it is a distraction on this flow
* Improve messaging when a 2FA confirmation is required first
* Improve display of server-side ActiveRecord model validation errors
  in password form, e.g. instead of "is the same as your current password"
  we do "The password is the same as your current password"
* Move password tip to next line below input and move caps lock hint
  inline with Show/Hide password toggle
* Add system specs for 2FA flow on reset password page
* Fixes a computed property conflict issue on the password reset
   page when toggling 2FA methods
2024-06-05 15:22:59 +10:00
Krzysztof Kotlarek
aa88b07640
FEATURE: the ability to change the order of flags (#27269)
Continued work on moderate flags UI.
In this PR admins are allowed to change the order of flags. The notify user flag is always on top but all other flags can be moved.
2024-06-05 13:27:06 +10:00
Krzysztof Kotlarek
c1ecbb8d28
UX: move users link to the top of the admin sidebar (#27339)
Before, users link was in the community section.
2024-06-05 12:49:46 +10:00
Kris
9404459188
UX: prevent twitter like/retweet counts from wrapping (#27333) 2024-06-04 16:55:50 -04:00
Kris
a4001548d8
UX: fix only-emoji size in user-stream excerpts (#27330) 2024-06-04 14:59:43 -04:00
Jarek Radosz
e57fe1e994
DEV: Remove uses of @on from native classes (#27327)
Fixes a deprecation warning introduced in a64f021f49 and removes all uses of `@on` in native classes. (those are unnecessary)
2024-06-04 20:16:05 +02:00
Jarek Radosz
bbdf14828b
DEV: Check lifecycle props in Presence service (#27328)
This may or may not fix flakes in `Unit | Service | presence` tests
2024-06-04 20:15:27 +02:00
Kris
4236aa0851
UX: add space between revision avatar and username (#27329) 2024-06-04 12:48:16 -04:00
Kris
14f81490ec
UX: fix mobile read state alignment (#27323) 2024-06-04 09:40:41 -04:00
Jarek Radosz
c972a31819
DEV: Fix typos and formatting (#27320) 2024-06-04 15:16:24 +02:00
David Taylor
0ddad8fc64
Revert "DEV: Update action syntax for routes/application.js (#27282)" (#27318)
This reverts commit 0b10e335ae.

I realised that some of these actions are overridden in themes/plugins, so this is going to cause problems (especially because modifyClass doesn't currently work well with the `@action` decorator)
2024-06-04 13:44:19 +01:00
David Taylor
0b10e335ae
DEV: Update action syntax for routes/application.js (#27282) 2024-06-04 13:38:24 +01:00
David Taylor
d02e40e989
DEV: Update action syntax for routes/discourse.js (#27283) 2024-06-04 13:37:18 +01:00
David Taylor
aa37be3323
UX: Use regular reset-password flow for expired passwords (#27316)
This makes it more obvious what's happening, and makes it much less likely that users will send repeated reset emails (and thereby hit the rate limit)

Followup to e97ef7e9af
2024-06-04 12:47:33 +01:00
Kris
30f55cd64b
UX: improve search result consistency (#27289) 2024-06-04 15:34:21 +10:00
Krzysztof Kotlarek
eebf332025
FEATURE: expand the admin sidebar when filtering (#27312)
Even when the admin sidebar sections are collapsed, they should expand while filtering. When the filter is removed, sections should go back to the previous state.

In addition, trim whitespace from the filter section.
2024-06-04 12:23:21 +10:00
David Taylor
a64f021f49
DEV: Convert user-posts-stream to native class syntax (#27278)
This is the final model in Discourse core to be converted
2024-06-03 15:03:50 +01:00