Commit Graph

55316 Commits

Author SHA1 Message Date
Isaac Janzen
2527f4599d
DEV: Add search_log modifier to prevent search log logging (#28279) 2024-08-08 12:41:10 -05:00
David Taylor
93a10b3b2e
FIX: Site setting category titles (#28281)
These were accidentally included in the refactoring of c197daa04c
2024-08-08 18:05:35 +01:00
Jean
1c9a482eb1
UX: Add plugin outlet to embeddable hosts (#28264) 2024-08-08 12:39:46 -04:00
Kris
0c0f9e4a0d
UX: smaller modal headings, shorter flag mdoal title (#28278) 2024-08-08 12:18:20 -04:00
Penar Musaraj
0d289a5690
UX: Do not delete narrative bot PM when skipping user tips (#28265)
Should fix https://meta.discourse.org/t/skip-tips-option-in-user-tip-should-not-delete-welcome-message/303420

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2024-08-08 12:12:01 -04:00
Joffrey JAFFEUX
c197daa04c
DEV: allows to alter category name/description (#28263)
This commit adds two new getters to the category model:
- `displayName`
- `descriptionText`

These getters are used instead of `name` and `description_text` where appropriate.

On top of this two transformers have been added to allow plugins to alter these getters:

```javascript
api.registerValueTransformer(
  "category-display-name",
  ({ value, context }) =>
    value + "-" + context.category.id + "-transformed"
);
```

```javascript
api.registerValueTransformer(
  "category-description-text",
  ({ value, context }) =>
    value + "-" + context.category.id + "-transformed"
);
```
2024-08-08 17:33:23 +02:00
Jarek Radosz
86bb07f619
DEV: Add support for regular plugin outlets in hbr (#27840) 2024-08-08 16:59:28 +02:00
Joffrey JAFFEUX
2fdee7849c
DEV: adds a tooltip system spec component (#28275)
Usage:

```
tooltip = PageObjects::Components::Tooltips.new(identifier)
expect(tooltip).to be_present(text: "Welcome")
expect(tooltip).to be_not_present(text: "Welcome")
tooltip.find(".my-button).click
```
2024-08-08 14:02:00 +02:00
Joffrey JAFFEUX
e79a50d7a9
DEV: adds logo page component (#28276)
Usage:

```
click_logo # globally accessible
PageObjects::Components::Logo.click
PageObjects::Components::Logo.hover
```
2024-08-08 13:52:48 +02:00
Loïc Guitaut
bf3d8a0a94 FIX: Don’t log an error when rendering a 404
Currently, in the list controller, when encountering an unsafe redirect
error, a 404 is rendered. The problem is that it’s done in a way that it
also logs a fatal error (because a `Discourse::NotFound` exception was
raised inside a `rescue_from` block).

This patch addresses that issue by simply rendering a 404 without
raising any error.
2024-08-08 09:21:27 +02:00
Alan Guo Xiang Tan
4c0af24173
DEV: Log a warning message when a MiniScheduler scheduled job is stuck (#28258)
This commit adds a `MiniSchedulerLongRunningJobLogger` class which will
poll every 60 seconds for mini_scheduler jobs which are stuck. When it
detects that a job is stuck, it will log a warning message with the
current backtrace of the thread that is executing the job.

Note that for scheduled jobs which are executed at a frequency of less
than 30 minutes, we will log when the job has been executing for 30
minutes.

For scheduled jobs executed at a frequency of less than 2 hours, we will
log when the job has been executing for a duration greater than its
specified frequency.

For scheduled jobs executed at a frequency greater than 2 hours, we will
log as long as the job has been executing for more than 2 hours.
2024-08-08 12:20:16 +08:00
dependabot[bot]
814d2e6286
Build(deps-dev): Bump puppeteer-core from 22.15.0 to 23.0.1 (#28268)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from 22.15.0 to 23.0.1.
- [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.15.0...puppeteer-core-v23.0.1)

---
updated-dependencies:
- dependency-name: puppeteer-core
  dependency-type: direct:development
  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>
2024-08-08 09:51:59 +08:00
dependabot[bot]
99f0b7c851
Build(deps-dev): Bump parser from 3.3.4.0 to 3.3.4.1 (#28267)
Bumps [parser](https://github.com/whitequark/parser) from 3.3.4.0 to 3.3.4.1.
- [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/whitequark/parser/compare/v3.3.4.0...v3.3.4.1)

---
updated-dependencies:
- dependency-name: parser
  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-08-08 09:51:24 +08:00
dependabot[bot]
1f02fef375
Build(deps): Bump terser from 5.31.3 to 5.31.4 (#28269)
Bumps [terser](https://github.com/terser/terser) from 5.31.3 to 5.31.4.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.31.3...v5.31.4)

---
updated-dependencies:
- dependency-name: terser
  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-08-08 09:50:47 +08:00
Krzysztof Kotlarek
db4395d70c
FIX: flaky flags specs when moving up or down (#28272)
Those are the steps to move the flag:
1. open menu;
2. click move up - `saving` CSS class is added;
3. request to backend;
4. `saving` CSS class is removed.

To check if the action was finished we are using this method:
```
def move_up(key)
  open_flag_menu(key)
  find(".admin-flag-item__move-up").click
  has_saved_flag?(key)
  self
end

def has_saved_flag?(key)
  has_css?(".admin-flag-item.#{key}.saving")
  has_no_css?(".admin-flag-item.#{key}.saving")
end
```

However, sometimes specs were failing with `expected to find CSS ".admin-flag-item.spam.saving" but there were no matches`

I think that the problem is with those 2 lines:
```
  find(".admin-flag-item__move-up").click
  has_closed_flag_menu?
```
If the save action is very fast, then the `saving` class is removed before the first check.

Therefore, to determine that the move action is finished, I am checking if the menu is closed.
2024-08-08 09:50:28 +08:00
Penar Musaraj
9d00871a67
UX: Change bookmark menu label from "Custom..." to "More options…" (#28266) 2024-08-07 17:57:18 -04:00
Joffrey JAFFEUX
1b69c0c721
DEV: adds tests for transformers (#28207)
This commit adds tests for:
- header-notifications-avatar-size
- home-logo-href
2024-08-07 20:58:56 +02:00
Sérgio Saquetim
a9abaf408d
DEV: Auto expand active sections and scroll active link into view (#28237) 2024-08-07 14:47:34 -03:00
Jarek Radosz
064332ef6e
DEV: Update ember-cli-deprecation-workflow from 2.2.0 to 3.0.1 (#28226)
From dependabot PR:

<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/ember-cli/ember-cli-deprecation-workflow/releases">ember-cli-deprecation-workflow's releases</a>.</em></p>
<blockquote>
<h2>v3.0.1-ember-cli-deprecation-workflow</h2>
<h2>Release (2024-07-11)</h2>
<p>ember-cli-deprecation-workflow 3.0.1 (patch)</p>
<h4>🏠 Internal</h4>
<ul>
<li><code>ember-cli-deprecation-workflow</code>
<ul>
<li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/192">#192</a> fix repository link in package.json (<a href="https://github.com/mansona"><code>@​mansona</code></a>)</li>
<li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/191">#191</a> update release plan workflow (<a href="https://github.com/mansona"><code>@​mansona</code></a>)</li>
</ul>
</li>
</ul>
<h4>Committers: 1</h4>
<ul>
<li>Chris Manson (<a href="https://github.com/mansona"><code>@​mansona</code></a>)</li>
</ul>
<h2>v3.0.0</h2>
<h2>Release (2024-06-25)</h2>
<p>ember-cli-deprecation-workflow 3.0.0 (major)</p>
<h4>💥 Breaking Change</h4>
<ul>
<li><code>ember-cli-deprecation-workflow</code>
<ul>
<li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/159">#159</a> [BREAKING] Convert to a module. Drops support for Ember &lt; 3.28, requires manual initialization (<a href="https://github.com/lolmaus"><code>@​lolmaus</code></a>)</li>
<li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/175">#175</a> Node 16 is the minimum supported version (<a href="https://github.com/mixonic"><code>@​mixonic</code></a>)</li>
</ul>
</li>
</ul>
<h4>🐛 Bug Fix</h4>
<ul>
<li><code>ember-cli-deprecation-workflow</code>
<ul>
<li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/181">#181</a> Remove unused broccoli magic (<a href="https://github.com/simonihmig"><code>@​simonihmig</code></a>)</li>
</ul>
</li>
</ul>
<h4>📝 Documentation</h4>
<ul>
<li><code>ember-cli-deprecation-workflow</code>
<ul>
<li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/184">#184</a> Update configuration paths in documentation (<a href="https://github.com/backspace"><code>@​backspace</code></a>)</li>
</ul>
</li>
</ul>
<h4>🏠 Internal</h4>
<ul>
<li><code>ember-cli-deprecation-workflow</code>
<ul>
<li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/189">#189</a> start using release-plan (<a href="https://github.com/mansona"><code>@​mansona</code></a>)</li>
<li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/188">#188</a> start using pnpm (<a href="https://github.com/mansona"><code>@​mansona</code></a>)</li>
<li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/178">#178</a> Upgrade Ember CLI to 5.4 (<a href="https://github.com/lolmaus"><code>@​lolmaus</code></a>)</li>
<li><a href="https://redirect.github.com/ember-cli/ember-cli-deprecation-workflow/pull/170">#170</a> Bump Node, swap to npm, update CI pipeline (<a href="https://github.com/mixonic"><code>@​mixonic</code></a>)</li>
</ul>
</li>
</ul>
<h4>Committers: 5</h4>
<ul>
<li>Andrey Mikhaylov (lolmaus) (<a href="https://github.com/lolmaus"><code>@​lolmaus</code></a>)</li>
<li>Buck Doyle (<a href="https://github.com/backspace"><code>@​backspace</code></a>)</li>
<li>Chris Manson (<a href="https://github.com/mansona"><code>@​mansona</code></a>)</li>
<li>Matthew Beale (<a href="https://github.com/mixonic"><code>@​mixonic</code></a>)</li>
<li>Simon Ihmig (<a href="https://github.com/simonihmig"><code>@​simonihmig</code></a>)</li>
</ul>
</blockquote>
</details>
2024-08-07 17:59:42 +02:00
Loïc Guitaut
e494bafed3 FIX: Unescape URI properly when redirecting to a category
Currently, when a badly named category slug is provided, it can lead to
an infinite redirect.

This patch addresses the issue by properly unescaping `request.fullpath`
so the path is successfully rewritten and the redirect happens as
expected.
2024-08-07 15:53:21 +02:00
David Taylor
75d11bfeba
DEV: Convert core controllers to native class syntax (batch 3) (#28224)
Changes made using the ember-native-class-codemod, plus some manual tweaks
2024-08-07 14:48:29 +01:00
carson chang
854b8b7093
FEATURE: Add option to immediately delete stub topics upon merge (#28228)
Currently to handle stub topics after merging, there are only options to (1) never delete a stub topic and (2) delete a stub topic after X amount of days. This adds the option to immediately delete a stub topic upon merge.

---------

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
Co-authored-by: Renato Atilio <renato@discourse.org>
2024-08-07 10:05:40 -03:00
David Taylor
2c8d703b48
DEV: Fixes for modifyClass (#28227)
This resolves issues when a mix of callback-based modifications and Ember-reopen-based modifications are used on the same target. In summary:

- Fixes `pluginId` exception logic for callback-based modifications

- Moves `pluginId` storage to a WeakMap so it doesn't pollute the target's descriptors

- When applying a legacy modifyClass, we will temporarily rollback any modern callback-based modifications. This means all of Ember's reopen calls apply to un-prepended classes, and then we add our modern prepends on top.

- Calls `.proto()` on CoreObject descendants before prepending, to ensure that pending Ember mixins have been applied
2024-08-07 12:28:51 +01:00
锦心
c8c859762b
FEATURE: Absolute Numbers in Poll (#28240)
What does this add?
===================

This PR adds an extra button to the poll to show the absolute number of
people who voted for each option. This button will only be added for
the single/multi-select bar chart.

Related meta topic: https://meta.discourse.org/t/absolute-numbers-in-polls/32771
2024-08-07 11:46:29 +02:00
Natalie Tay
a49a6941c6
DEV: Extend /filter's ability to order (#28242) 2024-08-07 16:37:00 +08:00
Osama Sayegh
5dbf812d32
DEV: Add site age and site activities section to the redesigned about page (#28214)
This commit continues on work laid out by 6039b513fe to redesign the /about page. In this commit, we add the site age and a section on the right hand side to show site activities/statistics such as topics, posts, sign-ups, likes etc.
2024-08-07 11:11:41 +03:00
Alan Guo Xiang Tan
1a09d6b246
FEATURE: Add live_slots_(start|finish) for Sidekiq perf logging (#28260)
This information is helpful in debugging memory spikes when Sidekiq
processes jobs.
2024-08-07 15:48:24 +08:00
Kris
66a23180d4
UX: fix issue with long usernames wrapping in mobile user cards (#28256) 2024-08-06 17:47:59 -04:00
Kris
76b28ed836
UX: fix user profile button wrap, clean up styles (#28255) 2024-08-06 17:47:51 -04:00
Isaac Janzen
8aff94dadb
DEV: Add addLogSearchLinkClickedCallbacks to plugin API (#28254)
- Added `addLogSearchLinkClickedCallbacks` which allows plugins/TCs to register a callback when a search link is clicked and before a search log is created
2024-08-06 16:08:40 -05:00
David Taylor
66de6a43a8
FIX: Ensure do-not-disturb icon updates correctly (#28253)
`currentUser.do_not_disturb_until` is a string, so we need to parse it before comparing to the current timestamp
2024-08-06 19:13:13 +01:00
Kris
fe307ea2f0
UX: remove extra margin from flag description links (#28251) 2024-08-06 11:11:38 -04:00
Kris
746d8e613e
UX: break long words to prevent overflow in activity stream (#28250) 2024-08-06 10:49:49 -04:00
Loïc Guitaut
97cd03d41a FIX: Return additional message types properly
Following a recent refactor, some methods from `FlagSettings` have been
renamed (`custom_types` -> `additional_message_types`). The
`PostActionType` model was using `custom_types` but when the renaming
was done, it was renamed to `with_additional_message` instead of
`additional_message_types`, which under the right circumstances will
raise an error.
2024-08-06 16:01:38 +02:00
Joffrey JAFFEUX
584106b752
UX: link edit text to search in badges form (#28248)
During our refactoring of admin badges we decided to link to:

`adminSiteText.edit locale=locale`

Instead of:

`adminSiteText q=key`

After feedback from the community we are reverting this change.
2024-08-06 16:01:20 +02:00
Loïc Guitaut
9e9d88f078 DEV: Use rspec mocks to properly verify a race condition
This is a small followup of https://github.com/discourse/discourse/pull/28124.
2024-08-06 15:57:04 +02:00
David Taylor
6f80ebfc41
Revert "FIX: backup_restore.rb wants db user from user, not username (#28229)" (#28245)
This reverts commit 2e8273dcb4. We're seeing this cause issues in production multisite environments. Reverting while we investigate
2024-08-06 14:11:48 +01:00
David Taylor
998e035614
DEV: Convert core controllers to native class syntax (batch 4) (#28225)
Changes made using the ember-native-class-codemod, plus some manual tweaks
2024-08-06 12:47:05 +01:00
Joffrey JAFFEUX
ad8c5e7f80
FIX: use CheckboxGroup for admin badges form (#28239)
A recent change in FormKit has changed the syntax of this specific component. It's also better to use `<CheckboxGroup />` for this use case too.

Im mixed on writing tests for labels, it's a lot of tests to write for a rather low value.

This commit also slightly tweaks the width of the icon picker, from medium to small.
2024-08-06 10:45:09 +02:00
Robert
e145735c1d
DEV: poll flakey spec 2024-08-06 08:39:03 +02:00
Krzysztof Kotlarek
2b6c754779
Revert "FIX: Cache all flags multisite-safe (#28204)" (#28236)
This reverts commit 2225c03455.
2024-08-06 10:59:10 +10:00
Krzysztof Kotlarek
fc2259d1c8
FIX: limit the number of custom flags to 50 (#28221)
Admin can create up to 50 custom flags. It is limited for performance reasons.

When the limit is reached "Add button" is disabled and backend is protected by guardian.
2024-08-06 10:50:12 +10:00
Jay Pfaffman
2e8273dcb4
FIX: backup_restore.rb wants db user from user, not username (#28229)
ActiveRecord::Base.connection_pool.db_config.configuration_hash has the username in `user`, not `username`.
2024-08-06 08:49:20 +08:00
dependabot[bot]
0514044cf2
Build(deps-dev): Bump @floating-ui/dom from 1.6.8 to 1.6.9 (#28235)
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.6.8 to 1.6.9.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Changelog](https://github.com/floating-ui/floating-ui/blob/master/packages/dom/CHANGELOG.md)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.6.9/packages/dom)

---
updated-dependencies:
- dependency-name: "@floating-ui/dom"
  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-08-06 08:48:17 +08:00
dependabot[bot]
05b6ae38cb
Build(deps-dev): Bump rubocop-rspec from 3.0.3 to 3.0.4 (#28233)
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/rubocop/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rspec/compare/v3.0.3...v3.0.4)

---
updated-dependencies:
- dependency-name: rubocop-rspec
  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-08-06 08:48:00 +08:00
dependabot[bot]
a42f039e89
Build(deps-dev): Bump rubocop-ast from 1.31.3 to 1.32.0 (#28232)
Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.31.3 to 1.32.0.
- [Release notes](https://github.com/rubocop/rubocop-ast/releases)
- [Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-ast/compare/v1.31.3...v1.32.0)

---
updated-dependencies:
- dependency-name: rubocop-ast
  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-08-06 08:47:51 +08:00
Martin Brennan
2225c03455
FIX: Cache all flags multisite-safe (#28204)
This fixes an N1 in topics when loading all flags
and also makes the cache multisite-safe, followup
to fb7cc2d375
2024-08-06 09:59:49 +10:00
dependabot[bot]
3b39c798bf
Build(deps): Bump bootsnap from 1.18.3 to 1.18.4 (#28234)
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.18.3 to 1.18.4.
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.18.3...v1.18.4)

---
updated-dependencies:
- dependency-name: bootsnap
  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-08-06 07:32:23 +08:00
Alan Guo Xiang Tan
2492fe7715
FIX: Set sane default for Net::HTTP when processing a request (#28141)
This commit patches `Net::HTTP` to reduce the default timeouts of 60
seconds when we are processing a request. There are certain routes in
Discourse which makes external requests and if the proper timeouts are
not set, we risk having the Unicorn master process force restarting the
Unicorn workers once the `30` seconds timeout is reached. This can
potentially become a vector for DoS attacks and this commit is aimed at
reducing the risk here.
2024-08-06 07:12:42 +08:00
Joffrey JAFFEUX
a333d71d4c
FIX: ensures tags/categories are present (#28230)
Prior to this fix the query in stalled_topic_finder would assume that tags/categories would be nil or an array of ids. However it can be an empty array, in this case the query will not return results.
2024-08-05 22:26:12 +02:00