Commit Graph

57098 Commits

Author SHA1 Message Date
Natalie Tay
d43d8e0023
FIX: Searchable user fields do not always have an integer name (#30223) 2024-12-17 11:06:19 +11:00
Krzysztof Kotlarek
a8bdc5f7c5
UX: display link to groups in admin sidebar (#30291)
Add groups link to admin and moderator sidebar for easy access.
Currently, the admin needs to go to `users` first.
2024-12-17 10:07:24 +11:00
Gary Pendergast
2827ca992f
FIX: Handle unrelated timings being moved (#30256) 2024-12-17 10:07:04 +11:00
dependabot[bot]
aff380bf73
Build(deps): Bump reline from 0.5.12 to 0.6.0 (#30307)
Bumps [reline](https://github.com/ruby/reline) from 0.5.12 to 0.6.0.
- [Release notes](https://github.com/ruby/reline/releases)
- [Commits](https://github.com/ruby/reline/compare/v0.5.12...v0.6.0)

---
updated-dependencies:
- dependency-name: reline
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 23:17:10 +01:00
dependabot[bot]
47c25bb3bf
Build(deps): Bump rdoc from 6.9.0 to 6.9.1 (#30306)
Bumps [rdoc](https://github.com/ruby/rdoc) from 6.9.0 to 6.9.1.
- [Release notes](https://github.com/ruby/rdoc/releases)
- [Changelog](https://github.com/ruby/rdoc/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rdoc/compare/v6.9.0...v6.9.1)

---
updated-dependencies:
- dependency-name: rdoc
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 23:12:14 +01:00
dependabot[bot]
b857eb988b
Build(deps): Bump securerandom from 0.4.0 to 0.4.1 (#30305)
Bumps [securerandom](https://github.com/ruby/securerandom) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/ruby/securerandom/releases)
- [Commits](https://github.com/ruby/securerandom/compare/v0.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: securerandom
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 23:12:08 +01:00
dependabot[bot]
6323303f9c
Build(deps): Bump net-imap from 0.5.1 to 0.5.2 (#30304)
Bumps [net-imap](https://github.com/ruby/net-imap) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/ruby/net-imap/releases)
- [Commits](https://github.com/ruby/net-imap/compare/v0.5.1...v0.5.2)

---
updated-dependencies:
- dependency-name: net-imap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 23:12:01 +01:00
dependabot[bot]
bf803addbc
Build(deps): Bump timeout from 0.4.2 to 0.4.3 (#30303)
Bumps [timeout](https://github.com/ruby/timeout) from 0.4.2 to 0.4.3.
- [Release notes](https://github.com/ruby/timeout/releases)
- [Commits](https://github.com/ruby/timeout/compare/v0.4.2...v0.4.3)

---
updated-dependencies:
- dependency-name: timeout
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 23:11:52 +01:00
dependabot[bot]
af8f219377
Build(deps-dev): Bump the embroider group with 3 updates (#30309)
Bumps the embroider group with 3 updates: [@embroider/compat](https://github.com/embroider-build/embroider/tree/HEAD/packages/compat), [@embroider/core](https://github.com/embroider-build/embroider/tree/HEAD/packages/core) and [@embroider/macros](https://github.com/embroider-build/embroider/tree/HEAD/packages/macros).


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

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 23:11:37 +01:00
Jordan Vidrine
565a48e8e1
UX: fix active and muted channels (#30308) 2024-12-16 16:02:44 -06:00
Jarek Radosz
e03121c55b
FIX: Correctly display group unread indicator in gjs (#30302) 2024-12-16 20:50:49 +01:00
David Taylor
03bb43f746
DEV: Move topic-list-class transformer to getter (#30301)
Using the (array) helper creates an array instance, passes it to applyValueTransformer, which then allows themes/plugins to mutate it.

When the helper is re-computed, the **same array instance** is passed to the transformers again. Any elements added in the last run are still there.

This commit moves applyValueTransformer to a getter, so that it's run with a brand new array each time.
2024-12-16 19:19:42 +00:00
Joffrey JAFFEUX
41df705188
DEV: replaces topic-notifications-options by DMenu (#30298)
This commit introduces <NotificationsTracking /> which is a wrapper component around <DMenu /> which replaces the select-kit component <TopicNotificationsButton />.

Each tracking case has its dedicated component:

- topic -> `<TopicNotificationsTracking />`
- group -> `<GroupNotificationsTracking />`
- tag -> `<TagNotificationsTracking />`
- category -> `<CategoryNotificationsTracking />`
- chat thread -> `<ThreadNotificationsTracking />`
2024-12-16 19:59:18 +01:00
Régis Hanol
062e4fb4f3
FIX: add server-side limit for DM channels (#30300)
When fetching DM channels, we would fetch all the user's DM channels,
and limit the number of DM channels we display on the client-side using
the `DIRECT_MESSAGE_CHANNELS_LIMIT`.

This is obviously not scalable as users are having more and more
discussions with other users.

This commit ensures we always limit the number of DM channels we send to the
client.

It adds the `MAX_DM_CHANNEL_RESULTS` in `ChannelFetcher` and use it to
limit the records returned by the server. This value should always be
lower than `DIRECT_MESSAGE_CHANNELS_LIMIT` on the client-side, so that
when the user has more "unread DMs" they still show up on the client as
they read them.

While adding a spec, I also updated the spec that ensures we have a
limit on public channels to use `stub_const` to temporarily lower the number
of fixtures we create during the test.
2024-12-16 18:36:29 +01:00
David Taylor
ea9cdf7d47
DEV: Compile theme raw-hbr to modules (#30299)
Previously, theme hbr files were compiled to an IIFE, which would be executed before the app is booted. That is causing silenced deprecations to be printed, because the deprecation-workflow isn't set up when the IIFE is run.

This commit updates the theme compiler so that it matches the ember-cli-based raw-hbs compiler. Templates are output to normal modules, which will then be loaded by the existing `eager-load-raw-templates` initializer. This runs after the app has started booting.
2024-12-16 17:31:49 +00:00
Gerhard Schlager
6b3e28216c
FEATURE: Allow pausing of restore before DB migration and uploads are restored (#30269)
This can be helpful if you need to fix problems in the DB before the DB gets migrated as well as before uploads are restored.
2024-12-16 12:50:08 +01:00
Kelv
04ba5baec0
DEV: ensure rebaking works even when some users have inconsistent data (#30261)
* DEV: add db consistency check for UserEmail

* DEV: add db consistency check for UserAvatar

* DEV: ignore inconsistent data related to user avatars when deciding whether to rebake old posts


Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>

---------

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2024-12-16 19:48:25 +08:00
David Taylor
ce8c2ef6d9
Revert "DEV: prioritize new email styles over existing, to make customization easier (#30244)" (#30297)
This reverts commit 9694dc6cb0.

Some of our previous email styling depended on this 'incorrect' ordering, so the change caused some text to become illegible. Reverting while we work out a better solution
2024-12-16 11:16:17 +00:00
Natalie Tay
537f09912e
DEV: Memoize group find when adding users to groups (#30296) 2024-12-16 17:47:24 +08:00
Kelv
a141a096d1
DEV: move CleansUp mixin code to components (#30292)
* DEV: move cleans-up event listeners directly to components
* DEV: inline logic from unnecessary cleanUp func in GroupCardContents
2024-12-16 12:01:14 +08:00
dependabot[bot]
d416b7c7dd
Build(deps-dev): Bump lint-to-the-future from 2.5.1 to 2.6.1 (#30290) 2024-12-16 00:09:02 +01:00
dependabot[bot]
deab88e7eb
Build(deps): Bump @highlightjs/cdn-assets from 11.10.0 to 11.11.0 (#30286) 2024-12-16 00:08:53 +01:00
dependabot[bot]
1ceca2e284
Build(deps): Bump highlight.js from 11.10.0 to 11.11.0 (#30288) 2024-12-16 00:08:41 +01:00
dependabot[bot]
acccdae0d1
Build(deps): Bump logger from 1.6.2 to 1.6.3 (#30283) 2024-12-16 00:08:27 +01:00
dependabot[bot]
90ae304fb5
Build(deps): Bump rexml from 3.3.9 to 3.4.0 (#30282) 2024-12-15 22:54:12 +01:00
dependabot[bot]
6f942d2fd5
Build(deps): Bump oj from 3.16.7 to 3.16.8 (#30285) 2024-12-15 22:53:53 +01:00
dependabot[bot]
772aa930a4
Build(deps): Bump rdoc from 6.8.1 to 6.9.0 (#30281) 2024-12-15 22:53:40 +01:00
dependabot[bot]
7e555b3421
Build(deps): Bump css_parser from 1.20.0 to 1.21.0 (#30278) 2024-12-15 22:53:29 +01:00
dependabot[bot]
db3d126467
Build(deps-dev): Bump rubocop-ast from 1.36.2 to 1.37.0 (#30279) 2024-12-15 22:53:17 +01:00
dependabot[bot]
2096d3570c
Build(deps): Bump csv from 3.3.0 to 3.3.1 (#30280) 2024-12-15 22:53:05 +01:00
Mark VanLandingham
85773eee21
DEV: Pass in old post to post_moved DiscourseEvent (#30274) 2024-12-13 12:30:00 -06:00
dependabot[bot]
316ba67aac
Build(deps): Bump irb from 1.14.1 to 1.14.2 (#30248) 2024-12-13 19:08:28 +01:00
David Taylor
b410677fcd
DEV: Disable Ember's LOG_STACKTRACE_ON_DEPRECATION (#30275)
This feature writes a stack trace as part of the message. That means it is not sourcemapped by the browser, and you have further to scroll to find the real backtrace.

In the past we avoided this feature with our production 'deprecation shim', but that was removed as part of our Ember 5.12 upgrade.
2024-12-13 17:56:11 +00:00
Régis Hanol
29dad8bbea
FIX: expanding / collapsing own user info panel (#30272)
When viewing your own user profile, we offer the ability to expand / collapse your user info.

By default, the info are collapsed and the button to toggle it only worked once. Meaning you could expand the info but not collapse it back.

This fixes the issue by using `toggleProperty()` instead of directly `set()`-ing a value.

Also added an acceptance test to ensure it doesn't regress.

Was reported in https://meta.discourse.org/t/342254
2024-12-13 17:37:57 +01:00
Régis Hanol
bdd4392c01
DEV: skip flaky chat specs (#30273)
while we figure out if we want to keep the feature or replace it with a simpler version.

Internal ref - t/144221
2024-12-13 17:37:40 +01:00
David Taylor
d0df16535e
DEV: Make banned-phrase detection case insensitive (#30271)
Followup to 78dacf773a
2024-12-13 16:24:35 +00:00
David Taylor
78dacf773a
DEV: Ensure banned phrases do not occur in en translations (#30264)
This will help us keep consistency with things that we've decided to rename. Initial rules are for "color scheme" -> "color palette", and "private message" -> "personal message".

Also updates some remaining occurences of "color scheme" in our translation files.

Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2024-12-13 16:02:32 +00:00
Joffrey JAFFEUX
f6a4de4805
DEV: adds support for nested collections and objects (#30265)
Collections were an existing concept in FormKit but didn't allow nesting. You can now do infinite nesting:

```gjs
<Form
  @data={{hash
    foo=(array
      (hash bar=(array (hash baz=1))) (hash bar=(array (hash baz=2)))
    )
  }}
  as |form|
>
  <form.Collection @name="foo" as |parent parentIndex|>
    <parent.Collection @name="bar" as |child childIndex|>
      <child.Field @name="baz" @title="Baz" as |field|>
        <field.Input />
      </child.Field>
    </parent.Collection>
  </form.Collection>
</Form>
```

On top of this a new component has been added: `Object`. It allows you to represent objects in your form data. Collections are basically handling arrays, and Objects are objects.

This is useful if you form data has this shape for example:

```javascript
{ foo: { bar: 1, baz: 2 } }
```

This can now be mapped in your form using this syntax:

```gjs
<Form @data={{hash foo=(hash bar=1 baz=2)}} as |form|>
  <form.Object @name="foo" as |object name|>
    <object.Field @name={{name}} @title={{name}} as |field|>
      <field.Input />
    </object.Field>
  </form.Object>
</Form>
```

Objects accept nested collections and nested objects. Just like Collections.

A small addition has also been made to `Collection`, they now support a custom `@tagName`, it's useful if each item of your collection is the row of a table for example.
2024-12-13 15:43:32 +01:00
Jordan Vidrine
b191d63c1b
DEV: removes sidebar-extensions css (#30266)
This PR cleans up some unnecessary CSS which are not used anymore. Support of sidebar in chat has a long history due to the various steps leading to the sidebar as we know it today.
2024-12-13 15:36:30 +01:00
Renato Atilio
a21f064fad
UX: add color-scheme meta tag to _head (#30245)
Adds the `color-scheme` meta tag to the `_head` partial and removes it from the finish installation template to prevent it from being added twice.
2024-12-13 08:10:08 -03:00
Loïc Guitaut
9e9abe0a82 DEV: Unify params access in services
Currently, there are two ways (kind of) for accessing `params` inside a
service:
- when there is no contract or it hasn’t been reached yet, `params` is
  just the hash that was provided to the service. To access a key, you
  have to use the bracket notation `params[:my_key]`.
- when there is a contract and it has been executed successfully,
  `params` now references the contract and the attributes are accessible
  using methods (`params.my_key`).

This patch unifies how `params` exposes its attributes. Now, even if
there is no contract at all in a service, `params` will expose its
attributes through methods, that way things are more consistent.

This patch also makes sure there is always a `params` object available
even when no `params` key is provided to the service (this allows a
contract to fail because its attributes are blank instead of having the
service raising an error because it doesn’t find `params` in its context).
2024-12-13 11:13:18 +01:00
Joffrey JAFFEUX
cbc0ece6e8
DEV: <DSelect /> (#30224)
`<DSelect />` is a wrapper similar to our existing `<DButton />` over the html element `<select>`. The code is ported from form kit which is now directly using `<DSelect />`. Note this component has also been used in edit topic timer modal.

This component is recommended for a small list of text items (no icons, no rich formatting...).

Usage:

```gjs
<DSelect class="my-select" @onChange={{this.handleChange}} as |select|>
  <select.Option @value="foo" class="my-favorite-option">Foo</select.Option>
  <select.Option @value="bar">Bar</select.Option>
</DSelect>
```

This commit comes with a set of assertions:

```gjs
import dselect from "discourse/tests/helpers/d-select-helper";
import { select } from "@ember/test-helpers";

assert
  .dselect(".my-select")
  .hasOption({ value: "bar", label: "Bar" })
  .hasOption({ value: "foo", label: "Foo" })
  .hasNoOption("baz");

await select(".my-select", "foo");

assert.dselect(".my-select").hasSelectedOption({value: "foo", label: "Foo"});
```
2024-12-13 10:40:06 +01:00
Natalie Tay
622eb9e51c
FIX: Avoid zipping when adding users to groups (#30263) 2024-12-13 17:24:40 +08:00
Alan Guo Xiang Tan
ebfc33b556
DEV: Remove line of code that does not work (#30258)
We can't delete the file from disk as some of the assets are still
served by the app instead of going through the S3 bucket. It is a bug we
need to fix but it also means this ENV is unsafe now. Just drop the env
until we ensure all assets requested by the app are requested from the
S3 bucket directly.
2024-12-13 09:36:51 +08:00
Jarek Radosz
ae6fca2f0b
DEV: Add io-console to default gems list (#30257) 2024-12-13 02:35:05 +01:00
Martin Brennan
fae6ffcf06
UX: Introduce <DStatTiles /> component (#30238)
Introduces a new component used to show a grid of stats
on any page, mostly used for dashboards and config pages.
This component yields a hash with a `Tile` component property,
and the caller can loop through their stats and display them
using this component.

Each stat needs a @label and a @value at minimum, but can
also pass in a @tooltip and a @url.
2024-12-13 11:32:46 +10:00
dependabot[bot]
54f0dd40ad
Build(deps): Bump css_parser from 1.19.1 to 1.20.0 (#30251)
Bumps [css_parser](https://github.com/premailer/css_parser) from 1.19.1 to 1.20.0.
- [Changelog](https://github.com/premailer/css_parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/premailer/css_parser/compare/v1.19.1...v1.20.0)

---
updated-dependencies:
- dependency-name: css_parser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 02:06:14 +01:00
dependabot[bot]
635cfdced7
Build(deps): Bump rails-html-sanitizer from 1.6.1 to 1.6.2 (#30250)
Bumps [rails-html-sanitizer](https://github.com/rails/rails-html-sanitizer) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/rails/rails-html-sanitizer/releases)
- [Changelog](https://github.com/rails/rails-html-sanitizer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rails/rails-html-sanitizer/compare/v1.6.1...v1.6.2)

---
updated-dependencies:
- dependency-name: rails-html-sanitizer
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 02:03:56 +01:00
dependabot[bot]
d039ed4241
Build(deps-dev): Bump rubocop-rspec from 3.2.0 to 3.3.0 (#30252)
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/rubocop/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rspec/compare/v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: rubocop-rspec
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 02:03:28 +01:00
dependabot[bot]
2960b6938b
Build(deps-dev): Bump rubocop from 1.69.1 to 1.69.2 (#30249)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.69.1 to 1.69.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.69.1...v1.69.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 02:03:20 +01:00