Fix/clean up of ComponentSettingsModal
and OverviewCard
#385
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Over the past couple of months, we've made some strategic decisions which have rendered some parts of the codebase irrelevant.
1. Our move to use Jekyll 4, and using collection config files to determine collection/folder page order
Previously, since collection page order was determined by the file name prefixes, we had complicated util functions (
generateNewCollectionFileName
,generateGroupIdentifier
, etc.) which helped us to calculate the file names when we create, delete, update, or move collection pages. With the new collection config files, these util functions are no longer needed since we no longer need to generate file name prefixes.2. Our decision to more closely mimic Google Drive's page-moving UI
Previously, users were able to create pages in a separate collection/folder from the workspace, using the
ComponentSettingsModal
. With this decision, users can only create pages in the collection/folder/resource category they are in. This decision also meant that the only place where the user can move pages is through theMenuDropdown
component'sMove to
tab.This meant that we no longer have to deal with third nav-related logic for the
ComponentSettingsModal
, which allows us to rip out a huge chunk of code from the component.3. New backend endpoints for moving pages
Refer to PR #124 in the backend. This allows us to eliminate complex, multi-step frontend logic (such as the
moveFile
function inOverviewCard
) and replace it with a single API call.Changes made in this PR
ComponentSettingsModal
. The component was also renamed toResourcePageSettingsModal
since that ended up being the only use case leftsaveFileAndRetrieveUrl
, as well as the other file name prefix generation util functions)OverviewCard
file-moving logic with a single API callChanges to make in subsequent PRs
ResourcePageSettingsModal
andOverviewCard
to usereact-query
(PR Refactor/ResourcePageSettingsModal
andOverviewCard
to use react query #386)