-
Notifications
You must be signed in to change notification settings - Fork 2
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: create placeholder for empty subfolders #137
Feat: create placeholder for empty subfolders #137
Conversation
This commit removes the check and automatic deletion of folders and resource categories. Since we now want to support the existence of empty folders, it would be inconsistent behaviour if folders/resource categories were deleted when their last item was.
0222064
to
2cca46e
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 comments. LGTM overall
As discussed offline, we will be refactoring the create
methods for the Collection
and Subfolder
classes so that file-moving is part of the folder/subfolder creation process, instead of the other way around. More details can be found in the CMS working doc here
routes/collections.js
Outdated
// Check if subfolder exists | ||
const IsomerSubfolder = new Subfolder(accessToken, siteName, targetCollectionName) | ||
const subfolders = await IsomerSubfolder.list() | ||
if (!subfolders.includes(targetSubfolderName)) IsomerSubfolder.create(targetSubfolderName) |
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.
subfolder creation should be awaited
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.
Good catch, resolved in 8f4525f
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!
* Feat: remove automatic deletion of folders and resource pages This commit removes the check and automatic deletion of folders and resource categories. Since we now want to support the existence of empty folders, it would be inconsistent behaviour if folders/resource categories were deleted when their last item was. * Feat: add new Subfolder class * Fix: creation of placeholder files when creating new subfolder through moving files * Feat: implement check for existence of resource category when listing resource pages * Fix: await subfolder creation * Fix: await subfolder creation in pages
This PR adds functionality for adding empty subfolders into the CMS, as well as the associated changes required. To be reviewed in conjunction with PR #384 on the isomercms frontend repo. A discussion of the reasoning behind this change can be found here.
This PR introduces the following changes: