Commit Graph

18123 Commits

Author SHA1 Message Date
Penar Musaraj
c6ead3f5c4
FEATURE: Allow users to confirm session with passkeys (#24337)
We ask users to confirm their session if they are making a sensitive
action, such as adding/updating second factors or passkeys. This
commit adds the ability to confirm sessions with passkeys as an option
to the password confirmation.
2023-11-14 11:38:10 -05:00
dependabot[bot]
c512552b4f
Build(deps): Bump ember-route-template in /app/assets/javascripts (#24353)
Bumps [ember-route-template](https://github.com/discourse/ember-route-template) from 1.0.2 to 1.0.3.
- [Commits](https://github.com/discourse/ember-route-template/compare/v1.0.2...v1.0.3)

---
updated-dependencies:
- dependency-name: ember-route-template
  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>
2023-11-14 13:06:53 +01:00
Kelv
2b4251c56c
DEV: change header-topic-title-suffix-outlet to insert into classed span element (#24362) 2023-11-14 14:06:48 +08:00
Martin Brennan
014bb0adb8
FIX: buildQuoteMarkdown fn was not passed down properly (#24360)
Followup to d128dc0e61,
I swear I tried this locally and it worked, but it turns
out it didn't. Need to keep the `action "function"` syntax
here.
2023-11-14 10:42:41 +10:00
Martin Brennan
a238f66b33
DEV: Add quote-share-buttons-before plugin outlet (#24358)
This is so additional buttons can be rendered inbetween
the quote/edit buttons and the share buttons for post quotes
2023-11-14 09:41:44 +10:00
Martin Brennan
d128dc0e61
FEATURE: Add buildQuoteMarkdown for post toolbar (#24326)
This allows outlets for the post-text-selection-toolbar to
get just the raw markdown of the selected text for a quote,
rather than opening the composer.
2023-11-14 08:47:39 +10:00
Sérgio Saquetim
9919046c1c
DEV: Improve discovery components plugin-outlets compatibility with existing customizations
This commit changes some plugin outlets in `<Discovery::Layout>`, `<Discovery::Navigation>` and `Discovery::Topics` to improve compatibility with existing customization, simplifying the migration process to the new discovery routes.

In these components, the standard plugin outlets will receive by default at least the arguments: `category` and `tag`.

Furthermore, two new wrapping plugin outlets were added to enable the conversion of existing template overrides to the new pattern: `discovery-list-area` and `topic-list-bottom`. The new template overrides will receive a `model` argument containing the full model handled by the route.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2023-11-13 19:00:00 -03:00
Penar Musaraj
fcf0373b13
FIX: only show passkeys button in login modal (#24351)
We show the rest of the external login buttons in the create account
modal as well, but "login with a passkey" is not relevant in that context.
2023-11-13 16:06:46 -05:00
Penar Musaraj
a814348176
DEV: Rename experimental_passkeys to enable_passkeys (#24349)
Also includes a migration.
2023-11-13 15:04:15 -05:00
Joffrey JAFFEUX
1dad379412
DEV: allows to wrap wizard checkbox with outlet (#24334) 2023-11-13 14:02:14 -05:00
Kris
797da5870b
FEATURE: remove category badge style options, set bullet style as default (#24198) 2023-11-13 10:46:15 -05:00
Godfrey Chan
8444c865e9
DEV: remove slightly less trivial {{action}} usages (#24289)
Follow-up to #24278 that is slightly less trivial.

* Some were "trivial" usages that were missed in the previous PR because the same file that had at least one other non-trivial usage.
* These involve extra arguments or inheritance but I have checked that they seem correct.
2023-11-13 13:29:20 +01:00
dependabot[bot]
fcafc8872f
Build(deps): Bump ember-route-template in /app/assets/javascripts (#24338)
Bumps [ember-route-template](https://github.com/discourse/ember-route-template) from 1.0.1 to 1.0.2.
- [Commits](https://github.com/discourse/ember-route-template/commits)

---
updated-dependencies:
- dependency-name: ember-route-template
  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>
2023-11-13 11:13:19 +00:00
Jarek Radosz
1e1bb45b96
FIX: Add a missing service injection (#24341)
Fixes the reorder-categories modal.
2023-11-13 01:31:04 +01:00
David Taylor
cdbe0f74e8
FIX: Load highlightjs bundle via CDN (#24335) 2023-11-10 22:19:06 +00:00
David Taylor
0878dde213
DEV: Modernise highlightjs loading (#24197)
- Remove vendored copy
- Update Rails implementation to look for language definitions in node_modules
- Use webpack-based dynamic import for hljs core
- Use browser-native dynamic import for site-specific language bundle (and fallback to webpack-based dynamic import in tests)
- Simplify markdown implementation to allow all languages into the `lang-{blah}` className
- Now that all languages are passed through, resolve aliases at runtime to avoid the need for the pre-built `highlightjs-aliases` index
2023-11-10 20:39:48 +00:00
David Taylor
ac896755bb
DEV: Simplify ember-cli proxy strategy (#24242)
Previously, the app HTML served by the Ember-CLI proxy was generated based on a 'bootstrap json' payload generated by Rails. This inevitably leads to differences between the Rails HTML and the Ember-CLI HTML.

This commit overhauls our proxying strategy. Now, we totally ignore the ember-cli `index.html` file. Instead, we take the full HTML from Rails and surgically replace script URLs based on a `data-discourse-entrypoint` attribute. This should be faster (only one request to Rails), more robust, and less confusing for developers.
2023-11-10 11:16:06 +00:00
David Taylor
80208d0ab6
DEV: Support legacy precompiler paths in theme compiler (#24329)
This updates the behaviour to match ember-cli-htmlbars, and should take care of the handful of themes which were relying on runtime compilation in tests (see 4425e99bf9)
2023-11-10 10:37:50 +00:00
Kris
36ab7ff2a9
FIX: update tag-chooser & category-selector action (#24318) 2023-11-10 00:05:02 +01:00
dependabot[bot]
10167ad8ee
Build(deps): Bump the babel group (#24310)
Bumps the babel group in /app/assets/javascripts 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.23.2 to 7.23.3
- [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.23.3/packages/babel-core)

Updates `@babel/standalone` from 7.23.2 to 7.23.3
- [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.23.3/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  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>
2023-11-10 00:00:05 +01:00
Andrei Prigorshnev
d91456fd53
DEV: Ability to collect stats without exposing them via API (#23933)
This adds the ability to collect stats without exposing them 
among other stats via API.

The most important thing I wanted to achieve is to provide 
an API where stats are not exposed by default, and a developer 
has to explicitly specify that they should be 
exposed (`expose_via_api: true`). Implementing an opposite 
solution would be simpler, but that's less safe in terms of 
potential security issues. 

When working on this, I had to refactor the current solution. 
I would go even further with the refactoring, but the next steps 
seem to be going too far in changing the solution we have, 
and that would also take more time. Two things that can be 
improved in the future:
1. Data structures for holding stats can be further improved
2. Core stats are hard-coded in the About template (it's hard 
to fix it without correcting data structures first, see point 1):
    63a0700d45/app/views/about/index.html.erb (L61-L101)

The most significant refactorings are:
1. Introducing the `Stat` model
2. Aligning the way the core and the plugin stats' are registered
2023-11-10 00:44:05 +04:00
Kris
6b6552fe45
DEV: remove wrapping span from discovery-above (#24297) 2023-11-08 13:53:08 -05:00
Jordan Vidrine
9d1e8265da
FEATURE: Add ability to hide modal header (#24290) 2023-11-08 12:15:35 -06:00
Bianca Nenciu
277496b6e0
FIX: Replace watched words with wildcards (#24279)
These have been broken since fd07c943ad
because watched words were not correctly transformed to regexps.
This partially reverts the changes.
2023-11-08 18:51:11 +02:00
Jarek Radosz
daf7608905
DEV: Migrate reorder-categories to the new modal API (#24209) 2023-11-08 16:28:53 +01:00
Roman Rizzi
3c29a84d98
DEV: Add support for radar charts when displaying reports. (#24274)
Reports can have the radar type, which will get rendered by the `admin-report-radar` component.
2023-11-08 10:48:12 -03:00
Godfrey Chan
82506096b7
DEV: remove trivial {{action}} usages (#24278)
This removes all trivial usages of the `{{action}}` keyword (the helper form, not the modifier form), where trivial means:

1. It's a co-located component (`.hbs` next to `.js`)
2. The JS file has a default export that is native class
3. `{{action "foo"}}` or `(action "foo")` with no extra arguments
4. There is a corresponding `foo()` method defined on the class (not inherited, etc)

There are more usages that is slightly more involved (with arguments, etc) that we can deal with, but this PR seems big enough so I just included the easiest cases here.

To aid review, each file is converted in an individual commit, and the matching method is temporary annotated with `@__action__` instead of the normal `@action`. This forces a git diff when it is already annotated as `@action`.

* DEV: {{action}} -> @action admin-penalty-post-action.hbs
* DEV: {{action}} -> @action admin-report.hbs
* DEV: {{action}} -> @action admin-watched-word.hbs
* DEV: {{action}} -> @action emoji-value-list.hbs
* DEV: {{action}} -> @action bool.hbs
* DEV: {{action}} -> @action category.hbs
* DEV: {{action}} -> @action secret-value-list.hbs
* DEV: {{action}} -> @action category-list.hbs
* DEV: {{action}} -> @action color.hbs
* DEV: {{action}} -> @action compact-list.hbs
* DEV: {{action}} -> @action group-list.hbs
* DEV: {{action}} -> @action host-list.hbs
* DEV: {{action}} -> @action named-list.hbs
* DEV: {{action}} -> @action simple-list.hbs
* DEV: {{action}} -> @action tag-group-list.hbs
* DEV: {{action}} -> @action tag-list.hbs
* DEV: {{action}} -> @action value-list.hbs
* DEV: {{action}} -> @action watched-word-form.hbs
* DEV: {{action}} -> @action composer-messages.hbs
* DEV: {{action}} -> @action section.hbs
* DEV: {{action}} -> @action user-status-picker.hbs
* DEV: cleanup @__action__ -> @action
2023-11-08 10:53:06 +01:00
Martin Brennan
184f038cbf
FIX: Fix hashtag decoration on later pages of user activity stream (#24261)
Followup to 545e92039c

This commit fixes an issue where hashtags on user activity stream
items past page 1 did not get decorated. This is because of a bug
in the user stream component, where it was trying to get stream
items to decorate after the AJAX call but before they had been
rendered by Ember. This can be fixed by wrapping this decoration
logic in later() to run on the next runloop.
2023-11-08 14:34:03 +10:00
Martin Brennan
986fb522be
FEATURE: Add theme-components route for admin (#24264)
This commit adds an /admin/customize/theme-components route,
that opens the theme page with the components tab pre-selected,
so people can navigate to that directly.
2023-11-08 13:42:27 +10:00
Kris
096462b5b0
FIX: relocate above-discovery-categories outlet (#24287) 2023-11-07 17:29:44 -05:00
Neil Lalonde
e34521f4b5
DEV: add PluginOutlet around the Customize > Themes tab (#24280) 2023-11-07 16:48:30 -05:00
dependabot[bot]
c7fd815759
Build(deps-dev): Bump the types group (#24281)
Bumps the types group in /app/assets/javascripts with 21 updates:

| Package | From | To |
| --- | --- | --- |
| [@types/ember](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember) | `4.0.8` | `4.0.9` |
| [@types/ember__application](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__application) | `4.0.9` | `4.0.10` |
| [@types/ember__array](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__array) | `4.0.7` | `4.0.8` |
| [@types/ember__component](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__component) | `4.0.19` | `4.0.20` |
| [@types/ember__controller](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__controller) | `4.0.9` | `4.0.10` |
| [@types/ember__debug](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__debug) | `4.0.6` | `4.0.7` |
| [@types/ember__destroyable](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__destroyable) | `4.0.3` | `4.0.4` |
| [@types/ember__engine](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__engine) | `4.0.8` | `4.0.9` |
| [@types/ember__error](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__error) | `4.0.4` | `4.0.5` |
| [@types/ember__object](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__object) | `4.0.9` | `4.0.10` |
| [@types/ember__polyfills](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__polyfills) | `4.0.4` | `4.0.5` |
| [@types/ember__routing](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__routing) | `4.0.17` | `4.0.18` |
| [@types/ember__runloop](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__runloop) | `4.0.7` | `4.0.8` |
| [@types/ember__service](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__service) | `4.0.6` | `4.0.7` |
| [@types/ember__string](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__string) | `3.0.12` | `3.0.13` |
| [@types/ember__template](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__template) | `4.0.4` | `4.0.5` |
| [@types/ember__test](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__test) | `4.0.4` | `4.0.5` |
| [@types/ember__utils](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__utils) | `4.0.5` | `4.0.6` |
| [@types/jquery](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jquery) | `3.5.26` | `3.5.27` |
| [@types/qunit](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/qunit) | `2.19.7` | `2.19.8` |
| [@types/rsvp](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/rsvp) | `4.0.6` | `4.0.7` |


Updates `@types/ember` from 4.0.8 to 4.0.9
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember)

Updates `@types/ember__application` from 4.0.9 to 4.0.10
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__application)

Updates `@types/ember__array` from 4.0.7 to 4.0.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__array)

Updates `@types/ember__component` from 4.0.19 to 4.0.20
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__component)

Updates `@types/ember__controller` from 4.0.9 to 4.0.10
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__controller)

Updates `@types/ember__debug` from 4.0.6 to 4.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__debug)

Updates `@types/ember__destroyable` from 4.0.3 to 4.0.4
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__destroyable)

Updates `@types/ember__engine` from 4.0.8 to 4.0.9
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__engine)

Updates `@types/ember__error` from 4.0.4 to 4.0.5
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__error)

Updates `@types/ember__object` from 4.0.9 to 4.0.10
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__object)

Updates `@types/ember__polyfills` from 4.0.4 to 4.0.5
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__polyfills)

Updates `@types/ember__routing` from 4.0.17 to 4.0.18
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Changelog](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ember__routing/history-location.d.ts)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__routing)

Updates `@types/ember__runloop` from 4.0.7 to 4.0.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__runloop)

Updates `@types/ember__service` from 4.0.6 to 4.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__service)

Updates `@types/ember__string` from 3.0.12 to 3.0.13
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__string)

Updates `@types/ember__template` from 4.0.4 to 4.0.5
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__template)

Updates `@types/ember__test` from 4.0.4 to 4.0.5
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__test)

Updates `@types/ember__utils` from 4.0.5 to 4.0.6
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__utils)

Updates `@types/jquery` from 3.5.26 to 3.5.27
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jquery)

Updates `@types/qunit` from 2.19.7 to 2.19.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/qunit)

Updates `@types/rsvp` from 4.0.6 to 4.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/rsvp)

---
updated-dependencies:
- dependency-name: "@types/ember"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__application"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__array"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__component"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__controller"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__debug"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__destroyable"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__engine"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__error"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__object"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__polyfills"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__routing"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__runloop"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__service"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__string"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__template"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__test"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__utils"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/jquery"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/qunit"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/rsvp"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 22:43:42 +01:00
Kris
f3d5cca3f2
FIX: restore "categories and top topics" layout (#24275) 2023-11-07 13:23:36 -05:00
Penar Musaraj
a1c1f7ce75
DEV: Standardize session confirmation prompt (#24212)
Switches to using a dialog to confirm a session (i.e. sudo mode for
account changes where we want to be extra sure the current user is who
they say they are) to match what we do with passkeys.
2023-11-07 11:26:10 -05:00
Jean
1d68ff430b
FEATURE: Add custom fields to members on group index (#24232)
* FEATURE: Add custom fields to members on group index
2023-11-07 10:06:47 -04:00
Kelv
4a21411de2
DEV: upgrade avatar-selector modal to glimmer component (#24192)
* DEV: upgrade avatar-selector modal

* DEV: add system test for avatar selection in account preferences
2023-11-07 21:02:19 +08:00
David Taylor
39e1b97a5d
FIX: Deleting tags via <TagInfo /> component (#24268)
https://github.com/discourse/discourse/pull/22622 accidentally introduced an `@action` decorator inside the actions hash, which does not work. This commit modernizes the component by removing the actions hash altogether.
2023-11-07 11:56:52 +00:00
David Taylor
a0b94dca16
DEV: Use WebPack stats plugin to map entrypoints to chunks (#24239)
Previously, we were parsing webpack JS chunk filenames from the HTML files which ember-cli generates. This worked ok for simple entrypoints, but falls apart once we start using async imports(), which are not included in the HTML.

This commit uses the stats plugin to generate an assets.json file, and updates Rails to parse it instead of the HTML. Caching on the Rails side is also improved to avoid reading from the filesystem multiple times per request in develoment.

Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
2023-11-07 10:24:49 +00:00
David Taylor
9dd4d97289
FIX: Expand globally pinned topics correctly (#24266)
and ensure proper re-render when moving between category/latest pages

Followup to 82d6d691ee
2023-11-07 10:17:41 +00:00
Martin Brennan
3fe8cc811c
DEV: Make admin experimental sidebar config more forgiving (#24236)
Followup to b53449eac9,
it was too easy to add broken routes which would break
configuration for the whole site, so now we validate ember
routes on save.
2023-11-07 13:20:57 +10:00
Kris
fb20f86784
DEV: remove undefined categoryPageStyle (#24253) 2023-11-06 18:15:38 -05:00
dependabot[bot]
17d1dd762d
Build(deps-dev): Bump the types group (#24250)
Bumps the types group in /app/assets/javascripts with 1 update: [@types/jquery](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jquery).

- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jquery)

---
updated-dependencies:
- dependency-name: "@types/jquery"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 22:53:00 +01:00
Penar Musaraj
fcaedbf4ba
FIX: Broken login with security key when passkeys enabled (#24249)
In some browsers, 2FA login was failing with a "request is already
pending" error. This only applied when `experimental_passkeys` was
enabled and on Chrome only. This was due to the fact that the webauthn
API only supports one auth attempt at a time, so the security key call
needs to abort the passkey's conditional UI request before starting.

I am not sure we can test this. We have system specs that simulate
webauthn credentials and they didn't catch this (probably because the
simulation covers the whole flow).
2023-11-06 16:45:33 -05:00
Godfrey Chan
9a1695ccc1
DEV: remove markdown-it-bundle and custom build code (#23859)
With Embroider, we can rely on async `import()` to do the splitting
for us.

This commit extracts from `pretty-text` all the parts that are
meant to be loaded async into a new `discourse-markdown-it` package
that is also a V2 addon (meaning that all files are presumed unused
until they are imported, aka "static").

Mostly I tried to keep the very discourse specific stuff (accessing
site settings and loading plugin features) inside discourse proper,
while the new package aims to have some resembalance of a general
purpose library, a MarkdownIt++ if you will. It is far from perfect
because of how all the "options" stuff work but I think it's a good
start for more refactorings (clearing up the interfaces) to happen
later.

With this, pretty-text and app/lib/text are mostly a kitchen sink
of loosely related text processing utilities.

After the refactor, a lot more code related to setting up the
engine are now loaded lazily, which should be a pretty nice win. I
also noticed that we are currently pulling in the `xss` library at
initial load to power the "sanitize" stuff, but I suspect with a
similar refactoring effort those usages can be removed too. (See
also #23790).

This PR does not attempt to fix the sanitize issue, but I think it
sets things up on the right trajectory for that to happen later.

Co-authored-by: David Taylor <david@taylorhq.com>
2023-11-06 16:59:49 +00:00
David Taylor
76b75fae36
DEV: Simplify I18n shim check (#24244)
We have identified some third-party analytics scripts which do things like `window.I18n = window.I18n` 🤦‍♂️. This leads to the window object having a null I18n property, but `"I18n" in globalThis` returns true.

This commit checks whether `window.I18n` is a truthy value.
2023-11-06 16:54:39 +00:00
David Taylor
4425e99bf9
DEV: Remove template-compiler from frontend test bundle (#24241)
Nowadays, themes/plugins have their templates compiled at build-time, so there is no need for us to carry the template compiler on the frontend during tests
2023-11-06 12:08:45 +00:00
David Taylor
82d6d691ee
DEV: Refactor discovery routes to remove use of 'named outlets' (#22622)
The motivation of this PR is to remove our dependence on Ember's 'named outlets', which are removed in Ember 4+.

At a high-level, the changes can be summarized as:

- The top-level `discovery` route is totally emptied of all logic. The HTML structure of the template is moved into the `<Discovery::Layout />` component for use by child routes.

- `AbstractTopicRoute` and `AbstractCategoryRoute` routes now both lean on the `DiscoverySortableController` and associated template. This controller is where most of the logic from the old top-level `discovery` controller has ended up.

- All navigation controllers/templates have been replaced with components. `navigation/categories`, `navigation/category` and `navigation/default` were very similar, and so they've all been combined into `<Navigation::Default>`. `navigation/filter` gets its own component.

- The `discovery/topics` controller/template have been moved into a new `<Discovery::Topics>` component.

Various other parts of the app have been tweaked to support these changes, but I've tried to keep that to a minimum.

Anything from `<TopicList>` down is untouched, which should hopefully mean that a large proportion of topic-list-customizing themes are unaffected.

For more information, see https://meta.discourse.org/t/282816
2023-11-06 10:39:31 +00:00
Renato Atilio
2201f8f7dc
FIX: form template upload type validation (#24148)
When submitting files through the form template upload field, we were having an issue where, although a validation error message was being presented to the user, the upload was still coming through, because `PickFilesButton`'s validation happens **after** the Uppy mixin finished the upload and hit `uploadDone`.

This PR adds a new overridable method to the Uppy mixin and overrides it with the custom validation, which now happens before the file is sent.

Additionally, we're now also using `uploadingOrProcessing` as the source of truth to show the upload/uploading label, which seems more reliable.
2023-11-03 10:11:25 -03:00
David Battersby
bb7a450da7
FEATURE: show lightbox carousel by default if post has 2 or more images (#24216)
This work includes the following updates for the new lightbox:

- Show carousel by default if there are more than 1 image in a post
- Removes toggling of carousel on mobile - now always open if there are more than 1 image
- Updates swipe down gesture on mobile to close lightbox (previously used to toggle carousel)
- Removes swipe up gesture on mobile (was previously used to close lightbox)
2023-11-03 16:32:15 +08:00
David Battersby
b2ec92390a
FIX: remove background image from lightbox backdrop (#24225)
This change removes the background image (which is the small version of the uploaded image) from the lightbox backdrop.

Now a solid color (dark grey) is used for the backdrop so we can distinguish between the lightbox's head, body and footer.
2023-11-03 16:10:04 +08:00
dependabot[bot]
b65e60ec38
Build(deps-dev): Bump sinon in /app/assets/javascripts (#24206)
Bumps [sinon](https://github.com/sinonjs/sinon) from 17.0.0 to 17.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v17.0.0...v17.0.1)

---
updated-dependencies:
- dependency-name: sinon
  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>
2023-11-02 19:22:26 +01:00
dependabot[bot]
b4e5d6a36d
Build(deps-dev): Bump ember-cli-deprecation-workflow (#24205)
Bumps [ember-cli-deprecation-workflow](https://github.com/mixonic/ember-cli-deprecation-workflow) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/mixonic/ember-cli-deprecation-workflow/releases)
- [Changelog](https://github.com/mixonic/ember-cli-deprecation-workflow/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mixonic/ember-cli-deprecation-workflow/compare/v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: ember-cli-deprecation-workflow
  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>
2023-11-02 19:22:08 +01:00
dependabot[bot]
cea743489a
Build(deps): Bump babel-plugin-ember-template-compilation (#24204)
Bumps [babel-plugin-ember-template-compilation](https://github.com/emberjs/babel-plugin-ember-template-compilation) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/emberjs/babel-plugin-ember-template-compilation/releases)
- [Changelog](https://github.com/emberjs/babel-plugin-ember-template-compilation/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emberjs/babel-plugin-ember-template-compilation/compare/v2.2.0...v2.2.1)

---
updated-dependencies:
- dependency-name: babel-plugin-ember-template-compilation
  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>
2023-11-02 19:21:37 +01:00
David Taylor
67bcef3959
DEV: Show theme/plugin error banner for route loading failures (#24218)
This aims to help admins and developers identify the cause of loading issues on routes.

As with other theme/plugin errors, the UI banner is only shown to administrators. For non-admins, the information is only written to the browser console.
2023-11-02 15:45:02 +00:00
David Taylor
08e2ee3ec1
DEV: Resolve observes deprecation in create-account (#24217) 2023-11-02 12:30:44 +00:00
Arpit Jalan
a38b80a0ea
FEATURE: add plugin outlets for topic title suffix (#24215) 2023-11-02 17:16:58 +05:30
David Battersby
65759c126b
FIX: add dominant color attribute to chat image uploads (#24214)
When uploading images, they are assigned a dominant color which gets used in various places, such as Discourse Hub and the new lightbox. Previously in chat we didn't assign this attribute, so it was defaulting to a null value. We did however use it as an inline CSS style for the image background (which is visible while the image is downloaded).

This change adds data-dominant-color to the uploaded image in chat and uses it correctly within lightbox.
2023-11-02 19:22:59 +08:00
Martin Brennan
d50fccfcaf
DEV: Do not auto-generate plugin routes for admin experimental sidebar (#24211)
Followup to b53449eac9, we cannot
generate the links to plugin admin pages in this way because it
depends on which plugins are installed; we would need to somehow
do it at runtime. Leaving it out for now, for people who need to
find these admin routes the Ember Inspector extension for Chrome
can be used in the meantime.
2023-11-02 12:13:20 +10:00
Martin Brennan
77a009397b
FIX: Broken hashtags on embed and publish pages (#24210)
Since we don't have icons or access to the JS that transforms
hashtag icon placeholders into their proper icons and colours
on embed and publish pages, we need to at least show _something_
and make sure the hashtags are not totally broken on these pages.
2023-11-02 11:43:55 +10:00
Martin Brennan
b53449eac9
DEV: Automatically generate all admin links for app for new sidebar (#24175)
NOTE: Most of this is experimental and will be removed at a later
time, which is why things like translations have not been added.

The new /admin-revamp UI uses a sidebar for admin nav. This initial
step adds a script to generate a map of all the current admin nav
into a format the sidebar to read. Then, people can experiment
with different changes to this structure.

The structure can then be edited from `/admin-revamp/config/sidebar-experiment`,
and it is saved to local storage so people can visually experiment with different ways
of showing the admin sidebar links.
2023-11-02 10:34:37 +10:00
Krzysztof Kotlarek
1c395e1a01
FIX: reliably reorder link in custom sections (#24188)
Two changes were introduced:
1. Reorder links on sidebar section is removed. Clicking and holding the mouse for 250ms was unintuitive;
2. Fixed bugs when reorder is done in edit modal.
2023-11-02 08:46:45 +11:00
Penar Musaraj
77445a4b32
FIX: Skip animated gif treatment for onebox avatar (#24199)
This fixes an edge case where the layout of a onebox with a gif avatar
was broken. Oneboxes have specific styling attached to avatar images and
the pausable animated image treatment was breaking that styling.
2023-11-01 16:24:06 -04:00
Jordan Vidrine
88bb5fa773
FIX: Adjust placement and animation of labels for custom user fields (#24201) 2023-11-01 14:51:40 -05:00
dependabot[bot]
eed041993b
Build(deps): Bump terser in /app/assets/javascripts (#24186)
Bumps [terser](https://github.com/terser/terser) from 5.23.0 to 5.24.0.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.23.0...v5.24.0)

---
updated-dependencies:
- dependency-name: terser
  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>
2023-11-01 11:23:10 +01:00
Mark VanLandingham
e58efa2c2e
DEV: Add a couple PluginOutlets to admin theme show (#24184) 2023-10-31 13:34:29 -05:00
Penar Musaraj
18d7162481
FIX: Maintain destination_url after passkey login (#24171) 2023-10-31 11:35:36 -04:00
Jarek Radosz
dbb532bae7
FIX: Full name validation regression (#24178)
Regressed in 351cbab1a8
2023-10-31 14:44:27 +01:00
David Taylor
32716f3746
DEV: Improve plugin/theme deprecation prefixes (#24155)
- Add prefixes to Ember deprecations (previously was just Discourse deprecations)

- Allow logic to work in tests (where window.Discourse is not defined)

- Detect `{plugin}_tests.js` files

- Optimise dev/test regex logic out of the production build using `if(DEBUG)`
2023-10-31 10:56:11 +00:00
Jarek Radosz
bbcf8e421c
DEV: Migrate associate-account-confirm to the new modal API (#24138)
(+ glimmer)
2023-10-31 11:45:14 +01:00
Martin Brennan
c80b5b718c
FIX: Add checkbox-label to more checkbox label elements (#24174)
Followup to e2d9117378, which
made these labels bold because they were missing the correct
class.
2023-10-31 08:57:50 +01:00
Jeff Wong
974c508cc8
UX: call discourseLater on menu animations (#24168)
* UX: add discourseLater call to add breathing room for animation

Allow for smoother animations on lower end devices.
Create time between render and animations.

extend panel width targets by 20 px to account for shadows as well
2023-10-30 18:43:20 -07:00
Jarek Radosz
360289e108
FIX: Account creation regression (#24169)
Regressed in 351cbab1a8
2023-10-31 02:05:35 +01:00
Jarek Radosz
08deedfd6e
FIX: autotracking.mutation-after-consumption (#24164) 2023-10-31 00:39:52 +01:00
dependabot[bot]
16861f9b3f
Build(deps): Bump terser in /app/assets/javascripts (#24167)
Bumps [terser](https://github.com/terser/terser) from 5.22.0 to 5.23.0.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.22.0...v5.23.0)

---
updated-dependencies:
- dependency-name: terser
  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>
2023-10-30 23:26:31 +01:00
Renato Atilio
bdf2a20355
UX: form template simpler "value missing" i18n (#24154) 2023-10-30 17:40:07 -03:00
Kris
fbf8528814
UX: set tag sort based on siteSetting (#24147) 2023-10-30 10:55:39 -04:00
Kris
2e06cc1248
UX: avoid footer admin menu from overflowing top (#24149) 2023-10-30 10:55:17 -04:00
David Taylor
3071535a14
DEV: extend withSilencedDeprecations to work for ember deprecations (#24153)
This will allow us to globally unsilence deprecations for plugin/theme authors while silencing specific cases in Discourse core.
2023-10-30 12:09:45 +00:00
David Taylor
b7cafdc07f
DEV: Deprecate api.decoratePluginOutlet (#24145)
This API is not used by any known themes/plugins, and is problematic for a few reasons

- It doesn't work on modern plugin connectors which have no wrapper element

- Making modifications to Ember-rendered DOM elements can lead to catastrophic and surprising errors

- It doesn't re-run when arguments to a plugin outlet change

This commit adds the deprecation notice, and refactors the tests so that they do not rely on any real core plugin outlets
2023-10-30 11:07:17 +00:00
Jarek Radosz
351cbab1a8
DEV: Migrate create-account to the new modal API (#24098)
plugin/theme-breaking changes:

1. `controller:create-account` is gone (use `component:modal/create-account` in modifyClass, **if** absolutely necessary)
2. `create-account-body` css class is gone (target `.d-modal.create-account` or any of the inner classes: `.modal-outer-container`, `.modal-middle-container`, `.modal-inner-container`, or `.modal-body`)
2023-10-30 11:01:09 +01:00
Martin Brennan
0a4b1b655d
FIX: Alter "Take Action" default behaviour to hide post (#24088)
This commit fixes an issue where clicking the default
"Take Action" option on a flag for a post doesn't always
end up with the post hidden.

This is because the "take_action" score bonus doesn’t take into account
the final score required to hide the post.

Especially with the `hide_post_sensitivity` site setting set to `low`
sensitivity, there is a likelihood the score needed to hide the post
won’t be reached.

Now, the default "Take Action" button has been changed to "Hide Post"
to reflect what is actually happening and the description has been
improved, and if "Take Action" is clicked we _always_ hide the post
regardless of score and sensitivity settings. This way the action reflects
expectations of the user.
2023-10-30 10:24:35 +10:00
Blake Erickson
1a78e8ec1b
FEATURE: Add keywords support for site_settings search (#24146)
* FEATURE: Add keywords support for site_settings search

This change allows for a new `keywords` field that can be added to site
settings in order to help with searching. Keywords are not visible in
the UI, but site settings matching one of the contained keywords will
appear when searching for that keyword.

Keywords can be added for site settings inside of the
`config/locales/server.en.yml` file under the new `keywords` key.

```
site_settings
  example_1: "fancy description"
  example_2: "another description"

  keywords:
    example_1: "capybara"
```

* Add keywords entry for a recently changed site setting and add system specs

* Use page.visit now that we have our own visit
2023-10-27 15:42:57 -06:00
Penar Musaraj
e7ed18fdfc
FIX: Only check for conditional mediation when needed (#24142)
Some browsers still don't support conditional mediation. This PR fixes issues with:

- TOR browser (it doesn't have `PublicKeyCredential` at all)
- Firefox 119 (doesn't support conditional mediation)

We also need to make sure not to call `isConditionalMediationAvailable` on browsers that don't support the method but support the feature (like Safari on iOS).
2023-10-27 11:55:55 -04:00
Blake Erickson
73589fa475
DEV: Use click once for video place holder (#24141)
Rather than removing the event listener just use `{once: true}`.

docs: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#once

meta: https://meta.discourse.org/t/283596
2023-10-27 08:55:19 -06:00
Kris
1c70a14d7c
UX: adjust various button classes (#24121) 2023-10-27 10:26:59 -04:00
Renato Atilio
5bd92dd252
FIX: only clear upload list if multiple not allowed (#24123)
* FIX: only clear upload list if multiple not allowed
2023-10-27 00:12:55 -03:00
Martin Brennan
545e92039c
FIX: Hashtags were not decorated in user activity list (#24125)
This was just a case of removing the `onlyStream: true`
operation from `decorateCookedElement`, since that restricts
the decoration only to topic page posts.
2023-10-27 12:00:19 +10:00
Penar Musaraj
7f57ba45ac
UX: Fix mobile passkeys login button (#24124)
This regressed in b6dc929. A test to ensure this doesn't regress has
been added as well.

This PR also fixes a flakey system spec. The conditional UI gets
triggered automatically, so the system spec shouldn't explicitly call
`find(".passkey-login-button").click`, because sometimes it isn't
present and that causes a test failure.
2023-10-26 20:55:41 -04:00
dependabot[bot]
7e002e52f7
Build(deps-dev): Bump sass in /app/assets/javascripts (#24120)
Bumps [sass](https://github.com/sass/dart-sass) from 1.69.4 to 1.69.5.
- [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.69.4...1.69.5)

---
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>
2023-10-26 23:53:08 +02:00
Jarek Radosz
125c19e8f7
FIX: Username validation in create-account modal (#24114)
* Move the create account test
* Clean up username-validation
* Fix the username validation bug
2023-10-26 20:38:34 +02:00
David Taylor
c124c69833
DEV: Simplify sprockets configuration (#24111)
- Remove the wildcard crawler. This was already excluding almost all file types, but the exclude list was missing '.gjs' which meant those files were unnecessarily being hoisted into the `public/` directory during precompile

- Automatically include all ember-cli-generated assets without needing them to be listed. The main motivation for this change is to allow us to start using async imports via Embroider/Webpack. The filenames for those new async bundles will not be known in advance.

- Skips sprockets fingerprinting on Embroider/Webpack chunk JS files. Their filenames already include a fingerprint, and having sprockets change the filenames will cause problems for the async import feature (where filenames are included deep inside js bundles)

This commit also updates our ember-cli build so that it skips building plugin tests in the production environment. This should provide a slight build speed improvement.
2023-10-26 17:29:53 +01:00
Jarek Radosz
00dc063d40
FIX: Restore support for custom NavItem class (#24113)
A followup to 930dc38500
2023-10-26 18:26:36 +02:00
Penar Musaraj
b8ee52c4cb
UX: Wait for render before invoking A11YDialog (#24100)
Previously, focus wasn't being applied correctly on dialogs using named
components. This was because the A11YDialog was being invoked before
the component was completely rendered.

The long-term plan is to move away from A11YDialog doing the rendering
here, but for now this should do.
2023-10-26 08:24:47 -04:00
David Taylor
d405305456
DEV: Explicitly disable Ember string prototype extensions (#24110)
These have been deprecated for some time, and the vast majority of themes/plugins have already removed their use. The prototype extensions were unexpectedly disabled as a side effect of 895036bd7a (more details in https://github.com/discourse/discourse/pull/24101).

Given that restoring the functionality now involves significant complexity, and would only be delaying the inevitable removal in a matter of months, we've decided to keep them disabled. This commit explicitly sets the flag in the ember environment config to make things clearer.
2023-10-26 11:16:57 +01:00
dependabot[bot]
8438aed727
Build(deps-dev): Bump jquery in /app/assets/javascripts (#24108)
Bumps [jquery](https://github.com/jquery/jquery) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.7.0...3.7.1)

---
updated-dependencies:
- dependency-name: jquery
  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>
2023-10-26 00:39:40 +02:00
Joffrey JAFFEUX
becad4d7d7
FIX: do not check if inside cooked early (#24105)
We already do this check inside `selectionChanged` and this was preventing us to correctly set `isSelecting` to true. This was causing issues when starting your selection from outside cooked.
2023-10-25 22:50:32 +02:00
Joffrey JAFFEUX
619d709d54
FIX: clear state if selected text is empty (#24102)
This would cause a loop and some very fast flashing of the selection in safari when scrolling the selection until the bottom of the page.
2023-10-25 22:15:30 +02:00
Penar Musaraj
e231ed2153
DEV: Improve error messaging (#24099)
Applies to passkeys, visible in a dev environment when using a non-standard
host. The error modal should only be shown when invoking the passkey
login button.
2023-10-25 13:44:08 -04:00
Joffrey JAFFEUX
334be4eac7
UX: improve quote/edit bar's rendering (#24097)
This change allows for a faster and smoother experience. It's also less noisy because the buttons will not be shown while selecting text.
2023-10-25 12:51:47 -04:00
Keegan George
115a05f37a
FIX: Don't show like error on topic creation (#24084) 2023-10-25 08:40:50 -07:00
Joffrey JAFFEUX
0e37ceeeb9
FIX: improves reliability of post-text-selection bar (#24093)
The main change made is to use `pointerdown` and `touchstart` for detecting click outside in `FloatKit`, the problem of using `click` is that it will trigger on `mouseup` which is not working well with `FloatKit` shown using `mousedown` (when we change selection with the `mousedown` for example) as the release will be interpreted as a click outside and close the menu. To solve this issue the previous code in `post-text-selection` was going through various hacks for detecting state of mouse which are not always very reliable.

The second fix is to exit earlier when selection didn't change.

This has been tested on chrome/firefox and safari (mobile) and seems to work reliably.

<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
2023-10-25 14:34:53 +02:00
Godfrey Chan
895036bd7a
DEV: remove @ember/jquery in favor of just jquery (#24034)
`@ember/jquery` was necessary to automate the `app.import()` but
that is no longer necessary with `ember-auto-import`. A secondary
thing it does is bringing back the `this.$` feature, but with a
deprecation. It is my understanding that the deprecation has long
be fully absorbed into both core and plugins so we shouldn't need
this package anymore.
2023-10-25 10:14:50 +01:00
Martin Brennan
3090b4801b
FIX: Add checkbox-label CSS class to flag modal labels (#24087)
Avoids a similar bolding issue to 88ae4c7b5c
2023-10-25 11:49:07 +10:00
Martin Brennan
9db4eaa870
DEV: Change anonymous_posting_min_trust_level to a group-based setting (#24072)
No plugins or themes rely on anonymous_posting_min_trust_level so we
can just switch straight over to anonymous_posting_allowed_groups

This also adds an AUTO_GROUPS const which can be imported in JS
tests which is analogous to the one defined in group.rb. This can be used
to set the current user's groups where JS tests call for checking these groups
against site settings.

Finally a AtLeastOneGroupValidator validator is added for group_list site
settings which ensures that at least one group is always selected, since if
you want to allow all users to use a feature in this way you can just use
the everyone group.
2023-10-25 11:45:10 +10:00
Martin Brennan
5e395d4382
FIX: Add support for OffscreenCanvas in media optimization worker (#24074)
Back in c31772879b we introduced
SiteSetting.composer_ios_media_optimisation_image_enabled and
disabled media optimization on safari iOS because of performance
issues when rendering to canvas, and OffscreenCanvas support
was not yet available.

Safari now supports OffscreenCanvas, so now we can give this
another go, and also use OffscreenCanvas everywhere it is supported.
2023-10-25 09:28:09 +10:00
Martin Brennan
88ae4c7b5c
FIX: Add checkbox-label class to site setting checkboxes (#24075)
Followup to e2d9117378, which
made these labels bold because they were missing the correct
class.
2023-10-25 09:14:27 +10:00
Kris
63a0700d45
DEV: add above-category-heading outlet (#24083) 2023-10-24 15:47:29 -04:00
Jarek Radosz
2f1acbb12d
DEV: Convert user-field to gjs (#24082) 2023-10-24 20:28:47 +02:00
Jarek Radosz
930dc38500
DEV: Convert nav-item to gjs (#24076) 2023-10-24 17:55:09 +02:00
Jarek Radosz
9a497d9e22
DEV: Move toggleAnonymous out of app route (#24077) 2023-10-24 17:54:56 +02:00
Kelv
44c84413fb
DEV: upgrade reject reason reviewable modal to glimmer component (#24073)
* DEV: add system test for rejecting user from review page
* DEV: upgrade reject-reason-reviewable modal to glimmer & DModal
2023-10-24 17:44:43 +08:00
Martin Brennan
d5e8bd790b
DEV: Re-enable minio specs by pre-installing minio binary before test run (#24050)
This fixes a similar issue to 8b3eca0 where an Errno::ETXTBSY error was raised because the minio_runner gem was trying to install the binary across multiple processes in rspec. If we just make sure the latest version is installed before the tests run, this shouldn't happen, since MinioRunner.start will not do any further attempts at installation if the latest version is installed.
2023-10-24 12:43:14 +10:00
dependabot[bot]
9e4a72945c
Build(deps-dev): Bump the types group (#24068)
Bumps the types group in /app/assets/javascripts with 1 update: [@types/jquery](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jquery).

- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jquery)

---
updated-dependencies:
- dependency-name: "@types/jquery"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 23:29:40 +02:00
David Taylor
35290660bf
DEV: Cleanup autoimport-related config from ember-cli-build (#24006)
Running addonPostprocessTree manually was causing ember-auto-import's postprocess hook to run and generate extra unnecessary chunks. The only reason called addonPostprocessTree directly was to allow the terser plugin to run on the extra public trees. We can do the terser postprocessing manually instead.

This commit is approximately the inverse of e1d27400f5.

This commit also removes ember-auto-import as dependencies of admin/wizard/discourse-plugins because they are not 'real' ember addons, and so it isn't serving any useful purpose. (see also https://github.com/discourse/discourse/pull/23974)
2023-10-23 22:26:39 +01:00
Jarek Radosz
b3caa90f6e
DEV: Check for mobile upload button presence (#24059)
If rendering would break before `_bindMobileUploadButton` - this would fail too, obscuring the original issue.
2023-10-23 23:14:17 +02:00
Joffrey JAFFEUX
043b4a4187
FIX: replaces data-tooltip usage by <DTooltip /> (#24062)
As much as possible I would like us to avoid having to go the with a global event listener on click/mouseover. For now I have removed all cases of `data-tooltip`, if we clearly identify a use case of a global event listener we might reconsider this.

The following changes are also included:
- by default tooltips won't attempt to focus first focusable element anymore
- tooltip will now use `cursor: pointer` by default
- a new service has been introduced: `InternalTooltip` which is responsible to track the current instance displayed by a `<DTooltip />`. Portal elements when replaced are not properly cleaned and I couldn't figure out a way to have a proper hook to ensure the previous `DTooltipInstance` is properly set as not expanded; this problem was very visible when using a tooltip as interactive and hovering another tooltip, which would replace the interactive tooltip as not closed.
2023-10-23 21:09:02 +02:00
Penar Musaraj
b6dc929141
UX: Add conditional UI for passkeys (#24041)
This allows users to see their passkeys recommended by the browser as they type their username.

There's a small refactor here, to make sure the same action is used by both the conditional UI and the passkey login button. The webauthn API only supports one auth attempt at a time, so in this PR we need to add a service singleton to manage the navigator.credentials.get promise so that it can be cancelled and reused as the user picks the conditional UI (i.e. the username login input) or the dedicated passkey login button.
2023-10-23 11:21:05 -04:00
Blake Erickson
8d640acf86
DEV: Show a loading spinner on video placeholders (#24039)
This commit adds a loading spinner that appears immediately after
clicking the play button on a video placeholder and will go away once
the "onCanPlay" event fires for the video.

This prevents a completely empty (no play button) placeholder from
appearing for some amount of time while the video is loading enough to
start playing.
2023-10-23 09:01:20 -06:00
Penar Musaraj
f9eec939e5
UX: Fixes for mobile "create account" modal (#24043)
- Don't include login buttons on mobile
- Fix padding/spacing
2023-10-23 10:48:46 -04:00
Penar Musaraj
0934cc6ece
DEV: Fix Ember inspector error on anonymous user (#24042) 2023-10-23 09:24:05 -04:00
Joffrey JAFFEUX
552cf56afe
DEV: toasts improvements (#24046)
- more subtle animation when showing a toast
- resumes auto close when removing the mouse from the toast
- correctly follows reduced motion
- uses output with role status as element: https://web.dev/articles/building/a-toast-component
- shows toasts inside a section element
- prevents toast to all have the same width
- fixes a bug on mobile where we would limit the width and the close button wouldn't show correctly aligned

I would prefer to have tests for this, but the conjunction of css/animations and our helper changing `discourseLater` to 0 in tests is making it quite challenging for a rather low value. We have system specs using  toasts ensuring they show when they should.
2023-10-23 15:23:10 +02:00
dependabot[bot]
2dc9c1b478
Build(deps-dev): Bump sinon in /app/assets/javascripts (#24052)
Bumps [sinon](https://github.com/sinonjs/sinon) from 16.1.3 to 17.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v16.1.3...v17.0.0)

---
updated-dependencies:
- dependency-name: sinon
  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>
2023-10-23 12:31:18 +02:00
Jarek Radosz
c84fe69e10
DEV: Use @discourse/lint-configs (#24038) 2023-10-23 12:08:35 +02:00
Kelv
6121869900
FIX: display and link to correct grant_by users for granted badges (#24021)
* FIX: display and link to correct grant_by users for granted badges in admin

* DEV: add system test for admin user badge granted by behaviour
2023-10-23 14:46:10 +08:00
Alan Guo Xiang Tan
8c07bbe084
FIX: Disable filter when loading tags in edit nav menu tags modal (#23789)
Why this change?

When we're in the midst of loading more tags, the filter dropdown
is still enabled and may result in us firing off multiple requests to
the server to load more tags. This makes the loading hard to reason
about in the tests environment and has led to flaky tests.

What does this change do?

This changes disables the filter dropdown when more tags are being
loading.
2023-10-23 08:35:40 +08:00
Sérgio Saquetim
53c23cf929
FIX: Use the category logo matching the theme (#24033)
This commit fixes a bug in which the dark category logo would be used in a light theme if the system preference was set to dark and the user forced the use of a light theme in Discourse
2023-10-20 17:57:36 +00:00
David Taylor
b38715e605
DEV: Actually fix decorateWidget error checking logic (#24037)
We need to separate the `:before` / `:after` suffix before looking up in the registry 🤦‍♂️🤦‍♂️
2023-10-20 17:54:15 +01:00
David Taylor
6c6740bb19
DEV: Correct decorateWidget error checking logic (#24036)
`name` referred to `window.name`, so the mistake wasn't detected by eslint 🤦‍♂️
2023-10-20 15:56:54 +01:00
David Taylor
373b2ca362
DEV: Correct addPostAdminMenuButton docs (#24035)
The `name` argument doesn't do anything, and 'title' should actually be 'label'
2023-10-20 14:12:27 +01:00
Sérgio Saquetim
0cfc42e0e6
FEATURE: Add dark mode option for category backgrounds (#24003)
Adds a new upload field for a dark mode category background that will be used as an alternative when Discourse is using a dark mode theme.
2023-10-20 12:48:06 +00:00
dependabot[bot]
467e1a1bdd
Build(deps-dev): Bump sinon from 16.1.0 to 16.1.3 in /app/assets/javascripts (#24031)
Bumps [sinon](https://github.com/sinonjs/sinon) from 16.1.0 to 16.1.3.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v16.1.0...v16.1.3)

---
updated-dependencies:
- dependency-name: sinon
  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>
2023-10-20 09:06:58 +08:00
Ty Correll
700c636d29
UX: unify ai representing icon (#24029)
This PR addresses the push to unify the icon representing AI throughout Discourse, by using the discourse-sparkles icon.

The icon is being moved to core to make changes with dependencies included in core that were using the "magic" icon instead.

In 2 places "magic" -> "discourse-sparkles,
1. topic summaries
2. (unreleased) chat summaries example
2023-10-19 17:30:27 -05:00
David Taylor
10cd0e5531
DEV: Print error when decorateWidget target does not exist (#24026) 2023-10-19 23:26:30 +01:00
David Taylor
a10a82131a
DEV: Remove post-admin-menu placeholder (#24025)
This widget is no longer used. It's better to remove it completely, so that `decorateWidget` and `reopenWidget` calls print a warning to the console rather than failing silently.
2023-10-19 23:26:13 +01:00
Roman Rizzi
a72e5fa763
FIX: Don't lose SummaryBox state through widget re-renders. (#24020)
* FIX: Don't lose SummaryBox state through widget re-renders.

The <SummaryBox /> component state will get lost when scrolling to the bottom of a topic. Due to the widget being re-rendered, it will go back to the collapsed state, and we need to fetch the summary again.

This change moves all the state updates to the postStream model, which also refreshes the widget to keep it updated.

* Reify topic summary using a pojo
2023-10-19 17:35:23 -03:00
Jarek Radosz
e31859a33a
FIX: Correctly set categoryId on Composer model (#23934) 2023-10-19 10:19:40 -07:00
Bianca Nenciu
a6b570681b
DEV: Fix category-selector's searching (#24023) 2023-10-19 20:00:02 +03:00
Kris
7b6e32c238
UX: move global option to sidebar modal footer, shorten translation (#24024) 2023-10-19 12:20:03 -04:00
Mark VanLandingham
cfbe16f9cc
DEV: Add option to float-kit toast to force auto-close (#24022) 2023-10-19 10:14:49 -05:00
Penar Musaraj
00aa81a271
UX: Fix form template mobile issues (#24019)
- allows scrolling on mobile when form template is present
- hides upload, preview buttons on mobile
2023-10-19 11:09:34 -04:00
David Taylor
7ed6195f19
PERF: Stop eagerly-loading core helper modules (#24015)
Now that core has a file structure and default imports, Ember's resolver can load helpers lazily. So we can remove the lazy loading, and helpers in ember templates will continue to work. This should provide a slight performance improvement for initial boot.

However, there is a slight complication: some of our helpers are also registered with our Raw Handlebars system as a side-effect of loading the module. Therefore, this commit adds a `helperMissing` helper to our RawHandlebars system. This looks up the helper by name in the ember resolver, which triggers the relevant module to be evaluated, and the raw helper to be registered as a side effect.

For backwards-compatibility, plugin and theme helpers continue to be eagerly evaluated. Once the `discourse.register-unbound` deprecation is resolved, we can safely remove this eager loading.
2023-10-19 15:52:51 +01:00
David Taylor
b1c6e67e2c
DEV: Update user-passkeys formatDate helper lookup (#24018)
This helper is now exported properly, so we can remove the `resolveRegistration()` workaround
2023-10-19 14:52:12 +01:00
Joffrey JAFFEUX
bc9558550d
DEV: replace registerUnbound usage with default exports (#23802)
`registerUnbound` was present for legacy reasons when using helpers in raw-hbs and has been replaced by `registerRawHelper`.

For new helpers used only in classic ember template, exporting a default function from `helpers/*.js` is recommended.

This change also means that all existing helpers will be available to import in `gjs` files.

Co-authored-by: David Taylor <david@taylorhq.com>
2023-10-19 14:28:25 +01:00
Jarek Radosz
24dc36cf91
DEV: Fix ember/require-super-in-lifecycle-hooks (#24007)
and `ember/no-ember-super-in-es-classes`
2023-10-19 13:47:45 +02:00
Jarek Radosz
ac30673b98
DEV: Fix ember/no-settled-after-test-helper (#24008) 2023-10-19 13:47:28 +02:00
Jarek Radosz
b45720b158
DEV: Fix ember/no-incorrect-calls-with-inline-anonymous-functions (#24010) 2023-10-19 13:47:01 +02:00
Jarek Radosz
754d13f5fa
DEV: Fix ember/require-valid-css-selector-in-test-helpers (#24011) 2023-10-19 13:46:48 +02:00
Jarek Radosz
23af6c23d0
DEV: Fix ember/prefer-ember-test-helpers (#24013) 2023-10-19 13:46:28 +02:00
David Taylor
8c01947c45
DEV: Remove USE_EMBROIDER flag (#23971)
Embroider has been the default since b72ed3cb38. This commit removes the ability to set `USE_EMBROIDER=0` and go back to the classic build.
2023-10-19 10:38:25 +01:00
Martin Brennan
9ef3a18ce4
DEV: Add new experimental admin UI route and sidebar (#23952)
This commit adds a new admin UI under the route `/admin-revamp`, which is
only accessible if the user is in a group defined by the new `enable_experimental_admin_ui_groups` site setting. It
also adds a special `admin` sidebar panel that is shown instead of the `main`
forum one when the admin is in this area.

![image](https://github.com/discourse/discourse/assets/920448/fa0f25e1-e178-4d94-aa5f-472fd3efd787)

We also add an "Admin Revamp" sidebar link to the community section, which
will only appear if the user is in the setting group:

![image](https://github.com/discourse/discourse/assets/920448/ec05ca8b-5a54-442b-ba89-6af35695c104)

Within this there are subroutes defined like `/admin-revamp/config/:area`,
these areas could contain any UI imaginable, this is just laying down an
initial idea of the structure and how the sidebar will work. Sidebar links are
currently hardcoded.

Some other changes:

* Changed the `main` and `chat` panels sidebar panel keys to use exported const values for reuse
* Allowed custom sidebar sections to hide their headers with the `hideSectionHeader` option
* Add a `groupSettingArray` setting on `this.siteSettings` in JS, which accepts a group site setting name
  and splits it by `|` then converts the items in the array to integers, similar to the `_map` magic for ruby
  group site settings
* Adds a `hidden` option for sidebar panels which prevents them from showing in separated mode and prevents
  the switch button from being shown

---------

Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
2023-10-19 14:23:41 +10:00
dependabot[bot]
67594f8d74
Build(deps-dev): Bump the types group (#23994)
Bumps the types group in /app/assets/javascripts with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@types/ember](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember) | `4.0.7` | `4.0.8` |
| [@types/ember__application](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__application) | `4.0.8` | `4.0.9` |
| [@types/ember__array](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__array) | `4.0.6` | `4.0.7` |
| [@types/ember__component](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__component) | `4.0.18` | `4.0.19` |
| [@types/ember__engine](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__engine) | `4.0.7` | `4.0.8` |
| [@types/ember__object](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__object) | `4.0.8` | `4.0.9` |
| [@types/ember__routing](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__routing) | `4.0.16` | `4.0.17` |
| [@types/ember__runloop](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__runloop) | `4.0.6` | `4.0.7` |
| [@types/ember__test](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__test) | `4.0.3` | `4.0.4` |
| [@types/jquery](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jquery) | `3.5.23` | `3.5.24` |
| [@types/qunit](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/qunit) | `2.19.6` | `2.19.7` |
| [@types/rsvp](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/rsvp) | `4.0.5` | `4.0.6` |


Updates `@types/ember` from 4.0.7 to 4.0.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember)

Updates `@types/ember__application` from 4.0.8 to 4.0.9
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__application)

Updates `@types/ember__array` from 4.0.6 to 4.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__array)

Updates `@types/ember__component` from 4.0.18 to 4.0.19
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__component)

Updates `@types/ember__engine` from 4.0.7 to 4.0.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__engine)

Updates `@types/ember__object` from 4.0.8 to 4.0.9
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__object)

Updates `@types/ember__routing` from 4.0.16 to 4.0.17
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Changelog](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ember__routing/history-location.d.ts)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__routing)

Updates `@types/ember__runloop` from 4.0.6 to 4.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__runloop)

Updates `@types/ember__test` from 4.0.3 to 4.0.4
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__test)

Updates `@types/jquery` from 3.5.23 to 3.5.24
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jquery)

Updates `@types/qunit` from 2.19.6 to 2.19.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/qunit)

Updates `@types/rsvp` from 4.0.5 to 4.0.6
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/rsvp)

---
updated-dependencies:
- dependency-name: "@types/ember"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__application"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__array"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__component"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__engine"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__object"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__routing"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__runloop"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__test"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/jquery"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/qunit"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/rsvp"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-19 00:22:30 +02:00
Ella E
7af291b40d
UX: Wizard static confetti (#23973)
* UX: add static confetti bacgkround image on wizard steps

* DEV: slow down speed animation for confetti

* DEV: compress image file size

* UX: use an image that has transparent background

* DEV: use correct image file name
2023-10-18 15:19:00 -06:00
Penar Musaraj
a125c9e63e
UX: Minor fixes to passkey handling (#23947)
- don't try to guess the name of the manager (too many options)
- improve error message when registration is not allowed
- output error in console when registration fails
- minor fix to rename dialog layout
- hides action buttons in DiscourseHub (because adding passkeys there is not possible)
- adds acceptance test to ensure action buttons are hidden for admins seeing another user's profile
2023-10-18 11:46:51 -04:00
Mark VanLandingham
585bb0df27
DEV: Add class name of action type for flag-action-type container (#23972) 2023-10-18 10:18:52 -05:00
David Taylor
3690fe59cc
DEV: Deprecate api.registerConnectorClass (#23721)
This API came from a time when themes had to define JS and templates inside `<script>` tags. Nowadays, it's rarely used, and much better patterns are available for registering connectors.
2023-10-18 13:01:46 +01:00
dependabot[bot]
c3bde99cd0
Build(deps): Bump ember-template-imports from 3.4.2 to 4.0.0 in /app/assets/javascripts (#23970)
* Build(deps): Bump ember-template-imports in /app/assets/javascripts

Bumps [ember-template-imports](https://github.com/ember-template-imports/ember-template-imports) from 3.4.2 to 4.0.0.
- [Release notes](https://github.com/ember-template-imports/ember-template-imports/releases)
- [Changelog](https://github.com/ember-template-imports/ember-template-imports/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ember-template-imports/ember-template-imports/compare/v3.4.2...v4.0.0)

---
updated-dependencies:
- dependency-name: ember-template-imports
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Remove legacy decorators from gjs file

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Taylor <david@taylorhq.com>
2023-10-18 12:42:26 +01:00
David Taylor
25ddbd1aa6
DEV: Convert remaining core services to native class syntax (#23756) 2023-10-18 12:28:56 +01:00
David Taylor
93c67eeb4f
DEV: Consolidate and update jsconfig, and add types packages (#23824)
These updates significantly improve IDE tooling for imports across the Discourse core codebase, and also for framework packages. The `@types/ember-*` packages are a temporary solution until we get onto Ember 5, which ships its types in the main package.

The previous approach of having jsconfig files in each package directory did work, but once you start adding all the possible interlinks between them, we hit the file count limit of VSCode's tooling (because it counts every file for every jsconfig its referenced in). Having one file at the root means that a single file can apply to all core packages and plugins.

Long-term, to get the same functionality for all themes/plugins, we may need to look at building/publishing a Discourse types package which can be added to theme/plugin package.json files for development purposes.
2023-10-18 12:13:20 +01:00
Godfrey Chan
c34f8b65cb
DEV: Rename I18n imports to discourse-i18n (#23915)
As of #23867 this is now a real package, so updating the imports to
use the real package name, rather than relying on the alias. The
name change in the package name is because `I18n` is not a valid
name as NPM packages must be all lowercase.

This commit also introduces an eslint rule to prevent importing from
the old I18n path.

For themes/plugins, the old 'i18n' name remains functional.
2023-10-18 11:07:09 +01:00
dependabot[bot]
0a6dfee0b9
Build(deps): Bump ember-this-fallback from 0.3.1 to 0.4.0 in /app/assets/javascripts (#23959)
* Build(deps): Bump ember-this-fallback in /app/assets/javascripts

Bumps [ember-this-fallback](https://github.com/tildeio/ember-this-fallback) from 0.3.1 to 0.4.0.
- [Release notes](https://github.com/tildeio/ember-this-fallback/releases)
- [Changelog](https://github.com/tildeio/ember-this-fallback/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tildeio/ember-this-fallback/commits)

---
updated-dependencies:
- dependency-name: ember-this-fallback
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Remove stale patch

* Update patch filenames

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Taylor <david@taylorhq.com>
2023-10-18 10:56:35 +01:00
Alan Guo Xiang Tan
3c26df78ea
UX: Fix deselect text location in edit sidebar category/tag modal (#23966)
Why this change?

In 38d3208027, the position of the
`headerBelowTitle` outlet was changed causing the deselect text in the
edit sidebar catgegory/tag modals to appear inline with the title which
we do not want.

What does this change do?

This change introduces the `belowModalTitle` outlet in `DModal` which is
where the `headerBelowTitle` outlet was located before it was changed.
2023-10-18 11:33:35 +08:00
Martin Brennan
e91d8feab3
Revert "FEATURE: Count only approved flagged posts in user pages (#22799)" (#23962)
This reverts commit 5f0bc4557f.

Through extensive internal discussion we have decided to revert
this change, as it significantly impacted moderation flow for
some Discourse site moderators, especially around "something else"
flags. We need to re-approach how flags are counted holistically,
so to that end this change is being reverted.
2023-10-18 11:38:17 +10:00
dependabot[bot]
30778e5fa4
Build(deps-dev): Bump sass in /app/assets/javascripts (#23960)
Bumps [sass](https://github.com/sass/dart-sass) from 1.69.3 to 1.69.4.
- [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.69.3...1.69.4)

---
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>
2023-10-18 02:48:43 +02:00
Krzysztof Kotlarek
4773f5d720
FEATURE: predefined simple list for admin setting (#23953)
Some admin settings are multiple list with predefined values. In that case, we should not allow to input any value which later will fail validation.
2023-10-18 00:25:32 +00:00
Bianca Nenciu
2e68ead45b
FEATURE: Use async search for category dropdowns (#23774)
This commit introduces a new endpoint to search categories and uses it
instead of the categories map that is preloaded using SiteSerializer.

This feature is enabled only when the hidden site setting
lazy_load_categories is enabled and should be used only on sites with
many categories.
2023-10-17 19:46:54 +03:00
Bianca Nenciu
c95ffb98ef
DEV: Serialize categories in topic lists (#23597)
At this moment, this feature is under a site setting named
lazy_load_categories.

In the future, categories will no longer be preloaded through site data.
This commit add information about categories in topic list and ensures
that data is used to display topic list items.

Parent categories are serialized too because they are necessary to
render {{category-link}}.
2023-10-17 19:06:01 +03:00
Godfrey Chan
6036001667
DEV: stop relying on global jQuery, import "jquery" instead (#23924)
We'll probably have to keep the globals around for compatibility, but we should always import it ourselves. We'll followup with an updated eslint config to enforce this.
2023-10-17 13:56:59 +01:00
dependabot[bot]
ee9aa02ab3
Build(deps): Bump terser in /app/assets/javascripts (#23948)
Bumps [terser](https://github.com/terser/terser) from 5.21.0 to 5.22.0.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.21.0...v5.22.0)

---
updated-dependencies:
- dependency-name: terser
  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>
2023-10-16 23:45:02 +02:00
Jeff Wong
d208396c5c
UX: improve touch, swipe, panning performance on mobile menus (#23775)
PERF: improve touch, swipe, panning performance on mobile menus
---

* stop event propagation on swipe events: other touch events were stealing a huge amount of time here. Stop event
propagation when handling pan events.
* animate with [web animations api](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Using_the_Web_Animations_API)
* prefer translate3d to hint for gpu rendering.
* query document for elements only on start move event, not on subsequent move
events
* remove unused calculations for directioned velocity and distance: all swipe/pan elements function in x/y direction only.
* re-implement scroll locking behavior.

re-implemented scroll lock behavior
---

With stop event propagation, we need to re-implement scroll locking on menu swipes.
Previously, this was using onTouchMove which was costly.

We may now use styling with overflow-y:hidden to lock scroll behavior.

overflow:hidden on html/body elements is now supported by iOS as of 2022
https://bugs.webkit.org/show_bug.cgi?id=153852
https://bugs.webkit.org/show_bug.cgi?id=220908

UX: improve swipe
---

Some improvements to get gestures and swipes feeling a little more polished.

This focuses on end gesture, and how we transfer it to a css animation to
complete a menu open/close action.

Multitouch: events may pan, scroll, and zoom - especially on iOS safari.
Cancelling the swipe event allows for a more pleasant zooming experience.

* ease-out on menus opening, linear on close
* calculate animation duration for opening and closing,
attempt to better transfer user swipe velocity to css animation.
* more timely close/open and cleanup from calculated animation timing.
* add animation to closing menus on cloak tap
* correctly animate menus with ease-in and ease-out
* add swipe cancel event on multitouch event

DEV
---

* lean on promises

js animations api gives us promises to listen to. Update test waiters
to use waitForPromise from @ember/test-waiters instead of reigster/unregister.

* convert swipe mixin to its own class.

Convert swipe callbacks to custom events on the element.
Move shared functions for max animation time and close logic to
new shared class.

swipe-events lib uses custom events to trigger callbacks, rather than assuming
implemented hard coded function from the mixin's base class. Custom events are
triggered from the bound element as swipestart, swipeend, swipe

Add shared convenience functions for swipe events so they can be more easily
shared.

A client receives an initial swipe event and can check some state to see if it
wants to handle the swipe event and if it doesn't, calling
`event.preventDefault();` will prevent `swipe` and `swipeend` events from firing
until another distinct swipestart event is fired. Swipe events will auto-cancel on multitouch.

The scroll lock has also exposed as its own utility class.
2023-10-16 11:27:00 -07:00
Penar Musaraj
13afad70a5
DEV: Lint admin-email-preview-test.js 2023-10-16 10:46:02 -04:00
David Taylor
0ed20fe1cd
SECURITY: Correctly escape 'text' email preview 2023-10-16 10:34:34 -04:00
David Taylor
1884b57af3
FIX: Open invite modal correctly from topic share UI (#23940)
This regressed when the create-invite modal was converted to the new component-based API in 8a7b5b00ea
2023-10-16 12:26:18 +01:00
dependabot[bot]
a21a6dbd4d
Build(deps-dev): Bump webpack in /app/assets/javascripts (#23939)
Bumps [webpack](https://github.com/webpack/webpack) from 5.88.2 to 5.89.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.88.2...v5.89.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>
2023-10-16 11:23:00 +02:00
Renato Atilio
6c818b449a
FIX: add missing type to form template upload (#23935) 2023-10-15 11:17:11 -03:00
Penar Musaraj
1a70817962
DEV: Add UI for passkeys (3/3) (#23853)
Adds UI elements for registering a passkey and logging in with it. The feature is still in an early stage, interested parties that want to try it can use the `experimental_passkeys` site setting (via Rails console). 

See PR for more details. 
---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2023-10-13 12:24:06 -04:00
Jarek Radosz
a5858e60e1
FIX: Transitioning to tag-intersection route (#23931)
…didn't correctly update location query params.

A followup to 1df3ccc903 (things broke after merging `main` to PR's branch)
2023-10-13 16:23:04 +01:00
David Taylor
b3df0a362b
DEV: Ensure current-post-changed is fired when switching between topics (#23930)
Previously this logic was only checking the post number. That meant that navigating between the first post of two topics would not trigger the event.

In the past, the event would be triggered anyway because the ScrollingPostStream would be destroyed/re-created when navigating between topics. But now that we use the 'loading slider' technique, the same component instance is re-used.

The motivation for this commit is to fix the 'DiscoToc' theme component, which relies on the event firing when navigating between topics.
2023-10-13 15:45:32 +01:00
Blake Erickson
b607d81d50
DEV: Change video placeholder click target (#23925)
Have the click target be the entire placeholder instead of just the play
button.
2023-10-13 13:26:10 +10:00
Martin Brennan
9762e65758
FEATURE: Add Revise... option for queued post reviewable (#23454)
This commit adds a new Revise... action that can be taken
for queued post reviewables. This will open a modal where
the user can select a Reason from a preconfigured list
(or by choosing Other..., a custom reason) and provide feedback
to the user about their post.

The post will be rejected still, but a PM will also be sent to
the user so they have an opportunity to improve their post when
they resubmit it.
2023-10-13 11:28:31 +10:00
dependabot[bot]
5fe4e0ed48
Build(deps-dev): Bump sass in /app/assets/javascripts (#23921)
Bumps [sass](https://github.com/sass/dart-sass) from 1.69.2 to 1.69.3.
- [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.69.2...1.69.3)

---
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>
2023-10-13 03:22:53 +02:00
dependabot[bot]
2fa9620f77
Build(deps-dev): Bump qunit-dom in /app/assets/javascripts (#23920)
Bumps [qunit-dom](https://github.com/mainmatter/qunit-dom) from 2.0.0 to 3.0.0.
- [Release notes](https://github.com/mainmatter/qunit-dom/releases)
- [Commits](https://github.com/mainmatter/qunit-dom/compare/v2.0.0...v3.0.0)

---
updated-dependencies:
- dependency-name: qunit-dom
  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>
2023-10-13 03:00:58 +02:00
Jarek Radosz
1df3ccc903
FIX: Pass category param on /tags/intersection (#23352) 2023-10-13 02:42:41 +02:00
dependabot[bot]
1fac13b405
Build(deps-dev): Bump the babel group (#23919)
Bumps the babel group in /app/assets/javascripts with 1 update: [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core).

- [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/@babel/core@7.23.2/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  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>
2023-10-13 00:08:07 +02:00
Blake Erickson
2443446e62
DEV: Prevent videos from preloading metadata (#23807)
Preloading just metadata is not always respected by browsers, and
sometimes the whole video will be downloaded. This switches to using a
placeholder image for the video and only loads the video when the play
button is clicked.
2023-10-12 13:47:48 -06:00
Mark VanLandingham
55e4fd63be
DEV: add class to bookmark-list TD (#23914) 2023-10-12 11:27:00 -05:00
Jarek Radosz
90743f162a
DEV: Add a plugin outlet for conditional-loading-spinner (#23911) 2023-10-12 17:53:53 +02:00
Kris
76cbfcd60c
A11Y: move new account disclaimer above buttons (#23884) 2023-10-12 11:30:03 -04:00
Godfrey Chan
2e00482ac4
DEV: convert I18n pseudo package into real package (discourse-i18n) (#23867)
Currently, `window.I18n` is defined in an old school hand written
script, inlined into locale/*.js by the Rails asset pipeline, and
then the global variable is shimmed into a pseudo AMD module later
in `module-shims.js`.

This approach has some problems – for one thing, when we add a new
V2 addon (e.g. in #23859), Embroider/Webpack is stricter about its
dependencies and won't let you `import from "I18n";` when `"I18n"`
isn't listed as one of its `dependencies` or `peerDependencies`.

This moves `I18n` into a real package – `discourse-i18n`. (I was
originally planning to keep the `I18n` name since it's a private
package anyway, but NPM packages are supposed to have lower case
names and that may cause problems with other tools.)

This package defines and exports a regular class, but also defines
the default global instance for backwards compatibility. We should
use the exported class in tests to make one-off instances without
mutating the global instance and having to clean it up after the
test run. However, I did not attempt that refactor in this PR.

Since `discourse-i18n` is now included by the app, the locale
scripts needs to be loaded after the app chunks. Since no "real"
work happens until later on when we kick things off in the boot
script, the order in which the script tags appear shouldn't be a
problem. Alternatively, we can rework the locale bundles to be more
lazy like everything else, and require/import them into the app.

I avoided renaming the imports in this commit since that would be
quite noisy and drowns out the actual changes here. Instead, I used
a Webpack alias to redirect the current `"I18n"` import to the new
package for the time being. In a separate commit later on, I'll
rename all the imports in oneshot and remove the alias. As always,
plugins and the legacy bundles (admin/wizard) still relies on the
runtime AMD shims regardless.

For the most part, I avoided refactoring the actual I18n code too
much other than making it a class, and some light stuff like `var`
into `let`.

However, now that it is in a reasonable format to work with (no
longer inside the global script context!) it may also be a good
opportunity to refactor and make clear what is intended to be
public API vs internal implementation details.

Speaking of, I took the librety to make `PLACEHOLDER`, `SEPARATOR`
and `I18nMissingInterpolationArgument` actual constants since it
seemed pretty clear to me those were just previously stashed on to
the `I18n` global to avoid polluting the global namespace, rather
than something we expect the consumers to set/replace.
2023-10-12 14:44:01 +01:00
David Taylor
525cfcbe0e
FIX: Ensure nested ember components can be used with mustache syntax (#23912)
We run the ember-this-fallback transformation on plugin and theme code so that they can continue omitting `this.` in `.hbs` templates. A bug in the implementation meant that it was incorrectly transforming things like `{{dir/some-component}}` into `<DirSomeComponent />` (rather than `<Dir::SomeComponent />`).

This commit uses patch-package to apply the fix from https://github.com/tildeio/ember-this-fallback/pull/56
2023-10-12 11:08:57 +01:00
David Taylor
6e004b04e1
FIX: Support PluginOutlet invocations with deprecated tagName (#23913)
This regressed in af305366
2023-10-12 11:03:44 +01:00
dependabot[bot]
88951e03bf
Build(deps): Bump the babel group (#23907)
Bumps the babel group in /app/assets/javascripts with 1 update: [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).

- [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.23.2/packages/babel-standalone)

---
updated-dependencies:
- 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>
2023-10-12 12:02:35 +02:00
dependabot[bot]
bf74d06a86
Build(deps-dev): Bump @ember/legacy-built-in-components (#23908)
Bumps [@ember/legacy-built-in-components](https://github.com/emberjs/ember-legacy-built-in-components) from 0.5.0-alpha.0 to 0.5.0.
- [Release notes](https://github.com/emberjs/ember-legacy-built-in-components/releases)
- [Commits](https://github.com/emberjs/ember-legacy-built-in-components/commits)

---
updated-dependencies:
- dependency-name: "@ember/legacy-built-in-components"
  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>
2023-10-12 12:02:08 +02:00
David Taylor
e2e30788b9
DEV: Add note about wrapper element to renderInOutlet API (#23903) 2023-10-11 23:11:08 +01:00
Godfrey Chan
2ae913f45e
Consistently import escape from discourse-common (#23790)
`escape` from `pretty-text/sanitizer` is a re-export of the same
function defined in `discourse-common`. Updating the import paths
across the codebase to use the `discourse-common` import path.

`escape` is a rather simple function that can be accomplished with
a regular expression in `discourse-common`.

On the other hand, the remaining parts in `pretty-text/sanitizer`
has a lot of code, PLUS it depend on the rather heavy "xss" NPM
library.

Currently, most of the consumers of `pretty-text/sanitizer` are of
the `{ escape }` varient. This is resolved by this PR.

The remaining usages are either:

1. via/through `PrettyText` which is essentially gated behind
   loading the markdown-it bundle, OR

2. via `sanitize` from `discourse/lib/text`

I believe we may ultimately be able to move all the usages to behind
the markdown-it bundle (or, equivilantly, set up another lazy bundle
for `sanitize`) and be able to shed the sanitization code and the
"xss" library from the initial page load.

`discourse/lib/text` also defines a `sanitizeAsync` which is gated
behind loading the markdown-it bundle.

Looking through the usages of `sanitize`, I believe most of these
can be safely switched to use `sanitizeAsync`, in that they are
already in an asynchrnous path that handles a server response. Most
of them are actually rendering a piece of server-generated HTML
message as flash message, so I am not sure there really is value in
sanitizing (we should be able to trust our own server?), but in any
case, code-wise, they should already be able to absorb the async
just fine.

I am not sure if `sanitize` and `sanitizeAsync` are actually API
compatible – they both take `options` but I think those `options` do
pretty different things. This is somethign for another person to
investigate down the road in another PR.

According to `all-the-plugins`, `discourse-graphviz` also import
from this location, so perhaps we should PR to update. That being
said, it doesn't really hurt anything to keep the alias around for
a while.
2023-10-11 22:21:01 +01:00
Godfrey Chan
210d13e3cb
DEV: fix setting isTesting (#23901)
This started out as a seemingly benign refactor to replace the
`require` for `withPluginApi` to an actual import. However, it
broke the test in seemingly random places.

It turns out that in serveral places, we are calling `isTesting()`
in module scope and assigning the result to a constant. For example
we do that in the composer service to disable checking drafts when
testing.

This is problematic because `isTesting` doesn't really set until
the `discourse-bootstrap` initializer is run, and so any modules
that are evaluated before then will have locked in the wrong value
for `isTesting()`.

If we are going to use and treat `isTesting()` like a constant then
we will have to make sure we set it sufficiently early before any
code-loading happens.
2023-10-11 22:20:02 +01:00
David Taylor
597ef11195
DEV: Improve reactivity of user-tips and remove runloop workarounds (#23897)
Previously, the `user-tips` service included a couple of calls to `next()`. These were introduced to work around errors like

```
You attempted to update `availableTips` on `<UserTips:ember659>`, but it had already been used previously in the same computation
```

These errors come from the fact that various `<UserTip>` components are rendering at slightly different times in the runloop and stepping on each other. Normally this doesn't happen in Ember, but the implementation details of our 'Widget' system and its 'RenderGlimmer' helper mean that RenderGlimmer components are rendered later than normal Ember components. Using `next()` avoids the problem because it means that all the updates are scheduled together in the following runloop interation.

However, the use of `next()` can create some subtle timing issues, which have been evident in the recent flakiness of some qunit tests. This commit makes a few changes to improve the situation:

1. Use a TrackedMap to provide fine-grained `shouldRender()` reactivity for each user-tip id. That means that different user tips will not be trying to update the same piece of tracked state (previously the entire `availableTips` array was `@tracked`, and was completely re-assigned every time a new `<UserTip>` was rendered

2. Avoid reassigning any tracked state unless the value has actually changed

3. Remove the `next()` workarounds
2023-10-11 14:03:31 +01:00
David Taylor
6970c7dc13
DEV: Resolve and prevent user fixture changes leaking between tests (#23898)
- Introduces a `deepFreeze` helper to block any mutations to the current-user fixture

- Add `cloneJSON` to any places which were previously causing mutations
2023-10-11 13:46:06 +01:00
Osama Sayegh
683032fcce
DEV: Add specific class to metadata section in topic-list-item (#23893)
Currently, the UI section that contains the title+category+tags of a topic list item (the mobile version) has only one and very generic CSS class, `.right`. Plugins and themes that need to target this section for styling would have to use awkward/very specific CSS selectors in order to avoid incorrectly styling other elements that happen to have the same generic CSS class.

This commit adds an additional class `.topic-item-metadata` to the section to allow easier and more maintainable styling for it.

See https://github.com/discourse/discourse-clickable-topic/pull/4 for a theme that will benefit from this change.
2023-10-11 12:19:15 +03:00
Krzysztof Kotlarek
b061631c18
FIX: correctly untrack topics when dismiss unread (#23894)
Bug introduced when dismiss modal was moved to new component-based API - https://github.com/discourse/discourse/pull/22262

We need to track `dismissTopics` property to send correct request to  server.

Meta: https://meta.discourse.org/t/dismiss-all-unread/280948
2023-10-11 02:51:43 +00:00
dependabot[bot]
775c7d427b
Build(deps): Bump ember-cli-babel in /app/assets/javascripts (#23890)
Bumps [ember-cli-babel](https://github.com/babel/ember-cli-babel) from 8.1.0 to 8.2.0.
- [Release notes](https://github.com/babel/ember-cli-babel/releases)
- [Changelog](https://github.com/babel/ember-cli-babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/ember-cli-babel/compare/v8.1.0...v8.2.0)

---
updated-dependencies:
- dependency-name: ember-cli-babel
  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>
2023-10-11 00:18:58 +02:00