Skip to content

Conversation

@PanchoutNathan
Copy link
Contributor

@PanchoutNathan PanchoutNathan commented Mar 11, 2025

This PR introduces the ability to create and navigate between subpages within a document. Each subpage is nested within a main document and can be opened for editing.

  • Added a subpage logic
  • UI to display and manage subpages
  • Navigation between subpages and the main document
  • Tests & Validation
@PanchoutNathan PanchoutNathan self-assigned this Mar 11, 2025
@PanchoutNathan PanchoutNathan marked this pull request as draft March 11, 2025 15:16
@PanchoutNathan PanchoutNathan linked an issue Mar 17, 2025 that may be closed by this pull request
@PanchoutNathan PanchoutNathan force-pushed the feature/doc-dnd branch 5 times, most recently from 25b3689 to b717fc6 Compare March 19, 2025 08:25
@PanchoutNathan PanchoutNathan requested a review from AntoLC March 19, 2025 08:27
@PanchoutNathan PanchoutNathan changed the title [WIP] doc dnd + tree ✨(frontend) sub-pages v1 Mar 19, 2025
@PanchoutNathan PanchoutNathan marked this pull request as ready for review March 19, 2025 08:29
Copy link
Collaborator

@AntoLC AntoLC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is quite nice, the drag n drop works smooth !

After I think we should add much more tests, the search part is not tested, same for the members inside subpages, we don't have to tests all the roles but at least that the main behaviors are like expected, doc inheritance is quite important.

I made a doc with some bugs that I found:
https://docs.numerique.gouv.fr/docs/67a846d7-7cf3-4ac4-9586-8cc691371df2/

@PanchoutNathan PanchoutNathan force-pushed the feature/doc-dnd branch 4 times, most recently from f60b892 to 7e6e3c4 Compare March 27, 2025 15:10
@PanchoutNathan PanchoutNathan requested a review from AntoLC March 27, 2025 15:35
@PanchoutNathan PanchoutNathan force-pushed the feature/doc-dnd branch 4 times, most recently from d5cb2ea to a1c32dc Compare March 31, 2025 08:29
@AntoLC AntoLC force-pushed the feature/doc-dnd branch 6 times, most recently from b2ed63c to c490d0f Compare April 3, 2025 12:39
sampaccoud and others added 3 commits July 8, 2025 13:58
The frontend needs to display inherited link accesses when it displays possible selection options. We need to return this information to the client.
With the soft delete feature, relying on the is_leaf method from the treebeard is not accurate anymore. To determine if a node is a leaf, it checks if the number of numchild is equal to 0. But a node can have soft deleted children, then numchild is equal to 0, but it is not a leaf because if we want to add a child we have to look for the last child to compute a correct path. Otherwise we will have an error saying that the path already exists.
Added several new dependencies to the `package.json` file, including `@dnd-kit/core`, `@dnd-kit/modifiers`, `@fontsource/material-icons`, and `@gouvfr-lasuite/ui-kit`.
@AntoLC AntoLC force-pushed the feature/doc-dnd branch from 6884c1c to e95d8ff Compare July 8, 2025 12:01
PanchoutNathan and others added 13 commits July 8, 2025 16:31
Added a new feature for moving documents within the user interface via drag-and-drop. This includes the creation of Draggable and Droppable components, as well as tests to verify document creation and movement behavior. Changes have also been made to document types to include user roles and child management capabilities.
New components were created to manage subpages in the document tree, including the ability to add, reorder, and view subpages. Tests were added to verify the functionality of these features. Additionally, API changes were made to manage the creation and retrieval of document children.
- Created new files for managing subdocuments and detaching documents. - Refactored API request configuration to use an improved configuration type. - Removed unnecessary logs from the ModalConfirmDownloadUnsafe component.
The error modal since next.js 15 are quite intrusive. We decided to hide them.
- Reduce proprs drilling - Improve state rerendering with useIsCollaborativeEditable
- Updated the `Access` and `Doc` interfaces to include new properties for role management and document link reach. - Introduced utility functions to handle document link reach and role, improving the logic for determining access levels. - Refactored the `isOwnerOrAdmin` function to simplify role checks for document ownership and admin status.
- Simplified the `getDocAccesses` function by removing pagination parameters. - Updated the `useDocAccesses` hook to reflect changes in the API response type. - Removed the `useDocAccessesInfinite` function to streamline document access management.
- Added a new component `DocInheritedShareContent` to display inherited access information for documents. - Updated `DocShareModal` to include inherited share content when applicable. - Refactored `DocRoleDropdown` to improve role selection messaging based on inherited roles. - Enhanced `DocVisibility` to manage link reach and role updates more effectively, including handling desynchronization scenarios. - Improved `DocShareMemberItem` to accommodate inherited access logic and ensure proper role management.
- Introduced new utility functions for managing document sharing, including `searchUserToInviteToDoc`, `addMemberToDoc`, and `updateShareLink`. - Updated existing tests to verify inherited share access and link visibility features. - Refactored document access handling in tests to improve clarity and maintainability. - Added comprehensive tests for inherited share functionalities, ensuring proper role and access management for subpages.
- update tests description - Corrected minor typos in test descriptions to enhance readability. - Ensured that all test cases clearly convey their purpose and expected outcomes.
During the multipage dev, the code base has changed a lot and rebase after rebase it has come difficult to manage fixup commits. This commits fix modification made that can be fixup in previous commits. The persmission AccessPermission has been renamed in ResourceWithAccessPermission and should be used in the DocumentAskForAccessViewSet. A migration with the same dependency exists, the last one is fixed. And a test didn't have removed an abilitites.
- Added a horizontal separator to the dropdown menu for better visual distinction between options. - Updated padding in the quick search input for improved layout consistency. - Adjusted margin in the quick search group for better spacing. - Increased vertical padding in quick search item content for enhanced readability. - Modified the horizontal separator to accept custom padding for more flexible styling. - Improved left panel styling to manage overflow behavior effectively. - Removed unused skeleton loading styles from globals.css to clean up the codebase.
- Introduced a new `AlertModal` component for confirmation dialogs. - Updated `DocToolBoxLicenceAGPL` and `DocToolBoxLicenceMIT` to include `isRootDoc` prop for better document management. - Enhanced `DocShareModal` to conditionally render content based on the root document status. - Improved `DocInheritedShareContent` to display inherited access information more effectively. - Refactored `DocRoleDropdown` to handle access removal actions and improve role management. - Updated `DocShareMemberItem` to accommodate new access management features.
@AntoLC AntoLC force-pushed the feature/doc-dnd branch 2 times, most recently from 88a0665 to 1dfe4e9 Compare July 8, 2025 14:34
PanchoutNathan and others added 4 commits July 8, 2025 17:00
- Removed 'feature/doc-dnd' branch from the Docker Hub workflow to streamline deployment processes. - Updated document creation tests to replace 'New page' button references with 'New doc' for consistency. - Enhanced test cases to improve clarity and ensure accurate verification of document functionalities. - Added new utility function for creating root subpages, improving test maintainability.
In a first version we want to restrict the ask for access feature only to root document. We will work on opening to all documents when iherited permissions will be implemented.
The children reflect the parent access. So we can request access only on the parent document.
The blocking edition modal could be flickring, because the connection to the collaborative server can take a bit of time. We set a timeout to ensure the loading state is cleared after a reasonable time.
@AntoLC AntoLC force-pushed the feature/doc-dnd branch from 1dfe4e9 to 33bd5ef Compare July 8, 2025 15:00
@AntoLC AntoLC merged commit 33bd5ef into main Jul 8, 2025
20 of 21 checks passed
@AntoLC AntoLC deleted the feature/doc-dnd branch July 8, 2025 15:17
@github-project-automation github-project-automation bot moved this from In Progress to Done in LaSuite Docs Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants