Commit Graph
182 Commits
Author SHA1 Message Date
Sabrina Demagny eca469e666 (api) add endpoint to manage ThreadAccess
Allows creating, updating, and deleting access to threads based on
user role.
2025-05-16 12:18:14 +02:00
jbpenrath bbb8f8cb4a (frontend) enhance search filters form and input handling
Added a new handleChange function to the SearchFiltersForm to update the
query on input change. Updated the SearchInput to handle search submissions
more effectively by allowing the closing of filters based on user interaction.
This improves the overall user experience when applying search filters.
2025-05-15 22:17:20 +02:00
jbpenrath b39133c82c (frontend) add search filters form
We have currently a raw search input, it's time to add a little ui to select
filter with ease.
2025-05-15 15:53:12 +02:00
Sylvain ZimmerandGitHub 87a949d4d2 (attach) add initial attachments support in in/outbound & api (#93) 2025-05-15 13:45:52 +02:00
Sabrina Demagny a99b2a0fae 🐛(backend) fix bcc lost after updated draft
Enhance and fix check to allow bcc displaying. Fix #85
2025-05-14 20:35:49 +02:00
Sabrina Demagny 11ffc48ead 🐛(backend) update thread stats after message hard delete
Call update_stats after delete one of thread's messages. Fixes #84.
2025-05-14 18:16:10 +02:00
jbpenrath 37d689bcb0 (frontend) add search input in the header
Allow the user to search in their email through a search input
2025-05-14 16:58:43 +02:00
jbpenrath b887e926c7 🔧(Makefile) add command to generate es index
Add `elasticsearch-index` command
2025-05-14 16:58:43 +02:00
jbpenrath 85e6cc8791 (frontend) allow to save draft without recipient
Make the `to` field optional to save draft then check if at least of recipient
(to, cc or bcc) has been defined.
2025-05-14 09:54:41 +02:00
jbpenrath e52dd1909f 🐛(frontend) allow to open link into MessageBody
Currently if a link does not open a new window, when the user clicks on the link
nothing happend. So we add `allow-popups` directive to allow this behavior.
2025-05-14 09:54:41 +02:00
jbpenrath a6427059ca 👔(frontend) manage QueueMessage timeout
Previously we expect the task retrieve endpoint could return a 404 when a task
does not exist but it is not possible (dce87f8) so instead we put a timeout to
stop to poll the task after a given delay.
2025-05-14 09:54:41 +02:00
Sylvain Zimmer dce87f864f (task) add test for task API and confirm unkown task behaviour
According to Celery's author here:
https://github.com/celery/celery/issues/3596#issuecomment-262102185

There is no way to check if a task ID exists. It will just return
"PENDING" indefinitely. Add tests for this accordingly.

Closes #91
2025-05-13 23:14:57 +02:00
renovate[bot]andJean-Baptiste PENRATH 3a3c79c645 ⬆️(dependencies) update js dependencies 2025-05-13 18:07:52 +02:00
jbpenrath 007c68a8d5 (frontend) follow sending message task status
We are now sending messages through celery. As now the sent is async,
we must inform the user of the sending progress. So now a toast is displayed
when the user send the message then this one is updated according to the
task status.
2025-05-13 17:28:21 +02:00
jbpenrath a79cfde5c4 👽️(api) update schema and api client
Fix task api schema (use enum for `status`) then run `make api-update`
2025-05-13 17:28:21 +02:00
Jean-Baptiste PENRATHandGitHub 3c16aa3efa 🔧(docker) update celery-dev service build context and target (#90)
Currently the `celery-dev` service is not able to build as the context is wrong
so the Dockerfile cannot be found. Furthermore we also fix the target.
2025-05-13 10:00:42 +02:00
jbpenrath e563166edb 🐛(frontend) simplify form value updates in MessageForm
Refactor the MessageEditor component to remove unnecessary options in form
value updates, ensuring cleaner state management.

Resolve #87
2025-05-13 09:45:25 +02:00
Sylvain ZimmerandGitHub 1f4047a061 (celery) add Celery worker, search, recipient statuses, better build (#88)
Before, sending was done synchronously on the api/send POST call. Now
we just build the MIME message and mark the message for sending, and
queue the actual SMTP (or internal) sending for the worker. We use
this opportunity to add fine-grained delivery statuses for each
recipient, something that traditional email systems are unable to do!

Expanding on that, this (too large) PR adds an initial Elasticsearch
index of threads. It also overhauls the build and CI system, using
Poetry instead of Pip.
2025-05-13 00:52:48 +02:00
Sabrina DemagnyandGitHub 84f95bf52a (backend) use ThreadAccess instead of direct mailbox link (#80)
* (backend) use ThreadAccess instead of direct mailbox link

Remove the direct link to a mailbox on Thread model. It is now possible to
define two types of roles for each thread (Reader and Editor) for a mailbox.
When creating a new thread, a new access to the sender's mailbox is created
with the Editor role.
It is now possible to delegate a thread to another mailbox with the Reader or
Editor role. So it is possible to forward a thread to another internal user
and avoid mail forwarding.

* (backend) change MailboxAccess permission into roles

Enhance access on mailbox and thread with role everywhere!

* improve doc

* enhance tests

* lint
2025-05-12 21:29:06 +02:00
jbpenrath 20e2e5ee73 (frontend) allow to delete draft message
Currently the button to delete a draft message simply mark it
as trashed that is weird for a draft message. So now we use the
message destroy api endpoint to delete this kind of message
2025-05-12 17:39:43 +02:00
jbpenrath f2462306df 🚸(frontend) invalidate thread stats when draft is created
Invalide thread stats queries when a draft message is created.
2025-05-12 17:39:43 +02:00
jbpenrath 6feaa39fa3 (frontend) display filtered message count
In the mailbox panel, use the new endpoint thread stats to display the count of
of messages or unread messages according to the selected folder.
2025-05-12 16:30:37 +02:00
jbpenrath f99b6f2a66 👽️(api) update schema and api client
Fix thread stats api schema (use enum for `stats_fields`)
 then run `make api-update`
2025-05-12 16:30:37 +02:00
jbpenrath ceff1293f8 (frontend) enhance MessageForm with toast notifications
Display success toast notifications for draft saving and message sending
 actions in the MessageForm component.
2025-05-12 14:34:25 +02:00
jbpenrath dfa7a48368 🚚(frontend) homogeneize file names
Use kebab-case to name js modules it prevents some issues
with git on OS using case insensitive file system.
2025-05-12 14:34:25 +02:00
jbpenrath b5aea63480 (frontend) install jsdom
jsdom lib is required by vitest.
2025-05-12 14:34:25 +02:00
jbpenrath 6b5f5a8571 ♻️(frontend) improve MessageForm validation
In order to manage and validate MessageForm, we decide to
use react-hook-form combined with Zod.

https://zod.dev/
https://react-hook-form.com/
2025-05-12 14:34:25 +02:00
Sylvain Zimmer 2bf02d399d 🐛(threads) fix replies not threading when delivering internally 2025-05-05 00:51:10 +02:00
Sylvain Zimmer ca0eb72c51 🐛(contacts) fix possibly empty contact names 2025-04-30 22:32:17 +02:00
jbpenrath b83a6ef631 (frontend) use dynamic views through thread counters
The api allows us to filter threads through filters. We are using this new
feature to build dynamic folders (All threads, Drafts, Send and Trash).
Furthermore we update the MessageForm logic to stick with the new draft
logic (First create a draft message then send the message)
2025-04-30 22:06:29 +02:00
jbpenrath 843f175ed7 (frontend) add action to trash a thread
User should be able to move a thread into the trash.
2025-04-30 22:06:29 +02:00
jbpenrath 29c700b198 👽️(frontend) use flags to update read thread/message state
We have a new route to update thread/message properties so the `read` endpoint
has been removed in favor of a `flag` endpoint. We update the frontend logic
to consume this new endpoint.
2025-04-30 22:06:29 +02:00
jbpenrath 715f040123 👽️(api) update schema and api client
Run `make api-update`
2025-04-30 22:06:29 +02:00
jbpenrath 6879694d2d 🍱(frontend) update banner asset
Use a new banner asset
2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH d95425cdd4 (mda) add a test for local message delivery 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 869ec6187a (api) add parent_id in message serializer 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 2b02f88161 (mda) differentiate local and external delivery of messages 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 5bad9de255 (threads) add new api/thread/stats/ route 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 81a8718cc5 🐛(drafts) add draftBody in message view 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH fed2d52c72 ♻️(thread) continue improving thread stats 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 134470e16b ♻️(flags) change IDs format to use post body JSON 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH ef5bd60509 💡(delete) restore commented bulk_delete, to be discussed 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH baa6ff8964 🚨(lint) fix lint 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH bf3df3a658 (api) add threads.count_messages and messaged_at 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 17b86ad5db ♻️(flags) refactor "read" and "thread.delete" feature in a single flag route 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 183d152f2c ♻️(mda) refactor large parts of the MDA with thinner views 2025-04-30 22:06:29 +02:00
Sabrina DemagnyandJean-Baptiste PENRATH 54fa808bb1 wip 2025-04-30 22:06:29 +02:00
Sabrina DemagnyandJean-Baptiste PENRATH 3df94cd80f (api) add draftBody 2025-04-30 22:06:29 +02:00
Sabrina DemagnyandJean-Baptiste PENRATH 9d72a787b7 (backend) allow to create draft message then send it
Add flag for draft message.
Split API view to create draft message, update it then allow to
send it.
2025-04-30 22:06:29 +02:00
renovate[bot]andJean-Baptiste PENRATH 73123c21d6 ⬆️(dependencies) update js dependencies
Bump all deps to their latest version through renovate. Just rollback
react and react-dom as `@openfun/cunningham-react` is not yet compatible
2025-04-29 16:13:26 +02:00