Commit Graph

54285 Commits

Author SHA1 Message Date
Amanda Alves Branquinho b0d95c8c78
FEATURE: Add bulk action to bookmark (#26856)
This PR aims to add bulk actions to the user's bookmarks.

After this feature, all users should be able to select multiple bookmarks and perform the actions of "deleting" or "clear reminders"
2024-05-22 12:50:21 -03:00
Jarek Radosz 4c10b2eb33
DEV: Fix home-logo test flakes (#27135) 2024-05-22 17:49:04 +02:00
Kris 24d701f058
UX: clean up email preference layout (#27136) 2024-05-22 11:47:50 -04:00
benj e42ba6e90a
UX: Group membership PMs thread (#26974)
Instead of creating two separate Topics when a user (1) requests to join a group and (2) gets accepted in, this makes the acceptance message into a Post under the origin group request Topic.
2024-05-22 11:47:28 -04:00
Régis Hanol 0012d9626f FIX: chat activity indicator wasn't working for threads
When a user had the chat option "Show activity indicator in header" set to "all new messages", and they would get a reply to a thread they're part of, the chat icon in the header would not show the unread bubble indicator.

In order to fix this, the `ChatHeaderIconUnreadIndicator` component will now `showUnreadIndicator` whenever there is either one unread public channel or there are unread threads.

I only added a system spec for this very specific path because I don't want to slow down the whole suite to test for all the various combination of the `chat_header_indicator_preference` values.

Internal ref - t/128874
2024-05-22 17:42:59 +02:00
Jarek Radosz 24230e7461
DEV: Silence whitespace-eating-comment warnings (#27129)
e.g. `unexpectedly found "! no whitespace ~" when slicing source, but expected " no whitespace "`
See: https://github.com/emberjs/ember.js/issues/19392

Co-authored-by: David Taylor <david@taylorhq.com>
2024-05-22 16:21:51 +02:00
Penar Musaraj a77e3eeaf2
DEV: Update Discover URL (#27116) 2024-05-22 09:53:09 -04:00
Régis Hanol d4af30f26d FIX: elided content in email should always have an href
Not 100% sure why the changes in `PrettyText.format_for_email` raised this issue, but we were missing adding a link to the Discourse instance whenever we are replacing the elided part of a post with a link to either the post or the Discourse instance in the email.

Also reformated the specs using better variable names (sometimes a variable named `md` would contain some html) and used the `match_html` helper for all the tests.
2024-05-22 15:38:18 +02:00
Régis Hanol 8f7a3e5b29 FIX: subfolder absolute links in summaries
This fixes the `PrettyText.make_all_links_absolute` to better handle subfolder.

In subfolder, when given the cooked version of a post, links to mentions includes the `Discourse.base_path` prefix. Adding the `Discourse.base_url` was doubling the `Discourse.base_path`.

The issue was hidden behind the specs which was stubbing `Discourse.base_url` instead of relying on `Discourse.base_path`.

This fixes both the "algorithm" used in `PrettyText.make_all_links_absolute` to better handle this case and correct the specs to properly handle subfolder cases.

There are lots of changes in the specs due to a refactoring to use squiggly heredoc strings for easier reading and less escaping.
2024-05-22 15:38:18 +02:00
Jan Cernik 9889547475
FEATURE: Allow to bulk delete chat messages (#26586) 2024-05-22 08:57:00 -03:00
Joffrey JAFFEUX e5d040ef61
UX: removes blinking indicator while streaming message (#27131)
Given this is currently buggy and  we have the cancel button Im not sure this is actually necessary. I feel like it's adding a lot of noise of low value.

For now at least, it's better without it.
2024-05-22 13:48:44 +02:00
Régis Hanol 004dabd84f
DEV: git ignored directories should not have trailing slashes (#27130)
VS Code is configured to automatically excludes files and directories from the `.gitignore` but the trailing slash was not working as expected.

The plugins that had a trailing slash in the .gitignore weren't allow-listed properly in VS Code.
2024-05-22 12:33:01 +02:00
Joffrey JAFFEUX 88ebd4c11f
DEV: review follow up (#27128) 2024-05-22 10:33:05 +02:00
Régis Hanol 958437e7dd
FIX: send activity summaries based on "last seen" (#27035)
instead of "last emailed" so that people getting email notifications (from a watched topic for example) also get the activity summaries.

Context - https://meta.discourse.org/t/activity-summary-not-sent-if-other-emails-are-sent/293040

Internal Ref - t/125582

Improvement over 95885645d9
2024-05-22 10:23:03 +02:00
Régis Hanol 3d4d21693b
FIX: various revision history modal quirks (#27058)
- FIX: properly scope category changes to what the current user can see
- UX: previous category is now highlighted in "red", new category is highlighted in "green"
- PERF: no need to serialize the categories
- FIX: properly track wiki
- FIX: properly track post_type (aka. Staff Color)
- FIX: properly track making a topic a PM
- FIX: never show the category changes when a topic is made a PM
- PERF: post_revision serializer is now more leaner (never includes title changes when post_number > 1, never includes user changes if there aren't any)
- UX: always sort the tags by name
2024-05-22 10:09:20 +02:00
Joffrey JAFFEUX 52125d849f
FIX: correctly check for disabled notifications, tab and is idle (#27127)
This commit reuses the existing codepath in desktop-notifications and make it available to use to chat.

primaryTab was too hard to test if not impossible in this service test, however isIdle and disabled notifications are correctly tested.
2024-05-22 10:08:05 +02:00
Sam 322a20a9f4
FIX: paginating posts should allow for deletions and PMs (#27098)
Note this may have performance issues in some cases, will need to be monitored

Previous to this change we were bracketing on 50 id windows. They may end up
having zero posts we are searching for leading to posts.rss and .json returning
no results.

- avoids Post.last.id which is expensive
- order by id desc which is better cause we bracket on id
2024-05-22 15:36:29 +10:00
Martin Brennan 3eb6fc058a
FEATURE: Use the new plugin show route from the plugin list (#27097)
Followup 4e7a75a7ec

Several plugins (Gamification, AI) now use the new
plugin show route. Any plugins that are using it can
now redirect to this page via the Settings button in
the plugin list, rather than taking the user to the
old site settings page filtered by category.
2024-05-22 11:34:12 +10:00
Jarek Radosz 4b29ab8572
DEV: Fix glimmer suggested topic item badges (#27123) 2024-05-22 03:06:45 +02:00
Sérgio Saquetim 48b74245b9
DEV: Add the `user-dropdown-button__*` plugin outlets (#27122) 2024-05-21 20:07:51 -03:00
Ella E 4334fc9bd3
UX: Change admin sidebar expand/collapse all icon (#27120) 2024-05-22 09:07:07 +10:00
Sérgio Saquetim 25060fbabd
DEV: Deprecate the `user-dropdown` header widget (#27118) 2024-05-21 19:51:42 -03:00
Jan Cernik 1863ee52e9
DEV: Remove activation part from spec to fix flaky test (#27100)
We already have a test for activation anyways
2024-05-21 17:39:29 -03:00
Jan Cernik 915982955b
DEV: Fix flaky spec when creating a chat message from params (#27099) 2024-05-21 17:39:17 -03:00
Joffrey JAFFEUX bc0ef9f7ee
FIX: play audio sound on message in non group DMs (#27112)
Prior to this change, only mentions would get a notification and a sound. This change will not create a notification for this case, but will play a sound. This is still respecting notification settings, not playing the sound when you are viewing the channel or not following it.

---------

Co-authored-by: Régis Hanol <regis@hanol.fr>
2024-05-21 21:51:22 +02:00
Kris 13a2ca8b09
UX: update px spacing to em for proportionality (#27108) 2024-05-21 13:13:38 -04:00
Jarek Radosz ea7e6ea459
DEV: Add missing `tr` wrapper to glimmer topic-list-header (#27107) 2024-05-21 19:00:03 +02:00
Jarek Radosz 5678332ffb
DEV: Add `td` to the `element` helper list (#27106)
…so it uses the more performant glimmer/template-only component wrapper instead of falling back to an ember component wrapper. see the `element` helper PR for more details.
2024-05-21 18:59:50 +02:00
Kris 06f48a82ed
UX: switch post action buttons to inline-flex to avoid extra whitespace (#27110) 2024-05-21 11:58:15 -04:00
Discourse Translator Bot db3db06caf
Update translations (#27104) 2024-05-21 17:40:50 +02:00
Kris fbb0fb92d1
UX: search context box too dark (#27109) 2024-05-21 10:52:14 -04:00
Jarek Radosz 87769a83c4
DEV: Implement glimmer topic-list (#26743)
(experimental)

The initial implementation of glimmer topic-list and related components. Does not include new APIs and isn't compatible with existing customization. That's gonna come in future PRs.

Enabled by adding groups to `experimental_glimmer_topic_list_groups` setting.
2024-05-21 14:36:15 +02:00
Jarek Radosz eb2df2b7d6
DEV: Clean up sidebar modals (#26999)
1. async/await
2. TrackedSet
3. don't rely on ember array methods
4. list used props
5. move stuff out of constructors
6. don't use ember's Input component
7. convert a function to a method (to avoid passing in a class prop)
8. add missing `@tracked`
9. remove tracking from props that don't need it (not used in templates)
2024-05-21 14:35:22 +02:00
Régis Hanol fe12cfeab2
FIX: shows errors when converting to public is impossible (#27103)
Follow up to e04ac5e2d8 which missed showing the error messages in the "convert to public" modal 🤦‍♂️
2024-05-21 12:14:31 +02:00
Krzysztof Kotlarek 40d65dddf8
Revert "DEV: move post flags into database (#26951)" (#27102)
This reverts commit 7aff9806eb.
2024-05-21 16:21:07 +10:00
Alan Guo Xiang Tan 67a7b28096
DEV: Don't run `discourse-ai` plugin specs when running against stable (#27095)
`discourse-ai` has custom gems which need to be bumped in order to be
compatible with Ruby 3.3. However, its version is pinned so we can't
pull in the commits in which upgrades the gems to be compatible with
Ruby 3.3. Just avoid running the specs on `stable` branch for now until
we release a new stable.
2024-05-21 12:09:40 +08:00
Krzysztof Kotlarek 7aff9806eb
DEV: move post flags into database (#26951)
This is preparation for a feature that will allow admins to define their custom flags. Current behaviour should stay untouched.
2024-05-21 13:15:32 +10:00
Alan Guo Xiang Tan 34c527d694
DEV: Pull compatible themes in tests workflow (#27093)
This commit adds a step in our tests workflow on Github actions to update the themes to
use the compatible version when not running aginast the `main` branch.
This is to ensure that we are not running
the tests for themes against an incompatible version of Discourse.
2024-05-21 10:38:41 +08:00
chapoi 1dcf756d78
UX: shorten duration of bookmark toasties (#27085) 2024-05-21 10:09:12 +10:00
chapoi 5c09792f79
UX: increase base font-size to 16px (#27087) 2024-05-20 21:08:20 +02:00
Joffrey JAFFEUX 7a0c4c5296
FIX: improves chat audio notification reliability (#27089)
Debouncing the audio was causing the audio to be lost sometimes, somewhat randomly. It's not supposed to be necessary.

The commit also refactors the code to async/await.
2024-05-20 20:48:30 +02:00
David Taylor fb9a43c282
DEV: Introduce `element` helper (#27086)
Returns a wrapper component with the given tagname, or an empty wrapper for an empty string.
Similar to the reference implementation of RFC389, with higher-performance shortcuts for common elements.
2024-05-20 17:40:12 +01:00
David Taylor 23b02a3824
DEV: Introduce `@dedupeTracked` (#27084)
Same as `@tracked`, but skips notifying consumers if the value is unchanged. This introduces some performance overhead, so should only be used where excessive downstream re-evaluations are a problem.

This is loosely based on `@dedupeTracked` in the `tracked-toolbox` package, but without the added complexity of a customizable 'comparator'. Implementing ourselves also avoids the need for pulling in the entire package, which contains some tools which we don't want, or which are now implemented in Ember/Glimmer (e.g. `@cached`).
2024-05-20 15:59:30 +01:00
Ted Johansson 32aaf2e8d3
DEV: Remove deprecated AuthProvider#enabled_setting= (#27081)
AuthProvider#enabled_setting=, used primarily by plugins, has been deprecated since version 2.9, in favour of Authenticator#enabled?. This PR confirms we are seeing no more usage and removes the method.
2024-05-20 18:10:15 +08:00
Joffrey JAFFEUX 9302187ca4
FIX: ensures topic info is dynamic with scroll (#27082)
Prior to this fix we were using `topic.current_post_number` which is coming from the server side and represents the initial topic scroll position when initially rendered to the end user. However, this value is not dynamic and is not updated when the user scrolls, `topic.currentPost` is the dynamic equivalent.

No test as there are very low chances a test like this one based on scroll position, will be reliable over time.
2024-05-20 11:20:37 +02:00
Alan Guo Xiang Tan 29bf61d5dd
DEV: Add mutex_m to reviewed gems (#27080) 2024-05-20 15:03:33 +08:00
Martin Brennan 1239178f49
FEATURE: Introduce DBreadcrumbs components (#27049)
This commit introduces the following components:

* DBreadcrumbsContainer - The wrapper template-only component,
  which renders all DBreadcrumbsItem components on the page.
* DBreadcrumbsItem - The component that registers a LinkTo
  for the breadcrumb trail. The breadcrumb > trail > will
  show based on the order these items are rendered on the page.
* BreadcrumbsService - Manages the DBreadcrumbsContainer elements
  on the page via DBreadcrumbsContainerModifier.
* DBreadcrumbsContainerModifier - Handles registering DBreadcrumbsContainer
  elements with the BreadcrumbsService and deregistering them.

For now, we will only use these breadcrumbs in the admin section
of Discourse, and this initial commit only uses them in admin/plugins.

This is heavily based off of
https://github.com/Bagaar/ember-breadcrumbs,
but will be further modified for our needs.
2024-05-20 14:25:54 +10:00
Martin Brennan f2cdc3b2a4
FIX: Take into account language fallbacks for admin sidebar plugin links (#27061)
This commit fixes an issue where I18n.lookup was being used to
check if a link had a valid I18n key when the `addAdminSidebarSectionLink`
plugin API was used. However this was imperfect -- usually when we do
`I18n.t`, we fall back to the default locale (`en`), but if
`I18n.lookup` is used we do not do this, so we were removing the link
needlessly.

This issue was identified via the plugin API's use in https://github.com/discourse/docker_manager

c.f. https://meta.discourse.org/t/new-admin-sidebar-wheres-the-update-discourse-button/308213/15?u=martin
2024-05-20 09:41:53 +10:00
dependabot[bot] e019f848bf
Build(deps-dev): Bump rb-inotify from 0.10.1 to 0.11.1 (#27074)
Bumps [rb-inotify](https://github.com/guard/rb-inotify) from 0.10.1 to 0.11.1.
- [Commits](https://github.com/guard/rb-inotify/compare/v0.10.1...v0.11.1)

---
updated-dependencies:
- dependency-name: rb-inotify
  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-05-20 07:02:52 +08:00
dependabot[bot] 3081273795
Build(deps-dev): Bump mocha from 2.2.0 to 2.3.0 (#27075)
Bumps [mocha](https://github.com/freerange/mocha) from 2.2.0 to 2.3.0.
- [Changelog](https://github.com/freerange/mocha/blob/main/RELEASE.md)
- [Commits](https://github.com/freerange/mocha/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: mocha
  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-05-20 07:02:36 +08:00