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/move files #124

Merged
merged 8 commits into from
Mar 10, 2021
Merged

Feat/move files #124

merged 8 commits into from
Mar 10, 2021

Conversation

alexanderleegs
Copy link
Contributor

@alexanderleegs alexanderleegs commented Mar 8, 2021

This PR introduces new endpoints to handle the moving of multiple files from one folder to another. To be reviewed in conjunction with PR #369 on the isomercms-frontend repo.

In addition, this PR also updates the existing list() method of collections to work with both the existing format as well as the file format post jekyll 4.0 update.

Resolves issues #116 and #120

Copy link
Contributor

@kwajiehao kwajiehao left a comment

Choose a reason for hiding this comment

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

Left a comment.

Separately, I wonder if removing and adding to the collection config should be abstracted away into the methods of the File type. Will follow up offline

const collections = await IsomerCollection.list()

// Check if collection already exists
if (!collections.includes(targetCollectionName) && targetCollectionName !== 'pages') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Also check that target collection name is not one of the ISOMER_TEMPLATE_DIRS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed offline, we will check for any of the protected folder names created by jekyll regardless of whether they are prepended with an underscore. This check has been added to the create method in the Collection class in fde311c, while pages will continue to be used to indicate a move to unlinked pages.

@kwajiehao
Copy link
Contributor

As discussed offline, we will be extending the File class so that adding and removing items to the collection config file are part of the create and delete methods of the new extended class for collection pages

Copy link
Contributor

@kwajiehao kwajiehao 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 1cf0c07 into staging Mar 10, 2021
@alexanderleegs alexanderleegs deleted the feat/move-files branch March 10, 2021 08:52
kwajiehao added a commit to isomerpages/isomercms-frontend that referenced this pull request Mar 23, 2021
Thanks to PR #124 on the backend isomerpages/isomercms-backend#124,
we can simplify the file-moving logic in `OverviewCard` since `OverviewCard` is
now used only for unlinked pages in the workspace (it is also
used for Resource Category display, but these do not have any move file
functionality).

This allows us to remove all the complex logic associated with file-moving
and replace it with a single API call to the new file moving
endpoint. This also allows us to delete the now-unused util function
`saveFileAndRetrieveUrl`.
harishv7 pushed a commit that referenced this pull request Feb 17, 2023
* Nit: config indentation

* Feat: update list for collection to not use _config.yml file

* Refactor: use new list method when retrieving folders

* Feat: add page moving endpoints for collections and unlinked pages

* Fix: missing import in config class

* Feat: add check for special directory names

* Feat: add third nav parameter to front matter

* Fix: remove unused import
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.

Fix Collection.list() Add page moving endpoints
2 participants