Commit Graph

51593 Commits

Author SHA1 Message Date
e6299a310f FIX: Further optimize mentioning groups in chat messages (#24122)
A follow-up to faac6773. This PR eliminates one more heavy join by forcing 
Active Record to do two queries instead.

Also, along the way, I made this change:
```
# this generates two quries to the groups table
def groups_to_mention
  @groups_to_mention = mentionable_groups - groups_with_too_many_members
end

# so I changed it to (this makes only one query to the groups table):
def groups_to_mention
  @groups_to_mention ||= mentionable_groups.where("user_count <= ?", SiteSetting.max_users_notified_per_group_mention)
end
```
This one is kind of a premature optimization, because we don't have evidence that 
this extra query is a problem, but it seems cleaner this way.

Commits history on this PR may help better understand the change.
2023-10-31 18:17:37 +04:00
5dae0fdfb6 DEV: add a plugin modifier to change hidden site settings (#24160)
Plugins can use a new modifier to change which site settings are hidden using the :hidden_site_settings modifier. For example:

```
register_modifier(:hidden_site_settings) do |hidden|
  (hidden + [:invite_only, :login_required]).uniq
end
```
2023-10-31 10:09:51 -04:00
1c8eaa9390 DEV: QUnit CSS tweaks (#24180)
1. Prevent a white background flash
2. Dark-mode support for two more inputs
2023-10-31 14:53:42 +01:00
231e02446b DEV: Add a basic account creation system spec (#24179) 2023-10-31 14:53:24 +01:00
dbb532bae7 FIX: Full name validation regression (#24178)
Regressed in 351cbab1a8568c06e138cf5d31fa66552c3ef352
2023-10-31 14:44:27 +01:00
05e810e3bf UX: update composer border colour (#24176) 2023-10-31 13:51:10 +01:00
6269134eed FiX: Update date url for thread oneboxes (#24172) 2023-10-31 08:04:40 -03:00
4ef3066af5 FIX: Add rel=0 to youtube lazy videos url (#24173) 2023-10-31 08:04:23 -03:00
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
bbcf8e421c DEV: Migrate associate-account-confirm to the new modal API (#24138)
(+ glimmer)
2023-10-31 11:45:14 +01:00
c80b5b718c FIX: Add checkbox-label to more checkbox label elements (#24174)
Followup to e2d9117378ead0dbfcc6533d7cf6a7bf8a14d033, which
made these labels bold because they were missing the correct
class.
2023-10-31 08:57:50 +01:00
84fdf40dd4 FIX: Correctly sanitize negative integers in site settings (#24170)
As part of #23816, which sought to strip out thousand separators, we also accidentally strip out signs. This is making it impossible to disable some settings which require a -1 to disable. Instead of stripping non-digits, strip anything that isn't a sign or a digit.
2023-10-31 10:21:30 +08:00
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
360289e108 FIX: Account creation regression (#24169)
Regressed in 351cbab1a8568c06e138cf5d31fa66552c3ef352
2023-10-31 02:05:35 +01:00
08deedfd6e FIX: autotracking.mutation-after-consumption (#24164) 2023-10-31 00:39:52 +01:00
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
7ab37daae5 Build(deps): Bump net-imap from 0.4.2 to 0.4.3 (#24166)
Bumps [net-imap](https://github.com/ruby/net-imap) from 0.4.2 to 0.4.3.
- [Release notes](https://github.com/ruby/net-imap/releases)
- [Commits](https://github.com/ruby/net-imap/compare/v0.4.2...v0.4.3)

---
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>
2023-10-30 23:23:47 +01:00
c47774b1d8 Build(deps): Bump bootsnap from 1.16.0 to 1.17.0 (#24165)
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.16.0 to 1.17.0.
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: bootsnap
  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:21:51 +01:00
bdf2a20355 UX: form template simpler "value missing" i18n (#24154) 2023-10-30 17:40:07 -03:00
5e633708ac UX: fix minor chat transcript overflow (#24158) 2023-10-30 16:31:01 -04:00
4859340b2d FIX: correctly display escaped thread titles (#24159)
Prior to this fix, titles with a quote `'` for example, would be rendered as: `&#x27`
2023-10-30 21:06:31 +01:00
56e233464f DEV: Set selenium-webdriver version to 4.14 (#24161)
It was already upgraded in 0d42e25, this just ensures metadata matches.
2023-10-30 15:52:08 -04:00
97f4df6d63 UX: convert share modal margin to gap (#24157) 2023-10-30 12:45:07 -04:00
923fe3d082 UX: fix btn-flat focus style (#24156) 2023-10-30 12:44:38 -04:00
fbf8528814 UX: set tag sort based on siteSetting (#24147) 2023-10-30 10:55:39 -04:00
2e06cc1248 UX: avoid footer admin menu from overflowing top (#24149) 2023-10-30 10:55:17 -04:00
68728806c1 UX: impove badge granted spacing with grid (#24150) 2023-10-30 10:55:01 -04:00
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
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
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
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
c0dff8e728 Build(deps-dev): Bump rubocop-rspec from 2.24.1 to 2.25.0 (#24152)
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 2.24.1 to 2.25.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/v2.24.1...v2.25.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>
2023-10-29 23:21:12 +01:00
4028d741a2 Build(deps): Bump rake from 13.0.6 to 13.1.0 (#24151)
Bumps [rake](https://github.com/ruby/rake) from 13.0.6 to 13.1.0.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v13.0.6...v13.1.0)

---
updated-dependencies:
- dependency-name: rake
  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-29 23:21:03 +01:00
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
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
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
1c70a14d7c UX: adjust various button classes (#24121) 2023-10-27 10:26:59 -04:00
983fd04f4b FIX: Memoization in EmberCli ruby helper class (#24139)
Previously we were memoizing based on `defined?`, but the `clear_cache!` method was doing `@blah = nil`. That meant that after the cache was cleared, future calls to the memoized method would return `nil` instead of triggering a recalculation.
2023-10-27 13:35:33 +01:00
3f3d2ee2c0 DEV: Deprecate defunct User#flag_level column (#24134)
The User#flag_level column has not been in use for a very long time. The "new" reviewable system dynamically calculates flag scores based on past performance of the user.

This PR removes flag_level from the admin user serializer (since it isn't displayed anywhere in admin user lists) and marks the column as deprecated and targeted for removal in the next minor version.
2023-10-27 17:27:04 +08:00
b6f9bc556e UX: remove border radius and box shadow (#24135) 2023-10-27 11:02:42 +02:00
e2bb84757e FIX: Ensure JS transpiler is available for multisite-migrate (#24136)
Previously done for the normal `db:migrate` command in 1e59e18ad2553f81c6efde51796be298392ca8fc
2023-10-27 09:59:41 +01:00
db880d8ed7 DEV: adds a :chat_thread_created trigger (#24133)
Usage:

```ruby
DiscourseEvent.on(:chat_thread_created) do |thread|
end
```
2023-10-27 10:27:34 +02:00
8465324168 FEATURE: Add new chat indicator preference for Only Mentions (#23848)
Add new chat indicator preference within chat user preferences.

Enabling this option will mean that green notifications will only appear for mentions (within channels and DMs.

This change also enables mentions within direct messages.
2023-10-27 15:58:19 +08:00
f9f9cf0bf4 DEV: Remove unreachable IP address validation message (#24131)
The message: :signup_not_allowed option to the IP address validator does nothing, because the AllowedIpAddressValidator chooses one of either:

- ip_address.blocked or
- ip_address.max_new_accounts_per_registration_ip

internally. This means that the translation for this was also never used.

This PR removes the ineffectual option and the unused translation. It also moves the translated error messages for blocked and max_new_accounts_per_registration_ip into the correct location so we can pass a symbol to ActiveModel::Errors#add.

There is no actual change in behaviour.
2023-10-27 15:22:38 +08:00
9acdafe87c DEV: Remove deprecated EmailValidator.email_regex (#24129)
The EmailValidator.email_regex method was moved to EmailAddressValidator.email_regex and marked for removal in 2.9.0. The method was proxied for backwards compatibility in plugins. This PR removes the method.
2023-10-27 15:11:10 +08:00
ac70ef929f DEV: Remove deprecated #pluck_first freedom patch (#24130)
The #pluck_first method got a replacement in ActiveRecord core named #pick. After a bunch of replacements in core and plugins, we are now ready to retire this freedom patch.
2023-10-27 14:52:23 +08:00
66084b3ce8 DEV: Remove deprecated PostsController#all_reply_ids (#24128)
The PostsController#all_reply_ids was deprecated and marked for removal in 3.0. This PR removes the controller action and the route.
2023-10-27 12:40:49 +08:00
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
219b071994 FIX: Revise and reject post breaks on new topics queued (#24109)
Followup to 9762e6575841889d50275cb6026e4482d8091857. This
original commit did not take into account the fact that
new topics can end up in the approval queue as a
ReviewableQueuedPost, and so there was a 500 error raised
when accessing `self.topic` when sending a PM to the user.
2023-10-27 13:05:41 +10:00
d0915027a8 DEV: Remove deprecated queue_jobs site setting (#24127)
Using SiteSetting.queue_jobs= to configure job asynchronicity was deprecated here four years ago and marked for removal in version 2.9.0. This PR removes the fallback method we kept since then. The method was there because it was still being used in a bunch of plugin tests (now fixed.)
2023-10-27 11:05:02 +08:00