Commit Graph

1755 Commits

Author SHA1 Message Date
Anthony LC
f4cb66d6b6 💄(frontend) Title header optional
On the DSFR instance the title will not
be displayed anymore in favor of
a icon that include the title.
So we make the title optional, it
will be configurable from the
theme configuration.
2026-02-12 12:53:30 +01:00
Anthony LC
57dc56f83e 🎨(frontend) improve overriding from configuration theme
We were partially overriding the frontend with the
cunningham theme meaning at build time. We stop to
do this way to do it only from the configuration
theme. This way it will be easier to maintain and
to update.
We improve as well the typing with more global types
like Image type from logo and icons, and HTMLLinkElement
type for the favicon, meaning you can really
override compoments from the configuration theme.
2026-02-12 12:53:30 +01:00
Cyril
de1a0e4a73 ️(frontend) prevent dates from being focusable
Keep date links clickable with mouse while removing keyboard focus.
2026-02-12 11:40:29 +01:00
BEY Quentin
17cb213ecd 🚸(oidc) ignore case when fallback on email
Some identity providers might change the case, but in our products we
don't consider case variation to be consider as different email
addresses.

Next step would be to normalize the DB value of email to be lower-case.
2026-02-11 18:48:51 +00:00
Sylvain Boissel
3ab0a47c3a (backend) manage reconciliation requests for user accounts (#1878)
For now, the reconciliation requests are imported through CSV in the
Django admin, which sends confirmation email to both addresses. When
both are checked, the actual reconciliation is processed, and all
user-related content is updated.

## Purpose

Fix #1616 // Replaces #1708

For now, the reconciliation requests are imported through CSV in the
Django admin, which sends confirmation email to both addresses. When
both are checked, the actual reconciliation is processed, and all
user-related content is updated.


## Proposal
- [x] New `UserReconciliationCsvImport` model to manage the import of
reconciliation requests through a task
(`user_reconciliation_csv_import_job`)
- [x] New `UserReconciliation` model to store the user reconciliation
requests themselves (a row = a `active_user`/`inactive_user` pair)
  - [x] On save, a confirmation email is sent to the users
- [x] A `process_reconciliation` admin action process the action on the
requested entries, if both emails have been checked.
- [x] Bulk update the `DocumentAccess` items, while managing the case
where both users have access to the document (keeping the higher role)
- [x] Bulk update the `LinkTrace` items, while managing the case where
both users have link traces to the document
- [x] Bulk update the `DocumentFavorite` items, while managing the case
where both users have put the document in their favorites
- [x] Bulk update the comment system items (`Thread`, `Comment` and
`Reaction` items)
  - [x] Bulk update the `is_active` status on both users
- [x] New `USER_RECONCILIATION_FORM_URL` env variable for the "make a
new request" URL in an email.
- [x] Write unit tests
- [x] Remove the unused `email_user()` method on `User`, replaced with
`send_email()` similar to the one on the `Document` model


## Demo page reconciliation success

<img width="1149" height="746" alt="image"
src="https://github.com/user-attachments/assets/09ba2b38-7af3-41fa-a64f-ce3c4fd8548d"
/>

---------

Co-authored-by: Anthony LC <anthony.le-courric@mail.numerique.gouv.fr>
2026-02-11 18:09:20 +00:00
Sylvain Boissel
685464f2d7 🚸(backend) sort user search results by proximity with the active user (#1802)
## Purpose
Allows a user to find more easily the other users they search, with the
following order of priority:
- users they already share documents with (more recent first)
- users that share the same full email domain
- ~~users that share the same partial email domain (last two parts)~~
- ~~other users~~

Edit: We need to ilter out other users in order to not reveal email
addresses from members of other organisations. It's still possible to
invite them by email.

Solves #1521

## Proposal
- [x] Add a new function in `core/utils.py`:
`users_sharing_documents_with()`
- [x] Use it as a key to sort the results of a basic user search
- [x] Filter user results to avoid reveal of users (and email addresses)
of other orgs or that have not been interacted with.
- [x] User research through "full" email address (contains the '@') is
left unaffected.

---------

Co-authored-by: Anthony LC <anthony.le-courric@mail.numerique.gouv.fr>
2026-02-11 18:51:45 +01:00
virgile-dev
9af540de35 📝(readme) replace demo link (#1875)
so that the sandbox is not a public gov one

Signed-off-by: virgile-deville <virgile.deville@beta.gouv.fr>
2026-02-11 16:48:24 +00:00
Manuel Raynaud
6c43ecc324 🔧(docker) change mime.types url in Dockerfile
Change mime.types url in Dockerfile
2026-02-11 14:17:32 +00:00
renovate[bot]
607bae0022 ⬆️(dependencies) update axios to v1.13.5 [SECURITY] 2026-02-10 09:29:05 +00:00
Anthony LC
1d8b730715 (e2e) add threshold in regression test
When comparing PDF screenshots, we can have some
minor differences due to the different environments
(OS, fonts, etc.).
To avoid false positives in our regression
tests, we can set a threshold for the number of
different pixels allowed before considering the
test as failed.
If the test fails we will now report the PDF
and the differences to identify quickly
what are the regressions.
2026-02-09 16:17:05 +01:00
Anthony LC
d02c6250c9 🔒️(frontend) harden security check on url
We harden the security check on url to prevent attacks.
2026-02-09 16:17:05 +01:00
Anthony LC
b8c1504e7a ♻️(export) change pdf block from embed to iframe
When trying to print with a embed PDF the
browser's print dialog stays blocked and the user
can't print the document. Changing the PDF block
to use an iframe instead of an embed resolves
this issue.
2026-02-09 16:17:05 +01:00
Anthony LC
18edcf8537 🚨(ci) limit print check to backend
We added a feature to print documents directly
from the browser. The function is called
`window.print()`, this name collides with Python's
`print()` function. To avoid false positives in our
CI when checking for print statements, we limit
the search to only the backend code.
2026-02-09 16:17:05 +01:00
Anthony LC
5d8741a70a (frontend) print a doc with native browser
We can now print a doc with the native browser
print dialog.
This feature uses the browser's built-in print
capabilities to generate a print preview and
allows users to print directly from the application.
It has as well a powerfull print to PDF feature
that leverages the browser's PDF generation
capabilities for better compatibility and
quality.

Co-authored-by: AntoLC <anthony.le-courric@mail.numerique.gouv.fr>
Co-authored-by: Cyril <c.gromoff@gmail.com>
2026-02-09 16:17:04 +01:00
Cyril
48df68195a ️(frontend) focus docs list title after filter navigation
Explain focus shift to match skip-to-content behavior.

hook useRouteChangeCompleteFocus

Positionne the focus on the first target or main element after a route change.
2026-02-05 11:13:30 +01:00
buildwithricky
7cf42e6404 🐛(frontend) fix doc timestamp display
Implemented the logic to show 'Just now' instead
of '0 seconds ago' when the difference is under
one second.

Signed-off-by: buildwithricky <nwakezepatrick@gmail.com>
2026-02-04 09:34:21 +01:00
Manuel Raynaud
9903bd73e2 ️(actions) enable trivy scan on backend image
The trivy was disabled because protobuf library was blocking the release
process. We can now enable it again, a new release of protobuf is
available.
2026-02-03 16:45:13 +00:00
Anthony LC
44b38347c4 🐛(frontend) fix broadcast store sync
When going from one subdoc to another by example,
the broadcast store could have difficulty to resync.
This commit ensures that the broadcast store
cleans up and resets its state when rerendering.
It will stop as well triggering the action for
the current user avoiding potential unecessary
requests.
2026-02-03 14:25:35 +01:00
Thai Pangsakulyanont
709076067b 🐛(backend) add AWS_S3_SIGNATURE_VERSION environment variable support
Add support for the `AWS_S3_SIGNATURE_VERSION` environment variable to
allow configuring S3 signature version for compatibility with
S3-compatible storage services like Linode Object Storage.

Fixes #1788

Signed-off-by: dtinth on MBP M1 <dtinth@spacet.me>
2026-02-02 10:47:14 +00:00
Anthony LC
db014cfc6f 🔖(minor) release 4.5.0
Added:
- (frontend) integrate configurable Waffle
-  Import of documents
- 🚨(CI) gives warning if theme not updated
- (frontend) Add stat for Crisp
- (auth) add silent login
- 🔧(project) add DJANGO_EMAIL_URL_APP environment variable

Changed:
- (frontend) improve accessibility:
  - ️(frontend) fix subdoc opening and emoji pick focus
- (backend) add field for button label in email template

Fixed:
- (e2e) fix e2e test for other browsers
- 🐛(export) fix export column NaN
- 🐛(frontend) add fallback for unsupported Blocknote
  languages
- 🐛(frontend) fix emojipicker closing in tree
- 🐛(frontend) display children in favorite
- 🐛(frontend) preserve typed text after @ on escape

Removed:
- 🔥(project) remove all code related to template

Security:
- 🔒️(trivy) fix vulnerability about jaraco.context
2026-01-29 16:13:37 +01:00
Manuel Raynaud
52cd76eb93 🔧(backend) customize cache config
We want to split the cache config between the app cache and the session
cache. In the app cache, the default one, we allow to configure a
prefix. By default this prefix is a fixed string so the cache will be
never revoked because it is changing but it allow every instance to
implement its own strategy like prefixing the keyx cache with a
timestamp.
To not impact session, the session cache is splitted in the settings.
2026-01-29 16:13:36 +01:00
Anthony LC
505b144968 🔊(CHANGELOG) change link version CHANGELOG
A "v" was introduced in the link format, we need
to update the version in the link accordingly to
match it.
We add "v" to fit with others projects.
2026-01-29 10:24:28 +01:00
lunika
009de5299f 🌐(i18n) update translated strings
Update translated files with new translations
2026-01-29 10:11:56 +01:00
Anthony LC
0fddabb354 🩺(CI) remove backend trivy guard
We need to do a release but the backend cannot
build because of a trivy issue.
So we temporarily remove the backend trivy guard
to be able to release.
2026-01-29 10:11:56 +01:00
Anthony LC
cd25c3a63b 🚚(frontend) move from hook to hooks
We has 2 folders for hooks: "hook" and "hooks".
To keep consistency, we move all hooks to "hooks"
folder and delete "hook" folder.
2026-01-28 16:59:45 +01:00
Anthony LC
adb216fbdf (frontend) add stat from Crisp
We want to track document views with user
authentication status using Crisp analytics.
2026-01-28 16:59:45 +01:00
Anthony LC
235c1828e6 💄(export) improve heading line height
Import heading line height mapping for PDF export
to match the one used in the doc.
2026-01-28 11:12:47 +01:00
Anthony LC
4588c71e8a 🏷️(frontend) adjust typing to fit styled-component
Recent upgrade of styled-components caused
type issues in Box and Text components.
We adjust the typing to fit the new version.
2026-01-28 11:12:47 +01:00
Anthony LC
6b7fc915dd ️(frontend) load Marianne font
Ui-kit expose now correctly the Marianne font.
We can use it now just by importing the font
from our css, no need to copy paste the font
in the public folder.
2026-01-28 11:12:46 +01:00
Anthony LC
c3e83c6612 ⬆️(dependencies) let docx dependencies be upgraded
Blocknote seems to manage the last version of
docx, we do not have to pin it to a specific version
anymore.
2026-01-28 11:12:46 +01:00
Anthony LC
586089c8e4 📌(dependencies) stop upgrading react-resizable-panels
Last versions of react-resizable-panels have some
issues performance issues. We will stick to
version 3.0.6 for now.
2026-01-28 11:12:46 +01:00
renovate[bot]
1b5ce3ed10 ⬆️(dependencies) update js dependencies 2026-01-28 11:12:46 +01:00
Anthony LC
989c70ed57 🚩(project) add FRONTEND_SILENT_LOGIN_ENABLED feature flag
Not every project requires silent login.
This commit adds a new feature flag
FRONTEND_SILENT_LOGIN_ENABLED to enable or
disable silent login functionality.
2026-01-28 10:35:34 +01:00
Anthony LC
c6ded3f267 (auth) add silent login
Currently users already logged in to the SSO have to click on
the login button again to be connected.
This extra step should not be necessary.

This commit uses the "silent=true" parameter to the login
endpoint to avoid the extra step.
2026-01-28 10:35:33 +01:00
Cyril
781f0815a8 🐛(frontend) preserve typed text after @ on escape
prevents losing input when closing interlink search
2026-01-27 15:14:30 +01:00
Anthony LC
325c7d9786 🔧(project) add DJANGO_EMAIL_URL_APP environment variable
Most of Docs app is configured thanks to environment
variables, except the url in the email that
was from the django site table.
Now we can set it with DJANGO_EMAIL_URL_APP
environment variable to have a better consistency.
We keep the previous way to avoid breaking
changes.
2026-01-23 17:56:31 +01:00
renovate[bot]
1083aac920 ⬆️(dependencies) update lodash to v4.17.23 [SECURITY] 2026-01-23 00:38:29 +00:00
Anthony LC
dcfb1115dd 🐛(export) fix export column NaN
During the export of tables to PDF, columns
with NaN widths were not handled correctly,
leading to export not exporting.
We now take in case NaN columnwidths.
We update the regressions tests to include
this kind of tables.
2026-01-22 17:37:48 +01:00
Anthony LC
f64800727a (e2e) fix flaki tests
Some tests were getting flaky:
- check the reorder of sub page
- it checks interlink feature
2026-01-22 17:07:01 +01:00
Anthony LC
65b67a29b1 🚨(CI) gives warning if theme not updated
When updating the UIkit or Cunningham version,
ensure to also update the theme files accordingly.
2026-01-21 11:27:45 +01:00
Anthony LC
b8bdcbf7ed 🛂(frontend) use max size and extension from config
The max size and allowed extensions for document
import are now fetched from the application
configuration.
This ensures consistency across the app and
allows for easier updates to these
settings in the future.
2026-01-21 10:30:24 +01:00
Manuel Raynaud
be995fd211 ♻️(helm) increase client_max_body_size value
Image and document uploaded were limited to 10MB.
For the conversion service, we allow up to 20MB.
For the dev and feature environment, we have to increase this value
accordingly.
2026-01-21 10:27:59 +01:00
Manuel Raynaud
dd5b6bd023 (backend) improve validation on conversion uploaded file
We now check the size and the extension of the uploaded file for
conversion.
2026-01-21 10:27:59 +01:00
Stephan Meijer
9345d8deab (docker) add docspec deployment and service to kubernetes configuration
Added Helm templates for docspec deployment and service to enable
document specification conversion in the Kubernetes environment.
Updated Tiltfile, compose.yml, and Helm values to
configure docspec integration alongside the
backend converter service for document import functionality.
2026-01-21 10:27:58 +01:00
Stephan Meijer
f0cc29e779 ♻️(backend) stylistic and consistency changes
Refactored converter services based on PR #1609 review comments:
- Renamed parameter to `data` across all convert methods for consistency
- Replaced recursive call with explicit sequential calls for readability
- Hardcoded CONVERSION_API_SECURE=True in Production class for security
- Removed unused YdocConverter import from viewsets.py
- Updated tests to match new error message wording

Signed-off-by: Stephan Meijer <me@stephanmeijer.com>
2026-01-21 10:27:58 +01:00
Stephan Meijer
767710231d (backend) add tests for document import feature
Added comprehensive tests covering DocSpec converter service,
converter orchestration, and document creation with file uploads.

Tests validate DOCX and Markdown conversion workflows, error
handling, service availability, and edge cases including empty
files and Unicode filenames.

Signed-off-by: Stephan Meijer <me@stephanmeijer.com>
2026-01-21 10:27:57 +01:00
Stephan Meijer
3480604359 ⬆️(docker) upgrade docspec api to version 2.4.4
Updated docspec service image from 2.0.0 to 2.4.4 to
include latest features and bug fixes.

Signed-off-by: Stephan Meijer <me@stephanmeijer.com>
2026-01-21 10:27:57 +01:00
Anthony LC
2e6c39262d (frontend) add import document area in docs grid
Add import document area with drag and drop
support in the docs grid component.
We can now import docx and and md files just
by dropping them into the designated area.

We are using the `react-dropzone` library to
handle the drag and drop functionality.
2026-01-21 10:27:56 +01:00
Anthony LC
feb9f7d4a9 💄(frontend) adapt the docs grid title bar
Adapt the docs grid title bar to align with the
new design. We will add a upload button in a
future iteration.
2026-01-21 10:27:56 +01:00
Stephan Meijer
b547657efd (backend) Import of documents
We can now import documents in formats .docx and .md.
To do so we added a new container "docspec", which
uses the docspec service to convert
these formats to Blocknote format.

More here: #1567 #1569.
2026-01-21 10:27:56 +01:00