1082 Commits

Author SHA1 Message Date
Nathan Panchout
4c6e89611e (front) add e2e tests for upload cancellation on deletion
Test two scenarios: deleting the current folder cancels
its uploads, and deleting one folder does not cancel
uploads targeting a different folder.
2026-04-20 14:43:03 +02:00
Nathan Panchout
7550490767 (front) cancel active uploads when parent folder is deleted
Track each uploading file's drop target folder via a Map.
When a folder is deleted, selectively cancel only the
uploads that were dropped into that folder, leaving other
uploads unaffected.
2026-04-20 14:43:03 +02:00
Nathan Panchout
e79c3d1f63 🐛(front) set size and variant on trash navigate modal
A gap had been created because the modal type
was missing.
2026-04-20 14:23:48 +02:00
Nathan Panchout
8bd256a3a8 🐛(front) fix horizontal overflow in search modal inputs and bump ui-kit
Add overflow-x: auto on the search modal inputs container to prevent
layout breakage when filters exceed available width, and upgrade
@gouvfr-lasuite/ui-kit from 0.20.0 to 0.20.1.
2026-04-20 13:58:30 +02:00
Nathan Panchout
52d5ab22b4 🐛(front) show actual selection count in hard delete modal
The trash hard delete confirmation modal always displayed "2 items"
regardless of how many items were selected, because it received a
boolean `multiple` prop and hardcoded `count: 2` for the i18n
interpolation. Replace the boolean with the real selection length so
the plural message reflects the actual count.
2026-04-16 16:04:15 +02:00
Nathan Panchout
37c650fdd3 ♻️(front) replace action menu icons with ui-kit components
Swap SVG imports and material-icons spans for
dedicated ui-kit icon components (Shared, Download,
Copy, Star, Edit, ArrowRight, Info, Trash, etc).
Add dropdown menu icon sizing style.
2026-04-16 15:06:42 +02:00
Nathan Panchout
631252760d (front) add e2e tests for mobile actions menu
Test that My Files shows the more menu with create
folder and import options on mobile viewport.
Test that the more menu button is visible inside
a folder on mobile viewport.
2026-04-16 14:43:36 +02:00
Nathan Panchout
0cc97d65c3 🐛(front) add actions menu on mobile My Files page
The more_vert button was only shown inside folders
on mobile. This adds a dropdown with create folder
and import options on the My Files default route.
Also adds includeCreate option to useCreateMenuItems
to allow excluding document creation items.
2026-04-16 14:43:36 +02:00
Nathan Panchout
51552ac482 🐛(frontend) fix SonarCloud issues on drop traversal
Use String.localeCompare in three test sort() calls to satisfy
the reliability rule S2871, and drop the redundant Event branch
of the Event | unknown parameter type in customGetFilesFromEvent
(S6571).
2026-04-16 14:21:33 +02:00
Nathan Panchout
9f142ab59d (frontend) add unit tests for drop traversal utility
Cover the custom drop traversal helpers: empty-folder marker
creation, batched readEntries() loop, recursive entry walking
for files, nested non-empty folders, and empty directories, plus
the customGetFilesFromEvent entry point for drop events and its
delegation to file-selector for non-drag inputs.
2026-04-16 14:21:33 +02:00
Nathan Panchout
3b58ffd36b (frontend) preserve empty folders on drag & drop upload
React-dropzone's default traversal silently drops empty directories
because webkitGetAsEntry()'s readEntries() yields no entry for them.

Add a custom getFilesFromEvent that walks the drop tree ourselves
and emits a zero-byte marker file for every empty folder. The marker
carries an isEmptyFolder flag and a path so useUpload can materialize
the folder chain via getFolderByPath, then skip the marker before any
size validation or backend upload.

When a drop contains only empty-folder markers, the file upload toast
is suppressed and a dedicated success toast is shown once the folders
have been created. Input change events (folder/file buttons) are
delegated to file-selector, matching the Google Drive / Proton Drive
limitation around <input webkitdirectory>.
2026-04-16 14:21:29 +02:00
Nathan Vasse
832725d217 ⬆️(dependencies) pin pillow to v12.2.0 [SECURITY]
Pillow 12.1.1 is vulnerable to CVE-2026-40192 (FITS GZIP decompression
bomb). easy_thumbnails pulls pillow transitively with no upper bound,
so enforce the floor via a uv constraint rather than a direct
dependency bump.
2026-04-14 16:10:12 +02:00
Samuel Paccoud - DINUM
18ad3ac5ff 🔧(helm) configure a daily cron job to purge deleted items
Run the cronjob at 0:45AM everyday.
2026-04-10 12:32:47 +02:00
Samuel Paccoud - DINUM
ea811ca269 (commands) add command to purge deleted items
This command loops over long deleted and hard deleted
items to purge them from storage and database.
2026-04-10 12:32:47 +02:00
Samuel Paccoud - DINUM
573499efc4 (backend) allow purging items after trashbin cutoff and grace period
An item is considered hard deleted in two cases:
- hard deletion was forced by the user while sitting in the trashbin
- the item was only soft deleted but the trashbin retention period
  has expired

Thus, a hard deleted item still exists in database with an associated
file in S3. What the asynchronous task is doing is another action:
permanently removing the item from database and its associated file
from S3. I propose to rename this action "purge".

We refactor the task to improve its resilience:
- don't recursively generate asynchronous tasks. We are already
  outside of a request cycle so we don't need to spawn new
  asynchronous tasks.
- purge the subtree from the bottom to the top: leaves first,
  root last.
- fail fast if something goes wrong and make sure the task will
  continue when we retry it.
2026-04-10 12:32:46 +02:00
Nathan Panchout
8029d4f91d (front) rewrite upload e2e tests for new toast behavior
Cover success, file-too-large errors, mixed uploads, cancel individual file,
cancel all via confirmation modal, toggle file list, and hover cancel overlay.
2026-04-10 10:28:36 +02:00
Nathan Panchout
399c1a7d16 (front) enhance upload toast with progress, errors and cancel support
- Add per-file status tracking (uploading/done/error/cancelled)
- Show error details inline with tooltips for failed uploads
- Display overall progress percentage during upload
- Add cancel overlay on hover for individual files
- Add confirmation modal when cancelling all uploads
- Handle too-large files as inline errors instead of separate toasts
- Add translations for error messages and cancel modal (en/fr/nl)
2026-04-10 10:28:36 +02:00
Nathan Panchout
6c8e399262 (front) add ErrorIcon component and support numeric icon sizes
Add a reusable ErrorIcon SVG component and allow IconSvg to accept
a raw numeric size in addition to named IconSize values.
2026-04-10 09:55:54 +02:00
Nathan Panchout
bdb5fcdad3 (front) make file upload abortable in driver layer
Refactor createFile to return { promise, abort } instead of a plain Promise,
enabling individual upload cancellation from the UI.
2026-04-10 09:55:54 +02:00
Manuel Raynaud
504b58f2a5 🔖(minor) bump release version 0.16.0
Added

- (frontend) add PDF viewer with thumbnail sidebar, zoom and page navigation
- (frontend) integrate PDF viewer into file preview modal
- 📝(doc) add local network setup documentation
- (global) add custom columns feature with configurable grid columns
- 🔒️(frontend) prevent search engine indexing
- (backend) allow ordering items by creator full name
- (frontend) add item duplication with polling and visual feedback
- (ci) shard e2e tests and cache playwright browsers
- ⬆️(frontend) upgrade cunningham-react and ui-kit to 0.20.0
- (frontend) improve custom columns with sortable config and i18n

Changed

- 🏷️(sdk) update Item interface by adding url_permalink
- 🔧(backend) allow extra CSRF origins via env variable
- 🔧(nginx) serve .mjs files with correct MIME type

Fixed

- 🐛(backend) fix hard delete of files created by other users
- 🐛(backend) handle race condition on concurrent LinkTrace creation
- 🐛(frontend) fix React SVG attributes in AddFolderButton
- 🔧(scalingo) compile translation files at deploy time
- 🐛(frontend) fix trash items not refreshing after hard delete
- 🐛(frontend) show modal when clicking files in trash
- 🐛(frontend) fix toasts appearing above modals
v0.16.0-preprod v0.16.0
2026-04-09 11:49:27 +02:00
Nathan Vasse
884116b696 (frontend) add v0.16.0 release note
Introduce the 0.16.0 release note highlighting customizable columns,
column sorting, document duplication and the new built-in PDF viewer,
with translations for en, fr and nl.
2026-04-09 11:22:02 +02:00
Nathan Vasse
0b600a145d ♻️(frontend) make release note step icons optional
Some release notes do not need step icons. Allowing icon and
activeIcon to be undefined lets versions opt out without providing
placeholder values.
2026-04-09 10:59:07 +02:00
renovate[bot]
d4a83b6f02 ⬆️(dependencies) update django to v5.2.13 [SECURITY] 2026-04-09 08:12:21 +00:00
Nathan Vasse
768f616859 🔒️(ci) restrict drive-frontend workflow token to contents:read
CodeQL flagged the workflow for running with default GITHUB_TOKEN
permissions. None of the jobs need write scopes, so pin to the
minimum to contain blast radius if a third-party action is
compromised.
2026-04-08 17:27:58 +02:00
Nathan Vasse
bdfade5d10 ️(ci) prebuild drive frontend and serve via nginx for e2e
Replace the per-shard \`yarn dev\` with a single static build
job whose output is shared as an artifact and served by stock
nginx using the production vhost. Cuts e2e startup cost and
exercises the same bundle we ship.
2026-04-08 16:58:27 +02:00
Nathan Vasse
49e0ec6402 (frontend) use a valid uuid for the 404 preview test
The static export router only matches valid uuid patterns, so
"not_a_uuid" never reaches the preview page. Use a well-formed
but non-existent uuid to actually exercise the 404 path.
2026-04-08 16:58:26 +02:00
Nathan Vasse
e1321079fd ♻️(frontend) gate PostHog dev behavior on explicit env flag
NODE_ENV no longer reliably signals a test/dev runtime once the
e2e build is produced as a production static export. Switch to
NEXT_PUBLIC_POSTHOG_TEST_MODE so we can opt in explicitly when
running under Playwright.
2026-04-08 16:58:26 +02:00
Nathan Vasse
d194b51312 ️(ci) cache Playwright browsers by version
Key the Playwright browser cache by the installed @playwright/test
version instead of yarn.lock so cache hits actually match the binaries
Playwright expects, avoiding redundant browser downloads on every CI
run. On cache hit we still install system deps to keep headless runs
working.
2026-04-08 14:37:53 +02:00
Nathan Panchout
c72bdefaaa (frontend) update e2e for item duplication with state interception
Added interception for list endpoints in the duplicate item e2e tests to
override the state of duplicated items, ensuring accurate testing of
upload states during the duplication process.
2026-04-08 13:57:33 +02:00
Nathan Panchout
29da771258 (compose) add dynamic PostgreSQL environment configuration
Added a new environment variable reference for PostgreSQL configuration
in the compose file to support dynamic environment overrides.
2026-04-08 13:57:33 +02:00
Manuel Raynaud
b6275a4278 (backend) prefix duplicated item with Copy of
We want to prefix a duplicated item with the string Copy of.
2026-04-08 13:57:33 +02:00
Nathan Panchout
bbabb790b0 (frontend) add e2e tests for custom columns features
Add tests for file extension display in File type
column, sort buttons hidden on Recent view, and
column duplicate prevention in dropdown.
2026-04-08 11:48:59 +02:00
Nathan Panchout
e722ee5cba 📝(doc) add custom columns changelog entry
Add entry in the unreleased section for the custom
columns improvements: sortable config, i18n size
units, file extension display and UI fixes.
2026-04-08 11:48:59 +02:00
Nathan Panchout
0dc0656172 (frontend) add sortable config and prevent col dupes
Add a sortable flag to ViewConfig to conditionally
hide sort buttons per view (disabled for Recent).
Propagate viewConfig through AppExplorer context to
all column headers.

Also prevent selecting the same column type in both
custom column slots by passing otherColumnType and
disabling already-selected options in the dropdown.
2026-04-08 11:48:59 +02:00
Nathan Panchout
fe5bf02449 (frontend) display file extension instead of type
Show the file extension (e.g. .pdf, .docx) in the
type column instead of a translated format label.
This is more concise and universally understood.
2026-04-08 11:48:59 +02:00
Nathan Panchout
7d9517c543 🌐(frontend) translate file size units
Add i18n support for file size units (B, KB, MB, etc.)
so they display correctly per locale (e.g. ko, Mo, Go
in French). Update formatSize to accept a translation
function and update all callers accordingly.
2026-04-08 11:48:59 +02:00
Nathan Vasse
440055998c 🐛(frontend) match anct theme variants in Gaufre limit
The themeName may include suffixes (e.g. anct variants), so use
includes() to ensure all anct themes get the higher showMoreLimit.
2026-04-07 15:39:47 +02:00
Nathan Vasse
1928e052a4 📝(changelog) update various entries
Update the changelog mainly based on the pdf viewer
review from our ux.
2026-04-07 15:39:45 +02:00
Nathan Vasse
f1191d426e 🔥(frontend) remove unused page-input styles
The custom input styles are no longer needed since the PDF
page navigator now uses the Cunningham Input component.
2026-04-07 15:39:33 +02:00
Nathan Vasse
fce5719568 🐛(frontend) scroll thumbnail sidebar to active page
When opening the thumbnail sidebar, scroll to the
currently active page so the user sees their position
immediately.
2026-04-07 15:39:33 +02:00
Nathan Vasse
a3d3ef8dc5 🐛(frontend) use cunningham Input in PDF page navigator
Replace the raw HTML input with the cunningham Input
component for consistency. Update focus styles to use
design system tokens.
2026-04-07 15:39:33 +02:00
Nathan Vasse
86f07a1999 ⬆️(frontend) upgrade cunningham-react and ui-kit
Upgrade cunningham-react to 4.3.0 and ui-kit to 0.20.0.
Theme names are renamed to match the new naming
convention (anct→anct-light, dark→dsfr-dark,
default→dsfr-light). Replace custom deepMerge with
the deepmerge library.
2026-04-07 15:39:33 +02:00
Nathan Vasse
7722b3759d 🐛(frontend) fix pdf thumbnail active state styling
Move the selection border from the outer button to the inner
thumbnail canvas so it wraps the page tightly. Highlight
the page number on the active thumbnail for better visual
feedback.
2026-04-07 15:39:32 +02:00
Nathan Vasse
1064ee6996 🐛(frontend) fix toasts appearing above modals
Toasts were displayed on top of modals and file preview
overlays because toastify default z-index was higher than
our modal z-index (1000). Setting it to 999 ensures proper
stacking order.
2026-04-07 15:39:32 +02:00
Nathan Vasse
af7d395760 (frontend) add e2e tests for trash item click behavior
Ensure clicking on deleted files and folders in the trash shows
the appropriate modal instead of attempting navigation or preview.
2026-04-07 15:13:44 +02:00
Nathan Vasse
ad0a588523 🐛(frontend) show modal when clicking files in trash
Clicking a deleted file in the trash was trying to open a preview,
causing a 403 redirect. We now intercept file clicks in trash the
same way we do for folders: by showing an informative modal asking
the user to restore the item first. The modal message now also
distinguishes between files and folders for clarity.

Closes #601
2026-04-07 15:13:44 +02:00
Nathan Vasse
dd3626e7f0 (frontend) stabilize duplicate item e2e ready-state check
Scope the ready-state assertions to the copied row and extend the
timeout so slower CI browsers have time to cover several 3s poll
cycles, avoiding races with unrelated re-renders.
2026-04-07 14:49:41 +02:00
Nathan Vasse
209917907f ️(ci) shard e2e tests and cache playwright browsers
E2e tests take 20-23min per browser because they run sequentially
on a single runner with no browser caching. Shard tests across 3
parallel runners per browser and cache Playwright browser binaries
to reduce wall-clock time to ~7min per browser.
2026-04-07 11:21:16 +02:00
Nathan Vasse
6d66804775 🐛(frontend) fix 403 redirect when deleting current folder
When deleting the current folder, the onSuccess callback was
invalidating the children query for the deleted item. This
triggered a refetch that returned 403, causing a hard redirect
to the error page. We now remove these queries from the cache
instead of invalidating them.
2026-04-07 10:38:18 +02:00
Nathan Vasse
45cd356342 (frontend) add e2e tests for trash hard delete
Ensure the trash list refreshes after hard-deleting an item,
both from the row actions menu and the selection bar.
2026-04-07 10:38:18 +02:00