- Notifications
You must be signed in to change notification settings - Fork 452
✨(frontend) sub-pages v1 #701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
23776c7 to fcba9ed Compare 25b3689 to b717fc6 Compare There was a problem hiding this 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/
src/frontend/apps/impress/src/features/docs/doc-management/components/ModalRemoveDoc.tsx Outdated Show resolved Hide resolved
src/frontend/apps/impress/src/features/docs/doc-tree/context/DocTreeContext.tsx Outdated Show resolved Hide resolved
src/frontend/apps/impress/src/features/docs/doc-tree/context/DocTreeContext.tsx Outdated Show resolved Hide resolved
src/frontend/apps/impress/src/features/docs/doc-tree/context/DocTreeContext.tsx Outdated Show resolved Hide resolved
src/frontend/apps/impress/src/features/docs/doc-tree/context/DocTreeContext.tsx Outdated Show resolved Hide resolved
src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareAddMemberList.tsx Outdated Show resolved Hide resolved
src/frontend/apps/impress/src/features/docs/doc-tree/components/DocTree.tsx Outdated Show resolved Hide resolved
f60b892 to 7e6e3c4 Compare d5cb2ea to a1c32dc Compare b2ed63c to c490d0f Compare 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`.
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.
88a0665 to 1dfe4e9 Compare - 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.
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.