-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feat/page dropdown api #388
Conversation
a3e933e
to
24fe76e
Compare
e921fff
to
a1896fe
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.
Left some comments. Additionally, there is another bug related to Move to
> subfolder > Move to
for unlinked pages. Steps to reproduce:
- Go to the
Workspace
layout - Scroll down to the Unlinked Pages section. Click on the options button for one of the pages and click on
Move to
- Click on the right caret button to view the selected folder's subfolders
- Click on the
<- Move to
button to go back (this brings you back to the main modal, instead of the modal screen with all the folders) - Clicking on
Move to
again brings you directly to the subfolders view, instead of the folders view
We don't need to fix this ^ bug in this PR, just wanted to point it out so that we are aware we need to fix this in subsequent PRs
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.
Left some comments.
There's a bug involving the page moving modal not closing on blur - if you click Move to, then click anywhere else (even another file's options), the Move to menu persists
Also, when moving pages into subfolders, the page is automatically created as the first item in the collection.yml file.
Above was a side effect caused by not using
Above was caused by the Both bugs fixed in d697a01 |
This commit accomplishes several changes: 1) changes ComponentSettingModal to take pageData as input from CollectionPagesSection and removes the current API call to retrieve page data 2) changes ComponentSettingModal to use useMutation for updating the resource page settings (used for creating new page, renaming a page and changing the url of a page) 3) removes dropdown for selecting page resource category during page resource creation, so that the behavior of creating resources pages will be similar to that of folder pages, where a page can only be created after a user navigates to that location where the new file should be created
This commit refactors CollectionPagesSection with the following key changes: 1) Adding Move To functionality to Unlinked pages and restoring Move To functionality to resources 2) cleaning up variables passed to ComponentSettingsModal since ComponentSettingsModal has been refactored 3) removing unused functionality for retrieving allCategories and improving display of pages prior to completion of loading
…avigates between folders and subfolders
This commit pushes several changes: Firstly, UX of titles and buttons have been improved, including the display of a loading icon while query categories are being retrieved. Secondly, the bug identified earlier where the user would be redirected to the link after returning from the subfolder has been fixed. This means that the user is able to navigate between the subfolder layer and the folders layer, and return to the general dropdown menu if they would like. This fix also fixes the bug behaviors identified by Alex and Jie Hao where dropdown modals are not closed when a user clicks elsewhere on a page, and where queryFolderName is not cleared when a user navigates away from the dropdown modal
7b92c6c
to
d2fa8d0
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.
Left some comments.
Also one small comment - the cursor on page cards turns into a normal one instead of a pointer - we might want to change them to always show the pointer
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.
Lgtm
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.
lgtm!
This PR adds the functionality to support:
For folder/subfolder pages, unlinked pages and resources.
This PR is a continuation of #380, and cleans up the
getPage
,createPage
,updatePage
APIs added in #380 to resemble those in #379 for better uniformity.Background
This PR focuses on the API integrations above, and should be reviewed with #139 on the backend. The visual appearance and UX of the Dropdown modal will be refined in a subsequent PR.
There is also some buggy behavior on the Dropdown back button behavior, where clicking this series of buttons (Fixed inMove To >
>[folderName] >
>← Move To
) will lead to Edit Page rather than triggering the previous Move To dropdown menu as expected. This will also be fixed in a subsequent PR.d697a01
As part of this PR,
OverviewCard
,ComponentSettingsModal
andCollectionPagesSection
andResources
have been refactored to remove unused functionality and to use ReactQuery.Lastly, the APIs introduced may require some cleanup as there is quite a fair bit of reused variables and flag checks. This will also be done in a subsequent PR.Fixed in 7911b8dDetails
Below, we summarise some key changes to each file.
ComponentSettingsModal
This component is now only used for settings on resource pages, so all functionality for collections and third-nav retrieval has been removed. The only API handler that runs here is Save, while the delete API handler is abstracted into
CollectionPagesSection
. The query call to retrieve the page details is abstracted intoCollectionPagesSection
so that the page details can be reused for deleting functionality.Since we plan for the resource creation behavior to match that of page creation behavior, users will be expected to navigate to the category before creating the resource. Hence, the resource category dropdown has also been removed. See below for the new UX:
PageSettingsModal
Similar to
ComponentSettingsModal
, the only API handler that runs here is Save, while the delete API handler is abstracted intoCollectionPagesSection
. The delete, create, and update APIs from #380 have been updated. The query call to retrieve the page details is abstracted intoFolders
so that the page details can be reused for deleting functionality.The UX has been updated to match that of
ComponentSettingsModal
. See below for the new UX:CollectionPagesSection
andFolders
The query call to retrieve the page details is added into
CollectionPagesSection
andFolders
. The query fires when the user clicks on the ⋮ Options dropdown for any page. The new delete and move API ReactQuery handlers have been added toCollectionPagesSection
and toFolders
.Note:
CollectionPagesSection
is actually used for all sections (unlinked pages and resources) apart from collections, so we should rename this during cleanup.OverviewCard
andFolderContent
The delete and the move handlers are abstracted into
CollectionPagesSection
andFolders
respectively, and the logic for accessingMove To
folders and subfolders have been added. This logic will be further refined based on designers input.Changes to
Resources
Since we plan for the resource creation behavior to match that of page creation behavior, users will be expected to navigate to the category before creating the resource. Hence, the option to create a new file from the Resources folder is removed, and should be replaced by the functionality to create a new resource folder #384. See below for the new UX:
Subsequent work
To highlight the changes that will be accomplished in a separate PR:
Fix buggy behavior on the Dropdown back button behaviour with Back button (depending on UX flow, may not be necessary, waiting on designers' input)Fixed in d697a01Clean up introduced APIs for duplicated flag checking and redundant variablesFixed in 7911b8dComponentSettingsModal
to automatically generatefile_url
when resource is a file