Commit Graph

48370 Commits

Author SHA1 Message Date
Alan Guo Xiang Tan
500d0f6daf
DEV: Allow webmock to intercept FinalDestination::HTTP requests (#20575) 2023-03-08 10:40:01 +08:00
Martin Brennan
a252022117
DEV: Fix broken plugin specs because of bookmarkable changes (#20574) 2023-03-08 10:39:51 +08:00
Alan Guo Xiang Tan
b5cd22edb6
DEV: Introduce stub_ip_lookup spec helper (#20571) 2023-03-08 09:28:09 +08:00
Sam
3f5fa4eb09
DEV: avoid mocking FinalDestination (#20570) 2023-03-08 09:09:18 +08:00
Krzysztof Kotlarek
f2476d4b80
FIX: class for section link when name has space (#20569)
Sidebar section link has class name based on link title. Title can contain spaces, therefore they should be replaced.
2023-03-08 12:07:03 +11:00
Martin Brennan
360d0dde65
DEV: Change Bookmarkable registration to DiscoursePluginRegistry (#20556)
Similar spirit to e195e6f614,
this moves the Bookmarkable registration to DiscoursePluginRegistry
so plugins which are not enabled do not register additional
bookmarkable classes.
2023-03-08 10:39:12 +10:00
Krzysztof Kotlarek
1c881c1037
FIX: anonymous FAQ link to external URL (#20568)
When FAQ url is set to external resource, site is failing for anonymous user.
2023-03-08 11:21:02 +11:00
Alan Guo Xiang Tan
5e0c95ed83
PERF: Remove request for PM topic tracking state initiated from sidebar (#20554)
What is the problem?

When constructing the "Messages" section in Sidebar, we call
startTracking() on the pm-topic-tracking-state service in order to
get the counts for new/unread for the private message inboxes for each
user. However, this is unnecessary because the inboxes are in a
collapsed state by default in the sidebar and are only expanded when the
current route correspond to the inbox's route. Therefore, we can avoid
calling startTracking() on the pm-topic-tracking-state service until
an inbox's route is loaded. This allows us to cut out one extra request
to the server on page load and defer it until it is necessarily.
2023-03-08 07:07:23 +08:00
Joffrey JAFFEUX
2781264711
PERF: various perf improvements of chat-live-pane (#20563) 2023-03-07 18:55:05 +01:00
Andrei Prigorshnev
fa543cda06
DEV: Always create chat mention records (#20470)
Before this commit, we created a chat mention record only in case we wanted to send a notification about that mention to the user. Notifications were the only use case for the chat_mention db table. Now we want to use that table for other features, so we have to always create a chat_mention record.
2023-03-07 19:07:11 +04:00
Discourse Translator Bot
1f88354c5e
Update translations (#20559) 2023-03-07 14:58:31 +01:00
Ted Johansson
fdcb429145
FIX: Handle null values in category settings relative time pickers (#20552)
As reported on Meta, the relative time pickers for configuring slow-mode and auto-close durations in category settings are initially showing a "mins" option, which then disappears after you select any other timescale.

Our `RelativeTimePicker` component wasn't equipped to handle `null` values as the initial input. This caused it to go into a code path that set the selected timescale to "mins", even if that is not an allowed option.

There are two things being done here:

1. Add support for `null` input values to `RelativeTimePicker`. This fixes the auto-close setting.
2. Allow minutes for the slow-mode setting. (The user in Meta mentioned they usually set 15-30 minutes to cool down hot topics.
2023-03-07 11:05:13 +08:00
Krzysztof Kotlarek
a16ea24461
FEATURE: allow external links in custom sidebar sections (#20503)
Originally, only Discourse site links were available. After feedback, it was decided to extend this feature to external URLs.

/t/93491
2023-03-07 11:47:18 +11:00
Blake Erickson
b4528b9e27
FIX: Trim whitespace on email field for invites (#20547)
If the whitespace isn't trimmed from the input field the email is
considered invalid, and the button remains greyed out. We should handle
removing any trailing whitespace and not rely on the user trying to see
it themselves.
2023-03-06 17:39:59 -07:00
Keegan George
15cf62411a
DEV: Add /theme-qunit to skipped mini profiler paths (#20551) 2023-03-06 14:56:27 -08:00
Joffrey JAFFEUX
c52570ddc4
FIX: prevents mouseover to gain focus on sk row (#20550)
This was causing unattended effects on other elements. eg: the select-kit header input could lose focus when the list filtered would change size and cause the cursor to be positioned over a row.
2023-03-07 09:27:38 +11:00
dependabot[bot]
5f57b4b5aa
Build(deps): Bump rubocop from 1.47.0 to 1.48.0 (#20548)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-07 06:26:25 +08:00
Kris
6fc2cded55
UX: fix width for top embedded reply, post notice (#20546) 2023-03-06 11:24:49 -05:00
Joffrey JAFFEUX
e27c045f75
PERF: reduce height of the load more past message area (#20545)
On fast networks it could end up in infinite loop until all messages had been loaded.
2023-03-06 17:23:32 +01:00
Penar Musaraj
420214fc82
FIX: Deleting security keys was not working (#20427)
Bug was introduced in e313190fdb. There is
a workaround, using the trash icon in the edit modal, but that UI is
quite confusing to users.
2023-03-06 10:51:39 -05:00
Joffrey JAFFEUX
b5e736504a
PERF: applies optimisations on chat-live pane (#20532)
- group writes when computing separators positions
- shows skeleton only on initial load
- forces date separator to be pinned when first message to prevent a pinned - not pinned - pinned sequence when loading more in past
- relies on `message.visible` property instead of checking `isElementInViewport`
- attempts to load next/prev messages earlier
- do not scroll to on fetch more
- hides `last visit` text while pinned
2023-03-06 16:42:11 +01:00
Kris
d28390054e
UX: style improvements to new user tables (#20530) 2023-03-06 09:30:48 -05:00
David Taylor
62dc37ac35
DEV: Improve mini_profiler skipped paths (#20544)
- Remove no-longer-used `commits-widget` and `site_customizations` paths
- Add `/presence/`
- Move from regex to strings. The unanchored regexes were causing unexpected behaviour (e.g. if a topic had the word `assets` in its slug, it would be skipped). When passed strings, mini-profiler uses `String#starts_with?` for comparison
- Add `Discourse.base_path` to ensure proper functionality in subfolder environments
2023-03-06 11:39:15 +00:00
David Taylor
41f933ce89
PERF: Skip metadata routes for mini_profiler (#20543)
Mini-profiler causes routes to become uncacheable. When using mini_profiler in production, the lack of cache on these routes can have a noticeable impact on performance/rate-limiting.
2023-03-06 11:08:32 +00:00
Joffrey JAFFEUX
9e49abc0b9
FIX: do not refresh when accessing loaded reply (#20526)
Note this test my prove to be flakey, so I might have to remove it or find a different solution. It's extremely complicated to test for something which shouldn't appear in a period of time and is not a present at T=0
2023-03-06 10:09:21 +01:00
chapoi
28f8bdf91d
UX: remove visual chat msg staging effect (#20542) 2023-03-06 10:07:46 +01:00
Osama Sayegh
3f908c047d
FIX: Use the default value correctly for theme settings of type uploads (#20541)
When a theme setting of type `upload` has a default upload, it should return the URL of the specified default upload until a custom upload is used for the setting. However, currently this isn't the case and we get null instead of the default upload URL.

The reason for this is because the `super` method of `#value` already returns the default upload URL (if there's one), so we can't pass that to `cdn_url` which expects an upload ID:

c961dcc757/lib/theme_settings_manager.rb (L212)

This commit fixes the bug by skipping the call to `cdn_url` when we fallback to the default upload for the setting value.
2023-03-06 11:41:47 +03:00
Sam
c961dcc757
FIX: leaking callbacks to synchronize state (#20540)
Every time we created a topic list we would leak a state change callback

This happens on any topic list -> topic -> topic list sequence

This can cause corruption of tracking state and memory bloating given that
all information may be sent to the sync function.
2023-03-06 12:52:24 +08:00
dependabot[bot]
bfd4bfb824
Build(deps): Bump ruby-progressbar from 1.12.0 to 1.13.0 (#20533)
Bumps [ruby-progressbar](https://github.com/jfelchner/ruby-progressbar) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/jfelchner/ruby-progressbar/releases)
- [Changelog](https://github.com/jfelchner/ruby-progressbar/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jfelchner/ruby-progressbar/compare/releases/v1.12.0...releases/v1.13.0)

---
updated-dependencies:
- dependency-name: ruby-progressbar
  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-03-06 11:52:37 +08:00
dependabot[bot]
36c8148377
Build(deps): Bump rack from 2.2.6.2 to 2.2.6.3 (#20535)
Bumps [rack](https://github.com/rack/rack) from 2.2.6.2 to 2.2.6.3.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/v2.2.6.2...v2.2.6.3)

---
updated-dependencies:
- dependency-name: rack
  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-03-06 11:52:15 +08:00
dependabot[bot]
a4e27da9e6
Build(deps): Bump sorbet-runtime from 0.5.10693 to 0.5.10696 (#20534)
Bumps [sorbet-runtime](https://github.com/sorbet/sorbet) from 0.5.10693 to 0.5.10696.
- [Release notes](https://github.com/sorbet/sorbet/releases)
- [Commits](https://github.com/sorbet/sorbet/commits)

---
updated-dependencies:
- dependency-name: sorbet-runtime
  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-03-06 11:51:57 +08:00
dependabot[bot]
a89ed6b14a
Build(deps): Bump faraday-retry from 2.0.0 to 2.1.0 (#20536)
Bumps [faraday-retry](https://github.com/lostisland/faraday-retry) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/lostisland/faraday-retry/releases)
- [Changelog](https://github.com/lostisland/faraday-retry/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lostisland/faraday-retry/compare/v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: faraday-retry
  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-03-06 11:51:33 +08:00
dependabot[bot]
d694cc8109
Build(deps-dev): Bump syntax_tree from 6.0.1 to 6.0.2 (#20537)
Bumps [syntax_tree](https://github.com/kddnewton/syntax_tree) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/kddnewton/syntax_tree/releases)
- [Changelog](https://github.com/ruby-syntax-tree/syntax_tree/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kddnewton/syntax_tree/compare/v6.0.1...v6.0.2)

---
updated-dependencies:
- dependency-name: syntax_tree
  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-03-06 11:49:15 +08:00
dependabot[bot]
9a58a97c45
Build(deps-dev): Bump minitest from 5.17.0 to 5.18.0 (#20538)
Bumps [minitest](https://github.com/seattlerb/minitest) from 5.17.0 to 5.18.0.
- [Release notes](https://github.com/seattlerb/minitest/releases)
- [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc)
- [Commits](https://github.com/seattlerb/minitest/compare/v5.17.0...v5.18.0)

---
updated-dependencies:
- dependency-name: minitest
  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>
2023-03-06 11:49:01 +08:00
dependabot[bot]
08b2da4c1f
Build(deps): Bump msgpack from 1.6.0 to 1.6.1 (#20539)
Bumps [msgpack](https://github.com/msgpack/msgpack-ruby) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/msgpack/msgpack-ruby/releases)
- [Changelog](https://github.com/msgpack/msgpack-ruby/blob/master/ChangeLog)
- [Commits](https://github.com/msgpack/msgpack-ruby/commits)

---
updated-dependencies:
- dependency-name: msgpack
  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-03-06 11:48:41 +08:00
Alan Guo Xiang Tan
e3977f84a3
FIX: Incorrect topic tracking state count when a new category is created (#20506)
What is the problem?

We have a hidden site setting `show_category_definitions_in_topic_lists`
which is set to false by default. What this means is that category
definition topics are not shown in the topic list by default. Only the
category definition topic for the category being viewed will be shown.
However, we have a bug where we would show that a category has new
topics when a new child category along with its category definition
topic is created even though the topic list does not list the child
category's category definition topic.

What is the fix here?

This commit fixes the problem by shipping down an additional
`is_category_topic` attribute in `TopicTrackingStateItemSerializer` when
the `show_category_definitions_in_topic_lists` site setting has been set
to false. With the new attribute, we can then exclude counting child
categories' category definition topics when counting new and unread
counts for a category.
2023-03-06 10:13:10 +08:00
Blake Erickson
2fcfaccb5c
FIX: The default inbox label if username is not all lower cased in the url (#20531) 2023-03-05 10:04:56 -07:00
Joffrey JAFFEUX
1c9f300896
DEV: removes dead code (#20529) 2023-03-03 22:07:40 +01:00
Kris
26f77f03d5
UX: remove old group directory template, CSS (#20528) 2023-03-03 15:25:35 -05:00
Joffrey JAFFEUX
cdcd20fe1e
FIX: prevents duplicate reactions (#20527)
This was possible due to specific events which are hard to represent in a test. The provided test is as close as possible to what was happening in production: a message bus event was played on a channel which has just loaded its state with the existing reaction.
2023-03-03 20:29:24 +01:00
Joffrey JAFFEUX
0dc9c6c96d
FIX: prevents exception on required login sites with chat (#20525)
On require login sites, the `site` is not setup and as a result `hashtag_configurations` was blank and causing an error when attempting to access `["chat-composer"]` on it.
2023-03-03 17:40:23 +01:00
Joffrey JAFFEUX
5d6e8fdff0
UX: makes last visit stand out less (#20524) 2023-03-03 15:55:22 +01:00
Osama Sayegh
aad0d5fcfb
DEV: Unify behavior of category and tag links in sidebar in new new view experiment (#20488)
Follow up to a509441148

This commit makes category and tag link in the sidebar consistent with the Everything link when the new New view experiment is enabled. In particular:

1. Category and tag links navigate to the per-category (or tag) `/new` view if there's at least one topic, and to `/latest` if there are no topics
2. Category and tag links only show the count of topics in `/new` without text
3. The Everything link navigates to the global `/new` view if there's at least one topic there, and to `/latest` if there are no topics in `/new`.

Internal topic: t/77234.
2023-03-03 17:52:02 +03:00
Joffrey JAFFEUX
6b0aeced7e
DEV: rework the chat-live-pane (#20519)
This PR is introducing glimmer usage in the chat-live-pane, for components but also for models. RestModel usage has been dropped in favor of native classes.

Other changes/additions in this PR:

sticky dates, scrolling will now keep the date separator of the current section at the top of the screen
better unread management, marking a channel as unread will correctly mark the correct message and not mark the whole channel as read. Tracking state will also now correctly return unread count and unread mentions.
adds an animation on bottom arrow
better scrolling behavior, we should now always correctly keep the scroll position while loading more
reactions are now more reactive, and will update their tooltip without needed to close/reopen it
skeleton has been improved with placeholder images and reactions
when making a reaction on the desktop message actions, the menu won't move anymore
simplify logic and stop maintaining a list of unloaded messages
2023-03-03 13:09:25 +01:00
David Taylor
e08a0b509d
DEV: Support @debounce decorator in native class syntax (#20521)
The implementation previously generated a descriptor with an `initializer()`, and bound the function to the `this` context of the initializer. In native class syntax, the initializer of a descriptor is only called once, with a `this` context of the constructor, not the instance.

This commit updates the implementation so that it generates the bound function on-demand using a getter. This is the same strategy employed by ember's built-in `@action` decorator.

Unfortunately, this use of a getter means that the `@observes` decorator does not support being directly chained to `@debounce`. It throws the error "`observer must be provided a function or an observer definition`". The workaround is to put the observer on its own function, which then calls the debounced function. Given that we're aiming to reduce our usage of `@observes`, we've accepted the need for this workaround rather than spending the time to patch the implementation of `@observes`.
2023-03-03 11:48:58 +00:00
Meghna
36ad653fa9
UX: fix banner overlapping issue at breakpoint of around 1260px width (#20463)
There seems to be a breakpoint around 1260px width. When the window is narrower than that breakpoint, the “new or updated topics” banner seems to overlap the list below it.
2023-03-03 11:16:25 +05:30
Alan Guo Xiang Tan
66c50547b4
DEV: Experimental /filter route to filter through topics (#20494)
This commit introduces an experimental `/filter` route which allows a
user to input a query string to filter through topics.

Internal Ref: /t/92833
2023-03-03 09:46:21 +08:00
Kris
e022a7adec
UX: update user chat preference link for new nav (#20518) 2023-03-03 06:50:47 +08:00
Alan Guo Xiang Tan
990b710ade
DEV: Add ruby_lsp gem to development (#20517)
In order to use the ruby-lsp vscode extension, the ruby_lsp gem needs to
be added to the project's Gemfile. That may soon change with
https://github.com/Shopify/vscode-ruby-lsp/pull/419 but this will do for
now.
2023-03-03 06:45:52 +08:00
Kris
fac78413c8
REFACTOR: user directories without <table>, second attempt (#20515) 2023-03-02 15:10:19 -05:00