Commit Graph

1708 Commits

Author SHA1 Message Date
Joffrey JAFFEUX 66130dc8c1
REFACTOR: handles every chat resource as an URL (#18961)
- Note this is also tweaking the UI a little bit as we are now using links/buttons in the header as needed
- It disables the find ideal channel in drawer mode, if loading `/chat` in drawer mode it will either reopen at the last position or just stay on index
2022-11-11 06:39:15 +01:00
Joffrey JAFFEUX 07e1b0591f
REFACTOR: chat-msgactions (#18969)
- s/chat-msg-actions/chat-message-actions
- s/chat-msgactions-hover/chat-message-actions-container
- creates dedicated css files for this component
- removes useless code
- removes grayscale
2022-11-10 15:08:14 +01:00
Joffrey JAFFEUX c0a4823203
UX: tweaks to msg actions menu (#18966)
- allows to scroll while hovering the menu
- correctly changes message background color while hovering menu
- prevents a bug where it would sometimes close the menu while moving from menu to the 3 dots expanded dropdown. This was caused by the gap between header/body of the 3 dots dropdown, which would sometimes allow to create a mouseover event on a possible different underlying message
- removes recent/favorite reactions on drawer mode
- grayscale reactions until hover
- boxshadow on msgactions container
- removes useless code
2022-11-10 07:42:37 +01:00
Keegan George 3d376c71b6
A11Y: Improve accessibility for saved status message (#18950)
Toggling channel settings shows a status message when saved. This status message is not accessible to screen readers. This commit ensures that the status message is made accessible.
2022-11-09 10:12:35 -08:00
Roman Rizzi 698c3ced15
FIX: Deliver chat summaries when allowed groups include "everyone" (#18955)
The mailer in charge of sending chat summary emails applies a filter to ensure only members of groups listed in the `chat allowed groups` setting receive them. However, when you set it to `everyone`, nobody will be notified because
we treat this group differently and don't create `GroupUser` records for every user on the site.

This commit changes the mailer to skip the filter when the `everyone` ID is in the list.
2022-11-09 10:54:47 -03:00
Martin Brennan de2382a652
DEV: Fix broken slug migration (#18951)
Follow up c6764d8c74
2022-11-09 11:08:02 +10:00
Martin Brennan c6764d8c74
FIX: Automatically generate category channel slugs (#18879)
This commit automatically ensures that category channels
have slugs when they are created or updated based on the
channel name, category name, or existing slug. The behaviour
has been copied from the Category model.

We also include a backfill here with a simplified version
of Slug.for with deduplication to fill the slugs for already
created Category chat channels.

The channel slug is also now used for chat notifications,
and for the UI and navigation for chat. `slugifyChannel`
is still used, but now does the following fallback:

* Uses channel.slug if it is present
* Uses channel.escapedTitle if it is present
* Uses channel.title if it is present

In future we may want to remove this altogether
and always rely on the slug being present, but this
is currently not possible because we are not generating
slugs for DM channels at this point.
2022-11-09 10:28:31 +10:00
Joffrey JAFFEUX 4e6909cc5a
FIX: uses i18n for saved text (#18949) 2022-11-09 00:15:57 +01:00
Discourse Translator Bot d7844a797f
Update translations (#18948) 2022-11-09 00:00:28 +01:00
Joffrey JAFFEUX 074aa5eb5e
FIX: handles starting draft dm from sidebar (#18946) 2022-11-08 23:58:11 +01:00
Roman Rizzi 74a9859a12
FIX: Migrate values before adding a not null constraint. (#18940)
Since the migration was added as a post migration, we'll try to add the constraint first, causing a NotNullViolation exception.

This only affects sites that were last deployed more than two days ago.
2022-11-08 16:11:03 -03:00
Joffrey JAFFEUX 21570410ab
FIX: makes sidebar links respect drawer mode (#18918)
Clicking a link of the sidebar will now open the drawer and load the correct channel.

This solution should correctly solve these cases:

closing drawer, clicking sidebar channel, should open the drawer on correct channel
visiting /chat then visiting / and clicking sidebar channel, should open full page chat on correct channel
2022-11-08 16:23:13 +01:00
Loïc Guitaut 9c482a645c FIX: Allow deletion of categories when chat channel is not present
Currently it’s not possible to delete a category if an associated chat
channel is present even if there are no messages in this channel.
This can lead to annoying situations for our users.

This patch addresses the issue by checking if the channel is empty
instead of just checking if there is a channel.
2022-11-08 10:25:39 +01:00
Martin Brennan ac7bf98ad1
DEV: Load client site settings YML into JS tests (#18413)
Our method of loading a subset of client settings into tests via
tests/helpers/site-settings.js can be improved upon. Currently we have a
hardcoded subset of the client settings, which may get out of date and not have
the correct defaults. As well as this plugins do not get their settings into the
tests, so whenever you need a setting from a plugin, even if it has a default,
you have to do needs.setting({ ... }) which is inconvenient.

This commit introduces an ember CLI build step to take the site_settings.yml and
all the plugin settings.yml files, pull out the client settings, and dump them
into a variable in a single JS file we can load in our tests, so we have the
correct selection of settings and default values in our JS tests. It also fixes
many, many tests that were operating under incorrect assumptions or old
settings.

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2022-11-08 09:17:43 +10:00
Martin Brennan 4116094e54
FIX: Make chat editor IDs not null (#18903)
Follow up to 766bcbc684

Makes ChatMessage.last_editor_id and ChatMessageRevision.user_id
NOT NULL since they are always filled in now and the last commit
had a migration to backfill this data.
2022-11-08 09:06:13 +10:00
Martin Brennan c66743ee3d
FIX: Make ChatMessageUpdater check editing access for guardian (#18902)
Follow up to 766bcbc684

This fixes a gaffe from that commit where I passed in the
guardian to ChatMessageUpdater but then forgot to remove
the old way of setting the guardian and user instance variables
from the chat_message that was passed in.

Also, it moves the ensure_can_edit_message! check from the
controller into ChatMessageUpdater so all the access
checks are in the same place.
2022-11-08 09:04:18 +10:00
Joffrey JAFFEUX 0a02a5d05a
FIX: follow up to #7fca078 (#18915)
- prevents triggering chat:open-channel two times
- builds a correct URL for home page
2022-11-07 19:31:08 +01:00
Joffrey JAFFEUX e0edfa9345
FIX: retention reminder is absolute and needs relative parent (#18913) 2022-11-07 19:10:09 +01:00
Rafael dos Santos Silva 3174e8e60f
DEV: DiscourseEvents for chat messages (#18914) 2022-11-07 19:06:10 +01:00
Joffrey JAFFEUX 7fca07821b
FIX: simplfies previous route handling (#18895)
This commits makes sure we correctly wait for the end of the transition to reopen the drawer on the correct channel/view. Also fixes a bug when previous URL was `/` and causing a double transition.
2022-11-07 14:48:18 +01:00
chapoi 091d83af60
UX: Chat index tweaks (#18905)
- rounded avatar
- cut off avatar
- no index background
2022-11-07 12:26:46 +01:00
maiki 4e4302c608
UX: Fix spelling and capitalization (#18886)
@discourse-translator-bot keep_translations_and_approvals
2022-11-07 10:40:34 +01:00
Joffrey JAFFEUX a51e5e1987
DEV: separates preferred-chat-mode service (#18883)
Also adds end to end system tests to ensure navigation scenarios are working correctly. This separation will make it easier to implement state in/out from chat.
2022-11-07 09:04:43 +01:00
Martin Brennan 766bcbc684
FIX: Add editing user ids to ChatMessage and ChatMessageRevision (#18877)
This commit adds last_editor_id to ChatMessage for parity with Post in
core, as well as adding user_id to the ChatMessageRevision record since
we need to know who is making edits and revisions to messages, in case
in future we want to allow more than just the current user to edit chat
messages. The backfill for data here simply uses the record's creating
user ID, but in future if we allow other people to edit the messages it
will use their ID.
2022-11-07 09:04:47 +10:00
Joffrey JAFFEUX 11f3618b80
DEV: initial system tests for chat and plugins (#18881)
This is a very basic to ensure it's working and open future possible work
2022-11-04 15:06:24 +01:00
Joffrey JAFFEUX 49a0129b0d
FIX: prevents chat to enter in endless loop when getting 404 (#18867)
Doing DOM operations in finally would cause them to happen even when the request was a failure. Consequence of these DOM operations would be new request, which would also end up in a 404, and so on.

This commit simply moves the DOM operations in the then block where it should be safe to make.
2022-11-03 19:52:44 +01:00
chapoi c122c032bb
Ux sidebar muted icon (#18856)
* UX: sidebar muted channel opacity and colour change

* UX: visual state for active on muted channel
2022-11-03 16:00:21 +01:00
Loïc Guitaut abcaa1a961 DEV: Rename direct message related models
This is a followup of the previous refactor where we created two new
models to handle all the dedicated logic that was present in the
`ChatChannel` model.

For the sake of consistency, `DMChannel` has been renamed to
`DirectMessageChannel` and the previous `DirectMessageChannel` model is
now named `DirectMessage`. This should help reasoning about direct
messages.
2022-11-03 14:39:23 +01:00
chapoi 2f510cbd05
FIX: Do not limit scope to direct messages (#18855) 2022-11-03 09:17:23 +01:00
Keegan George 0028149ed4
UX: Add back button in chat browse screen on mobile (#18849) 2022-11-03 09:06:30 +01:00
Joffrey JAFFEUX 9ff091dc01
FIX: the notification data on the client expects an identifier (#18850) 2022-11-03 09:06:05 +01:00
chapoi 1c52e11d48
UX: scope chat-channel-title hover effect (#18854) 2022-11-03 09:04:57 +01:00
Alan Guo Xiang Tan d446ad3290
UX: Muted style for entire chat section link when muted (#18852) 2022-11-03 08:37:39 +09:00
Keegan George 2e984f2eca
UX: Increase padding of back button in chat draft screen (#18848)
To increase hit target size for easier press on mobile devices
2022-11-02 21:28:41 +01:00
Discourse Translator Bot 82425b23ee
Update translations (#18813) 2022-11-02 15:13:47 +01:00
Roman Rizzi 0a5f548635
DEV: Move `discourse-chat` to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00
Daniel Waterworth 167181f4b7
DEV: Quote values when constructing SQL (#18827)
All of these cases should already be safe, but still good to quote for
"defense in depth".
2022-11-01 14:05:13 -05:00
Discourse Translator Bot 5f02f11acc
Update translations (#18740) 2022-10-25 17:00:49 +02:00
Penar Musaraj 595fc3ef22
A11Y: add keyboard support to youtube embeds (#18710) 2022-10-21 16:32:53 -04:00
Jarek Radosz 8304f40f84
FIX: Correctly debounce various functions (#18673)
Debouncing inline anonymous functions does not work.

This fixes all instances of that error by extracting the function or using the new `@debounce(delay)` decorator
2022-10-20 13:28:09 +02:00
David Taylor 9a4072fe31
DEV: Load plugin CSS in tests (#18668) 2022-10-19 18:10:06 +01:00
Discourse Translator Bot 0af2837b73
Update translations (#18642) 2022-10-19 15:19:28 +02:00
David Taylor f5419521f0
DEV: Support colocation of component templates in plugins (#18598)
This allows plugins to colocate component JS and HBS under `/plugins/{name}/assets/javascripts/discourse/components`.

`discourse-presence` is updated to use this new pattern, which also serves as an integration test for this part of the build pipeline.
2022-10-17 09:38:20 +01:00
Jarek Radosz a5156d18ff
DEV: Modernize controller unit tests (#17412)
Aligns controller tests with the Ember standard, by using `module` and `setupTest` instead of our custom `discourseModule`)
2022-10-14 13:15:58 +02:00
Jarek Radosz 4170b9bb58
DEV: Use more css vars (#18561)
Followup to #18518

This time it's mostly line-height vars and a couple of other uncommon vars.
2022-10-12 16:05:42 +02:00
Jarek Radosz ea326906e3
DEV: Use css var font sizes (#18518)
For consistency and and the ability to change all font sizes at once in the dev tools
2022-10-12 15:31:59 +02:00
Natalie Tay 1631394826
FEATURE: Show relative time when date is omitted (#18547) 2022-10-12 11:23:34 +08:00
David Taylor a0eb8092f0
FIX: Ensure local date format shortcuts work correctly (#18541)
Followup to 03b7b7d1bc
2022-10-11 11:25:32 +01:00
David Taylor a10a81244c
FIX: Ensure poll type toggle buttons function correctly (#18540)
Followup to 03b7b7d1bc
2022-10-11 11:20:18 +01:00
Natalie Tay e391f71c04
FIX: Determining local date same range is erroring when there is no date (#18509) 2022-10-07 21:07:27 +08:00