Skip to content
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/nested images modal #424

Merged
merged 18 commits into from
Apr 22, 2021
Merged

Feat/nested images modal #424

merged 18 commits into from
Apr 22, 2021

Conversation

alexanderleegs
Copy link
Contributor

This is a duplicate of #370, as we do not want to merge this into prod yet.

SingpassAuth and others added 18 commits April 14, 2021 14:31
This commit updates the FolderCard component to accept a `linkPath`
prop so that we can pass in a custom URL for the FolderCard component
to link to. This is necessary for images and files which are nested
in at least one layer of directories.
This commit modifies the frontend routing to create a /sites/:siteName/images/:customPath
path, which will allow users to access nested image folders on the
Images layout.

The Images layout has also been modified to allow navigation to the
parent image folder using the Header component's back button.
The frontend paths that we use for Images are:
- /sites/:siteName/images
- /sites/:siteName/images/:customPath

The second path, /sites/:siteName/images/:customPath, is responsible
for handling all other nested levels. For example, if the repo path to
the nested image folder is /images/features/2013, then the CMS URL
would be /sites/:siteName/images/features/2013. The problem with this
is that this URL does not actually match the allocated URL, since
there are `/` characters in the route param. Therefore, we need to
modify the `customPath` variables to be encoded URI components so that
the accessed URLs match the frontend route.
This commit adds the FolderOptionButton components for image upload
and directory creation.

This commit also fixes a bug where the pending image upload state
was not correctly set when refactoring the Image layout from a class
component to a functional component.
This commit fixes the back navigation for nested images directories.
Previously, we failed to account for the fact that the custom path
provided as part of the route would be URI encoded. As such, we were
splitting on the `/` character instead of the encoded equivalent,
`%2F`. This commit fixes this issue by using the encoded character
instead.
This commit modifies the endpoint for the GET call to retrieve
images from nested directories instead of just the top level
'images' directory by encoding the path of the nested file.
…rectories

This commit adds an `imageDirectory` attribute to the request body
to specify the creation of a new image in that nested directory
Copy link
Contributor

@gweiying gweiying left a comment

Choose a reason for hiding this comment

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

lgtm!

@alexanderleegs alexanderleegs merged commit 104585d into develop Apr 22, 2021
@alexanderleegs alexanderleegs deleted the feat/nested-images-modal branch April 22, 2021 06:34
@alexanderleegs alexanderleegs restored the feat/nested-images-modal branch April 29, 2021 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants