Commit Graph

54124 Commits

Author SHA1 Message Date
Jarek Radosz
20e049bcbc
DEV: Minor refactor of d-menu/d-tooltip (#26942)
* `menuInstance` cached getter -> prop
* `next()` and a `trigger` check -> gone
* `allowedProperties` action -> getter
* `keys` -> `entries`
* update the `service` import
* flatten the object spread structures
2024-05-09 10:54:37 +02:00
David Battersby
4404b6808c
UX: expand threads list tap area on mobile (#26818)
This change adds a wrapper link around the thread list details on mobile to make the click area larger.

We also update child div elements to span to ensure valid html, since the link is an inline element and divs are block level.

---------

Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
2024-05-09 12:45:02 +04:00
Neil Lalonde
efc21dd98b
UX: enable_powered_by_discourse site setting default is true (#26774) 2024-05-09 13:01:08 +05:30
Rishabh
69158ebb5c
Update /powered-by link to final target (#26950) 2024-05-09 13:00:08 +05:30
Alan Guo Xiang Tan
7079698cdf
FIX: Use MaxMind supplied permalinks to download MaxMind databases (#26847)
This commit switches `DiscourseIpInfo.mmdb_download` to use the
permalinks supplied by MaxMind to download the MaxMind databases as
specified in
https://dev.maxmind.com/geoip/updating-databases#directly-downloading-databases
which states:

```
To directly download databases, follow these steps:

1. In the "Download Links" column, click "Get Permalink(s)" for the desired database.
2. Copy the permalink(s) provided in the modal window.
3. Provide your account ID and your license key using Basic Authentication to authenticate.
```

Previously we are downloading from `https://download.maxmind.com/app/geoip_download` but this is not
documented anyway on MaxMind's docs so this URL can in theory break
in the future without warning. Therefore, we are taking a proactive
approach to download the databases from MaxMind the recommended way
instead of relying on a hidden URL. This old way of downloading the
databases with only a license key will be deprecated in 3.3 and be
removed in 3.4.
2024-05-09 15:11:56 +08:00
Martin Brennan
abb073b80a
UX: Add CSS for admin plugin empty list CTA (#26949)
This adds `admin-plugin-config-area__empty-list`,
allows us to standardize on CTA styling for empty lists.
2024-05-09 12:46:41 +10:00
dependabot[bot]
842b0a97b2
Build(deps): Bump net-imap from 0.4.10 to 0.4.11 (#26946)
Bumps [net-imap](https://github.com/ruby/net-imap) from 0.4.10 to 0.4.11.
- [Release notes](https://github.com/ruby/net-imap/releases)
- [Commits](https://github.com/ruby/net-imap/compare/v0.4.10...v0.4.11)

---
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-05-09 01:02:00 +02:00
dependabot[bot]
be6e417192
Build(deps-dev): Bump rspec-mocks from 3.13.0 to 3.13.1 (#26947)
Bumps [rspec-mocks](https://github.com/rspec/rspec-mocks) from 3.13.0 to 3.13.1.
- [Release notes](https://github.com/rspec/rspec-mocks/releases)
- [Changelog](https://github.com/rspec/rspec-mocks/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-mocks/compare/v3.13.0...v3.13.1)

---
updated-dependencies:
- dependency-name: rspec-mocks
  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-05-09 01:01:40 +02:00
Alan Guo Xiang Tan
c8da2a33e8
FIX: Attempt to onebox even if response body exceeds max_download_kb (#26929)
In 95a82d608d, we lowered the default for
`Onebox.options.max_download_kb` from 10mb to 2mb for security hardening
purposes. However, this resulted in multiple bug reports where seemingly
nomral URLs stopped being oneboxed. It turns out that lowering
`Onebox.options.max_download_kb` resulted in `Onebox::Helpers::DownloadTooLarge` being raised
more often for more URLs  in `Onebox::Helpers.fetch_response` which
`Onebox::Helpers.fetch_html_doc` relies on. When
`Onebox::Helpers::DownloadTooLarge` is raised in
`Onebox::Helpers.fetch_response`, we throw away whatever response body
which we have already downloaded at that point. This is not ideal
because Nokogiri can parse incomplete HTML documents and there is a
really high chance that the incomplete HTML document still contains the
information which we need for oneboxing.

Therefore, this commit updates `Onebox::Helpers.fetch_html_doc` to not
throw away the response body when the size of the response body exceeds
`Onebox.options.max_download_size`. Instead, we just take whatever
response which we have and get Nokogiri to parse it.
2024-05-09 07:00:34 +08:00
David McClure
13334a3da0
UX: link to /latest in welcome topic template (#26944)
On new sites, /top has no topics, which is a poor experience for new users.
2024-05-08 17:01:42 -04:00
Keegan George
0695424c92
DEV: Bump ember-instantsearch to v1.1.2 (#26943) 2024-05-08 13:06:59 -07:00
Jarek Radosz
e579cfc08f
DEV: Avoid using the old action helper (#26935) 2024-05-08 20:26:48 +02:00
Jarek Radosz
1b80ee9eb7
FIX: Track User.status property (#26941)
Fixes a bug I stumbled upon in dev env:

```
Error: Assertion Failed: You attempted to update <discourse@model:user::ember337>.status to "[object Object]", but it is being tracked by a tracking context, such as a template, computed property, or observer. In order to make sure the context updates properly, you must invalidate the property when updating it. You can mark the property as `@tracked`, or use `@ember/object#set` to do this.
```
2024-05-08 19:07:43 +02:00
Jan Cernik
7bc7ad45bb
UX: Merge the redesign experiment for embedded replies (#26876)
This PR merges the [design experiment](https://meta.discourse.org/t/embedded-replies-feedback/290538) based on the [Custom embedded replies component](https://meta.discourse.org/t/custom-embedded-replies/272670) created by [Don](https://meta.discourse.org/u/don/summary)

---------

Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
2024-05-08 18:00:17 +02:00
David Taylor
ece0150cb7
FIX: Ensure RequestTracker handles bubbled exceptions correctly (#26940)
This can happen for various reasons including rate limiting and middleware bugs. This should resolve the warning we're seeing in the logs

```
RequestTracker.get_data failed : NoMethodError : undefined method `[]' for nil:NilClass
```
2024-05-08 16:08:39 +01:00
Joffrey JAFFEUX
c8faf3e427
FIX: ensures chat notifications links work with subfolder (#26938)
We were missing two `getURL` calls.

The test is now written for subfolder but it's good enough. If it's working for subfolder, it's working for non subfolders, the opposite being false.
2024-05-08 14:47:15 +02:00
Joffrey JAFFEUX
9bf763d03f
FIX: inject current user service in category model (#26937) 2024-05-08 14:09:00 +02:00
Jarek Radosz
5d7aff12a7
DEV: Convert dialog-holder to gjs (#26869) 2024-05-08 13:04:01 +02:00
Joffrey JAFFEUX
7896d00a7a
FIX: incorrect divider in topic admin menu (#26934)
Adds a divider only if we are staff or have extra buttons.
2024-05-08 11:49:04 +02:00
David Taylor
0f4520867b
DEV: @babel/plugin-proposal-decorators -> decorator-transforms (#25290)
decorator-transforms (https://github.com/ef4/decorator-transforms) is a modern replacement for babel's plugin-proposal-decorators. It provides a decorator implementation using modern browser features, without needing to enable babel's full suite of class feature transformations. This improves the developer experience and performance.

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

It reduces our initial gzip'd JS payloads by 3.2% (2.43MB -> 2.35MB), or 7.5% (14.5MB -> 13.4MB) uncompressed.
2024-05-08 10:40:51 +01:00
David Taylor
f74983e2e1
DEV: Enable 'cheap source maps' in GitHub CI (#26933)
This seems to save ~7s in core build time. I also tried disabling sourcemaps completely, but it didn't bring any additional benefit.
2024-05-08 10:28:07 +01:00
dependabot[bot]
592d05cb9c
Build(deps): Bump babel-plugin-ember-template-compilation (#26932)
Bumps [babel-plugin-ember-template-compilation](https://github.com/emberjs/babel-plugin-ember-template-compilation) from 2.2.3 to 2.2.4.
- [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/commits)

---
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>
2024-05-08 11:11:09 +02:00
dependabot[bot]
34b9b3f6a7
Build(deps): Bump the embroider group with 3 updates (#26931)
Bumps the embroider group with 3 updates: [@embroider/compat](https://github.com/embroider-build/embroider/tree/HEAD/packages/compat), [@embroider/router](https://github.com/embroider-build/embroider/tree/HEAD/packages/router) and [@embroider/addon-shim](https://github.com/embroider-build/embroider/tree/HEAD/packages/addon-shim).


Updates `@embroider/compat` from 3.4.9 to 3.5.0
- [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/router` from 2.1.6 to 2.1.7
- [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/router)

Updates `@embroider/addon-shim` from 1.8.7 to 1.8.8
- [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/addon-shim)

---
updated-dependencies:
- dependency-name: "@embroider/compat"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: embroider
- dependency-name: "@embroider/router"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/addon-shim"
  dependency-type: direct:production
  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-05-08 11:10:45 +02:00
Rishabh
a20e0ef0b6
powered-by-discourse should link to /about instead (#26930) 2024-05-08 18:45:08 +10:00
dependabot[bot]
7155682dc1
Build(deps-dev): Bump esbuild from 0.20.2 to 0.21.1 (#26919)
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.20.2 to 0.21.1.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.20.2...v0.21.1)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 10:41:00 +02:00
dependabot[bot]
93e55ed355
Build(deps-dev): Bump @types/jquery in the types group (#26918)
Bumps the types group with 1 update: [@types/jquery](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jquery).


Updates `@types/jquery` from 3.5.29 to 3.5.30
- [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>
2024-05-08 10:40:14 +02:00
Joffrey JAFFEUX
cf8b81771f
DEV: implements <DropdownMenu /> (#26917)
DropdownMenu component is meant as a way to describe the content of menus.

Syntax:

```
<DropdownMenu as |dm|>
  <dm.item class="test">
    First
  </dm.item>
  <dm.divider class="foo" />
  <dm.item class="bar">
    Second
  </dm.item>
</DropdownMenu>
```
2024-05-08 09:08:42 +02:00
Alan Guo Xiang Tan
21bce2d07e
DEV: Fix a flaky system test for editing sidebag navigation tags (#26897)
This commits updates
`PageObjects::Components::NavigationMenu::Base#click_edit_tags_button`
to wait for `.sidebar-tags-form` to be present before returning. This is
essential because the client side app has to load the tags from the
server when the modal is open. If we don't wait for all the tags to be
loaded, it makes it hard to reason about the state of the UI when
interacting with the modal. In the case of "allows a user to deselect all tags in the modal which will display the site's top tags" which
was flaky, the system test was interacting with the UI when the tags are
still loading.
2024-05-08 14:34:32 +08:00
dependabot[bot]
7744e8ac85
Build(deps-dev): Bump sinon from 17.0.1 to 17.0.2 (#26920)
Bumps [sinon](https://github.com/sinonjs/sinon) from 17.0.1 to 17.0.2.
- [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.1...v17.0.2)

---
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>
2024-05-08 14:08:39 +08:00
dependabot[bot]
c02d9fbbe4
Build(deps): Bump nio4r from 2.7.1 to 2.7.3 (#26922)
Bumps [nio4r](https://github.com/socketry/nio4r) from 2.7.1 to 2.7.3.
- [Release notes](https://github.com/socketry/nio4r/releases)
- [Changelog](https://github.com/socketry/nio4r/blob/main/changes.md)
- [Commits](https://github.com/socketry/nio4r/compare/v2.7.1...v2.7.3)

---
updated-dependencies:
- dependency-name: nio4r
  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-05-08 14:08:29 +08:00
dependabot[bot]
b67513eb28
Build(deps-dev): Bump sass from 1.76.0 to 1.77.0 (#26921)
Bumps [sass](https://github.com/sass/dart-sass) from 1.76.0 to 1.77.0.
- [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.76.0...1.77.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 14:08:20 +08:00
dependabot[bot]
f43025f047
Build(deps): Bump i18n from 1.14.4 to 1.14.5 (#26923)
Bumps [i18n](https://github.com/ruby-i18n/i18n) from 1.14.4 to 1.14.5.
- [Release notes](https://github.com/ruby-i18n/i18n/releases)
- [Changelog](https://github.com/ruby-i18n/i18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ruby-i18n/i18n/compare/v1.14.4...v1.14.5)

---
updated-dependencies:
- dependency-name: i18n
  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-05-08 14:08:09 +08:00
dependabot[bot]
0789a5c899
Build(deps): Bump sass-embedded from 1.76.0 to 1.77.0 (#26925)
Bumps [sass-embedded](https://github.com/sass-contrib/sass-embedded-host-ruby) from 1.76.0 to 1.77.0.
- [Commits](https://github.com/sass-contrib/sass-embedded-host-ruby/compare/v1.76.0...v1.77.0)

---
updated-dependencies:
- dependency-name: sass-embedded
  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-05-08 14:08:00 +08:00
dependabot[bot]
2ee2ed0b1b
Build(deps): Bump bigdecimal from 3.1.7 to 3.1.8 (#26924)
Bumps [bigdecimal](https://github.com/ruby/bigdecimal) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/ruby/bigdecimal/releases)
- [Changelog](https://github.com/ruby/bigdecimal/blob/master/CHANGES.md)
- [Commits](https://github.com/ruby/bigdecimal/compare/v3.1.7...v3.1.8)

---
updated-dependencies:
- dependency-name: bigdecimal
  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-05-08 14:07:50 +08:00
Martin Brennan
ce2388e40b
FEATURE: Remove "Enable Sidebar" step from setup wizard (#26926)
This keeps coming up in user testing as something
we want to get rid of. The `navigation_menu` setting
has been set to sidebar by default for some time now,
and we are rolling out admin sidebar widely. It just
doesn't make sense to let people turn this off in
the first step of the wizard -- we _want_ people to
use the sidebar.
2024-05-08 10:00:40 +10:00
Krzysztof Kotlarek
b3f321e333
Revert "FEATURE: revert redirect from wizard to guide (#26873)" (#26916)
This reverts commit 74f1a79d36.
2024-05-08 08:46:30 +10:00
Joffrey JAFFEUX
fe16633a0c
DEV: allows for multiple menus/tooltips (#26823)
menus and tooltips are now appended to their own portals. The service are the only responsible for managing the instances, prior to this commit, services could manage one instance, but the DMenu and DTooltip components could also take over which could cause unexpected states.

This change also allows nested menus/tooltips.

Other notable changes:

- few months ago core copied the CloseOnClickOutside modifier of float-kit without removing the float-kit one, this commit now only use the core one.
- the close function is now trully async
- the close function accepts an instance or an identifier as parameter
2024-05-07 23:48:44 +02:00
Blake Erickson
95302cc7ed
DEV: Adjust flaky bulk select spec (#26913)
For some reason this test is showing up as flaky. It has something to do
with `have_read_post`:

https://github.com/discourse/discourse/blob/main/spec/system/page_objects/components/topic_view.rb#L10

In an effort to not just increase the wait time for `page.has_css?`
let's make these little tweaks and see if it makes any sort of
difference.
2024-05-07 14:37:47 -06:00
Jarek Radosz
b49fc052eb
DEV: Use current-user service wherever possible (#26901) 2024-05-07 22:19:42 +02:00
Sérgio Saquetim
e992cf1507
DEV: Prevent removed keys from being resolved in the DAG (#26912) 2024-05-07 16:59:36 -03:00
chapoi
4edc011d10
UX: use quaternary colour for keyboard navigation (#26911) 2024-05-07 20:20:16 +02:00
Régis Hanol
12cba2ce24 PERF: bail out of expensive post validations
Whenever a post already failed "lightweight" validations, we skip all the expensive validations (that cooks the post or run SQL queries) so that we reply as soon as possible.

Also skip validating polls when there's no "[/poll]" in the raw.

Internal ref - t/115890
2024-05-07 18:56:16 +02:00
Joffrey JAFFEUX
49661d7098
DEV: removes flakey tests (#26909)
Removes tests, just can't be made resilient on CI
2024-05-07 18:55:42 +02:00
Joffrey JAFFEUX
92a59e2480
DEV: uses swipe-events lib for swipe modifier (#26905)
This commit also:

uses the swipe modifier in the glimmer-site-header component
changes closing condition for d-modal and toast from distance to velocity
cancels toast auto close on touch
2024-05-07 17:43:37 +02:00
Joffrey JAFFEUX
69e5c9f611
FIX: prevents flakey due to usernames with quotes (#26907)
Faker could generate usernames like `D'angelo` and that doesn’t work out nicely for our tests. Using domain names seems safer.
2024-05-07 17:41:49 +02:00
Régis Hanol
342328b622
DEV: depend less on pngquant version (#26906)
This spec has been failing forever on my machine. I guess I have a "better" version of pngquant?

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-05-07 16:56:05 +02:00
Joffrey JAFFEUX
278eb0a1a5
FIX: improvements to chat message streaming (#26892)
- prevents re-rendering avatars while updating messages quickly in the thread preview indicator
- ensures the cancel button is shown when you are admin OR when the streamed message is a reply to the current user
2024-05-07 15:38:24 +02:00
Discourse Translator Bot
42297b2ec3
Update translations (#26903) 2024-05-07 09:31:46 -04:00
Kris
01e725a225
DEV: Remove default button classes from sidebar buttons (#26893) 2024-05-07 09:20:30 -04:00
Joffrey JAFFEUX
26c8eab1f3
FIX: allows bots to create/update/stream messages (#26900)
Prior to this commit, only system users had this pass.

Another significant change of the PR, is to make membership of a channel the angular stone of the permission check to create/update/stop streaming a message. The idea being, if you are a member of a channel already we don't need to check if you can join it AGAIN.

We also have `Chat::AutoRemove::HandleCategoryUpdated` which will deal with permissions change so it's simpler and less prone to error to consider the membership as the only source of truth.
2024-05-07 15:17:42 +02:00