Commit Graph

52917 Commits

Author SHA1 Message Date
Bianca Nenciu
1403217ca4
FEATURE: Async load of category and chat hashtags (#25526)
This commit includes several changes to make hashtags work when "lazy
load categories" is enabled. The previous hashtag implementation use the
category colors CSS variables, but these are not defined when the site
setting is enabled because categories are no longer preloaded.

This commit implements two fundamental changes:

1. load colors together with the other hashtag information

2. load cooked hashtag data asynchronously

The first change is implemented by adding "colors" to the HashtagItem
model. It is a list because two colors are returned for subcategories:
the color of the parent category and subcategory.

The second change is implemented on the server-side in a new route
/hashtags/by-ids and on the client side by loading previously unseen
hashtags, generating the CSS on the fly and injecting it into the page.

There have been minimal changes outside of these two fundamental ones,
but a refactoring will be coming soon to reuse as much of the code
and maybe favor use of `style` rather than injecting CSS into the page,
which can lead to page rerenders and indefinite grow of the styles.
2024-02-12 12:07:14 +02:00
Martin Brennan
6b596151ff
DEV: Change Group.trusted_group_ids to use const (#25639)
We have AUTO_GROUPS, we can use this instead of the
hardcoded 10..19 (not even sure why it goes up to 19,
trust levels previously only went to 5 max).
2024-02-12 12:36:00 +10:00
Martin Brennan
d80345fa83
DEV: Chat hashtag test (#25638)
Followup a2a2785f0b, moving
stuff to an existing test.
2024-02-12 12:32:52 +10:00
Martin Brennan
cf4d92f686
FIX: Change max_image_megapixels logic (#25625)
This commit changes `max_image_megapixels` to be used
as is without multiplying by 2 to give extra leway.
We found in reality this was just causing confusion
for admins, especially with the already permissive
40MP default.
2024-02-12 09:56:43 +10:00
dependabot[bot]
fb83058e9d
Build(deps-dev): Bump crack from 0.4.6 to 1.0.0 (#25637) 2024-02-11 23:56:19 +01:00
Ella E
427e11b177
DEV: move the margin to 'configure more' link on the setup wizard (#25626) 2024-02-09 13:55:50 -07:00
Kris
c49eb373de
FIX: render category badge styles inline for email (#25487) 2024-02-09 15:29:11 -05:00
Bianca Nenciu
a2a2785f0b
FIX: Look up all channel hashtags (#25617) 2024-02-09 19:59:38 +02:00
Daniel Waterworth
6311a80724
FIX: Preload associations on subcategories when lazy loading categories (#25630) 2024-02-09 11:48:26 -06:00
Daniel Waterworth
250ce25ca3
DEV: Clarify site-setting category-list concurrency protection (#25614) 2024-02-09 10:14:00 -06:00
David Taylor
2af8f5708d
DEV: Convert UserStream model to native class syntax (#25629)
This commit was created with a combination of the ember-native-class-codemod and manual cleanup
2024-02-09 15:16:05 +00:00
Kris
d93debc634
A11Y: mark up custom nav section form for screen readers (#25623) 2024-02-09 08:42:28 -05:00
David Taylor
b797434376
DEV: Update nav-item model to native class syntax (#25627)
This commit was created with a combination of the ember-native-class-codemod and manual cleanup
2024-02-09 12:40:47 +00:00
David Taylor
d4b03d0ad2
DEV: Convert composer model to native class syntax (#25615)
This commit was created with a combination of the ember-native-class-codemod and manual cleanup
2024-02-09 10:43:55 +00:00
Martin Brennan
3cc73cfd1e
FIX: Always preload admin plugin list for admin in sidebar (#25606)
When we show the links to installed plugins in the admin
sidebar (for plugins that have custom admin routes) we were
previously only doing this if you opened /admin, not if you
navigated there from the main forum. We should just always
preload this data if the user is admin.

This commit also changes `admin_sidebar_enabled_groups` to
not be sent to the client as part of ongoing efforts to
not check groups on the client, since not all a user's groups
may be serialized.
2024-02-09 12:52:22 +10:00
Kris
110d544225
UX: fix post count position on avatars in topic map (#25622) 2024-02-08 17:07:38 -05:00
Alan Guo Xiang Tan
0b39ee87f0
DEV: Fix checkout time not properly enabled on CI (#25621)
Follow-up to 96ae5c395f
2024-02-09 06:02:42 +08:00
dependabot[bot]
4fd93ad4b0
Build(deps-dev): Bump minitest from 5.22.1 to 5.22.2 (#25620)
Bumps [minitest](https://github.com/minitest/minitest) from 5.22.1 to 5.22.2.
- [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc)
- [Commits](https://github.com/minitest/minitest/compare/v5.22.1...v5.22.2)

---
updated-dependencies:
- dependency-name: minitest
  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-02-09 08:34:01 +11:00
Mark VanLandingham
797dffd7cc
DEV: Add PluginOutlet after user notifications filter 2024-02-08 14:58:11 -06:00
Sam
c8410537c1
FIX: hot not adding recently bumped topics (#25619)
When we insert into the hot set we add things with a score of 0
This means that if hot has more than batch size items in it with a score, then the 0s don't get an initial score

This corrects the situation by always ensuring we re-score:

1. batch size high scoring topics
2. (new) batch size recently bumped topics

* Update spec/models/topic_hot_scores_spec.rb

Co-authored-by: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com>

---------

Co-authored-by: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com>
2024-02-09 07:45:47 +11:00
David Taylor
c9b9463ee3
DEV: Resolve decorator import deprecations (#25616) 2024-02-08 19:02:26 +00:00
Bianca Nenciu
95555b9a97
FIX: Do not async already loaded categories (#25607)
Use sync findByIds to return the category list if all of them have been
previously loaded.
2024-02-08 18:36:31 +02:00
Penar Musaraj
6bd26e81c1
FIX: Respect date range in top traffic sources report (#25599)
See https://meta.discourse.org/t/reports-top-traffic-sources-topics-stat-issue/179850
2024-02-08 11:17:59 -05:00
David Taylor
a3ef9e92eb
DEV: Update topic and post models to native class syntax (#25612)
This commit was created with a combination of the ember-native-class-codemod and manual cleanup
2024-02-08 15:09:50 +00:00
David Taylor
6c597b648b
DEV: Convert most JS models to native class syntax (#25608)
This commit was created with a combination of the ember-native-class-codemod and manual cleanup
2024-02-08 13:17:36 +00:00
David Taylor
234795c70e
FIX: Service worker push notifications when cache disabled (#25610) 2024-02-08 11:55:32 +00:00
David Taylor
ee08a8c52b
Revert "FIX: Omit CSP nonce and hash values when unsafe-inline enabled (#25590)" (#25609)
This reverts commit 767b49232e.

If anything else (e.g. GTM integration) introduces a nonce/hash, then this change stops the splash screen JS to fail and makes sites unusable.
2024-02-08 11:44:09 +00:00
Alan Guo Xiang Tan
fb0e656cb7
DEV: Refactor subclasses in ThemeSettingsManager to individual files (#25605)
Why this change?

One Ruby class per file improves readability
2024-02-08 12:59:52 +08:00
Martin Brennan
7ce76143ac
FIX: Always trust admin and moderators with post edits (#25602)
Removes duplication from LimitedEdit to see who can edit
posts, and also removes the old trust level setting check
since it's no longer necessary.

Also make it so staff can always edit since can_edit_post?
already has a staff escape hatch.
2024-02-08 13:10:26 +10:00
Alan Guo Xiang Tan
96ae5c395f
DEV: Set database checkout timeout to 10 on CI (#25604)
Why this change?

We have been seeing checkout timeouts happening on CI when using the
default of 5 seconds. This can happen in system tests when the server
has to process many requests using the same database connection.
Therefore, we will double the timeout for now and monitor if stuff
continues to timeout.
2024-02-08 10:35:55 +08:00
Alan Guo Xiang Tan
9f884cdaab
DEV: Introduce experimental type: objects theme setting (#25538)
Why this change?

This commit introduces an experimental `type: objects` theme setting
which will allow theme developers to store a collection of objects as
JSON in the database. Currently, the feature is still in development and
this commit is simply setting up the ground work for us to introduce the
feature in smaller pieces.

What does this change do?

1. Adds a `json_value` column as `jsonb` data type to the `theme_settings` table.
2. Adds a `experimental_objects_type_for_theme_settings` site setting to
   determine whether `ThemeSetting` records of with the `objects` data
   type can be created.
3. Updates `ThemeSettingsManager` to support read/write access from the
   `ThemeSettings#json_value` column.
2024-02-08 10:20:59 +08:00
Martin Brennan
8eb4bf07a6
FIX: Translation missing for Illegal flag on topic (#25603)
Followup to 95a2d285d3

Fixes a missing translation and also makes it so the
flag modal does not have a scrollbar when it opens.
2024-02-08 11:53:45 +10:00
Martin Brennan
4ce1c2c030
FIX: Always allow staff (admins & mods) to post links (#25601)
Followup fb087b7ff6

post_links_allowed_groups is an odd check tied to
unrestricted_link_posting? in PostGuardian, in that
it doesn't have an escape hatch for staff like most
of the rest of these group based settings.

It doesn't make sense to exclude admins or mods from
posting links, so just always allow them to avoid confusion.
2024-02-08 11:19:28 +10:00
Martin Brennan
adb4eee153
DEV: Make more group-based settings client: false (#25585)
Affects the following settings:

* whispers_allowed_groups
* anonymous_posting_allowed_groups
* personal_message_enabled_groups
* shared_drafts_allowed_groups
* here_mention_allowed_groups
* uploaded_avatars_allowed_groups
* ignore_allowed_groups

This turns off `client: true` for these group-based settings,
because there is no guarantee that the current user gets all
their group memberships serialized to the client. Better to check
server-side first.
2024-02-08 09:43:34 +10:00
Daniel Waterworth
57c53b0ead
DEV: Do lazy_load_categories check inside asyncFindByIds (#25600)
This way, we can use asyncFindByIds indiscriminately.
2024-02-07 17:33:59 -06:00
Daniel Waterworth
8058fd5b80
FIX: Add id to warn (#25597) 2024-02-07 17:20:08 -06:00
Daniel Waterworth
3da302716c
DEV: Coalesce category ids to numbers (#25598)
Otherwise, if you pass in strings, strange things happen.
2024-02-07 17:19:58 -06:00
dependabot[bot]
6341bfa0b6
Build(deps-dev): Bump minitest from 5.22.0 to 5.22.1 (#25595) 2024-02-07 23:21:38 +01:00
dependabot[bot]
9a9277aaa2
Build(deps-dev): Bump parallel_tests from 4.4.0 to 4.5.0 (#25594) 2024-02-07 23:21:00 +01:00
Daniel Waterworth
30922855f2
PERF: Don't allow a single user to monopolize the defer queue (#25593) 2024-02-07 13:47:50 -06:00
Daniel Waterworth
67229a7739
DEV: switch to asyncFindByIds in category-list site-setting component (#25592)
We no longer want to rely on preloading every single category, which
means we need to do http requests for categories when we need them.
2024-02-07 12:07:32 -06:00
David Taylor
225db41bfc
DEV: Remove service-worker fetch handler entirely when cache disabled (#25591)
Followup to c4559ae575
2024-02-07 14:57:40 +00:00
David Battersby
490041a435
UX: add padding to bottom of mobile chat channel settings page (#25587)
The leave channel button is cut off when accessing the channel settings page on mobile.

This change adds additional padding to the bottom of the channel settings page when accessing via iPad/PWA/Hub.
2024-02-07 22:14:26 +08:00
David Taylor
767b49232e
FIX: Omit CSP nonce and hash values when unsafe-inline enabled (#25590)
Browsers will ignore unsafe-inline if nonces or hashes are included in the CSP. When unsafe-inline is enabled, nonces and hashes are not required, so we can skip them.

Our strong recommendation remains that unsafe-inline should not be used in production.
2024-02-07 12:35:35 +00:00
David Taylor
c4559ae575
DEV: Add disable_service_worker_cache global setting (#25589)
When enabled, the workbox caching logic in the service worker will be replaced with a very simple offline error page. We plan to use this as an experiment to see how it affects performance and stability of Discourse.
2024-02-07 10:44:12 +00:00
David Taylor
dea753a204
FIX: Restore support for .js.es6 files in PrettyText (#25588)
Regressed in 1757a688c4

https://meta.discourse.org/t/294155
2024-02-07 09:34:31 +00:00
Isaac Janzen
32ee0e3c0a
FIX: Similar topics relying on widget search menu (#25586) 2024-02-07 18:15:54 +11:00
Alan Guo Xiang Tan
f9789e974b
DEV: Reduce pool size for test environment to 1 (#25584)
Why this change?

I have been investigating transaction related issues with our system
tests and I have a hard time figuring out what is causing the problem.
To help simplify our environment further, we will set the pool size in
the test environment to 1 so that it is impossible for us to be fetching
a different connection between the threads since they all share the
connection pool.

Also set `reaping_frequency` to `0` to ensure we don't reap any
connection ensuring the same connection is always used.
2024-02-07 11:10:17 +08:00
Ted Johansson
95a2d285d3
FEATURE: Add new 'illegal' flag reason (#25498)
To comply with Digital Services Act we need a way for users to flag a post as potentially illegal. This PR adds that functionality.
2024-02-07 10:12:22 +08:00
Jarek Radosz
21a830b53d
FIX: Clicking a notification was triggering an error (#25583) 2024-02-07 00:21:44 +01:00