Commit Graph

53882 Commits

Author SHA1 Message Date
Sam
1c67917367
FIX: disable storing invalid post and topic timing when sent from client (#26683)
This ensures we only ever store correct post and topic timing when the client
notifies.

Previous to this change we would blindly trust the client.

Additionally this has error correction code that will correct the last seen
post number when you visit a topic with incorrect timings.
2024-04-19 18:10:50 +10:00
David Battersby
06500fa626
FEATURE: add swipe up to close toast notification (#26659)
Toasts can now be dismissed by doing a swipe up on mobile.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2024-04-19 09:49:50 +02:00
Keenan Brock
fdff9b06a5
DEV: Peg redis client to 4.0 (#26104)
Peg redis to 4.0 and explain it still does not work on 5.0
2024-04-19 17:22:12 +10:00
Carson Chang
7cf04d96c3
UX: Keep input headings consistently bold (#26510) 2024-04-18 20:22:08 -07:00
Martin Brennan
dbcefcf85e
FEATURE: Show additional filter links in admin sidebar for no results (#26672)
When the user sees no results in their admin sidebar query,
we are adding two additional links:

* "Search site settings" - Navigates to the site settings page
  with the filter prefilled in the search
* "Admin user list" - Navigates to the user list with the filter
  prefilled in the username search

This will bridge the gap until we have a full admin-wide search.

Also make admin site setting search param refresh on filter changes

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-04-19 10:55:17 +10:00
Kris
60d3a79d40
UX: update to variable text color for variable background (#26676) 2024-04-18 14:12:16 -04:00
dependabot[bot]
b88273e046
Build(deps-dev): Bump the embroider group with 5 updates (#26677)
Bumps the embroider group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [@embroider/test-setup](https://github.com/embroider-build/embroider/tree/HEAD/packages/test-setup) | `3.0.3` | `4.0.0` |
| [@embroider/compat](https://github.com/embroider-build/embroider/tree/HEAD/packages/compat) | `3.4.7` | `3.4.8` |
| [@embroider/core](https://github.com/embroider-build/embroider/tree/HEAD/packages/core) | `3.4.7` | `3.4.8` |
| [@embroider/macros](https://github.com/embroider-build/embroider/tree/HEAD/packages/macros) | `1.15.1` | `1.16.0` |
| [@embroider/webpack](https://github.com/embroider-build/embroider/tree/HEAD/packages/webpack) | `3.2.3` | `4.0.0` |


Updates `@embroider/test-setup` from 3.0.3 to 4.0.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/test-setup)

Updates `@embroider/compat` from 3.4.7 to 3.4.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/compat)

Updates `@embroider/core` from 3.4.7 to 3.4.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/core)

Updates `@embroider/macros` from 1.15.1 to 1.16.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/macros)

Updates `@embroider/webpack` from 3.2.3 to 4.0.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/webpack)

---
updated-dependencies:
- dependency-name: "@embroider/test-setup"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: embroider
- dependency-name: "@embroider/compat"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/macros"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: embroider
- dependency-name: "@embroider/webpack"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: embroider
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 15:48:10 +01:00
David Taylor
5c2ac4fe88
DEV: Allow RenderGlimmer to be used inside post-cooked-glued widgets (#26675)
In this case, the top-level widget being glued must have a `_postCookedWidget` attribute.
2024-04-18 15:39:29 +01:00
Jarek Radosz
bfd6a7b86c
DEV: Clean up sidebar/filter.gjs (#26673)
The most important change being the replacement of `Input` component with an `<input>` element.
2024-04-18 13:17:21 +02:00
Jarek Radosz
2d5d7b5a33
DEV: Don't leak the topic model through minimized arg (#26669)
Co-authored-by: David Taylor <david@taylorhq.com>
2024-04-18 13:17:09 +02:00
Jarek Radosz
27d9b53bac
FEATURE: Allow dismissing tooltips by clicking their button (#26668)
Also: fixes typos, updates tests, and moves the tooltip element into document.body
2024-04-18 13:16:55 +02:00
Jarek Radosz
285acf0b86
DEV: Add missing svg icons to the svg_sprite list (#26674) 2024-04-18 13:01:48 +02:00
Martin Brennan
2d2329095c
FEATURE: Use new bookmark menu in topic footer buttons (#26670)
Followup to 67a8080e33

This commit makes it so the topic footer button for bookmarks
uses the new BookmarkMenu component, and makes some tweaks to
that component to allow for a label and CSS class options.

Also introduces a TopicBookmarkManager to manage the saving/editing/
deleting of the topic level bookmarks and the reactivity that happens
in the topic UI afterward.

Next commit should rip out old bookmark associated code in the
topic controller as it will no longer be needed.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2024-04-18 11:06:12 +02:00
Joffrey JAFFEUX
09311c7dab
DEV: minimum fabricators for post/topic (#26671)
I will add new default properties as needed in the future, but for now this is enough to have an entry point.
2024-04-18 09:54:23 +02:00
Martin Brennan
99d22c85ae
FEATURE: Make admin sidebar keywords translateable (#26657)
This commit ensures that additional keywords for admin
sidebar links (which are also stored in the admin sidebar state
manager) are translated with I18n, which was discussed
in https://meta.discourse.org/t/introducing-experimental-admin-sidebar-navigation/289281/58?u=martin

This also changes the admin sidebar state manager keywords to
not be a TrackedObject -- this is not necessary as keywords are
only set once, and it was causing rendering issues because
the keywords were being set at the same time they were read.

Finally this adds a "theme" keyword to the "Components" link
because we often refer to components as Theme Components

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-04-18 16:14:11 +10:00
Ted Johansson
f3cad5f3a2
FIX: Correctly re-attach allowed images in activity summary e-mail (#26642)
For e-mails, secure uploads redacts all secure images, and later uses the access control post to re-attached allowed ones. We pass the ID of this post through the X-Discourse-Post-Id header. As the name suggests, this assumes there's only ever one access control post. This is not true for activity summary e-mails, as they summarize across posts.

This adds a new header, X-Discourse-Post-Ids, which is used the same way as the old header, but also works for the case where an e-mail is associated with multiple posts.
2024-04-18 10:27:46 +08:00
Kelv
edbd44e737
DEV: replace transformed-post POJO with topic model in topic-map components (#26629)
* DEV: replace postAttrs dependencies in topic-map component by passing in topicDetails and postStream to topic-map to ensure state changes are passed properly down to child components
2024-04-18 10:04:38 +08:00
Krzysztof Kotlarek
c5dd50aa02
FIX: don't purge users who were deactivated by the system (#26656)
In a previous PR, we skipped users deactivated by admins from being automatically purged - https://github.com/discourse/discourse/pull/26478.

However, users deactivated by `discourse-auto-deactivate` plugin are deactivated by the system user. Those users should not be purged as well.

https://github.com/discourse/discourse-auto-deactivate/blob/main/plugin.rb#L62
2024-04-18 09:53:43 +10:00
Krzysztof Kotlarek
98fc614162
FEATURE: mandatory fields for group site setting (#26612)
Automatically add `moderators` and `admins` auto groups to specific site settings.

In the new group-based permissions systems, we just want to check the user’s groups since it more accurately reflects reality

Affected settings:
- tag_topic_allowed_groups
- create_tag_allowed_groups
- send_email_messages_allowed_groups
- personal_message_enabled_groups
- here_mention_allowed_groups
- approve_unless_allowed_groups
- approve_new_topics_unless_allowed_groups
- skip_review_media_groups
- email_in_allowed_groups
- create_topic_allowed_groups
- edit_wiki_post_allowed_groups
- edit_post_allowed_groups
- self_wiki_allowed_groups
- flag_post_allowed_groups
- post_links_allowed_groups
- embedded_media_post_allowed_groups
- profile_background_allowed_groups
- user_card_background_allowed_groups
- invite_allowed_groups
- ignore_allowed_groups
- user_api_key_allowed_groups
2024-04-18 08:53:52 +10:00
Kris
1dbceb1a70
UX: when reopening collapsed composer, reset height (#26661) 2024-04-17 17:28:18 -04:00
Jarek Radosz
84efa66cc1
DEV: Apply flex-direction: column on .d-header (#26658)
This doesn't change anything in 99.9% of cases - by default d-header has only one child element `.wrap`.

There are only two themes that I'm aware of that add another child:
1. discourse-categories-navbar - which I'm currently updating to use the new header APIs, and where the column layout makes more sense
2. a private theme, which was recently updated to use those APIs and that works around the current layout by applying `flex-wrap: wrap` to d-header (I'll remove that override as it conflicts with this change)
2024-04-17 23:00:55 +02:00
Daniel Waterworth
7ce5eac235
FIX: Don't put non-category in Site.categories (#26664) 2024-04-17 15:54:34 -05:00
Bianca Nenciu
6281f5d768
DEV: Merge two similar category serializers (#26653)
CategoryBadgeSerializer and TopicCategorySerializer are too similar and
are used in similar contexts. This commit merges the two into a single
CategoryBadgeSerializer.
2024-04-17 18:52:34 +03:00
Bianca Nenciu
9638ce17fa
FIX: Serialize categories for bookmarks (#26606)
This is necessary when "lazy load categories" feature is enabled to make
sure the categories are rendered for topics and posts.
2024-04-17 17:23:47 +03:00
Bianca Nenciu
c9a46cfdda
FIX: Use ILIKE for searching categories (#26619)
Full text search does not return ideal results for category dropdown.
Usually, in category dropdowns we want to search for categories as we
type. For example, while typing "theme", the dropdown should show
intermediary results for "t", "th", "the", "them" and finally "theme".
For some of these substrings (like "the"), full text search does not
return any results, which leads to an unpleasant user experience.
2024-04-17 17:20:25 +03:00
David Taylor
840ac6bd0a
DEV: Avoid using @tracked as a decorator in RenderGlimmer object literal
Decorators in object literals are non-standard, and we're working to remove them.
2024-04-17 15:19:23 +01:00
dependabot[bot]
672f7523a1
Build(deps-dev): Bump rubocop from 1.63.1 to 1.63.2 (#26654)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.63.1 to 1.63.2.
- [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.63.1...v1.63.2)

---
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>
2024-04-17 13:12:22 +02:00
Joffrey JAFFEUX
552859b0ff
DEV: converts discard-draft modal to gjs (#26637) 2024-04-17 13:11:50 +02:00
Krzysztof Kotlarek
df373d90fe
FEATURE: direct link to components for admin sidebar (#26644)
To add a components link to the sidebar refactoring was required to create unique URLs for themes and components. Before the query param was used. After changes, we have two URLs `/admin/customize/themes` and `/admin/customize/components`.
2024-04-17 11:45:59 +10:00
Daniel Waterworth
56c4804440
DEV: Always pass ancestors to category-link (#26638)
We want to remove uses of Category.findById. This change pushes the fetching up the chain of responsibility.
2024-04-16 15:28:36 -05:00
Osama Sayegh
4733369f71
FEATURE: Add 'New users only' option to user_updated trigger (#26648)
This commit adds a new option to the `user_updated` trigger of the automation plugin to only trigger an automation for new users that join after the automation is enabled.

Internal topic: t/125829/9.
2024-04-16 21:13:11 +03:00
dependabot[bot]
57d29b6f3b
Build(deps-dev): Bump ember-cli from 5.7.0 to 5.8.0 (#26641)
Bumps [ember-cli](https://github.com/ember-cli/ember-cli) from 5.7.0 to 5.8.0.
- [Release notes](https://github.com/ember-cli/ember-cli/releases)
- [Changelog](https://github.com/ember-cli/ember-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ember-cli/ember-cli/compare/v5.7.0...v5.8.0)

---
updated-dependencies:
- dependency-name: ember-cli
  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-04-16 17:42:33 +01:00
Discourse Translator Bot
8346f4a1e6
Update translations (#26651) 2024-04-16 17:37:49 +02:00
Joffrey JAFFEUX
4f7cd7b78e
FIX: correctly unshrink composer when re-editing post (#26650)
Prior to this fix we were manually expanding the composer but not setting the correct height. This commit adds a new `unshrink` function on the composer service to correctly set the state and the height on the composer model.
2024-04-16 14:49:51 +02:00
Joffrey JAFFEUX
8fbdce36a4
FIX: prevents open to happen too early (#26649)
In discourse-assign the assign menu in the modal is using this `expandedOnInsert` option and  was sometimes not opening correctly resulting in a broken state until you click two times on it. This should prevent this issue.
2024-04-16 13:58:06 +02:00
Jarek Radosz
99391277d4
DEV: Remove an unused hbr template (#26620) 2024-04-16 12:58:18 +02:00
David Taylor
1be488e4fb
DEV: Consolidate message-bus ajax implementation (#26646)
Previously it was split across multiple functions, and had multiple logic branches. This commit consolidates it into a single `mbAjax` function
2024-04-16 11:16:04 +01:00
Natalie Tay
1fea2bf1c5
FEATURE: Merge user associated accounts, favouring the target user upon conflict (#26645) 2024-04-16 17:37:33 +08:00
Joffrey JAFFEUX
bbe62d88d2
FIX: prevents showing discard modal on re-edit (#26639)
This commit will now change two behaviors:

- If composer is already opened on a specific post and we click on edit again for the same post, we will do nothing and not show the discard draft modal
- if composer is shrinked and we click on edit for the same currently edited post, we will just open the composer and not show the discard draft modal
2024-04-16 10:34:32 +02:00
Martin Brennan
7a083daf27
Revert "FIX: Post uploads setting access_control_post_id unnecessarily (#26627)" (#26643)
This reverts commit cdc8e9de1b.

It's made things worse internally and on meta.
2024-04-16 14:10:25 +10:00
Martin Brennan
cdc8e9de1b
FIX: Post uploads setting access_control_post_id unnecessarily (#26627)
This commit addresses an issue for sites where secure_uploads
is turned on after the site has been operating without it for
some time.

When uploads are linked when they are used inside a post,
we were setting the access_control_post_id unconditionally
if it was NULL to that post ID and secure_uploads was true.

However this causes issues if an upload has been used in a
few different places, especially if a post was previously
used in a PM and marked secure, so we end up with a case of
the upload using a public post for its access control, which
causes URLs to not use the /secure-uploads/ path in the post,
breaking things like image uploads.

We should only set the access_control_post_id if the post is the first time the
upload is referenced so it cannot hijack uploads from other places.
2024-04-16 10:37:57 +10:00
dependabot[bot]
9a5eca04fb
Build(deps-dev): Bump puppeteer-core from 22.6.4 to 22.6.5 (#26633)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from 22.6.4 to 22.6.5.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json)
- [Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v22.6.4...puppeteer-core-v22.6.5)

---
updated-dependencies:
- dependency-name: puppeteer-core
  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-04-16 00:29:25 +02:00
dependabot[bot]
ff2ab4bee9
Build(deps): Bump sassc-embedded from 1.74.1 to 1.75.2 (#26624)
Bumps [sassc-embedded](https://github.com/sass-contrib/sassc-embedded-shim-ruby) from 1.74.1 to 1.75.2.
- [Commits](https://github.com/sass-contrib/sassc-embedded-shim-ruby/compare/v1.74.1...v1.75.2)

---
updated-dependencies:
- dependency-name: sassc-embedded
  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>
2024-04-16 00:29:06 +02:00
dependabot[bot]
f8d6d58658
Build(deps-dev): Bump sass from 1.74.1 to 1.75.0 (#26625)
Bumps [sass](https://github.com/sass/dart-sass) from 1.74.1 to 1.75.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.74.1...1.75.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-04-16 00:28:46 +02:00
dependabot[bot]
5e05c1bec6
Build(deps): Bump faraday-retry from 2.2.0 to 2.2.1 (#26634)
Bumps [faraday-retry](https://github.com/lostisland/faraday-retry) from 2.2.0 to 2.2.1.
- [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.2.0...v2.2.1)

---
updated-dependencies:
- dependency-name: faraday-retry
  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-04-16 00:17:34 +02:00
dependabot[bot]
a664e555c5
Build(deps): Bump method_source from 1.0.0 to 1.1.0 (#26635)
Bumps [method_source](https://github.com/banister/method_source) from 1.0.0 to 1.1.0.
- [Changelog](https://github.com/banister/method_source/blob/master/CHANGELOG.md)
- [Commits](https://github.com/banister/method_source/compare/v1.0.0...v1.1.0)

---
updated-dependencies:
- dependency-name: method_source
  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-04-16 00:17:10 +02:00
dependabot[bot]
bb538b4ac8
Build(deps): Bump sass-embedded from 1.74.1 to 1.75.0 (#26636)
Bumps [sass-embedded](https://github.com/sass-contrib/sass-embedded-host-ruby) from 1.74.1 to 1.75.0.
- [Commits](https://github.com/sass-contrib/sass-embedded-host-ruby/compare/v1.74.1...v1.75.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-04-16 00:16:27 +02:00
Blake Erickson
9338a9f2dc
DEV: Update constants (#26580)
I needed to run `rake javascript:update_constants` for my previous
commit: 72ac675e4e

The change in this commit though was completely unrelated, so I saved it
for it's own commit.
2024-04-15 15:17:45 -06:00
Gerhard Schlager
d286c1d5a1
DEV: Prepare new structure for migrations-tooling (#26631)
* Moves existing files around. All essential scripts are in `migrations/bin`, and non-essential scripts like benchmarks are in `migrations/scripts`
* Dependabot configuration for migrations-tooling (disabled for now)
* Updates test configuration for migrations-tooling
* Shorter configuration for intermediate DB for now. We will add the rest table by table.
* Adds a couple of benchmark scripts
* RSpec setup especially for migrations-tooling and the first tests
* Adds sorting/formatting to the `generate_schema` script
2024-04-15 18:47:40 +02:00
Gerhard Schlager
831da05103 DEV: Update migration-tests workflow 2024-04-15 16:22:11 +02:00