Commit Graph

50334 Commits

Author SHA1 Message Date
dependabot[bot] 6a4666456e
Build(deps-dev): Bump node-fetch from 3.3.1 to 3.3.2 in /app/assets/javascripts (#22792)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v3.3.1...v3.3.2)

---
updated-dependencies:
- dependency-name: node-fetch
  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-07-26 09:21:25 +08:00
dependabot[bot] 0354370937
Build(deps-dev): Bump rubocop from 1.54.2 to 1.55.0 (#22790)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.54.2 to 1.55.0.
- [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.54.2...v1.55.0)

---
updated-dependencies:
- dependency-name: rubocop
  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-07-26 09:21:12 +08:00
dependabot[bot] a57254687f
Build(deps): Bump zeitwerk from 2.6.8 to 2.6.9 (#22791)
Bumps [zeitwerk](https://github.com/fxn/zeitwerk) from 2.6.8 to 2.6.9.
- [Changelog](https://github.com/fxn/zeitwerk/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fxn/zeitwerk/compare/v2.6.8...v2.6.9)

---
updated-dependencies:
- dependency-name: zeitwerk
  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>
2023-07-26 09:20:59 +08:00
Krzysztof Kotlarek 85e2f67367
FEATURE: API to set combined/separated sidebar mode. (#22753)
New API to change sidebar mode. We defined two:
Separated - only sections belonging to specific panel are displayed, and buttons to switch the panel are available as well.
Combined - all sections are displayed together and switch panel buttons are not visible.

In addition, as a part of refactoring, a new service called SidebarState was introduced.
2023-07-26 10:15:56 +10:00
Jordan Vidrine 5d1c1e5f62
prettier (#22786) 2023-07-25 16:19:07 -05:00
Isaac Janzen 0db03b684d
DEV: Convert `delete-posts-confirmation` modal to component-based API (#22700) 2023-07-25 16:11:32 -05:00
Penar Musaraj c6dca50ba4
UX: Remove ring from avatar for a new user (#22780) 2023-07-25 14:49:44 -04:00
Mark VanLandingham b91228d6c2
FIX: Looping attempt to reconnect in network connectivity service (#22783) 2023-07-25 11:57:28 -05:00
Natalie Tay 1ab1116cda
FIX: Disable the previous revision button if it is the last revision (#22784)
We introduced a tiny bug #22522.

When viewing the last revision of a post, we need to disable the  button. This fixes the issue.
2023-07-26 00:44:57 +08:00
Discourse Translator Bot ad9ad55870
Update translations (#22664) 2023-07-25 17:57:48 +02:00
Penar Musaraj f5e8e737ad
UX: Compact option for multi-selects (#22239)
Adds an alternative to the default multi select item, better suited for quickly adding/removing tags.
2023-07-25 11:00:02 -04:00
Penar Musaraj 4e5756e3ae
FIX: Handle empty directory columns in /u route (#22747)
The `/u` route was broken when there were no directory columns because
its order parameter relied on the first column's name. This commit adds
a `likes_received` as the default order when there are no columns, which
results in a list of users being output without any additional columns.

For this very edge case, that's better than a JS error.
2023-07-25 10:58:43 -04:00
David Taylor 00903f6b11
DEV: Support version operators in .discourse-compatibility (#22714)
This adds support for the `<=` and `<` version operators in `.discourse-compatibility` files. This allows for more flexibility (e.g. targeting the entire 3.1.x stable release via `< 3.2.0.beta1`), and should also make compatibility files to be more readable.

If an operator is not specified we default to `<=`, which matches the old behavior.
2023-07-25 14:04:39 +01:00
David Taylor 42a78bb4ad
UX: Hide header in dismiss modal (#22777)
The header was accidentally introduced during the refactoring in d8a87792af
2023-07-25 13:51:38 +01:00
Jarek Radosz 49fc775fad
FIX: Fast-edit shortcuts got lost in bdd97ff (#22762) 2023-07-25 14:45:59 +02:00
David Battersby f7353e7bfa
FIX: Prevent lightbox from loading onebox embed icons in chat uploads (#22776)
Sharing a link in chat will create a onebox embed with a source that includes a site icon and title.

This change prevents loading the site icon into lightbox.
2023-07-25 15:56:26 +08:00
David Battersby d11f02c03a
FIX: make document overflow hidden on both axis when lightbox is open (#22775)
Fixes issue with scrolling background when lightbox is opened on mobile.

Since we rely on swiping for navigating lightbox galleries on mobile, we want to disable document scrolling.
2023-07-25 15:27:32 +08:00
Natalie Tay 72bc3ae9ce
DEV: Add some description to help with understanding flakey test failures (#22772) 2023-07-25 15:14:08 +08:00
Ted Johansson f380643528
DEV: Ensure don't feed the trolls feature considers active flags only (#22774)
We recently added a "don't feed the trolls" feature which warns you about interacting with posts that have been flagged and are pending review. The problem is the warning persists even if an admin reviews the post and rejects the flag.

After this change we only consider active flags when deciding whether to show the warning or not.
2023-07-25 15:12:22 +08:00
Ted Johansson f1a43f2319
DEV: Handle SSL errors in push notification pusher (#22771)
We're seeing unhandled errors in production when web push notifications are failing with an SSL error. This is happening for a few users, but generating a large amount of log noise due to the sheer number of notifications.

This adds handling of SSL errors in two places:

1. In FinalDestination::HTTP, this is handled the same as a timeout error, and gives a chance to recover.
2. In PushNotificationPusher. This will cause the notification to retry a number of times, and if it keeps failing, disable push notifications for the user. (Existing behaviour.)

I wanted to wrap the SSL error in e.g. WebPush::RequestError, but the gem doesn't have request error handling, so didn't want to have the freedom patch diverge from the gem as well. Instead just propagating the raw SSL error.
2023-07-25 15:01:02 +08:00
Alan Guo Xiang Tan 752bb29415
FIX: Managing sidebar custom sections not working on subfolder (#22773)
Why this change?

We were verifying that a url for a section link in a custom sidebar
section is valid by passing the url string to `Router#recognize`.
If a `rootURL` has been set on the router, the url string that is passed
to `Router#recognize` has to start with the `rootURL`.

This commit fixes the problem by ensuring that `RouteInfoHelper` adds
the application subfolder path before calling `Router#recognize` on the
url string.
2023-07-25 13:57:49 +08:00
Alan Guo Xiang Tan fe1034e89c
FIX: Loading more tags in edit nav menu tags modal not working (#22770)
Why this change?

When setting up the `IntersectionObserver`, we did not account for the
top margin and padding causing no intersection event to fire when the
last tag is load into view. This commits fixes the problem by setting a
bottom margin using the `rootMargin` option when setting up the
`IntersectionObserver`.

This commit also improves the test coverage surrounding the loading of
more tags.
2023-07-25 13:44:25 +08:00
dependabot[bot] 25a948c892
Build(deps): Bump optimist from 3.0.1 to 3.1.0 (#22769)
Bumps [optimist](https://github.com/ManageIQ/optimist) from 3.0.1 to 3.1.0.
- [Changelog](https://github.com/ManageIQ/optimist/blob/master/History.txt)
- [Commits](https://github.com/ManageIQ/optimist/compare/v3.0.1...v3.1.0)

---
updated-dependencies:
- dependency-name: optimist
  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-07-25 10:31:50 +08:00
Ted Johansson 513a026cb2
DEV: Consolidate ignore user modals (#22754)
We recently replaced another ignore user modal with a Glimmer and DModal based component. This change makes use of that same component in the user card ignore modal by adding an enableSelection flag.
2023-07-25 09:04:28 +08:00
dependabot[bot] 832369942a
Build(deps): Bump a11y-dialog from 7.5.2 to 8.0.0 in /app/assets/javascripts (#22751)
* Build(deps): Bump a11y-dialog in /app/assets/javascripts

Bumps [a11y-dialog](https://github.com/KittyGiraudel/a11y-dialog) from 7.5.2 to 8.0.0.
- [Release notes](https://github.com/KittyGiraudel/a11y-dialog/releases)
- [Commits](https://github.com/KittyGiraudel/a11y-dialog/compare/7.5.2...8.0.0)

---
updated-dependencies:
- dependency-name: a11y-dialog
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Fix failing test after upgrade

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2023-07-25 06:43:02 +08:00
Kris ba91309cb8
UX: fix bookmark modal footer layout (#22766) 2023-07-25 06:42:29 +08:00
Canapin e503a4fc37
DEV: add activate/deactivate user endpoints to API docs (#22716)
* DEV: add activate/deactivate user endpoints to API docs

* Update spec/requests/api/users_spec.rb

---------

Co-authored-by: Blake Erickson <o.blakeerickson@gmail.com>
2023-07-24 11:45:04 -06:00
Roman Rizzi 3389b3eeb0
FIX: Use base 10 when gettings allowed group IDs from settings. (#22761)
Same as discourse/discourse-ai#113
2023-07-24 12:05:04 -03:00
Jarek Radosz 320f271d35
DEV: Convert d-tooltip to gjs (#22760)
* Fix the usage of component args (this.args and this.attrs in an ember component? :P)
* Don't use an internal Ember API
* Glimmer! And GJS!
2023-07-24 16:43:00 +02:00
Jarek Radosz 6725a1d7bd
FIX: Restore the unconditional yield in d-button (#22759)
Fixes bootstrap button tooltips
2023-07-24 15:15:03 +02:00
chapoi 5a36abd073
UX: category hashtag colors order fix (#22758)
* UX: revert gradient of category hashtag colours

* tests
2023-07-24 14:36:56 +02:00
David Battersby d8a87792af
DEV: Migrate Discard Draft to new Modal API (#22755)
Migrate discard draft to new modal API.
2023-07-24 19:48:12 +08:00
David Taylor 21dad02503
FIX: Correct router service call from some admin controllers (#22757)
72edb727 updated these to point to the router service, but the method name also needed to be changed from replaceRoute -> replaceWith
2023-07-24 12:32:17 +01:00
David Taylor a5fa24d876
DEV: Correct typo in d-modal-body (#22756)
Interestingly, this missing parenthesis was silently repaired under Chrome/Firefox, but seems to have caused some issues on other browsers.

https://meta.discourse.org/t/272496
2023-07-24 12:28:20 +01:00
Loïc Guitaut 5d2ec6461d DEV: Refactor a little chat uploads
This is extracted from #22390.

This patch simplifies a little how we handle uploads in chat, relying on
ActiveRecord mechanisms instead of calling custom methods.

This also makes `Chat::Message#validate_message` a “real” AR validation,
meaning it will run automatically when `#valid?` is called.
2023-07-24 11:13:57 +02:00
Ted Johansson 0db98e9d86
DEV: Remove deprecated ascending param from AdminUserIndexQuery (#22741)
The parameter ascending was deprecated (replaced by asc) and marked for deletion in 2.9. This PR removes it. Since the resulting code was a simple one-liner, the method body was inlined instead.
2023-07-24 09:37:18 +08:00
Alan Guo Xiang Tan 7a790a5f4c
UX: Display tag's description as title in navigation menu (#22710)
Why this change?

We're already displaying a category's description as the title attribute
on the category section link. We should do the same for tags as well.
2023-07-24 08:07:37 +08:00
dependabot[bot] e19316aebf
Build(deps-dev): Bump terser in /app/assets/javascripts (#22752)
Bumps [terser](https://github.com/terser/terser) from 5.19.1 to 5.19.2.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.19.1...v5.19.2)

---
updated-dependencies:
- dependency-name: terser
  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-07-24 00:41:31 +02:00
dependabot[bot] 0c822c8c87
Build(deps-dev): Bump sass in /app/assets/javascripts (#22750)
Bumps [sass](https://github.com/sass/dart-sass) from 1.64.0 to 1.64.1.
- [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.64.0...1.64.1)

---
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-07-24 00:32:43 +02:00
dependabot[bot] 309e752255
Build(deps): Bump sass-embedded from 1.64.0 to 1.64.1 (#22749)
Bumps [sass-embedded](https://github.com/ntkme/sass-embedded-host-ruby) from 1.64.0 to 1.64.1.
- [Commits](https://github.com/ntkme/sass-embedded-host-ruby/compare/v1.64.0...v1.64.1)

---
updated-dependencies:
- dependency-name: sass-embedded
  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>
2023-07-24 00:23:57 +02:00
Olivia-Hou999 31e2a0027e
Update INSTALL-cloud.md (#22739) 2023-07-23 17:07:36 +10:00
Emmett Ling 978d52841a
FEATURE: Implement SiteSetting to Allow Anonymous Likes (#22131)
Allow anonymous users (logged-in, but set to anonymous posting) to like posts

---------

Co-authored-by: Emmett Ling <eling@zendesk.com>
Co-authored-by: Nat <natalie.tay@discourse.org>
2023-07-21 21:21:07 +08:00
Jarek Radosz 8ffc274438
DEV: Remove bulk-actions-buttons template (#22742)
No longer used
2023-07-21 13:45:41 +02:00
Kelv 2968fb6a5c
FIX: Render user profile trust level name for TL0 (#22740)
* Why was this change necessary?
The current logic in the user.hbs template file does not render the
trust level element for the user's info panel when the user is TL0,
because 0 is treated as falsey in the `if` conditional block.

Ref: https://meta.discourse.org/t/tl0-not-displayed-on-users-profile-pages/271779/10

* How does it address the problem?

This PR adds a predicate helper method local to the user controller that
includes an additional check which returns true if the trust_level of
the user is 0 on top of the existing logic. This allows TL0 users to
have their trust level rendered correctly in their profile's info panel.
2023-07-21 15:16:34 +08:00
Alan Guo Xiang Tan 384068f4c7
DEV: Remove webrick dependency which we no longer need (#22738)
The `discourse-prometheus` plugin has since specificed the depedency on
webrick in the plugin so we no longer need to carry this in core.

See c4b675f0fe
2023-07-21 13:12:32 +08:00
David Battersby 351e8e2359
FIX: capture click target in lightbox click handler (#22732)
In Safari, clicking any image in a lightbox gallery results in the first image loading (instead of the clicked image).

Previously we relied on document.activeElement to determine which lightbox image was clicked. However in Chrome the active element is the lightbox selector (a.lightbox), whereas in Safari the active element defaults to the body tag.

Currently the startingIndex that is calculated within processHTML() is used by lightbox to determine which image to load first. The starting index is currently achieved by checking each lightbox element within the gallery against the active element.

To fix this issue we can use the event.target to get the clicked image, then use the closest selector and pass that into the function to do the matching and return the correct startingIndex.
2023-07-21 12:28:37 +08:00
Ted Johansson a0ad7d0a04
DEV: Remove deprecated arguments to Plugin::Instande#add_api_parameter_route (#22736)
We deprecated the keywords method, route, and format (replaced with methods, actions, and formats respectively) as parameters to Plugin::Instance#add_api_parameter_route, marked for removal in 2.7. This PR deletes them.
2023-07-21 12:22:33 +08:00
Ted Johansson a9a568d112
DEV: Remove warning for discontinued site_setting_saved event (#22735)
We used to have a deprecation warning here for the now defunct site_setting_saved event, marked for removal in 2.4. This PR deletes it.
2023-07-21 12:22:18 +08:00
Ted Johansson 46f21104f4
FIX: Inline deprecated settings in migration file (#22737)
After deleting SiteSetting::ALLOWLIST_DEPRECATED_SITE_SETTINGS, we found out this was referenced in a migration file. This PR inlines the constant into the migration file to prevent it from erroring out.
2023-07-21 12:22:00 +08:00
Alan Guo Xiang Tan 1f2213414a
DEV: Remove redundant line of code (#22734)
No need for `limit(1)` when we are already calling `first`
2023-07-21 11:50:07 +08:00