Commit Graph

50858 Commits

Author SHA1 Message Date
Roman Rizzi
7d0e2b9e7b
FIX: Keep track of suggestion updates during scrolling and navigation. (#23190)
This PR changes how we track which lists are available for a topic and how we decide which is the active one. The new approach centralizes everything in the service, and exposes functions for adding/removing a list, which each calls via `did-insert/will-destroy` modifiers.

It makes it much easier to track and update state when navigated to another topic or PM, ensuring things get updated correctly.
2023-08-22 14:10:15 -03:00
Andrei Prigorshnev
a3410e7dc3
UX: update outdated description of chat messages export (#23191)
We removed all restrictions from the exporter of chat messages in cd45f33, but 
forgot to update the description on the page /admin/plugins/chat.
2023-08-22 20:45:50 +04:00
Andrei Prigorshnev
2d16446078
FIX: revert previously removed mentions transformation on the client (#23084)
This partially reverts 2ecc829.

The problem is that if we don't transform mentions right away, 
there is a noticeable lag before a mention gets fully rendered, 
while with the transformation, everything is super smooth.

I'm reverting that change only for mentions. Another part was about 
category hashtags, but unfortunately they lag both with and without 
the transformation. We need to address them separately.
2023-08-22 20:36:38 +04:00
Joffrey JAFFEUX
0e00784218
UX: do not show user tab preference when disabled (#23188)
Prior to this fix we would only check if the user is allowed to chat and not if chat is enabled.
2023-08-22 18:22:25 +02:00
David Taylor
b5b4a3f233
UX: Fix positioning of mobile show-more following 71ff3417 (#23189)
71ff3417 removed the mobile-specific template for discovery/topics. It was noted that this would introduce an additional `<div class='show-more'>` wrapper around the new topic indicator on mobile, but I didn't realise that it would cause positioning problems on mobile.

This commit moves the desktop-specific CSS into the desktop SCSS file so that it does not apply to mobile.
2023-08-22 17:16:12 +01:00
Jarek Radosz
3a37ecfccd
DEV: Remove unused files (#23185)
I believe those were supposed to be deleted in fe294ab1a77c1026b6996550eb8c36b6f07e1b73?
2023-08-22 16:50:44 +02:00
David Taylor
71ff3417a6
DEV: Remove dedicated mobile template for discovery/topics (#23179)
Separate mobile templates are a pattern we're moving away from. They are not supported by Ember, and make things more difficult to develop/test. The differences between the mobile and desktop templates for `discovery/topics` are very minimal, so they can be easily integrated.

The only feature missing from the main template was the new 'list header controls' UI. This commit introduces that to the main template inside an `mobileView` conditional.

Key changes in behavior, many of which could be considered bug fixes, are:

- Mobile will now include 'redirected reason'
- Mobile will now include shared drafts
- Mobile will now include before-topic-list and after-topic-list Plugin Outlets
- Mobile will now have a `<div class="show-more">` wrapper around the 'new or updated' UI, to match desktop. This does not seem to cause any visual change.

Mobile-specific template overrides of `discovery/topics` will continue to function as before - this should not be a breaking change for any themes/plugins.

Mobile-specific templates for the topic list and topic-list-item remain in place.
2023-08-22 15:42:51 +01:00
Jarek Radosz
fd8fdb060f
DEV: Clean up extraneous helper parens (#23186) 2023-08-22 16:42:22 +02:00
Joffrey JAFFEUX
2d8a38f883
DEV: removes deprecated code (#23183) 2023-08-22 15:53:37 +02:00
Joffrey JAFFEUX
0afddca0b9
FIX: displays popup error for any error (#23184)
In the past we were only intercepting 429 and 404; it's probably better to surface any error.

There are already tests for the 404 and 429, I consider them enough for now.
2023-08-22 15:53:22 +02:00
Joffrey JAFFEUX
89259205d6
FIX: do not delete empty message with uploads (#23177)
Prior to this fix when editing a message containing only upload, if we would save it, it would delete it by considering it empty.
2023-08-22 15:21:21 +02:00
Joffrey JAFFEUX
687c6c7515
FIX: correctly display max users message error (#23178) 2023-08-22 12:42:35 +02:00
dependabot[bot]
539fa5bf82
Build(deps-dev): Bump rubocop from 1.56.0 to 1.56.1 (#23175)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.56.0 to 1.56.1.
- [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.56.0...v1.56.1)

---
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>
2023-08-22 11:32:52 +02:00
Blake Erickson
26b3c63c74
DEV: Tighten up fuzzy search site setting results (#23176)
Sometimes the fuzzy search would return too many site setting results
making it hard to find what you are searching for. This change still
allows for fuzzy searching but tightens up the criteria for being a
fuzzy match.

One example is searching for 'cheer', a term associated with a plugin,
previously returned ~55 search results. With this change it will return
~13 (Actual numbers depend on how many plugins your instance has).

Another example is searching for 'digest'. Previously returned ~37
results and now will return ~14.

Follow up to: e63e193a0a

See also: https://meta.discourse.org/t/276013
2023-08-21 19:04:57 -06:00
Isaac Janzen
742d71e99c
DEV: Finalize glimmer search menu (#23174)
There was a few outstanding items that needed cleaning up.
### Make sure we don't clear the topic context prematurely
##### Before
https://github.com/discourse/discourse/assets/50783505/e92e4d6f-f42c-4357-8f13-8fa9f1024ade

_getting to zero search characters would automatically clear the search context_

##### After
https://github.com/discourse/discourse/assets/50783505/fd805dfd-576d-4e32-b6b5-5b93c25a5782

### Style fixes
##### Before
<img width="498" alt="Screenshot 2023-08-21 at 4 37 31 PM" src="https://github.com/discourse/discourse/assets/50783505/70847db1-43ec-477e-a21a-54ef2de0af42">

##### After
<img width="500" alt="Screenshot 2023-08-21 at 4 38 36 PM" src="https://github.com/discourse/discourse/assets/50783505/98cfb2e9-7c4d-44a6-bde2-53b85318fed3">

##### Before
<img width="450" alt="Screenshot 2023-08-21 at 4 33 45 PM" src="https://github.com/discourse/discourse/assets/50783505/3e057a52-5d1c-4776-93d0-a48133a722bc">

##### After
<img width="451" alt="Screenshot 2023-08-21 at 4 34 30 PM" src="https://github.com/discourse/discourse/assets/50783505/77548f6c-a9cf-4cf8-88d8-ee249736d684">

##### Before
<img width="460" alt="Screenshot 2023-08-21 at 4 31 01 PM" src="https://github.com/discourse/discourse/assets/50783505/9da57868-bc66-4d84-9108-4ae705a0562b">

##### After
<img width="456" alt="Screenshot 2023-08-21 at 4 30 52 PM" src="https://github.com/discourse/discourse/assets/50783505/f9444546-97f2-4d1a-9f78-7407f0f32ae7">
2023-08-21 17:51:11 -05:00
Isaac Janzen
3eb8046dde
DEV: Update replaceWith on Route (#23153)
# Context
This PR was originally implemented in https://github.com/discourse/discourse/pull/22645 then reverted in https://github.com/discourse/discourse/pull/22693. We protect from aborted transition when _awaiting_ on `replaceWith` by utilizing [followRedirects()](https://api.emberjs.com/ember/5.1/classes/Transition/methods/followRedirects?anchor=followRedirects)

# Description
Per https://deprecations.emberjs.com/v3.x/#toc_routing-transition-methods

We are upgrading all `this.replaceWith` calls on routes to directly call the router service (`this.router.replaceWith`)
2023-08-21 16:53:54 -05:00
Joffrey JAFFEUX
3bb2f3a604
FIX: correctly recognizes URL with subfolder (#23173)
Prior to this fix minimizing a full page chat on a subfolder install would cause the drawer to not show.
2023-08-21 22:12:05 +02:00
Blake Erickson
c3a4ce79cb
DEV: Add CSP to setting descriptions (#23172)
In an effort to aid in the searchability of Content-Security-Policy related
site settings this commit is appending "CSP" to several
`content_security_policy_` site setting descriptions.
2023-08-21 13:58:41 -06:00
Penar Musaraj
4c3ee1b211
DEV: Remove unused code (#23171)
This method slipped in by accident in 10c6b2a and is not used.
2023-08-21 15:01:05 -04:00
David Taylor
201c39e68e
DEV: Ensure plugin raw connectors are transpiled to /raw-templates (#23170)
Transpiling to `/raw-templates` is important so that they are detected by the `eager-load-raw-templates` initializer. Prior to 16c6ab86 this wasn't a problem because all connector modules were being eager-loaded. Now that connectors are lazily loaded, it's critical that `eager-load-raw-templates` does the eager loading. This problem doesn't affect themes because they compile raw templates into an iife instead of a `define()` module.

Unfortunately we don't have any way to introduce automated testing for this part of our compilation pipeline. However, discourse-calendar will begin depending on this functionality imminently, so its tests will warn us of future regressions.
2023-08-21 19:24:49 +01:00
Mark VanLandingham
730f652255
DEV: Add plugin modifier locations for user search locations (#23169) 2023-08-21 12:23:42 -05:00
Joffrey JAFFEUX
f179eef6ae
DEV: makes every spec use new messages helper (#23163)
It's been introduced months ago, but not everything was transitioned to it.
2023-08-21 16:31:58 +02:00
Joffrey JAFFEUX
932fd089c5
DEV: converts user-status modal to component (#23168) 2023-08-21 16:19:21 +02:00
David Taylor
121cd886a4
PERF: Improve rendering performance of empty PluginOutlets (#23165)
This commit introduces a 'shortcut' when rendering PluginOutlets which have no registered connectors. On my machine, this improves rendering performance of empty PluginOutlets by around 30-40% (tested by running tachometer on a `/latest` route with 600 plugin outlets).
2023-08-21 13:42:59 +01:00
Jarek Radosz
c48e29db02
DEV: Use object spread instead of Object.assign({}, …) (#23167)
Same behavior, more consistent and concise code.
2023-08-21 14:28:16 +02:00
Jarek Radosz
4a4c91b0a1
FIX: Resize-modifier event listener cleanup (#23166) 2023-08-21 14:14:52 +02:00
Natalie Tay
4702df85b2
DEV: Add composer close method to composer (#23164) 2023-08-21 18:59:15 +08:00
Ted Johansson
928a6cd143
FIX: Delete fast typer reviewable when deleting user (#23162)
In most cases, deleting a user from outside the review UI will also delete any pending reviewables for that user. This was not working in some cases, e.g. for reviewables created due to "fast typer" violations.

This was happening because UserDestroyer only automatically resolves flagged posts.

After this change, in addition to existing checks, look for ReviewablePost where the post was created by the user and reject them if present.
2023-08-21 18:03:03 +08:00
dependabot[bot]
db40941deb
Build(deps): Bump ember-cli-babel in /app/assets/javascripts (#23157)
Bumps [ember-cli-babel](https://github.com/babel/ember-cli-babel) from 7.26.11 to 8.0.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/v7.26.11...v8.0.0)

---
updated-dependencies:
- dependency-name: ember-cli-babel
  dependency-type: direct:production
  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-08-21 11:27:24 +02:00
dependabot[bot]
14ca7080d1
Build(deps): Bump puma from 6.3.0 to 6.3.1 (#23155)
Bumps [puma](https://github.com/puma/puma) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: puma
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 11:08:55 +02:00
dependabot[bot]
a7a45f4894
Build(deps-dev): Bump shoulda-matchers from 783a905 to 68f76ce (#23160)
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from `783a905` to `68f76ce`.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Commits](783a905540...68f76ce13e)

---
updated-dependencies:
- dependency-name: shoulda-matchers
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 11:05:11 +02:00
dependabot[bot]
c5c8367d9b
Build(deps): Bump sass-embedded from 1.66.0 to 1.66.1 (#23159)
Bumps [sass-embedded](https://github.com/ntkme/sass-embedded-host-ruby) from 1.66.0 to 1.66.1.
- [Commits](https://github.com/ntkme/sass-embedded-host-ruby/compare/v1.66.0...v1.66.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-08-21 11:01:54 +02:00
dependabot[bot]
54bb9da65b
Build(deps): Bump google-protobuf from 3.24.0 to 3.24.1 (#23158)
Bumps [google-protobuf](https://github.com/protocolbuffers/protobuf) from 3.24.0 to 3.24.1.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.24.0...v3.24.1)

---
updated-dependencies:
- dependency-name: google-protobuf
  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-08-21 11:01:39 +02:00
dependabot[bot]
42bcec6c79
Build(deps-dev): Bump sass in /app/assets/javascripts (#23156)
Bumps [sass](https://github.com/sass/dart-sass) from 1.66.0 to 1.66.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.66.0...1.66.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-08-21 11:01:16 +02:00
Kris
2a49757f35
UX: update /new toggle styles, class names (#23154)
* Minor style adjustments
* Removes "all" count because it's redundant to the count on New
* Updates generic class names with -- modifier to follow BEM and help avoid class name collisions
* Hides the toggle when bulk select is enabled (the UI ends up being too busy)
2023-08-21 09:34:12 +08:00
Joffrey JAFFEUX
b03c26ebf5
FIX: correctly handles mobile and default (#23152)
This commit ensures we have correct icon and title on mobile for the chat header icon.

It also fixes a bug where the site setting was not correctly used when the user has not yet set the user option.

Both cases are now correctly tested.
2023-08-18 22:32:43 +02:00
Juan David Martínez Cubillos
477a5dd371
FEATURE: Digest suppression by tags (#23089)
* FEATURE: Digest suppression by tags

* fixed stree issues

* fixed code so untagged topics are not suppressed when suppressing certain tags
2023-08-18 14:28:20 -05:00
Joffrey JAFFEUX
3d86fc1391
FIX: sets sidebar state on load (#23150)
This commit was incorrectly removed of https://github.com/discourse/discourse/pull/23078 and would set the state only on entering (or exiting) chat route. The tests were already present in the previous PR.
2023-08-18 21:08:50 +02:00
Joffrey JAFFEUX
b2b84cc957
FEATURE: implements user based sidebar mode (#23078) 2023-08-18 20:33:07 +02:00
David Taylor
82b16f4f47
DEV: Do not manipulate theme module paths at build-time (#23148)
Manipulating theme module paths means that the paths you author are not the ones used at runtime. This can lead to some very unexpected behavior and potential module name clashes. It also meant that the refactor in 16c6ab8661 was unable to correctly match up theme connector js/templates.

While this could technically be a breaking change, I think it is reasonably safe because:

1. Themes are already forced to use relative paths when referencing their own modules (since they're namespaced based on the site-specific id). The only time this might be problematic is when theme tests reference modules in the theme's main `javascripts` directory

2. For things like components/services/controllers/etc. our custom Ember resolver works backwards from the end of the path, so adding `discourse/` in the middle will not affect resolution.
2023-08-18 18:15:23 +01:00
Mark VanLandingham
291749e35b
DEV: Move PluginOutlet at bottom of TopicNavigation (#23149) 2023-08-18 11:41:09 -05:00
marstall
0dd1ee2e09
FIX: correct bulk invite expire time for DST (#23073)
This is a bug that happens only when the current date is less than 90 days from a date on which the time zone transitions into or out of Daylight Savings Time.

In these conditions, bulk invites show the time of day of their expiration as being 1 hour later than the current time.

Whereas it should match the time of day the invite was generated.

This is because the server has not been using the user's timezone in calculating the expiration time of day. This PR fixes issue by considering the user's timezone when doing the date math.

https://meta.discourse.org/t/bulk-invite-logic-to-generate-expire-date-bug/274689
2023-08-18 12:33:40 -04:00
Daniel Waterworth
91f560a521
DEV: Make every DistributedCache lazily instantiated (#23147) 2023-08-18 10:59:11 -05:00
Selase Krakani
87ebbec9b2
FIX: Pending post deletion by creator (#23130)
`ReviewableQueuedPost` got refactored a while back to use the more
appropriate `target_created_by` for the user of the post being queued
instead of `created_by`. The change was not extended to the `DELETE
/review/:id` endpoint leading to error responses for a user attempting
to deleting their own queued post.

This fix extends the `Reviewable` lookup implementation in
`ReviewablesController#destroy` and Guardian implementation to account
for this change.
2023-08-18 15:30:59 +00:00
Joffrey JAFFEUX
4661bcb5ea
FIX: correctly makes this accessible in the scope (#23146) 2023-08-18 17:20:59 +02:00
Kris
51e369a2c6
UX: update admin popular theme list (#23134) 2023-08-18 09:07:25 -04:00
Penar Musaraj
10c6b2a0c2
WIP: Rename Webauthn to DiscourseWebauthn (#23077) 2023-08-18 08:39:10 -04:00
David Taylor
16c6ab8661
DEV: Allow plugin outlets to be defined using gjs (#23142)
Previously we were discovering plugin outlets by checking first for dedicated template files, and then looking for classes to match them. This doesn't work for components which are entirely defined in JS (e.g. those authored with gjs, or those which are re-exports of a colocated component).

This commit refactors our detection logic to look for both class and template modules in a single pass. It also refactors things so that the modules themselves are required lazily when needd, rather than all being loaded during app boot.
2023-08-18 12:07:10 +01:00
Andrei Prigorshnev
052462a8f8
FIX: Don't fail when exporting chat messages from deleted channels (#23131) 2023-08-18 14:22:24 +04:00
chapoi
a2f5b1b101
UX: improved animation (#23145) 2023-08-18 11:59:54 +02:00