In order to be more fault tolerant, to not lose data if the redis is
reset, etc. We decided to put the item to mirror in a new table and then
the task will manage the status in the database.
This is the first step to then add tasks in the admin to retry or check
why the task has failed and also implement a retry strategy.
The Dockerfile must also be modified, we need the libmagic library to
build the image at the collect stage because the magic module is
imported in the storage module and all tasks are imported when the
application starts.
when an upload is ended, we have to call the mirror_file task. The
upload is made in the client browser so we can't use the S3 storage
class dedicated to the mirroring.
The mirror_file task is reponsible to copy an object from a bucket to an
other one. The buckets can be in different location, in different cloud
providers so we have to download it to reupload it. The `copy` method on
the s3 client only work when the bucket are in the cloud provider infra,
like for AWS.
We want to save a file on an other s3 bucket. For this we created a
dedicated storage inheriting from the S3Storage. This storage only
dispatch a message in a celery task. The logic of mirroring will be
implemented in this task in order to do it in an async way.
We don't want to use the s3_client anymore but to rely on the django
storages API. This first step will allow us to create a dedicated
backend for mirroring file saving.
The user's short_name field length was set to 20. This is not enought
and we have some users who cannot register because of that. We changed
this length to a higher one, 100, like the full_name.
Microsoft has a generic format for files like .xls .doc .ppt and the
mimetype returned is application/x-ole-storage. We want to add it to
generic type list in order to use the extension instead.
Preserve django_site table during e2e db clearing to
avoid breaking site configuration. Add video recording
on first retry and screenshot capture on failure for
easier debugging of flaky tests.
Since the link_reach is inherited and not set on every items, we can't
filter anymore, in the ItemViewset.get_queryset method directly on the
link_reach column, we must have the computed_link_reach. We introduce a
bug on the item list methods because too much link_traces record were
return. We have to remove the link_traces related to a restricted items.
The "only owner" message was displayed to all users when
viewing the last owner's access, instead of only showing
it to the owner themselves.
Also simplify role restriction message logic by checking
access.is_explicit instead of comparing available roles.
Co-authored-by: Cursor <cursoragent@cursor.com>
For the same reason we not create an access when a child is created, we
have to not set value to link_reach allowing null value. A root will
have the link_reach set to restricted when created and then every
children are set to null. when the link_configuration will be updated,
descendants will be sync when the new link_reach is higher than the
previous one. Also move scenarios are impacted. When moving to the root,
we force the link_reach to restricted and when moving in an existing
item, we sync it with parents.
Pass the item from GlobalExplorerContext directly to
EmbeddedExplorerGridBreadcrumbs instead of refetching it. The component now
accepts an optional `item` prop and only fetches when the prop is not
provided, maintaining backward compatibility.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rename my_files route to my-files for URL consistency.
All routes now use kebab-case convention.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Once all accesses filtered, we need to check it we have to change the
max_ancestors_role for accesses that are inherited. An inherited access is will
not have the same item_id than the current item used in this viewset. In that
case, we use the role of the current access and the item_id it is related to.
Introduced new end-to-end tests that validate the functionality of
starring and unstarring items within the application. The tests cover
scenarios for adding items to starred, verifying their presence, and
removing them from starred, enhancing test coverage and ensuring the
correct behavior of the starring feature.
Introduced new end-to-end tests that validate the sharing functionality
of folders between two users. The tests cover scenarios for sharing a
folder, verifying visibility based on user roles, and checking link
reach settings. This addition enhances test coverage and ensures the
correct functionality of the sharing feature in the application.
Introduced new end-to-end tests for moving items within the file
structure, including moving items to a new folder, searching and
selecting items to move, and moving items to the root. These tests
enhance coverage and ensure the correct functionality of item movement
in the application.
Updated multiple search tests to replace the expectation of the current
folder with a new utility function for navigating to "My Files." This
change improves test clarity and reliability by accurately simulating
user interactions during the search process.
Updated the URL file preview test to utilize a new navigation utility
function, improving clarity and ensuring the correct visibility of UI
elements. This change enhances the reliability of the test by accurately
reflecting user interactions when accessing the file preview.
Refactored the HEIC file preview test to utilize a new navigation
utility function. This change improves the test's clarity and ensures
the correct visibility of UI elements when attempting to open a HEIC
file, enhancing overall test reliability.
Updated the folder creation test to utilize new utility functions for
improved readability and maintainability. This change enhances the
test's reliability by streamlining the process of navigating to "My
Files" and creating a folder.
Refactored the create-folder test to improve clarity and functionality.
Removed outdated assertions and added checks for visibility of relevant
UI elements before creating a new folder. This enhances the test's
reliability and ensures it accurately reflects user interactions.
Introduced new end-to-end tests for the left bar navigation links,
ensuring proper redirection to the recents, my files, shared with me,
trash, and favorites pages after login. This enhances test coverage and
verifies navigation functionality.
Removed outdated delete-item-in-tree tests and added new delete-item
tests to improve structure and maintainability. The new tests ensure
proper redirection after deleting folders and workspaces.
To compute the abilities, the current item mu be aware of ancestors
link_reach and link_role. On the recents and favorite_list view if we
want to avoid N+1 queries we have to compute it for each deepest items
present in the final queryset, compute the ancestors link_definition and
then add it in the serializer. We added a new parameter to the
`get_response_for_queryset` method allowing to do this job.
Updated all imports from @openfun/cunningham-react to
@gouvfr-lasuite/cunningham-react across the application. This change
includes updating dependencies in package.json and yarn.lock to reflect
the new package version. Enhanced the integration of the Cunningham
components for improved consistency and functionality throughout the
app.
Removed the type filter from SearchItemFilter to simplify item filtering
logic. Added new pages for 'My Files', 'Favorites', 'Recent', and
'Shared with Me' in the explorer, each utilizing the WorkspacesExplorer
component with appropriate default filters. Updated the file preview
component in the FilePage to use CustomFilesPreview for improved
functionality.
Added a check for disabled state in the keyboard navigation hook to
prevent focus when disabled. Updated the upload hook to improve parentId
handling and integrated a new utility for checking child creation
permissions, enhancing the upload process and ensuring better error
handling during file uploads.
Modified the item navigation logic in ExplorerLayout to handle favorite
items correctly. The item ID is now extracted to ensure proper routing
to the favorite items section, enhancing user experience and navigation
accuracy.
Introduced a new EmbeddedExplorerSearchInput component for enhanced
search capabilities within the embedded explorer. Updated the
EmbeddedExplorer and EmbeddedExplorerGrid components to integrate search
functionality, allowing users to filter items dynamically. Improved the
styling of various components, including breadcrumbs and grid items, for
better visual consistency and user experience. Enhanced the handling of
default routes and item navigation, ensuring a more intuitive interface.
Refactored the DroppableNodeTree component to improve item drop logic by
introducing a visibility check for non-node types. Updated the
ExplorerTree and ExplorerTreeItem components to utilize default routes
for better navigation and streamlined item rendering. Enhanced the
ExplorerTree.scss styles for improved layout and responsiveness,
including new flex properties and hover effects. Simplified item action
handling in ExplorerTreeItemActions by integrating the
ItemActionDropdown for a cleaner UI experience.
Updated the ExplorerCreateFolderModal to make the parentId prop optional
and streamlined the onSuccess callback. Enhanced the
ExplorerMoveFolderModal by integrating query invalidation for moved
items and improved the modal's layout. Removed the deprecated
FileShareModal and WorkspaceShareModal components, while introducing the
new ItemShareModal with comprehensive sharing capabilities. Added styles
for the new share modal and ensured better user experience across
modals.
Refactored the GlobalExplorerContext to streamline item management,
including the addition of favorite item functionality. Updated the
ItemActionDropdown to support sharing and favoriting items, integrating
new modals for item sharing. Improved the ExplorerRightPanelContent to
reflect these changes and removed unused workspace-related logic.
Introduced a new FolderIcon component for better icon representation.
Added a new CustomFilesPreview component to improve file preview
capabilities, allowing users to view and share files seamlessly. Updated
translations for new UI elements and integrated share modal
functionality. Introduced default routes for better navigation and added
utility functions for item management. Enhanced global styles to
accommodate new components.
Updated the fetchAPI to accept boolean parameters, added new enums for
item filters, and expanded the Driver class with methods for managing
favorite items and link configurations. Introduced utility functions for
managing paginated lists and improved item handling in the explorer
component. Removed unused constants and optimized query handling for
better performance.
Introduced new SVG icons for various sections in the drive interface,
including 'my files', 'recents', 'shared with me', and 'starred'.
Updated the existing 'grid_empty' SVG and added a new 'grid_empty' JPG
asset for improved visual representation.