Commit Graph

19468 Commits

Author SHA1 Message Date
Renato Atilio
676f0897ac
FIX: subfolder account activation (#28463) 2024-08-21 13:50:38 -03:00
Jarek Radosz
cee2605d88
FIX: Lost outer context in #each block in hbr (#28461)
Regressed 3.5 years ago in e80332a2bc :P
2024-08-21 17:11:36 +02:00
Osama Sayegh
b69a7ea824
FIX: Specify @type arg for the image uploader in the about config area (#28460)
Specifying the type is required for the uploader to work on sites that use S3 uploads.
2024-08-21 16:35:32 +03:00
Martin Brennan
9dd47ca755
UX: Fix restore info link on admin backups page (#28452)
Followup 1446596089

The link to inform admins that restore is disabled
was not correct. This fixes it and also changes it
to go to /admin/backups/settings
2024-08-21 13:23:24 +10:00
Martin Brennan
8632ea5a63
UX: Apply admin UI guidelines to custom flags (#28433)
This commit changes the custom flags admin config area
to use the AdminPageHeader component and conforms
to the new admin UI guidelines. Also makes some slight
modifications to the reusable components to handle using
a @route for an action button.
2024-08-21 10:42:00 +10:00
dependabot[bot]
e1855da40d
Build(deps-dev): Bump ember-cli from 5.10.0 to 5.11.0 (#28449)
Bumps [ember-cli](https://github.com/ember-cli/ember-cli) from 5.10.0 to 5.11.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.10.0...v5.11.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-08-21 00:54:06 +02:00
dependabot[bot]
3d217dc6b3
Build(deps): Bump ace-builds from 1.35.4 to 1.35.5 (#28450)
Bumps [ace-builds](https://github.com/ajaxorg/ace-builds) from 1.35.4 to 1.35.5.
- [Release notes](https://github.com/ajaxorg/ace-builds/releases)
- [Changelog](https://github.com/ajaxorg/ace-builds/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ajaxorg/ace-builds/compare/v1.35.4...v1.35.5)

---
updated-dependencies:
- dependency-name: ace-builds
  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-21 00:52:25 +02:00
Sérgio Saquetim
649cbad216
DEV: Use the glimmer header in the Styleguide (#28427) 2024-08-20 19:44:26 -03:00
Osama Sayegh
eb0b2c9308
FIX: Use correct subtitle for Site contact name field (#28448)
A copy-and-paste error resulted in using the wrong subtitle for the "Site contact name" field in the admin config area for the /about page.
2024-08-21 01:21:49 +03:00
Kris
6c159241c9
UX: view count in topic map should always be at least 1 (#28447) 2024-08-20 17:26:09 -04:00
Osama Sayegh
10ae7ef44a
FEATURE: Add estimated number of global and EU visitors to the about page (#28382)
This commit implements 2 new metrics/stats in the /about page for the _estimated_ numbers of unique visitors from the EU and the rest of the world. This new feature is currently off by default, but it can be enabled by turning on the hidden `display_eu_visitor_stats` site settings via the rails console.

There are a number of assumptions that we're making here in order to estimate the number of unique visitors, specifically:

1. we're assuming that the average of page views per anonymous visitor is similar to the average number of page views that a logged-in visitor makes, and
2. we're assuming that the ratio of logged in visitors from the EU is similar to the ratio of anonymous visitors from the EU

Discourse keeps track of the number of both logged-in and anonymous page views, and also the number of unique logged-in visitors and where they're from. So with those numbers and the assumptions above, we can estimate the number of unique anonymous visitors from the EU and the rest of the world.

Internal topic: t/128480.
2024-08-21 00:03:42 +03:00
Mark VanLandingham
9802d4040f
DEV: Add class to span wrapping after-topic-list plugin outlet (#28445) 2024-08-20 14:08:06 -05:00
Osama Sayegh
db6eff7be9
DEV: Allow custom site activity items in the new /about page (#28400)
This commit introduces a new frontend API to add custom items to the "Site activity" section in the new /about page. The new API is called `addAboutPageActivity` and it works along side the `register_stat` serve-side API which serializes the data that the frontend API consumes. More details of how the two APIs work together is in the JSDoc comment above the API function definition.

Internal topic: t/128545/9.
2024-08-20 16:16:05 +03:00
Joffrey JAFFEUX
ccb1861ada
DEV: better highlighting of mentions (#28403)
This commit improves the hilight-ing of mentions in posts and chat messages.

- `@here` and `@all` will generate a `<a class="mention --wide">`
- bots will generate a `<a class="mention --bot">`
- current user will generate a `<a class="mention --current">`

To achieve this change the following value transformer has been added: "mentions-class". It will be run in posts and chat messages after the mention is rendered.

A bug were bots were not considered in mentioned users has also been fixed as part of this PR.
2024-08-20 14:37:28 +02:00
Osama Sayegh
35b748e7f4
FIX: Don't show silence button on staff users and display similar users (#28423)
This commit fixes a bug where the silence button is incorrectly displayed on the admin page of a staff user. It's not actually possible to silence a staff user because the backend correctly prevents it, but the frontend isn't checking if the button should be displayed.

Another small bug that this commit fixes is the similar users list not showing up inside the silence/suspend modals due to also a bug in the frontend.

I've also changed the way similar users are loaded so that they're not returned by the `admin/users#show` endpoint anymore and moved them into a new endpoint that the penalize modals (suspend and silence) can call directly to retrieve the list of users. This is done because the similar users list is never shown on the admin user page (`/admin/users/:user_id/:username`); they're only needed when the suspend or silence modals are opened.

Internal topic: t/130014.
2024-08-20 15:27:29 +03:00
dependabot[bot]
08463a9db2
Build(deps): Bump a11y-dialog from 8.0.4 to 8.1.0 (#28418)
Bumps [a11y-dialog](https://github.com/KittyGiraudel/a11y-dialog) from 8.0.4 to 8.1.0.
- [Release notes](https://github.com/KittyGiraudel/a11y-dialog/releases)
- [Commits](https://github.com/KittyGiraudel/a11y-dialog/compare/8.0.4...8.1.0)

---
updated-dependencies:
- dependency-name: a11y-dialog
  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-08-20 12:00:41 +02:00
锦心
070025204d
DEV: add addError method to FormKit onRegisterApi (#28436)
This commit adds the addError method to From's onRegisterApi to allow
parent components to add errors to a field.
2024-08-20 17:22:36 +08:00
dependabot[bot]
b42d6faef5
Build(deps-dev): Bump @swc/core from 1.7.11 to 1.7.14 (#28424)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.7.11 to 1.7.14.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/swc-project/swc/compare/v1.7.11...v1.7.14)

---
updated-dependencies:
- dependency-name: "@swc/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-08-20 13:07:51 +08:00
David Taylor
dfc947a97d
PERF: Defer button actions to improve interaction-next-paint (INP) (#28019)
This is a variation on bc3e8a9963cf9a64d114ec751c875025af169690, which was reverted due to issues on iOS. Safari's "in response to user action" check cannot follow the `runAfterFramePaint` chain of interaction -> requestAnimationFrame -> messageChannel, and so some sensitive browser APIs (e.g. clipboard, upload, etc.) were blocked.

This commit is similar, but uses `next()` instead of `runAfterFramePaint()`. The result seems the same, but doesn't have the same issue on iOS.

The chat-emoji-picker change was required to resolve a test failure. The emoji picker has never closed-on-scroll on desktop, so there is no user-facing change in behavior.
2024-08-20 10:11:34 +08:00
Martin Brennan
1446596089
UX: Apply admin interface guidelines to Backups page (#28051)
This commit converts the Backups page in the admin interface
to follow our new admin interface guidelines.

As part of this work, I've also made `AdminPageHeader` and `AdminPageSubheader`
components that can be reused on any admin page for consistency, that handle
the title and action buttons and also breadcrumbs.

Also renamed `AdminPluginFilteredSiteSettings` to `AdminFilteredSiteSettings` since
it can be used generally to show a subset of filtered site settings, not only
settings for a plugin. Not sure if it's ideal to have to define a new route for this
for every config area, but not sure how else to do it right now.
2024-08-20 09:59:43 +10:00
Gerhard Schlager
0826e021e4
PERF: Delete I18n._overrides after they have been applied (#28405)
There's no need to keep them around. This might just bloat memory if there are lots of translation overrides.
2024-08-19 14:11:04 +02:00
Gerhard Schlager
7b8855a698
FIX: Translation overrides didn't work for search orders (#28404)
The `SortOrders` were cached before translation overrides were applied on the client.
2024-08-19 14:10:29 +02:00
Martin Brennan
31a6d24053
FEATURE: Unseen feature indicator in admin sidebar (#28397)
This commit adds a blue dot next to the "What's New"
link in the admin sidebar if the user has not seen the
new features yet, as a followup to 3e5976f843
which removed the tab on the dashboard that had this same
functionality.

When the admin visits the "What's New" page they count
as having seen all the features straight away. This could
be something we want to change, but for now this keeps the
same functionality.
2024-08-19 14:50:30 +10:00
dependabot[bot]
32195ed77e
Build(deps-dev): Bump qunit from 2.21.1 to 2.22.0 (#28415)
Bumps [qunit](https://github.com/qunitjs/qunit) from 2.21.1 to 2.22.0.
- [Release notes](https://github.com/qunitjs/qunit/releases)
- [Changelog](https://github.com/qunitjs/qunit/blob/main/History.md)
- [Commits](https://github.com/qunitjs/qunit/compare/2.21.1...2.22.0)

---
updated-dependencies:
- dependency-name: qunit
  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-08-19 01:01:47 +02:00
Joffrey JAFFEUX
e7b7886d83
DEV: removes route action usage from sidebar footer (#28408)
`routeAction` is an old and bad pattern we don't want to have in the codebase anymore.


Co-authored-by: Jarek Radosz <jarek@cvx.dev>
2024-08-17 17:45:18 +02:00
Joffrey JAFFEUX
3e69f31e0b
DEV: migrates webhook-status to gjs (#28407)
This commit also adds a test for this component.

---------

Co-authored-by: Jarek Radosz <jarek@cvx.dev>
2024-08-17 17:44:56 +02:00
Joffrey JAFFEUX
ea8516b38d
DEV: prevents route action to crash in tests (#28409)
`routeAction` is testing at runtime that a route exists when in debug mode. However in the case of components tested in isolation there's no existing route which was causing an exception, this commit prevents this check in this case as it's irrelevant.
2024-08-17 13:52:20 +02:00
Renato Atilio
5e91233ca9
UX: omit fav badges count if max is 0 (#28402) 2024-08-16 16:42:10 -03:00
Joffrey JAFFEUX
a59c89211b
FIX: bypass highlighths for long code in auto mode (#28399)
Long code is considered 1000 characters atm. 10000+ characters would take seconds due to how highlightjs will consider every installed lang before choosing the best candidate.
2024-08-16 14:25:19 +02:00
Jarek Radosz
6cc100abe0
DEV: Move user-profile-secondary outlet (#28398)
Move it into the preceding `dl` element and remove the `div` wrapper.

The two plugins that use this outlet:
* d-follow - actually jumps through hacky hoops to get its elements into that `dl` anyway
* d-gamification - would look better if its element was in that `dl`
2024-08-16 13:47:52 +02:00
chapoi
931485b7c1
DEV: replace list control nav dropdown with DMenuMobile (#28324)
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Renato Atilio <renato@discourse.org>
Co-authored-by: David Taylor <david@taylorhq.com>
2024-08-16 01:40:47 +02:00
Martin Brennan
3e5976f843
FEATURE: Always show full page "New Features" to admins (#28383)
We used to show New Features in a tab on the dashboard,
but this could get pushed down the page especially on
our hosting. In 043117ca13
we made a separate What's New page, so this commit removes
the dashboard tab and changes the admin notification to
send the admin to /admin/whats-new instead of the dashboard
tab.
2024-08-16 09:12:24 +10:00
Kris
43abc219d1
DEV: give sidebar link buttons a data-list-item-name (#28389) 2024-08-15 17:44:37 -04:00
Osama Sayegh
a92cf019db
FIX: Make cancel and reset buttons work for file_size_restriction settings (#28347)
This commit fixes a number of bugs in `file_size_restriction` settings and does a little of refactoring to reduce duplicated code in site setting types (the refactoring is necessary to fix one of the bugs).

The bugs in `file_size_restriction` settings that are fixed in this commit:

1. Save/cancel buttons next to a `file_size_restriction` setting are shown upon navigating to the settings page without changes being made to the setting
2. Cancel button that discards changes made to the setting doesn't work
3. Reset button that resets the setting to its default doesn't work
4. Validation error message isn't cleared when resetting/cancelling changes

To repro those bugs, navigate to `/admin/site_settings/category/files` and observe the top 2 settings in the page (`max image size kb` and `max attachment size kb`).

Internal topic: t/134726.
2024-08-15 19:38:47 +03:00
Kris
b545576b3c
UX: do not check for dimensions in video filename (#28349) 2024-08-15 11:59:13 -04:00
David Battersby
de08ce8f7b
FIX: allow chat sound when notifications are disabled (#28385)
Desktop chat notification sounds have stopped working on most desktop browsers.

This is due to Notifications API being disabled when Push Notifications are supported in the browser, which means that we never iterate on the desktopNotificationHandlers and trigger the callback since we return early.
2024-08-15 18:30:55 +04:00
dependabot[bot]
10c6a761b3
Build(deps-dev): Bump @swc/core from 1.7.10 to 1.7.11 (#28379)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.7.10 to 1.7.11.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/swc-project/swc/compare/v1.7.10...v1.7.11)

---
updated-dependencies:
- dependency-name: "@swc/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-08-15 14:58:50 +02:00
Kris
8cd42de2ef
DEV: add before-sidebar-sections outlet to dropdown mode too (#28376) 2024-08-14 16:25:58 -04:00
Sérgio Saquetim
49449531de
DEV: Accept new transformer names after resetting to a new test (#28375) 2024-08-14 16:05:46 -03:00
David Taylor
b7b233423d
DEV: Fix ordering of freeze-valid-transformers (#28374)
plugins/themes need to use `withPluginApi` to register transformers, and that only works after `discourse-bootstrap` has been run
2024-08-14 18:22:48 +01:00
David Taylor
ede6220347
UX: Only scrollIntoView if sidebar items are not already visible (#28372)
When browsing through a sidebar with this feature enabled (i.e. admin, or docs), it's weird to have the scroll jump around when you click an item. This commit adds a check, so that we only `scrollIntoView` for items which are not already in the viewport.

Followup to b7cce1a0dc
2024-08-14 15:58:11 +01:00
Ted Johansson
d15031a219
DEV: Add plugin outlet for below wizard field (#28371)
We changed the design of the member access wizard step to use toggle groups instead of switches. To support existing designs for notices, we need another plugin outlet.
2024-08-14 15:25:59 +02:00
Osama Sayegh
1bcb5c4e21
UX: Tweak styling for the new /about page (#28367)
Various tweaks the new /about page. Main change is to make it display 3 columns of users instead of 2 when there's enough space.
2024-08-14 14:57:35 +03:00
锦心
1ffb0462c1
FIX: FormKit: Allow 0 in required number input (#28368)
0 is falsy in JavaScript, so the original code would treat 0 as if it
were not input. This unique exception was added to prevent 0 from being
treated as empty input.
2024-08-14 19:46:24 +08:00
Osama Sayegh
3704a917a9
FIX: Don't show blank space when there's no banner image (#28366)
This commit fixes a bug in the redesigned about page where if there's no banner image configured for the page, the top of the page where the banner goes is occupied with large white space. Additionally, this commit also fixes a related bug in the admin config area for the /about page where it's not possible to remove the uploaded banner image.
2024-08-14 10:34:34 +03:00
dependabot[bot]
ed3e566576
Build(deps): Bump terser from 5.31.5 to 5.31.6 (#28358)
Bumps [terser](https://github.com/terser/terser) from 5.31.5 to 5.31.6.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
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-14 00:57:46 +02:00
Joffrey JAFFEUX
a5980ea637
FIX: access correct name and description (#28353)
`defaultCategoryLinkRenderer` is using a fake category object which doesn’t have access to the functions and getters of category model.

This had been incorrectly set in c197daa04c

As we don't get a real category object, we have to call the transformers manually and also pass the fake category object as context, this is not ideal as people might try to access properties in the transformer which are not available on the category object given they will be different based on the context. Hopefully one day this helper and all the chain can be refactored to use a real category model.

This commit also adds tests for these two properties in the category-link helper.

<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
2024-08-14 00:04:55 +02:00
Jarek Radosz
c96dce2934
DEV: Convert user-status-picker to glimmer/gjs/dbutton/input (#28344) 2024-08-13 18:57:57 +02:00
Jarek Radosz
82741eb0a6
DEV: Replace onClick props in topic-timeline container (#28342)
Use `on` modifier instead, and set proper href attributes on links
2024-08-13 18:38:07 +02:00
Joffrey JAFFEUX
31ae81b8eb
FIX: do not continue list inside codefence (#28346)
This commit forces the textarea to check if the list is inside a codefence and won't continue the list if it's the case.

Note this commit also uses the message param of qunit assertions to make them more explicit. It has no impact on behavior.
2024-08-13 17:36:51 +02:00