Commit Graph

3790 Commits

Author SHA1 Message Date
Kelv
8719235cfd
DEV: update deprecated icon name archive to box-archive in chat plugin (#30687) 2025-01-10 12:59:56 +08:00
Kris
c99a8dcfe7
Revert "UX: use font with more glyphs for discobot certificates" (#30681)
This reverts commit 55914bf9a3.
2025-01-09 18:56:47 -05:00
Kris
d9c992bfdd
UX: follow-up sidebar variable fixes for c398933 (#30676) 2025-01-09 15:53:29 -05:00
David Taylor
69ec6d29d7
DEV: Resolve this-property-fallback deprecation in chat test (#30669) 2025-01-09 10:17:18 +00:00
Joffrey JAFFEUX
40f7941f2b
FIX: emoji-picker minor improvements (#30645)
- uses emojiSearch to ensure we have the same result than autocomplete when filtering emojis (for example search aliases were not working correctly because of this)
- reset the visible sections when clearing filter to ensure we are not attempting to display all the emojis at once which would be slow
- prevents flashing of the full emoji list before showing filtered results
- correctly reset recent favorites and only show them when used
2025-01-08 22:10:50 +01:00
Kris
55914bf9a3
UX: use font with more glyphs for discobot certificates (#30646) 2025-01-08 13:44:09 -05:00
Natalie Tay
6dd306be55
DEV: Update a defensive test which case is no longer possible (#30640)
Introduced in https://github.com/discourse/discourse/pull/30263, it is also causing flaky tests.
2025-01-08 21:06:04 +08:00
Joffrey JAFFEUX
21c8376679
DEV: removes non needed special case (#30638)
Now that we correctly await for the modal to close, we dont need to special case and disable focusTrigger, the flow will now be:

- click an element of the menu
- wait for modal to close
- focus trigger
- trigger action, which will eventually open a modal and attempt to focus the first item
2025-01-08 11:59:16 +01:00
Joffrey JAFFEUX
6740a340ca
DEV: unifies emoji picker (#28277)
The chat emoji picker is renamed emoji-picker, and the old emoji-picker is removed.

This commit doesn't attempt to fully rework a new emoji-picker but instead tries to migrate everything to one picker (the chat one) and add small changes.

Other notable changes:
- all the favorite emojis code has been mixed into one service which is able to store one state per context, favorites emojis will be stored for all topics, and for each chat channel. Meaning that if you always use a specific emoji in a channel, it will only show as favorite emoji in this channel.
- a lot of static code has been removed which should improve initial load perf of discourse. Initially this code was around to improve the performance of the emoji picker rendering.
- the emojis are now stored, once the full list has been loaded, if you close and reopen the picker it won't have to load them again.

List of components:

- `<EmojiPicker />` will render a button which will open a dropdown
- `<EmojiPickerContent />` represents the content of the dropdown alone, it's useful when you want to render a picker from an action which is not the default picker button
- `<EmojiPickerDetached />` just a simple wrapper over `<EmojiPickerContent />` to make it easier to use it with `this.menu.show(...)`

---------

Co-authored-by: Renato Atilio <renatoat@gmail.com>
2025-01-08 11:41:36 +01:00
Discourse Translator Bot
1d7b1e587a Update translations 2025-01-07 21:56:56 +01:00
Renato Atilio
9b4dfbbbfe
DEV: skip flaky chat composer emoji spec (#30623)
This test is flaky, sometimes it fails with the hamburger menu blocking the click on the emoji, other times it just doesn't return the list of emojis when the search term is there.

Other similar emoji tests are skipped. Stopping the bleed, but we still need to figure out a more reliable testing strategy here.

Will revisit after #28277 is merged.

ref /t/-/145212
2025-01-07 13:36:43 -03:00
Gary Pendergast
b6c1e881be
FIX: Ensure popups from the chat composer dropdown gain focus (#30613)
When inserting anything from the chat composer dropdown, any popups opened weren't properly focussed.

This was due to the default behaviour of the dropdown menu closing, which tries to return the focus to the original triggering element. This would normally be the correct behaviour, but here we want the menu to close in the background, handing focus off to the popup, instead.
2025-01-07 17:34:01 +11:00
Martin Brennan
30be75460f
UX: Admin setting page consistency - Group permissions (#30528) (#30578)
* UX: Admin setting page consistency - Group permissions (#30528)

Followup c2282439b3 and
21470e4afd

Adds a new "Group permissions" page and group_permissions site
setting area, which shows every single group-based site setting
in the app and core plugins.

Also adds a "trust_levels" area to show on the already moved
admin "Trust level" settings page, since that previously was
showing a mix of trust level settings and allowed group settings.

* DEV: Review fixes
2025-01-07 11:25:21 +10:00
Osama Sayegh
7df1fac68b
DEV: Fix build (#30600)
The `faker` gem, which is a dependency for the `*:populate` rake tasks, isn't installed in the production environment, so we should only load files/classes related to those rake tasks in non-production environments.
2025-01-07 03:37:03 +03:00
Osama Sayegh
2d424676fc
DEV: Extend the reviewables:populate rake task in chat (#30597)
Related to 5a55c9062a

The chat plugin now makes use of the plugin API that was added in the linked commit for extending the reviewables:populate rake task.
2025-01-07 03:05:34 +03:00
Gabriel Grubba
0d62863951
FEATURE: Add trigger_on option to topic_tags_changed automation (#30391)
* FEATURE: default value to fields in automation

This PR adds the property `extra.default_value` to the fields in automation. This property is used to set the default value of the field.

Reducing the nil checks we have to do in automation fields.

I've added only testing in the `da-choices-field-test.js` file, but we could add tests to all the fields.

* FEATURE: Add trigger_on option to `topic_tags_changed` automation

This new field will allow users to specify when the trigger should be fired. The options are:
- `tags_added_or_removed`: The trigger will be fired when tags are added or removed from the topic.
- `tags_added`: The trigger will be fired when tags are added to the topic.
- `tags_removed`: The trigger will be fired when tags are removed from the topic.

This PR also brings a migration to set the `trigger_on` field to `tags_added_or_removed` for all existing `topic_tags_changed` automations.

* DEV: reorganize the specs in context blocks

* DEV: migration to add trigger_on field default value to topic_tags_changed_trigger

* DEV: `down` migration for `add_trigger_on_field_default_value_to_topic_tags_changed_trigger` migration

* Update plugins/automation/lib/discourse_automation/triggers/topic_tags_changed.rb

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>

* Update plugins/automation/config/locales/client.en.yml

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>

* DEV: lint files and update topic_tags_changed trigger to use `default_value`

* Revert "FEATURE: default value to fields in automation"

This reverts commit 4d32635c69.

* DEV: remove migration file

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-01-06 11:22:39 -03:00
David Battersby
67d568f709
FIX: stuck notification for mentions within threads (#30546)
For mentions within threads, the mentioned user can experience a stuck notification. This is due to thread memberships only being created for users who interact with a thread. Without the membership we cannot track if the message containing the mention was read by the user.

The solution to this explored in this PR is:

- auto add memberships for mentioned users (only direct mentions for performance reasons).
- update channel/thread unread queries to check notification read status AND thread membership last read message id when counting mentions.

Previously the mention count would remain until the user notification (containing the mention) was read. However this only happens if the user clicks the notification or clicks dismiss all notifications. When a user navigated to the thread without clicking the notification, the green/urgent badge on chat would remain even after a hard page refresh.
2025-01-06 17:26:37 +04:00
dependabot[bot]
27c557bc89
Build(deps-dev): Bump mocha from 2.6.1 to 2.7.1 (#30189)
* Build(deps-dev): Bump mocha from 2.6.1 to 2.7.1

Bumps [mocha](https://github.com/freerange/mocha) from 2.6.1 to 2.7.1.
- [Changelog](https://github.com/freerange/mocha/blob/main/RELEASE.md)
- [Commits](https://github.com/freerange/mocha/compare/v2.6.1...v2.7.1)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* DEV: Fix spec

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Brennan <martin@discourse.org>
2025-01-06 12:33:05 +01:00
Gary Pendergast
f5126199f6
UX: Admin setting page consistency - Navigation (#30574)
Create a basic config page that only contains navigation-related settings, to replace the setting filtered view linked to from "Navigation" in the admin sidebar.
2025-01-06 17:44:33 +11:00
Jarek Radosz
a4c2653db8
DEV: Update rubocop-discourse (#30552)
…and autofix the issues
2025-01-04 13:48:21 +01:00
Discourse Translator Bot
6c7eaf99af
Update translations (#30434) 2025-01-03 14:01:32 +01:00
Jan Cernik
bba4c9b005
FIX: Fallback when embedding YouTube videos with lazy videos (#30514) 2025-01-03 08:55:40 -03:00
Martin Brennan
3260654505
UX: Admin setting page consistency - Notifications (#30528)
Followup c2282439b3

Make the Notifications config page reached from the sidebar
use our consistent site setting page rules.
2025-01-03 10:34:40 +10:00
Renato Atilio
eb58623b11
UX: replace partially written emoji when using picker on chat (#30517)
After searching for an emoji through the autocomplete, when a user uses the emoji picker (to see the full list of emojis) and selects one, the content in the chat composer would contain both the partially written emoji and the full :selected_emoji: code.

The actual fix is just re-using the emojiSelected method from TextManipulation.
2025-01-02 12:29:18 -03:00
Joffrey JAFFEUX
80cda1212e
DEV: do not check for loading state (#30530)
This shouldn't be necessary and is already causing flakyness today.
2025-01-02 11:08:23 +01:00
Martin Brennan
5711bf6f27
DEV: Move admin config pages out of /customize/ sub-route (#30511)
The customize routes add CSS classes that make these admin
config pages look different from the ones under /admin/config.
We want all config routes to be under /admin/config as well.

This commit moves the emoji, user fields, and permalinks pages
out of customize and into config, updating all references and
adding more rails routes as needed.

Also renames admin emojis route to emoji, emoji is singular and plural.
2025-01-02 09:13:11 +10:00
Joffrey JAFFEUX
e9d4afec53
DEV: simplify restore message spec (#30490)
This spec was flaky, by not using a second session and rely on services instead, I hope to make it more stable and faster.
2024-12-28 15:27:12 +01:00
Joffrey JAFFEUX
4e5fc4654c
DEV: fixes safari bug with content including linebreaks (#30451) 2024-12-23 18:39:28 +01:00
Jordan Vidrine
d69b7da3ca
fix (#30450) 2024-12-23 09:42:55 -06:00
Jarek Radosz
c3548aec5e
DEV: Don't use 0-delay for test-env discourseLater (#30442)
`discourseLater` automatically uses delay of 10ms in test environment
2024-12-23 16:31:46 +01:00
Jarek Radosz
d0e38977e3
UX: Remove chat hover effect from github status badge (#30447) 2024-12-23 16:31:29 +01:00
Joffrey JAFFEUX
3198326cda
DEV: ensures channel has been created (#30445)
We were sometimes trying to fetch the channel before it has been created.
2024-12-23 13:54:22 +01:00
Joffrey JAFFEUX
ae4a4b7d00
DEV: waits for mark_read! to be applied (#30444) 2024-12-23 13:54:13 +01:00
Joffrey JAFFEUX
96b5c28cf9
DEV: correct test to visit category channel and not DM (#30441) 2024-12-23 13:36:02 +01:00
Joffrey JAFFEUX
cf26d3f211
DEV: uses capybara helper has_field (#30438)
Checking for value of input directly is not waiting for value to be present.
2024-12-23 13:25:17 +01:00
Joffrey JAFFEUX
c601b4112e
DEV: no services are used in this component (#30439) 2024-12-23 12:47:53 +01:00
Jarek Radosz
3c95aceeb0
DEV: Unify on-resize modifier situation (#30415)
1. Move chat's on-resize to core
2. Remove ember-on-resize-modifier
2024-12-23 09:11:17 +01:00
Jarek Radosz
0336235c74
DEV: Use object spread instead of Object.assign (#30407) 2024-12-23 08:44:29 +01:00
Régis Hanol
ebb6f1c2d2
FIX: better handle race condition when a channel is deleted (#30403)
NOTE: I wasn't able to reproduce locally, so that's my best guess as to what happens based on the production error logs.
It's also the reason why I haven't changed/added any tests...

Earlier today, we started seeing a growing number of errors in the `register_presence_channel_prefix("chat-reply")` handler of the chat plugin.
It was all coming from a Discourse where they make a heavy use of chat channels. They create and **delete** category channels regularly.

If a user has a thread in one of the channels that just got deleted, the client application might not be aware (just yet), asks the server to be connected to the "presence" bus of that channel, and BOOOM.

The following [line](fa0ad0306c/plugins/chat/plugin.rb (L325)) explodes because `chat_channel` is `nil`

```ruby
config.allowed_group_ids = chat_channel.allowed_group_ids
```

And why is `chat_channel` `nil`? Because when we [do](fa0ad0306c/plugins/chat/plugin.rb (L319))

```ruby
chat_channel = Chat::Thread.find_by!(id: thread_id, channel_id: channel_id).channel
```

The thread is still in the database, but the associated channel has been deleted.

A proper fix would most likely be to delete all the `Chat::Thread` associated to a deleted `Chat::Channel` but this might have more technical & business implications.
2024-12-21 00:49:21 +01:00
Jarek Radosz
d18bf67868
DEV: Remove unnecessary optional chaining operators (#30400) 2024-12-20 16:48:13 +01:00
David Taylor
d2979997e9
DEV: Introduce new 'glimmer topic list mode' site setting (#30375)
This replaces the previous group-based site setting
2024-12-19 17:38:35 +00:00
Keegan George
d886c55f63
DEV: Reusable post-list component (#30312)
This update adds a  _new_ `<PostList />` component, along with it's child components (`<PostListItem/>` and `<PostListItemDetails />`). This new generic component can be used to show a list of posts.

It can be used like so:
```js
/**
 * A component that renders a list of posts
 *
 * @component PostList
 *
 * @args {Array<Object>} posts - The array of post objects to display
 * @args {Function} fetchMorePosts - A function that fetches more posts. Must return a Promise that resolves to an array of new posts.
 * @args {String} emptyText (optional) - Custom text to display when there are no posts
 * @args {String|Array} additionalItemClasses (optional) - Additional classes to add to each post list item
 * @args {String} titleAriaLabel (optional) - Custom Aria label for the post title
 * 
*/
```
```hbs
<PostList
    @posts={{this.posts}}
    @fetchMorePosts={{this.loadMorePosts}}
    @emptyText={{i18n "custom_identifier.empty"}}
    @additionalItemClasses="custom-class"
 />
```
2024-12-19 09:20:25 -08:00
Ella E.
ddca2ca629
UX: Apply admin table to Automation settings page (#30341)
* UX: Apply admin table classes for consistent mobile styling on the automation page

* UX: Remove icon beside the automation page title

* DEV: Add status label to translations

* UX: Reorder the status and name when on mobile

* DEV: Add comment explaining tablet-specific status reorder

* DEV: Apply prettier
2024-12-19 05:07:14 -07:00
Régis Hanol
770a478fcc
UX: fix border around reply indicator (#30343)
On a narrow viewport on desktop, the margins above and below the "replying..." indicator were missing.

Internal - t/144612
2024-12-18 12:34:39 -05:00
Discourse Translator Bot
1631c39391
Update translations (#30319) 2024-12-18 15:19:37 +01:00
David Taylor
8f6c99df8c
DEV: Run prettier correctly for bundled-plugin test directories (#30338) 2024-12-18 12:02:28 +00:00
Martin Brennan
a879bcdc35
DEV: Introduce <DPageHeader /> and <DPageSubheader /> components (#30146)
This converts the `<AdminPageHeader />` component and the
`<AdminPageSubheader />` components into new components
that can be used outside of admin, and updates the CSS classes.
Also introduces a `<DPageActionButton />` component and child
components for the header action buttons.

I have to keep the old admin-only components around for
now until plugins are updated, then we can remove it,
and remove the re-exports that are done within
admin-page-action-button.gjs
2024-12-18 08:13:39 +10:00
Isaac Janzen
af8c98217a
DEV: Remove empty beforeEach hooks (#30326) 2024-12-17 11:57:49 -06:00
Ted Johansson
c1c7ea8959
DEV: Change hide_email_address_taken default to true (#30293)
We're changing the default of hide_email_address_taken to true. This is a trade-off we want to make, as it prevents account enumeration with minimal impact on legitimate users. If you forget you have an account and try to sign up again with the same e-mail you'll receive an e-mail letting you know.
2024-12-17 10:46:04 +08:00
Joffrey JAFFEUX
41df705188
DEV: replaces topic-notifications-options by DMenu (#30298)
This commit introduces <NotificationsTracking /> which is a wrapper component around <DMenu /> which replaces the select-kit component <TopicNotificationsButton />.

Each tracking case has its dedicated component:

- topic -> `<TopicNotificationsTracking />`
- group -> `<GroupNotificationsTracking />`
- tag -> `<TagNotificationsTracking />`
- category -> `<CategoryNotificationsTracking />`
- chat thread -> `<ThreadNotificationsTracking />`
2024-12-16 19:59:18 +01:00